detect: constify Signature/SigMatch use at runtime

pull/2559/head
Victor Julien 9 years ago
parent a44da9f5cb
commit bfd4bc8233

@ -1455,10 +1455,10 @@ static int Unified2Test01(void)
memset(&s, 0, sizeof(Signature));
p->alerts.cnt++;
s.id = 1;
s.gid = 1;
s.rev = 1;
p->alerts.alerts[p->alerts.cnt-1].s = &s;
p->alerts.alerts[p->alerts.cnt-1].s->id = 1;
p->alerts.alerts[p->alerts.cnt-1].s->gid = 1;
p->alerts.alerts[p->alerts.cnt-1].s->rev = 1;
SET_PKT_LEN(p, sizeof(raw_ipv4_tcp));
FlowInitConfig(FLOW_QUIET);
@ -1546,10 +1546,10 @@ static int Unified2Test02(void)
memset(&s, 0, sizeof(Signature));
p->alerts.cnt++;
s.id = 1;
s.gid = 1;
s.rev = 1;
p->alerts.alerts[p->alerts.cnt-1].s = &s;
p->alerts.alerts[p->alerts.cnt-1].s->id = 1;
p->alerts.alerts[p->alerts.cnt-1].s->gid = 1;
p->alerts.alerts[p->alerts.cnt-1].s->rev = 1;
SET_PKT_LEN(p, sizeof(raw_ipv6_tcp));
FlowInitConfig(FLOW_QUIET);
@ -1643,10 +1643,10 @@ static int Unified2Test03(void)
memset(&s, 0, sizeof(Signature));
p->alerts.cnt++;
s.id = 1;
s.gid = 1;
s.rev = 1;
p->alerts.alerts[p->alerts.cnt-1].s = &s;
p->alerts.alerts[p->alerts.cnt-1].s->id = 1;
p->alerts.alerts[p->alerts.cnt-1].s->gid = 1;
p->alerts.alerts[p->alerts.cnt-1].s->rev = 1;
SET_PKT_LEN(p, sizeof(raw_gre));
FlowInitConfig(FLOW_QUIET);
@ -1740,10 +1740,10 @@ static int Unified2Test04(void)
memset(&s, 0, sizeof(Signature));
p->alerts.cnt++;
s.id = 1;
s.gid = 1;
s.rev = 1;
p->alerts.alerts[p->alerts.cnt-1].s = &s;
p->alerts.alerts[p->alerts.cnt-1].s->id = 1;
p->alerts.alerts[p->alerts.cnt-1].s->gid = 1;
p->alerts.alerts[p->alerts.cnt-1].s->rev = 1;
SET_PKT_LEN(p, sizeof(raw_ppp));
FlowInitConfig(FLOW_QUIET);
@ -1828,10 +1828,10 @@ static int Unified2Test05(void)
memset(&s, 0, sizeof(Signature));
p->alerts.cnt++;
s.id = 1;
s.gid = 1;
s.rev = 1;
p->alerts.alerts[p->alerts.cnt-1].s = &s;
p->alerts.alerts[p->alerts.cnt-1].s->id = 1;
p->alerts.alerts[p->alerts.cnt-1].s->gid = 1;
p->alerts.alerts[p->alerts.cnt-1].s->rev = 1;
SET_PKT_LEN(p, sizeof(raw_ipv4_tcp));
FlowInitConfig(FLOW_QUIET);

@ -260,7 +260,7 @@ typedef struct PacketAlert_ {
SigIntId num; /* Internal num, used for sorting */
uint8_t action; /* Internal num, used for sorting */
uint8_t flags;
struct Signature_ *s;
const struct Signature_ *s;
uint64_t tx_id;
} PacketAlert;

@ -45,7 +45,7 @@
/* prototypes */
static int DetectAckSetup(DetectEngineCtx *, Signature *, char *);
static int DetectAckMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, Signature *, const SigMatchCtx *);
Packet *, const Signature *, const SigMatchCtx *);
static void DetectAckRegisterTests(void);
static void DetectAckFree(void *);
static int PrefilterSetupTcpAck(SigGroupHead *sgh);
@ -79,7 +79,7 @@ void DetectAckRegister(void)
* \retval 1 match
*/
static int DetectAckMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectAckData *data = (const DetectAckData *)ctx;

@ -49,16 +49,16 @@
#define MAX_ALPROTO_NAME 50
static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx);
Packet *p, const Signature *s, const SigMatchCtx *ctx);
static int DetectAppLayerEventAppMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *,
uint8_t, void *, Signature *, SigMatch *);
uint8_t, void *, const Signature *, const SigMatch *);
static int DetectAppLayerEventSetupP1(DetectEngineCtx *, Signature *, char *);
static void DetectAppLayerEventRegisterTests(void);
static void DetectAppLayerEventFree(void *);
static int DetectEngineAptEventInspect(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
/**
@ -89,7 +89,7 @@ void DetectAppLayerEventRegister(void)
static int DetectEngineAptEventInspect(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id)
{
@ -134,7 +134,7 @@ static int DetectEngineAptEventInspect(ThreadVars *tv,
static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectAppLayerEventData *aled = (const DetectAppLayerEventData *)ctx;
@ -143,8 +143,8 @@ static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det
}
static int DetectAppLayerEventAppMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, void *state, Signature *s,
SigMatch *m)
Flow *f, uint8_t flags, void *state, const Signature *s,
const SigMatch *m)
{
SCEnter();
AppLayerDecoderEvents *decoder_events = NULL;

@ -37,7 +37,7 @@ static void DetectAppLayerProtocolRegisterTests(void);
static int DetectAppLayerProtocolPacketMatch(ThreadVars *tv,
DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
SCEnter();

@ -43,7 +43,7 @@
const char *ASN_DELIM = " \t,\n";
int DetectAsn1Match(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
const Signature *, const SigMatchCtx *);
static int DetectAsn1Setup (DetectEngineCtx *, Signature *, char *);
void DetectAsn1RegisterTests(void);
void DetectAsn1Free(void *);
@ -138,7 +138,7 @@ static uint8_t DetectAsn1Checks(Asn1Node *node, const DetectAsn1Data *ad)
* \retval 1 match
*/
int DetectAsn1Match(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
Signature *s, const SigMatchCtx *ctx)
const Signature *s, const SigMatchCtx *ctx)
{
uint8_t ret = 0;

@ -20,6 +20,6 @@
void DetectBase64DataRegister(void);
int DetectBase64DataDoMatch(DetectEngineCtx *, DetectEngineThreadCtx *,
Signature *, Flow *);
const Signature *, Flow *);
#endif /* __DETECT_BASE64_DATA_H__ */

@ -54,7 +54,7 @@ void DetectBase64DecodeRegister(void)
DetectSetupParseRegexes(decode_pattern, &decode_pcre, &decode_pcre_study);
}
int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s,
int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *det_ctx, const Signature *s,
const SigMatch *sm, uint8_t *payload, uint32_t payload_len)
{
DetectBase64Decode *data = (DetectBase64Decode *)sm->ctx;

@ -27,7 +27,7 @@ typedef struct DetectBase64Decode_ {
} DetectBase64Decode;
void DetectBase64DecodeRegister(void);
int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *, Signature *,
const SigMatch *, uint8_t *, uint32_t);
int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *,
const Signature *, const SigMatch *, uint8_t *, uint32_t);
#endif /* __DETECT_BASE64_DECODE_H__ */

@ -49,7 +49,8 @@
#include "util-unittest-helper.h"
#include "util-device.h"
int DetectBypassMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
int DetectBypassMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectBypassSetup(DetectEngineCtx *, Signature *, char *);
static void DetectBypassRegisterTests(void);
@ -91,7 +92,8 @@ static int DetectBypassSetup(DetectEngineCtx *de_ctx, Signature *s, char *str)
return 0;
}
int DetectBypassMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
int DetectBypassMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
PacketBypassCallback(p);

@ -90,7 +90,7 @@ static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectByteExtractMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, Signature *, SigMatch *);
Packet *, const Signature *, const SigMatch *);
int DetectByteExtractSetup(DetectEngineCtx *, Signature *, char *);
void DetectByteExtractRegisterTests(void);
void DetectByteExtractFree(void *);
@ -112,8 +112,8 @@ void DetectByteExtractRegister(void)
DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study);
}
int DetectByteExtractDoMatch(DetectEngineThreadCtx *det_ctx, SigMatch *sm,
Signature *s, uint8_t *payload,
int DetectByteExtractDoMatch(DetectEngineThreadCtx *det_ctx, const SigMatch *sm,
const Signature *s, uint8_t *payload,
uint16_t payload_len, uint64_t *value,
uint8_t endian)
{
@ -204,10 +204,8 @@ int DetectByteExtractDoMatch(DetectEngineThreadCtx *det_ctx, SigMatch *sm,
int DetectByteExtractMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, SigMatch *m)
Packet *p, const Signature *s, const SigMatch *m)
{
goto end;
end:
return 1;
}
@ -756,7 +754,7 @@ void DetectByteExtractFree(void *ptr)
*
* \retval A pointer to the SigMatch if found, otherwise NULL.
*/
SigMatch *DetectByteExtractRetrieveSMVar(const char *arg, Signature *s)
SigMatch *DetectByteExtractRetrieveSMVar(const char *arg, const Signature *s)
{
DetectByteExtractData *bed = NULL;
int list;

@ -63,9 +63,9 @@ void DetectByteExtractRegister(void);
int DetectByteExtractSetup(DetectEngineCtx *, Signature *, char *);
void DetectByteExtractFree(void *);
int DetectByteExtractMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, Signature *, SigMatch *);
SigMatch *DetectByteExtractRetrieveSMVar(const char *, Signature *);
int DetectByteExtractDoMatch(DetectEngineThreadCtx *, SigMatch *, Signature *,
Packet *, const Signature *, const SigMatch *);
SigMatch *DetectByteExtractRetrieveSMVar(const char *, const Signature *);
int DetectByteExtractDoMatch(DetectEngineThreadCtx *, const SigMatch *, const Signature *,
uint8_t *, uint16_t, uint64_t *, uint8_t);
#endif /* __DETECT_BYTEEXTRACT_H__ */

@ -84,7 +84,7 @@ void DetectBytejumpRegister (void)
* \retval 1 match
* \retval 0 no match
*/
int DetectBytejumpDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s,
int DetectBytejumpDoMatch(DetectEngineThreadCtx *det_ctx, const Signature *s,
const SigMatchCtx *ctx, uint8_t *payload, uint32_t payload_len,
uint8_t flags, int32_t offset)
{
@ -197,7 +197,7 @@ int DetectBytejumpDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s,
}
int DetectBytejumpMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectBytejumpData *data = (const DetectBytejumpData *)ctx;
uint8_t *ptr = NULL;

@ -113,8 +113,8 @@ DetectBytejumpData *DetectBytejumpParse(char *optstr, char **offset);
* error as a match.
*/
int DetectBytejumpMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx);
int DetectBytejumpDoMatch(DetectEngineThreadCtx *, Signature *, const SigMatchCtx *,
Packet *p, const Signature *s, const SigMatchCtx *ctx);
int DetectBytejumpDoMatch(DetectEngineThreadCtx *, const Signature *, const SigMatchCtx *,
uint8_t *, uint32_t, uint8_t, int32_t);
#endif /* __DETECT_BYTEJUMP_H__ */

@ -89,7 +89,9 @@ void DetectBytetestRegister (void)
* \retval 1 match
* \retval 0 no match
*/
int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s, const SigMatchCtx *ctx, uint8_t *payload, uint32_t payload_len,
int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx,
const Signature *s, const SigMatchCtx *ctx,
uint8_t *payload, uint32_t payload_len,
uint8_t flags, int32_t offset, uint64_t value)
{
SCEnter();
@ -231,7 +233,7 @@ int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s, const Si
}
int DetectBytetestMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
return DetectBytetestDoMatch(det_ctx, s, ctx, p->payload, p->payload_len,
((DetectBytetestData *)ctx)->flags, 0, 0);

@ -121,8 +121,8 @@ DetectBytetestData *DetectBytetestParse(char *optstr, char **value,
* \todo The return seems backwards. We should return a non-zero error code. One of the error codes is "no match". As-is if someone accidentally does: if (DetectBytetestMatch(...)) { match }, then they catch an error as a match.
*/
int DetectBytetestMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx);
int DetectBytetestDoMatch(DetectEngineThreadCtx *, Signature *,
Packet *p, const Signature *s, const SigMatchCtx *ctx);
int DetectBytetestDoMatch(DetectEngineThreadCtx *, const Signature *,
const SigMatchCtx *ctx, uint8_t *, uint32_t,
uint8_t, int32_t, uint64_t);

@ -40,44 +40,44 @@
#include "util-profiling.h"
/* prototypes for the "ipv4-csum" rule keyword */
int DetectIPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
static int DetectIPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectIPV4CsumSetup(DetectEngineCtx *, Signature *, char *);
void DetectIPV4CsumFree(void *);
/* prototypes for the "tcpv4-csum" rule keyword */
int DetectTCPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
static int DetectTCPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectTCPV4CsumSetup(DetectEngineCtx *, Signature *, char *);
void DetectTCPV4CsumFree(void *);
/* prototypes for the "tcpv6-csum" rule keyword */
int DetectTCPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
static int DetectTCPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectTCPV6CsumSetup(DetectEngineCtx *, Signature *, char *);
void DetectTCPV6CsumFree(void *);
/* prototypes for the "udpv4-csum" rule keyword */
int DetectUDPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
static int DetectUDPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectUDPV4CsumSetup(DetectEngineCtx *, Signature *, char *);
void DetectUDPV4CsumFree(void *);
/* prototypes for the "udpv6-csum" rule keyword */
int DetectUDPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
static int DetectUDPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectUDPV6CsumSetup(DetectEngineCtx *, Signature *, char *);
void DetectUDPV6CsumFree(void *);
/* prototypes for the "icmpv4-csum" rule keyword */
int DetectICMPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
static int DetectICMPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectICMPV4CsumSetup(DetectEngineCtx *, Signature *, char *);
void DetectICMPV4CsumFree(void *);
/* prototypes for the "icmpv6-csum" rule keyword */
int DetectICMPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
static int DetectICMPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectICMPV6CsumSetup(DetectEngineCtx *, Signature *, char *);
void DetectICMPV6CsumFree(void *);
@ -229,8 +229,8 @@ error:
*
* \retval 1 if the Packet contents match the keyword option; 0 otherwise
*/
int DetectIPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectIPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectCsumData *cd = (const DetectCsumData *)ctx;
@ -323,8 +323,8 @@ void DetectIPV4CsumFree(void *ptr)
*
* \retval 1 if the Packet contents match the keyword option; 0 otherwise
*/
int DetectTCPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectTCPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectCsumData *cd = (const DetectCsumData *)ctx;
@ -418,8 +418,8 @@ void DetectTCPV4CsumFree(void *ptr)
*
* \retval 1 if the Packet contents match the keyword option; 0 otherwise
*/
int DetectTCPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectTCPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectCsumData *cd = (const DetectCsumData *)ctx;
@ -513,8 +513,8 @@ void DetectTCPV6CsumFree(void *ptr)
*
* \retval 1 if the Packet contents match the keyword option; 0 otherwise
*/
int DetectUDPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectUDPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectCsumData *cd = (const DetectCsumData *)ctx;
@ -609,8 +609,8 @@ void DetectUDPV4CsumFree(void *ptr)
*
* \retval 1 if the Packet contents match the keyword option; 0 otherwise
*/
int DetectUDPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectUDPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectCsumData *cd = (const DetectCsumData *)ctx;
@ -705,8 +705,8 @@ void DetectUDPV6CsumFree(void *ptr)
*
* \retval 1 if the Packet contents match the keyword option; 0 otherwise
*/
int DetectICMPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectICMPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectCsumData *cd = (const DetectCsumData *)ctx;
@ -800,8 +800,8 @@ void DetectICMPV4CsumFree(void *ptr)
*
* \retval 1 if the Packet contents match the keyword option; 0 otherwise
*/
int DetectICMPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectICMPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectCsumData *cd = (const DetectCsumData *)ctx;

@ -52,8 +52,8 @@
static pcre *parse_regex = NULL;
static pcre_extra *parse_regex_study = NULL;
int DetectDceIfaceMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t,
void *, Signature *, SigMatch *);
static int DetectDceIfaceMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *,
uint8_t, void *, const Signature *, const SigMatch *);
static int DetectDceIfaceSetup(DetectEngineCtx *, Signature *, char *);
void DetectDceIfaceFree(void *);
@ -242,8 +242,9 @@ static inline int DetectDceIfaceMatchIfaceVersion(uint16_t version,
* \retval 1 On Match.
* \retval 0 On no match.
*/
int DetectDceIfaceMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f,
uint8_t flags, void *state, Signature *s, SigMatch *m)
static int DetectDceIfaceMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, void *state,
const Signature *s, const SigMatch *m)
{
SCEnter();

@ -52,8 +52,8 @@
static pcre *parse_regex = NULL;
static pcre_extra *parse_regex_study = NULL;
int DetectDceOpnumMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t,
void *, Signature *, SigMatch *);
static int DetectDceOpnumMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t,
void *, const Signature *, const SigMatch *);
static int DetectDceOpnumSetup(DetectEngineCtx *, Signature *, char *);
void DetectDceOpnumFree(void *);
@ -237,8 +237,9 @@ static inline DetectDceOpnumData *DetectDceOpnumArgParse(const char *arg)
* \retval 1 On Match.
* \retval 0 On no match.
*/
int DetectDceOpnumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f,
uint8_t flags, void *state, Signature *s, SigMatch *m)
static int DetectDceOpnumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, void *state,
const Signature *s, const SigMatch *m)
{
SCEnter();

@ -51,7 +51,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectDetectionFilterMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectDetectionFilterMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectDetectionFilterSetup(DetectEngineCtx *, Signature *, char *);
void DetectDetectionFilterRegisterTests(void);
void DetectDetectionFilterFree(void *);
@ -74,7 +75,8 @@ void DetectDetectionFilterRegister (void)
DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study);
}
int DetectDetectionFilterMatch (ThreadVars *thv, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectDetectionFilterMatch (ThreadVars *thv, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
return 1;
}

@ -139,7 +139,7 @@ static char *TrimString(char *str)
}
static int DetectEngineInspectDNP3Data(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags,
DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id)
{
SCEnter();
@ -163,7 +163,7 @@ static int DetectEngineInspectDNP3Data(ThreadVars *tv, DetectEngineCtx *de_ctx,
}
static int DetectEngineInspectDNP3(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags,
DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id)
{
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags,

@ -49,7 +49,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectDsizeMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectDsizeMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectDsizeSetup (DetectEngineCtx *, Signature *s, char *str);
void DsizeRegisterTests(void);
static void DetectDsizeFree(void *);
@ -105,7 +106,8 @@ DsizeMatch(const uint16_t psize, const uint8_t mode,
* \retval 0 no match
* \retval 1 match
*/
int DetectDsizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectDsizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
SCEnter();
int ret = 0;

@ -186,7 +186,8 @@ int PacketAlertRemove(Packet *p, uint16_t pos)
* \param flags alert flags
* \param alert_msg ptr to StreamMsg object that the signature matched on
*/
int PacketAlertAppend(DetectEngineThreadCtx *det_ctx, Signature *s, Packet *p, uint64_t tx_id, uint8_t flags)
int PacketAlertAppend(DetectEngineThreadCtx *det_ctx, const Signature *s,
Packet *p, uint64_t tx_id, uint8_t flags)
{
int i = 0;

@ -29,7 +29,8 @@
#include "detect.h"
void PacketAlertFinalize(DetectEngineCtx *, DetectEngineThreadCtx *, Packet *);
int PacketAlertAppend(DetectEngineThreadCtx *, Signature *, Packet *, uint64_t tx_id, uint8_t);
int PacketAlertAppend(DetectEngineThreadCtx *, const Signature *,
Packet *, uint64_t tx_id, uint8_t);
int PacketAlertCheck(Packet *, uint32_t);
int PacketAlertRemove(Packet *, uint16_t);
void PacketAlertTagInit(void);

@ -99,7 +99,7 @@
* \retval 1 match
*/
int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
Signature *s, SigMatch *sm,
const Signature *s, const SigMatch *sm,
Flow *f,
uint8_t *buffer, uint32_t buffer_len,
uint32_t stream_start_offset,

@ -34,7 +34,7 @@ enum {
};
int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
Signature *s, SigMatch *sm,
const Signature *s, const SigMatch *sm,
Flow *f,
uint8_t *buffer, uint32_t buffer_len,
uint32_t stream_start_offset,

@ -62,7 +62,7 @@
* \retval 1 Match.
*/
int DetectEngineInspectDcePayload(DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, Signature *s,
DetectEngineThreadCtx *det_ctx, const Signature *s,
Flow *f, uint8_t flags, void *alstate)
{
SCEnter();

@ -25,7 +25,7 @@
#define __DETECT_ENGINE_DCEPAYLOAD_H__
int DetectEngineInspectDcePayload(DetectEngineCtx *, DetectEngineThreadCtx *,
Signature *, Flow *, uint8_t, void *);
const Signature *, Flow *, uint8_t, void *);
void DcePayloadRegisterTests(void);

@ -63,7 +63,7 @@
int DetectEngineInspectDnsQueryName(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id)
{
DNSTransaction *tx = (DNSTransaction *)txv;
@ -141,7 +141,7 @@ int PrefilterTxDnsQueryRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectDnsRequest(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id)
{
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags,
@ -152,7 +152,7 @@ int DetectEngineInspectDnsRequest(ThreadVars *tv,
int DetectEngineInspectDnsResponse(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id)
{
return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags,

@ -26,17 +26,17 @@
int PrefilterTxDnsQueryRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectDnsQueryName(ThreadVars *, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *, Signature *,
DetectEngineThreadCtx *, const Signature *,
Flow *, uint8_t, void *, void *, uint64_t);
int DetectEngineInspectDnsRequest(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id);
int DetectEngineInspectDnsResponse(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id);
#endif /* __DETECT_ENGINE_DNS_H__ */

@ -218,7 +218,7 @@ int CIPServiceMatch(ENIPTransaction *enip_data,
* \retval 0 no match or 1 match
*/
int DetectEngineInspectCIP(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags,
DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id)
{
SCEnter();
@ -258,7 +258,7 @@ int DetectEngineInspectCIP(ThreadVars *tv, DetectEngineCtx *de_ctx,
*/
int DetectEngineInspectENIP(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags,
DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id)
{
SCEnter();

@ -24,11 +24,11 @@
#define __DETECT_ENGINE_ENIP_H__
int DetectEngineInspectCIP(ThreadVars *, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *, Signature *,
DetectEngineThreadCtx *, const Signature *,
Flow *, uint8_t, void *, void *, uint64_t);
int DetectEngineInspectENIP(ThreadVars *, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *, Signature *,
DetectEngineThreadCtx *, const Signature *,
Flow *, uint8_t, void *, void *, uint64_t);
void DetectEngineInspectENIPRegisterTests(void);

@ -47,7 +47,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectEngineEventMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectEngineEventMatch (ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectEngineEventSetup (DetectEngineCtx *, Signature *, char *);
static int DetectDecodeEventSetup (DetectEngineCtx *, Signature *, char *);
static int DetectStreamEventSetup (DetectEngineCtx *, Signature *, char *);
@ -92,7 +93,8 @@ void DetectEngineEventRegister (void)
* \retval 0 no match
* \retval 1 match
*/
int DetectEngineEventMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectEngineEventMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
SCEnter();

@ -26,11 +26,11 @@
int DetectFileInspectHttp(ThreadVars *tv,
DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags, void *alstate,
const Signature *s, Flow *f, uint8_t flags, void *alstate,
void *tx, uint64_t tx_id);
int DetectFileInspectSmtp(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, Signature *s,
DetectEngineThreadCtx *det_ctx, const Signature *s,
Flow *f, uint8_t flags, void *alstate,
void *tx, uint64_t tx_id);

@ -30,7 +30,7 @@ int PrefilterTxSmtpFiledataRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectSMTPFiledata(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void DetectEngineCleanSMTPBuffers(DetectEngineThreadCtx *det_ctx);

@ -32,7 +32,7 @@ int PrefilterTxHttpRequestBodyRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpClientBody(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void DetectEngineCleanHCBDBuffers(DetectEngineThreadCtx *);

@ -168,7 +168,7 @@ int PrefilterTxResponseCookieRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpCookie(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -31,7 +31,7 @@ int PrefilterTxResponseCookieRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpCookie(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);

@ -384,7 +384,7 @@ int PrefilterTxHttpResponseHeadersRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpHeader(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id)
{

@ -31,7 +31,7 @@ int PrefilterTxHttpResponseHeadersRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpHeader(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void DetectEngineCleanHHDBuffers(DetectEngineThreadCtx *det_ctx);

@ -117,7 +117,7 @@ int PrefilterTxHostnameRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpHH(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -30,7 +30,7 @@ int PrefilterTxHostnameRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpHH(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);

@ -114,7 +114,7 @@ int PrefilterTxMethodRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpMethod(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -28,7 +28,7 @@
int DetectEngineInspectHttpMethod(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);

@ -165,7 +165,7 @@ int PrefilterTxResponseHeadersRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpRawHeader(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -31,7 +31,7 @@ int PrefilterTxResponseHeadersRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpRawHeader(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void DetectEngineHttpRawHeaderRegisterTests(void);

@ -129,7 +129,7 @@ int PrefilterTxHostnameRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpHRH(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -30,7 +30,7 @@ int PrefilterTxHostnameRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpHRH(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);

@ -114,7 +114,7 @@ int PrefilterTxRawUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpRawUri(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -31,7 +31,7 @@ int PrefilterTxRawUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpRawUri(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void DetectEngineHttpRawUriRegisterTests(void);

@ -32,7 +32,7 @@ int PrefilterTxHttpResponseBodyRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpServerBody(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void DetectEngineCleanHSBDBuffers(DetectEngineThreadCtx *det_ctx);

@ -113,7 +113,7 @@ int PrefilterTxHttpStatCodeRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpStatCode(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -30,7 +30,7 @@ int PrefilterTxHttpStatCodeRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpStatCode(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void DetectEngineHttpStatCodeRegisterTests(void);

@ -113,7 +113,7 @@ int PrefilterTxHttpStatMsgRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpStatMsg(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -30,7 +30,7 @@ int PrefilterTxHttpStatMsgRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpStatMsg(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void DetectEngineHttpStatMsgRegisterTests(void);

@ -122,7 +122,7 @@ int PrefilterTxUARegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
int DetectEngineInspectHttpUA(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -30,7 +30,7 @@ int PrefilterTxUARegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpUA(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);

@ -199,7 +199,7 @@ static int DetectEngineInspectModbusAddress(ModbusTransaction *tx,
int DetectEngineInspectModbus(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s,
const Signature *s,
Flow *f,
uint8_t flags,
void *alstate,

@ -34,7 +34,7 @@
#define __DETECT_ENGINE_MODBUS_H__
int DetectEngineInspectModbus(ThreadVars *, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *, Signature *,
DetectEngineThreadCtx *, const Signature *,
Flow *, uint8_t, void *, void *, uint64_t);
void DetectEngineInspectModbusRegisterTests(void);

@ -173,7 +173,7 @@ int DetectEngineInspectPacketPayload(DetectEngineCtx *de_ctx,
* from the current packet here.
*/
int DetectEngineInspectStreamPayload(DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f,
DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f,
uint8_t *payload, uint32_t payload_len)
{
SCEnter();

@ -28,9 +28,9 @@ int PrefilterPktPayloadRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int PrefilterPktStreamRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectPacketPayload(DetectEngineCtx *,
DetectEngineThreadCtx *, Signature *, Flow *, Packet *);
DetectEngineThreadCtx *, const Signature *, Flow *, Packet *);
int DetectEngineInspectStreamPayload(DetectEngineCtx *,
DetectEngineThreadCtx *, Signature *, Flow *,
DetectEngineThreadCtx *, const Signature *, Flow *,
uint8_t *, uint32_t);
void PayloadRegisterTests(void);

@ -161,7 +161,8 @@ static int DeStateSearchState(DetectEngineState *state, uint8_t direction, SigIn
return 0;
}
static void DeStateSignatureAppend(DetectEngineState *state, Signature *s, uint32_t inspect_flags, uint8_t direction)
static void DeStateSignatureAppend(DetectEngineState *state,
const Signature *s, uint32_t inspect_flags, uint8_t direction)
{
int jump = 0;
int i = 0;
@ -202,9 +203,9 @@ static void DeStateSignatureAppend(DetectEngineState *state, Signature *s, uint3
return;
}
static void DeStateFlowRuleAppend(DetectEngineStateFlow *state, Signature *s,
SigMatch *sm, uint32_t inspect_flags,
uint8_t direction)
static void DeStateFlowRuleAppend(DetectEngineStateFlow *state, const Signature *s,
const SigMatch *sm, uint32_t inspect_flags,
uint8_t direction)
{
int jump = 0;
int i = 0;
@ -392,7 +393,8 @@ int DeStateFlowHasInspectableState(Flow *f, AppProto alproto,
static int StoreState(DetectEngineThreadCtx *det_ctx,
Flow *f, const uint8_t flags, const uint8_t alversion,
Signature *s, SigMatch *sm, const uint32_t inspect_flags,
const Signature *s, const SigMatch *sm,
const uint32_t inspect_flags,
const uint16_t file_no_match)
{
if (f->de_state == NULL) {
@ -445,7 +447,7 @@ static void StoreStateTxFileOnly(DetectEngineThreadCtx *det_ctx,
static void StoreStateTx(DetectEngineThreadCtx *det_ctx,
Flow *f, const uint8_t flags, const uint8_t alversion,
const uint64_t tx_id, void *tx,
Signature *s, SigMatch *sm,
const Signature *s, const SigMatch *sm,
const uint32_t inspect_flags, const uint16_t file_no_match, int check_before_add)
{
if (AppLayerParserSupportsTxDetectState(f->proto, f->alproto)) {
@ -474,7 +476,7 @@ static void StoreStateTx(DetectEngineThreadCtx *det_ctx,
int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Packet *p, Flow *f, uint8_t flags,
const Signature *s, Packet *p, Flow *f, uint8_t flags,
AppProto alproto, const uint8_t alversion)
{
SigMatch *sm = NULL;
@ -946,8 +948,8 @@ static int DoInspectFlowRule(ThreadVars *tv,
uint32_t inspect_flags = item->flags;
int total_matches = 0;
int full_match = 0;
SigMatch *sm = NULL;
Signature *s = de_ctx->sig_array[item->sid];
const SigMatch *sm = NULL;
const Signature *s = de_ctx->sig_array[item->sid];
RULE_PROFILING_START(p);

@ -123,7 +123,7 @@ typedef struct DetectEngineState_ {
/* FLOW BASED (AMATCH) */
typedef struct DeStateStoreFlowRule_ {
SigMatch *nm;
const SigMatch *nm;
uint32_t flags;
SigIntId sid;
} DeStateStoreFlowRule;
@ -188,7 +188,8 @@ int DeStateFlowHasInspectableState(Flow *f, AppProto alproto, uint8_t alversion,
*/
int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Packet *p, Flow *f, uint8_t flags,
const Signature *s, Packet *p, Flow *f,
uint8_t flags,
AppProto alproto, uint8_t alversion);
/**

@ -25,7 +25,7 @@
#define __DETECT_TEMPLATE_ENGINE_H__
int DetectEngineInspectTemplateBuffer(ThreadVars *, DetectEngineCtx *,
DetectEngineThreadCtx *, Signature *, Flow *, uint8_t, void *, void *,
DetectEngineThreadCtx *, const Signature *, Flow *, uint8_t, void *, void *,
uint64_t);
#endif /* __DETECT_TEMPLATE_ENGINE_H__ */

@ -98,7 +98,7 @@ int PrefilterTxTlsSniRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx)
* \retval 1 Match
*/
int DetectEngineInspectTlsSni(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, Signature *s,
DetectEngineThreadCtx *det_ctx, const Signature *s,
Flow *f, uint8_t flags, void *alstate, void *txv,
uint64_t tx_id)
{

@ -29,22 +29,22 @@ int PrefilterTxTlsSubjectRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectTlsSni(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id);
int DetectEngineInspectTlsIssuer(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id);
int DetectEngineInspectTlsSubject(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id);
int DetectEngineInspectTlsValidity(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate, void *txv, uint64_t tx_id);
#endif /* __DETECT_ENGINE_TLS_H__ */

@ -29,7 +29,7 @@ int PrefilterTxUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx);
int DetectEngineInspectHttpUri(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *tx, uint64_t tx_id);
void UriRegisterTests(void);

@ -106,7 +106,7 @@ void DetectAppLayerInspectEngineRegister(AppProto alproto,
int (*Callback)(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *sig, Flow *f,
const Signature *sig, Flow *f,
uint8_t flags, void *alstate,
void *tx, uint64_t tx_id))
{

@ -89,7 +89,7 @@ void DetectAppLayerInspectEngineRegister(AppProto alproto,
int (*Callback)(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *sig, Flow *f,
const Signature *sig, Flow *f,
uint8_t flags, void *alstate,
void *tx, uint64_t tx_id));

@ -52,7 +52,7 @@
#include "detect-fileext.h"
static int DetectFileextMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *,
uint8_t, File *, Signature *, SigMatch *);
uint8_t, File *, const Signature *, const SigMatch *);
static int DetectFileextSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFileextRegisterTests(void);
static void DetectFileextFree(void *);
@ -89,7 +89,7 @@ void DetectFileextRegister(void)
* \retval 1 match
*/
static int DetectFileextMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, File *file, Signature *s, SigMatch *m)
Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatch *m)
{
SCEnter();
int ret = 0;

@ -76,7 +76,7 @@ void DetectFilemagicRegister(void)
#else /* HAVE_MAGIC */
static int DetectFilemagicMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *,
uint8_t, File *, Signature *, SigMatch *);
uint8_t, File *, const Signature *, const SigMatch *);
static int DetectFilemagicSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFilemagicRegisterTests(void);
static void DetectFilemagicFree(void *);
@ -176,7 +176,7 @@ int FilemagicThreadLookup(magic_t *ctx, File *file)
* \retval 1 match
*/
static int DetectFilemagicMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, File *file, Signature *s, SigMatch *m)
Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatch *m)
{
SCEnter();
int ret = 0;

@ -53,7 +53,7 @@
#include "app-layer-parser.h"
static int DetectFilenameMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *,
uint8_t, File *, Signature *, SigMatch *);
uint8_t, File *, const Signature *, const SigMatch *);
static int DetectFilenameSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFilenameRegisterTests(void);
static void DetectFilenameFree(void *);
@ -101,7 +101,7 @@ void DetectFilenameRegister(void)
* \retval 1 match
*/
static int DetectFilenameMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, File *file, Signature *s, SigMatch *m)
Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatch *m)
{
SCEnter();
int ret = 0;

@ -49,7 +49,7 @@ static pcre_extra *parse_regex_study;
/*prototypes*/
static int DetectFilesizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f,
uint8_t flags, File *file, Signature *s, SigMatch *m);
uint8_t flags, File *file, const Signature *s, const SigMatch *m);
static int DetectFilesizeSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFilesizeFree (void *);
static void DetectFilesizeRegisterTests (void);
@ -87,7 +87,7 @@ void DetectFilesizeRegister(void)
* \retval 1 match
*/
static int DetectFilesizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f,
uint8_t flags, File *file, Signature *s, SigMatch *m)
uint8_t flags, File *file, const Signature *s, const SigMatch *m)
{
SCEnter();

@ -60,7 +60,7 @@ static pcre *parse_regex;
static pcre_extra *parse_regex_study;
static int DetectFilestoreMatch (ThreadVars *, DetectEngineThreadCtx *,
Flow *, uint8_t, File *, Signature *, SigMatch *);
Flow *, uint8_t, File *, const Signature *, const SigMatch *);
static int DetectFilestoreSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFilestoreFree(void *);
static void DetectFilestoreRegisterTests(void);
@ -180,7 +180,7 @@ static int FilestorePostMatchWithOptions(Packet *p, Flow *f, DetectFilestoreData
* When we are sure all parts of the signature matched, we run this function
* to finalize the filestore.
*/
int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s)
int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s)
{
uint8_t flags = 0;
@ -247,7 +247,7 @@ int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Pack
* needs to be put behind a api.
*/
static int DetectFilestoreMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f,
uint8_t flags, File *file, Signature *s, SigMatch *m)
uint8_t flags, File *file, const Signature *s, const SigMatch *m)
{
uint16_t file_id = 0;

@ -41,5 +41,7 @@ typedef struct DetectFilestoreData_ {
/* prototypes */
void DetectFilestoreRegister (void);
int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *);
int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *);
#endif /* __DETECT_FILESTORE_H__ */

@ -58,7 +58,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
static int DetectFlagsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectFlagsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectFlagsSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFlagsFree(void *);
@ -138,7 +139,8 @@ static inline int FlagsMatch(const uint8_t pflags, const uint8_t modifier,
* \retval 0 no match
* \retval 1 match
*/
static int DetectFlagsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectFlagsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
SCEnter();

@ -49,7 +49,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectFlowMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
int DetectFlowMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectFlowSetup (DetectEngineCtx *, Signature *, char *);
void DetectFlowRegisterTests(void);
void DetectFlowFree(void *);
@ -132,7 +133,8 @@ static inline int FlowMatch(const uint32_t pflags, const uint8_t pflowflags,
* \retval 0 no match
* \retval 1 match
*/
int DetectFlowMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
int DetectFlowMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
SCEnter();

@ -49,7 +49,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectFlowbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
int DetectFlowbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectFlowbitSetup (DetectEngineCtx *, Signature *, char *);
void DetectFlowbitFree (void *);
void FlowBitsRegisterTests(void);
@ -122,7 +123,8 @@ static int DetectFlowbitMatchIsnotset (Packet *p, const DetectFlowbitsData *fd)
* -1: error
*/
int DetectFlowbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
int DetectFlowbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
const DetectFlowbitsData *fd = (const DetectFlowbitsData *)ctx;
if (fd == NULL)

@ -54,7 +54,7 @@ static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectFlowintMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
const Signature *, const SigMatchCtx *);
static int DetectFlowintSetup(DetectEngineCtx *, Signature *, char *);
void DetectFlowintFree(void *);
void DetectFlowintRegisterTests(void);
@ -87,7 +87,7 @@ void DetectFlowintRegister(void)
* condition
*/
int DetectFlowintMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
const DetectFlowintData *sfd = (const DetectFlowintData *)ctx;
FlowVar *fv;

@ -44,9 +44,11 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectFlowvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
int DetectFlowvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectFlowvarSetup (DetectEngineCtx *, Signature *, char *);
static int DetectFlowvarPostMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx);
static int DetectFlowvarPostMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx);
static void DetectFlowvarDataFree(void *ptr);
void DetectFlowvarRegister (void)
@ -93,7 +95,8 @@ static void DetectFlowvarDataFree(void *ptr)
* -1: error
*/
int DetectFlowvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
int DetectFlowvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
int ret = 0;
DetectFlowvarData *fd = (DetectFlowvarData *)ctx;
@ -261,7 +264,7 @@ error:
*/
static int DetectFlowvarPostMatch(ThreadVars *tv,
DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
DetectFlowvarList *fs, *prev;
const DetectFlowvarData *fd;

@ -68,7 +68,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
static int DetectFragBitsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectFragBitsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectFragBitsSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFragBitsFree(void *);
@ -136,7 +137,7 @@ FragBitsMatch(const uint8_t pbits, const uint8_t modifier,
* \retval 1 match
*/
static int DetectFragBitsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
if (!ctx || !PKT_IS_IPV4(p) || PKT_IS_PSEUDOPKT(p))
return 0;

@ -44,7 +44,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectFragOffsetMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectFragOffsetMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);
static int DetectFragOffsetSetup(DetectEngineCtx *, Signature *, char *);
void DetectFragOffsetRegisterTests(void);
void DetectFragOffsetFree(void *);
@ -102,7 +103,8 @@ static inline int FragOffsetMatch(const uint16_t poffset, const uint8_t mode,
* \retval 1 match
*
*/
int DetectFragOffsetMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectFragOffsetMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
uint16_t frag = 0;
const DetectFragOffsetData *fragoff = (const DetectFragOffsetData *)ctx;

@ -47,13 +47,11 @@
#include "stream-tcp.h"
#include "util-byte.h"
int DetectFtpbounceMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, SigMatch *);
int DetectFtpbounceALMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *,
uint8_t, void *, Signature *, SigMatch *);
static int DetectFtpbounceALMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *,
uint8_t, void *, const Signature *, const SigMatch *);
static int DetectFtpbounceSetup(DetectEngineCtx *, Signature *, char *);
int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len,
uint32_t ip_orig, uint16_t offset);
static int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len,
uint32_t ip_orig, uint16_t offset);
void DetectFtpbounceRegisterTests(void);
void DetectFtpbounceFree(void *);
@ -83,7 +81,7 @@ void DetectFtpbounceRegister(void)
*
* \retval 1 if ftpbounce detected, 0 if not
*/
int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len,
static int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len,
uint32_t ip_orig, uint16_t offset)
{
SCEnter();
@ -168,9 +166,9 @@ int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len,
* \retval 0 no match
* \retval 1 match
*/
int DetectFtpbounceALMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, void *state, Signature *s,
SigMatch *m)
static int DetectFtpbounceALMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, void *state, const Signature *s,
const SigMatch *m)
{
SCEnter();
FtpState *ftp_state =(FtpState *)state;

@ -68,7 +68,8 @@ TODO:
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectHostbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectHostbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectHostbitSetup (DetectEngineCtx *, Signature *, char *);
void DetectHostbitFree (void *);
void HostBitsRegisterTests(void);
@ -265,7 +266,8 @@ int DetectXbitMatchHost(Packet *p, const DetectXbitsData *xd)
* -1: error
*/
int DetectHostbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectHostbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
const DetectXbitsData *xd = (const DetectXbitsData *)ctx;
if (xd == NULL)

@ -67,7 +67,7 @@ static int PrefilterTxHttpRequestLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx
static int DetectEngineInspectHttpRequestLine(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id);
/**
@ -174,7 +174,7 @@ static int PrefilterTxHttpRequestLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx
static int DetectEngineInspectHttpRequestLine(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -67,7 +67,7 @@ static int PrefilterTxHttpResponseLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ct
static int DetectEngineInspectHttpResponseLine(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id);
@ -175,7 +175,7 @@ static int PrefilterTxHttpResponseLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ct
int DetectEngineInspectHttpResponseLine(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Flow *f, uint8_t flags,
const Signature *s, Flow *f, uint8_t flags,
void *alstate,
void *txv, uint64_t tx_id)
{

@ -43,7 +43,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectIcmpIdMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectIcmpIdMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectIcmpIdSetup(DetectEngineCtx *, Signature *, char *);
void DetectIcmpIdRegisterTests(void);
void DetectIcmpIdFree(void *);
@ -129,7 +130,8 @@ static inline _Bool GetIcmpId(Packet *p, uint16_t *id)
* \retval 0 no match
* \retval 1 match
*/
int DetectIcmpIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectIcmpIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
uint16_t pid;

@ -43,7 +43,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectIcmpSeqMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectIcmpSeqMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectIcmpSeqSetup(DetectEngineCtx *, Signature *, char *);
void DetectIcmpSeqRegisterTests(void);
void DetectIcmpSeqFree(void *);
@ -131,7 +132,8 @@ static inline _Bool GetIcmpSeq(Packet *p, uint16_t *seq)
* \retval 0 no match
* \retval 1 match
*/
int DetectIcmpSeqMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectIcmpSeqMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
uint16_t seqn;

@ -46,7 +46,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectICodeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectICodeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectICodeSetup(DetectEngineCtx *, Signature *, char *);
void DetectICodeRegisterTests(void);
void DetectICodeFree(void *);
@ -115,7 +116,8 @@ static inline int ICodeMatch(const uint8_t pcode, const uint8_t mode,
* \retval 0 no match
* \retval 1 match
*/
int DetectICodeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectICodeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
if (PKT_IS_PSEUDOPKT(p))
return 0;

@ -49,8 +49,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectIdMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
Signature *, const SigMatchCtx *);
static int DetectIdMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectIdSetup (DetectEngineCtx *, Signature *, char *);
void DetectIdRegisterTests(void);
void DetectIdFree(void *);
@ -88,8 +88,8 @@ void DetectIdRegister (void)
* \retval 0 no match
* \retval 1 match
*/
int DetectIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
Signature *s, const SigMatchCtx *ctx)
static int DetectIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
const DetectIdData *id_d = (const DetectIdData *)ctx;

@ -43,7 +43,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectIpOptsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectIpOptsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectIpOptsSetup (DetectEngineCtx *, Signature *, char *);
void IpOptsRegisterTests(void);
void DetectIpOptsFree(void *);
@ -98,7 +99,8 @@ struct DetectIpOpts_ {
* \retval 0 no match
* \retval 1 match
*/
int DetectIpOptsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectIpOptsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
const DetectIpOptsData *de = (const DetectIpOptsData *)ctx;

@ -52,7 +52,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectIPRepMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectIPRepMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectIPRepSetup (DetectEngineCtx *, Signature *, char *);
void DetectIPRepFree (void *);
void IPRepRegisterTests(void);
@ -166,7 +167,8 @@ static inline int RepMatch(uint8_t op, uint8_t val1, uint8_t val2)
* 1: match
* -1: error
*/
int DetectIPRepMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectIPRepMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
const DetectIPRepData *rd = (const DetectIPRepData *)ctx;
if (rd == NULL)

@ -46,7 +46,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectITypeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectITypeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectITypeSetup(DetectEngineCtx *, Signature *, char *);
void DetectITypeRegisterTests(void);
void DetectITypeFree(void *);
@ -115,7 +116,8 @@ static inline int ITypeMatch(const uint8_t ptype, const uint8_t mode,
* \retval 0 no match
* \retval 1 match
*/
int DetectITypeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectITypeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
if (PKT_IS_PSEUDOPKT(p))
return 0;

@ -88,9 +88,9 @@ void DetectLuaRegister(void)
#include "util-lua.h"
static int DetectLuaMatch (ThreadVars *, DetectEngineThreadCtx *,
Packet *, Signature *, const SigMatchCtx *);
Packet *, const Signature *, const SigMatchCtx *);
static int DetectLuaAppMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m);
Flow *f, uint8_t flags, void *state, const Signature *s, const SigMatch *m);
static int DetectLuaAppTxMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags,
void *state, void *txv, const Signature *s,
@ -186,7 +186,7 @@ void LuaDumpStack(lua_State *state)
}
int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx,
Signature *s, SigMatch *sm,
const Signature *s, const SigMatch *sm,
uint8_t *buffer, uint32_t buffer_len, uint32_t offset,
Flow *f)
{
@ -292,7 +292,7 @@ int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx,
* \retval 1 match
*/
static int DetectLuaMatch (ThreadVars *tv, DetectEngineThreadCtx *det_ctx,
Packet *p, Signature *s, const SigMatchCtx *ctx)
Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
SCEnter();
int ret = 0;
@ -537,7 +537,8 @@ static int DetectLuaAppMatchCommon (ThreadVars *t, DetectEngineThreadCtx *det_ct
* \retval 1 match
*/
static int DetectLuaAppMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m)
Flow *f, uint8_t flags, void *state,
const Signature *s, const SigMatch *m)
{
return DetectLuaAppMatchCommon(t, det_ctx, f, flags, state, s, m->ctx);
}

@ -55,7 +55,8 @@ typedef struct DetectLuaData {
/* prototypes */
void DetectLuaRegister (void);
int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx, Signature *s, SigMatch *sm,
int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx,
const Signature *s, const SigMatch *sm,
uint8_t *buffer, uint32_t buffer_len, uint32_t offset,
Flow *f);

@ -43,7 +43,8 @@ static pcre *parse_regex;
static pcre_extra *parse_regex_study;
static int DetectMarkSetup (DetectEngineCtx *, Signature *, char *);
int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx);
static int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx);
void DetectMarkDataFree(void *ptr);
/**
@ -217,7 +218,8 @@ void DetectMarkDataFree(void *ptr)
}
int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
#ifdef NFQ
const DetectMarkData *nf_data = (const DetectMarkData *)ctx;

@ -171,8 +171,8 @@ void DetectPcreRegister (void)
* \retval 1 Match.
* \retval 0 No match.
*/
int DetectPcrePayloadMatch(DetectEngineThreadCtx *det_ctx, Signature *s,
SigMatch *sm, Packet *p, Flow *f, uint8_t *payload,
int DetectPcrePayloadMatch(DetectEngineThreadCtx *det_ctx, const Signature *s,
const SigMatch *sm, Packet *p, Flow *f, uint8_t *payload,
uint32_t payload_len)
{
SCEnter();

@ -44,7 +44,8 @@ typedef struct DetectPcreData_ {
} DetectPcreData;
/* prototypes */
int DetectPcrePayloadMatch(DetectEngineThreadCtx *, Signature *, SigMatch *, Packet *, Flow *, uint8_t *, uint32_t);
int DetectPcrePayloadMatch(DetectEngineThreadCtx *, const Signature *,
const SigMatch *, Packet *, Flow *, uint8_t *, uint32_t);
int DetectPcrePacketPayloadMatch(DetectEngineThreadCtx *, Packet *, Signature *, SigMatch *);
int DetectPcrePayloadDoMatch(DetectEngineThreadCtx *, Signature *, SigMatch *,
Packet *, uint8_t *, uint16_t);

@ -39,7 +39,8 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectPktvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
static int DetectPktvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectPktvarSetup (DetectEngineCtx *, Signature *, char *);
void DetectPktvarRegister (void)
@ -61,7 +62,8 @@ void DetectPktvarRegister (void)
* -1: error
*/
int DetectPktvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectPktvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
int ret = 0;
const DetectPktvarData *pd = (const DetectPktvarData *)ctx;

@ -48,8 +48,9 @@
static pcre *parse_regex;
static pcre_extra *parse_regex_study;
int DetectRpcMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *);
int DetectRpcSetup (DetectEngineCtx *, Signature *, char *);
static int DetectRpcMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *,
const Signature *, const SigMatchCtx *);
static int DetectRpcSetup (DetectEngineCtx *, Signature *, char *);
void DetectRpcRegisterTests(void);
void DetectRpcFree(void *);
@ -86,7 +87,8 @@ void DetectRpcRegister (void)
* \retval 0 no match
* \retval 1 match
*/
int DetectRpcMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx)
static int DetectRpcMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s, const SigMatchCtx *ctx)
{
/* PrintRawDataFp(stdout, p->payload, p->payload_len); */
const DetectRpcData *rd = (const DetectRpcData *)ctx;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save