From: Victor Julien Date: Fri, 28 Jun 2019 17:29:55 +0000 (+0200) Subject: detect: remove Threadvars argument from API calls X-Git-Tag: suricata-5.0.0-rc1~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14896365efa44ae5ed9eb3460a0f469cfc71b7e6;p=thirdparty%2Fsuricata.git detect: remove Threadvars argument from API calls Remove it as it's (almost) never used. If it is really needed it can be accessed through DetectEngineThreadCtx::tv as well. --- diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index 092ab0bc1f..9452ee4340 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -48,7 +48,7 @@ #define MAX_ALPROTO_NAME 50 -static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectAppLayerEventPktMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx); static int DetectAppLayerEventSetupP1(DetectEngineCtx *, Signature *, const char *); static void DetectAppLayerEventRegisterTests(void); @@ -133,7 +133,7 @@ static int DetectEngineAptEventInspect(ThreadVars *tv, } -static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectAppLayerEventPktMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectAppLayerEventData *aled = (const DetectAppLayerEventData *)ctx; diff --git a/src/detect-app-layer-protocol.c b/src/detect-app-layer-protocol.c index 214bac80b7..fc0520dc7c 100644 --- a/src/detect-app-layer-protocol.c +++ b/src/detect-app-layer-protocol.c @@ -35,7 +35,7 @@ static void DetectAppLayerProtocolRegisterTests(void); -static int DetectAppLayerProtocolPacketMatch(ThreadVars *tv, +static int DetectAppLayerProtocolPacketMatch( DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { diff --git a/src/detect-asn1.c b/src/detect-asn1.c index af37546be1..524bd97868 100644 --- a/src/detect-asn1.c +++ b/src/detect-asn1.c @@ -42,7 +42,7 @@ /* delimiters for functions/arguments */ const char *ASN_DELIM = " \t,\n"; -static int DetectAsn1Match(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectAsn1Match(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectAsn1Setup (DetectEngineCtx *, Signature *, const char *); static void DetectAsn1RegisterTests(void); @@ -137,7 +137,7 @@ static uint8_t DetectAsn1Checks(Asn1Node *node, const DetectAsn1Data *ad) * \retval 0 no match * \retval 1 match */ -static int DetectAsn1Match(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectAsn1Match(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { uint8_t ret = 0; diff --git a/src/detect-bypass.c b/src/detect-bypass.c index 2f6a2fbdd8..8a37b3ba70 100644 --- a/src/detect-bypass.c +++ b/src/detect-bypass.c @@ -50,7 +50,7 @@ #include "util-unittest-helper.h" #include "util-device.h" -static int DetectBypassMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectBypassMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectBypassSetup(DetectEngineCtx *, Signature *, const char *); static void DetectBypassRegisterTests(void); @@ -92,7 +92,7 @@ static int DetectBypassSetup(DetectEngineCtx *de_ctx, Signature *s, const char * return 0; } -static int DetectBypassMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectBypassMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { PacketBypassCallback(p); diff --git a/src/detect-bytejump.c b/src/detect-bytejump.c index c277da03fd..a64b8f81f1 100644 --- a/src/detect-bytejump.c +++ b/src/detect-bytejump.c @@ -60,7 +60,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectBytejumpMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectBytejumpMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx); static DetectBytejumpData *DetectBytejumpParse(const char *optstr, char **offset); static int DetectBytejumpSetup(DetectEngineCtx *de_ctx, Signature *s, const char *optstr); @@ -199,7 +199,7 @@ int DetectBytejumpDoMatch(DetectEngineThreadCtx *det_ctx, const Signature *s, SCReturnInt(1); } -static int DetectBytejumpMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectBytejumpMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectBytejumpData *data = (const DetectBytejumpData *)ctx; diff --git a/src/detect-bytetest.c b/src/detect-bytetest.c index d7c0db0bbc..e205a9f3fc 100644 --- a/src/detect-bytetest.c +++ b/src/detect-bytetest.c @@ -62,7 +62,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectBytetestMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectBytetestMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx); static int DetectBytetestSetup(DetectEngineCtx *de_ctx, Signature *s, const char *optstr); static void DetectBytetestFree(void *ptr); @@ -234,7 +234,7 @@ int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx, } -static int DetectBytetestMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectBytetestMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { return DetectBytetestDoMatch(det_ctx, s, ctx, p->payload, p->payload_len, diff --git a/src/detect-csum.c b/src/detect-csum.c index 89341b533b..5e36f54ce5 100644 --- a/src/detect-csum.c +++ b/src/detect-csum.c @@ -40,43 +40,43 @@ #include "util-profiling.h" /* prototypes for the "ipv4-csum" rule keyword */ -static int DetectIPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectIPV4CsumMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectIPV4CsumSetup(DetectEngineCtx *, Signature *, const char *); static void DetectIPV4CsumFree(void *); /* prototypes for the "tcpv4-csum" rule keyword */ -static int DetectTCPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectTCPV4CsumMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectTCPV4CsumSetup(DetectEngineCtx *, Signature *, const char *); static void DetectTCPV4CsumFree(void *); /* prototypes for the "tcpv6-csum" rule keyword */ -static int DetectTCPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectTCPV6CsumMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectTCPV6CsumSetup(DetectEngineCtx *, Signature *, const char *); static void DetectTCPV6CsumFree(void *); /* prototypes for the "udpv4-csum" rule keyword */ -static int DetectUDPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectUDPV4CsumMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectUDPV4CsumSetup(DetectEngineCtx *, Signature *, const char *); static void DetectUDPV4CsumFree(void *); /* prototypes for the "udpv6-csum" rule keyword */ -static int DetectUDPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectUDPV6CsumMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectUDPV6CsumSetup(DetectEngineCtx *, Signature *, const char *); static void DetectUDPV6CsumFree(void *); /* prototypes for the "icmpv4-csum" rule keyword */ -static int DetectICMPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectICMPV4CsumMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectICMPV4CsumSetup(DetectEngineCtx *, Signature *, const char *); static void DetectICMPV4CsumFree(void *); /* prototypes for the "icmpv6-csum" rule keyword */ -static int DetectICMPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectICMPV6CsumMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectICMPV6CsumSetup(DetectEngineCtx *, Signature *, const char *); static void DetectICMPV6CsumFree(void *); @@ -229,7 +229,7 @@ error: * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -static int DetectIPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectIPV4CsumMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -324,7 +324,7 @@ static void DetectIPV4CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -static int DetectTCPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTCPV4CsumMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -421,7 +421,7 @@ static void DetectTCPV4CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -static int DetectTCPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTCPV6CsumMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -518,7 +518,7 @@ static void DetectTCPV6CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -static int DetectUDPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectUDPV4CsumMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -615,7 +615,7 @@ static void DetectUDPV4CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -static int DetectUDPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectUDPV6CsumMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -712,7 +712,7 @@ static void DetectUDPV6CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -static int DetectICMPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectICMPV4CsumMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -807,7 +807,7 @@ static void DetectICMPV4CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -static int DetectICMPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectICMPV6CsumMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; diff --git a/src/detect-dce-iface.c b/src/detect-dce-iface.c index 5c9ebae2d8..07062f7b12 100644 --- a/src/detect-dce-iface.c +++ b/src/detect-dce-iface.c @@ -55,8 +55,7 @@ static pcre *parse_regex = NULL; static pcre_extra *parse_regex_study = NULL; -static int DetectDceIfaceMatchRust(ThreadVars *t, - DetectEngineThreadCtx *det_ctx, +static int DetectDceIfaceMatchRust(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m); static int DetectDceIfaceSetup(DetectEngineCtx *, Signature *, const char *); @@ -276,7 +275,7 @@ static inline int DetectDceIfaceMatchIfaceVersion(const uint16_t version, * \retval 1 On Match. * \retval 0 On no match. */ -static int DetectDceIfaceMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectDceIfaceMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { @@ -340,15 +339,14 @@ end: SCReturnInt(ret); } -static int DetectDceIfaceMatchRust(ThreadVars *t, - DetectEngineThreadCtx *det_ctx, +static int DetectDceIfaceMatchRust(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { SCEnter(); if (f->alproto == ALPROTO_DCERPC) { - return DetectDceIfaceMatch(t, det_ctx, f, flags, + return DetectDceIfaceMatch(det_ctx, f, flags, state, txv, s, m); } diff --git a/src/detect-dce-opnum.c b/src/detect-dce-opnum.c index 11166484ae..8d841d6e36 100644 --- a/src/detect-dce-opnum.c +++ b/src/detect-dce-opnum.c @@ -56,10 +56,9 @@ static pcre *parse_regex = NULL; static pcre_extra *parse_regex_study = NULL; -static int DetectDceOpnumMatchRust(ThreadVars *t, - DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *state, void *txv, - const Signature *s, const SigMatchCtx *m); +static int DetectDceOpnumMatchRust(DetectEngineThreadCtx *det_ctx, + Flow *f, uint8_t flags, void *state, void *txv, + const Signature *s, const SigMatchCtx *m); static int DetectDceOpnumSetup(DetectEngineCtx *, Signature *, const char *); static void DetectDceOpnumFree(void *); static void DetectDceOpnumRegisterTests(void); @@ -243,7 +242,7 @@ static DetectDceOpnumData *DetectDceOpnumArgParse(const char *arg) * \retval 1 On Match. * \retval 0 On no match. */ -static int DetectDceOpnumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectDceOpnumMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { @@ -275,15 +274,14 @@ static int DetectDceOpnumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, SCReturnInt(0); } -static int DetectDceOpnumMatchRust(ThreadVars *t, - DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *state, void *txv, - const Signature *s, const SigMatchCtx *m) +static int DetectDceOpnumMatchRust(DetectEngineThreadCtx *det_ctx, + Flow *f, uint8_t flags, void *state, void *txv, + const Signature *s, const SigMatchCtx *m) { SCEnter(); if (f->alproto == ALPROTO_DCERPC) { - return DetectDceOpnumMatch(t, det_ctx, f, flags, + return DetectDceOpnumMatch(det_ctx, f, flags, state, txv, s, m); } diff --git a/src/detect-detection-filter.c b/src/detect-detection-filter.c index f091db86b4..60676fc3b2 100644 --- a/src/detect-detection-filter.c +++ b/src/detect-detection-filter.c @@ -51,7 +51,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectDetectionFilterMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectDetectionFilterMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectDetectionFilterSetup(DetectEngineCtx *, Signature *, const char *); static void DetectDetectionFilterRegisterTests(void); @@ -75,7 +75,7 @@ void DetectDetectionFilterRegister (void) DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study); } -static int DetectDetectionFilterMatch (ThreadVars *thv, DetectEngineThreadCtx *det_ctx, +static int DetectDetectionFilterMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { return 1; diff --git a/src/detect-dnp3.c b/src/detect-dnp3.c index 2ff1b32e95..ab2625394b 100644 --- a/src/detect-dnp3.c +++ b/src/detect-dnp3.c @@ -423,7 +423,7 @@ static void DetectDNP3Free(void *ptr) SCReturn; } -static int DetectDNP3FuncMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectDNP3FuncMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) { @@ -441,7 +441,7 @@ static int DetectDNP3FuncMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, return match; } -static int DetectDNP3ObjMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectDNP3ObjMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) { @@ -469,7 +469,7 @@ static int DetectDNP3ObjMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, return 0; } -static int DetectDNP3IndMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectDNP3IndMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) { diff --git a/src/detect-dsize.c b/src/detect-dsize.c index adbc0802b1..c92adfc7ad 100644 --- a/src/detect-dsize.c +++ b/src/detect-dsize.c @@ -50,7 +50,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectDsizeMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectDsizeMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectDsizeSetup (DetectEngineCtx *, Signature *s, const char *str); static void DsizeRegisterTests(void); @@ -107,7 +107,7 @@ DsizeMatch(const uint16_t psize, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -static int DetectDsizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectDsizeMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { SCEnter(); diff --git a/src/detect-engine-alert.c b/src/detect-engine-alert.c index d2401b57af..528e5b3cd1 100644 --- a/src/detect-engine-alert.c +++ b/src/detect-engine-alert.c @@ -254,7 +254,7 @@ void PacketAlertFinalize(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx while (1) { /* tags are set only for alerts */ KEYWORD_PROFILING_START; - sigmatch_table[smd->type].Match(NULL, det_ctx, p, (Signature *)s, smd->ctx); + sigmatch_table[smd->type].Match(det_ctx, p, (Signature *)s, smd->ctx); KEYWORD_PROFILING_END(det_ctx, smd->type, 1); if (smd->is_last) break; diff --git a/src/detect-engine-event.c b/src/detect-engine-event.c index 8665d73189..486d4968e6 100644 --- a/src/detect-engine-event.c +++ b/src/detect-engine-event.c @@ -47,7 +47,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectEngineEventMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectEngineEventMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectEngineEventSetup (DetectEngineCtx *, Signature *, const char *); static int DetectDecodeEventSetup (DetectEngineCtx *, Signature *, const char *); @@ -93,7 +93,7 @@ void DetectEngineEventRegister (void) * \retval 0 no match * \retval 1 match */ -static int DetectEngineEventMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectEngineEventMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { SCEnter(); @@ -367,7 +367,7 @@ static int EngineEventTestParse06 (void) sm->type = DETECT_DECODE_EVENT; sm->ctx = (SigMatchCtx *)de; - ret = DetectEngineEventMatch(&tv,NULL,p,NULL,sm->ctx); + ret = DetectEngineEventMatch(NULL,p,NULL,sm->ctx); if(ret) { SCFree(p); diff --git a/src/detect-engine-file.c b/src/detect-engine-file.c index dee3c584e0..a6f8cfa058 100644 --- a/src/detect-engine-file.c +++ b/src/detect-engine-file.c @@ -144,7 +144,7 @@ static int DetectFileInspect(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, if (sigmatch_table[smd->type].FileMatch != NULL) { KEYWORD_PROFILING_START; match = sigmatch_table[smd->type]. - FileMatch(tv, det_ctx, f, flags, file, s, smd->ctx); + FileMatch(det_ctx, f, flags, file, s, smd->ctx); KEYWORD_PROFILING_END(det_ctx, smd->type, (match > 0)); if (match == 0) { r = DETECT_ENGINE_INSPECT_SIG_CANT_MATCH_FILES; @@ -178,7 +178,7 @@ static int DetectFileInspect(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, if (fd->scope > FILESTORE_SCOPE_DEFAULT) { KEYWORD_PROFILING_START; match = sigmatch_table[smd->type]. - FileMatch(tv, det_ctx, f, flags, /* no file */NULL, s, smd->ctx); + FileMatch(det_ctx, f, flags, /* no file */NULL, s, smd->ctx); KEYWORD_PROFILING_END(det_ctx, smd->type, (match > 0)); if (match == 1) { diff --git a/src/detect-engine-iponly.c b/src/detect-engine-iponly.c index 0b2870dd32..33c715b70c 100644 --- a/src/detect-engine-iponly.c +++ b/src/detect-engine-iponly.c @@ -952,7 +952,7 @@ int IPOnlyMatchCompatSMs(ThreadVars *tv, while (1) { DEBUG_VALIDATE_BUG_ON(!(sigmatch_table[smd->type].flags & SIGMATCH_IPONLY_COMPAT)); KEYWORD_PROFILING_START; - if (sigmatch_table[smd->type].Match(tv, det_ctx, p, s, smd->ctx) > 0) { + if (sigmatch_table[smd->type].Match(det_ctx, p, s, smd->ctx) > 0) { KEYWORD_PROFILING_END(det_ctx, smd->type, 1); if (smd->is_last) break; @@ -1082,7 +1082,7 @@ void IPOnlyMatchPacket(ThreadVars *tv, if (smd != NULL) { while (1) { KEYWORD_PROFILING_START; - (void)sigmatch_table[smd->type].Match(tv, det_ctx, p, s, smd->ctx); + (void)sigmatch_table[smd->type].Match(det_ctx, p, s, smd->ctx); KEYWORD_PROFILING_END(det_ctx, smd->type, 1); if (smd->is_last) break; diff --git a/src/detect-engine.c b/src/detect-engine.c index c749567309..7c078d8137 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -1131,7 +1131,7 @@ static bool DetectEngineInspectRulePacketMatches( SCLogDebug("running match functions, sm %p", smd); while (1) { KEYWORD_PROFILING_START; - if (sigmatch_table[smd->type].Match(tv, det_ctx, p, s, smd->ctx) <= 0) { + if (sigmatch_table[smd->type].Match(det_ctx, p, s, smd->ctx) <= 0) { KEYWORD_PROFILING_END(det_ctx, smd->type, 0); SCLogDebug("no match"); return false; @@ -1350,14 +1350,10 @@ int DetectEngineInspectGenericList(ThreadVars *tv, if (smd != NULL) { while (1) { int match = 0; -#ifdef PROFILING KEYWORD_PROFILING_START; -#endif match = sigmatch_table[smd->type]. - AppLayerTxMatch(tv, det_ctx, f, flags, alstate, txv, s, smd->ctx); -#ifdef PROFILING + AppLayerTxMatch(det_ctx, f, flags, alstate, txv, s, smd->ctx); KEYWORD_PROFILING_END(det_ctx, smd->type, (match == 1)); -#endif if (match == 0) return DETECT_ENGINE_INSPECT_SIG_NO_MATCH; if (match == 2) { diff --git a/src/detect-file-hash-common.c b/src/detect-file-hash-common.c index e3d84fc00c..fd666dcbce 100644 --- a/src/detect-file-hash-common.c +++ b/src/detect-file-hash-common.c @@ -135,7 +135,6 @@ static int HashMatchHashTable(ROHashTable *hash_table, uint8_t *hash, /** * \brief Match the specified file hash * - * \param t thread local vars * \param det_ctx pattern matcher thread local data * \param f *LOCKED* flow * \param flags direction flags @@ -146,7 +145,7 @@ static int HashMatchHashTable(ROHashTable *hash_table, uint8_t *hash, * \retval 0 no match * \retval 1 match */ -int DetectFileHashMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +int DetectFileHashMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m) { SCEnter(); diff --git a/src/detect-file-hash-common.h b/src/detect-file-hash-common.h index c05ca9ec9f..85cadfbd9e 100644 --- a/src/detect-file-hash-common.h +++ b/src/detect-file-hash-common.h @@ -37,7 +37,7 @@ typedef struct DetectFileHashData_ { int ReadHashString(uint8_t *, const char *, const char *, int, uint16_t); int LoadHashTable(ROHashTable *, const char *, const char *, int, uint32_t); -int DetectFileHashMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, +int DetectFileHashMatch(DetectEngineThreadCtx *, Flow *, uint8_t, File *, const Signature *, const SigMatchCtx *); int DetectFileHashSetup(DetectEngineCtx *, Signature *, const char *, uint32_t, int); void DetectFileHashFree(void *); diff --git a/src/detect-fileext.c b/src/detect-fileext.c index e3c550c2e0..b1f590946c 100644 --- a/src/detect-fileext.c +++ b/src/detect-fileext.c @@ -51,7 +51,7 @@ #include "stream-tcp.h" #include "detect-fileext.h" -static int DetectFileextMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectFileextMatch (DetectEngineThreadCtx *, Flow *, uint8_t, File *, const Signature *, const SigMatchCtx *); static int DetectFileextSetup (DetectEngineCtx *, Signature *, const char *); static void DetectFileextRegisterTests(void); @@ -93,7 +93,7 @@ void DetectFileextRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectFileextMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFileextMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m) { SCEnter(); diff --git a/src/detect-filemagic.c b/src/detect-filemagic.c index bd9b34993e..ca2faab976 100644 --- a/src/detect-filemagic.c +++ b/src/detect-filemagic.c @@ -78,7 +78,7 @@ void DetectFilemagicRegister(void) #else /* HAVE_MAGIC */ -static int DetectFilemagicMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectFilemagicMatch (DetectEngineThreadCtx *, Flow *, uint8_t, File *, const Signature *, const SigMatchCtx *); static int DetectFilemagicSetup (DetectEngineCtx *, Signature *, const char *); static void DetectFilemagicRegisterTests(void); @@ -231,7 +231,7 @@ static int FilemagicThreadLookup(magic_t *ctx, File *file) * \retval 0 no match * \retval 1 match */ -static int DetectFilemagicMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFilemagicMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m) { SCEnter(); diff --git a/src/detect-filename.c b/src/detect-filename.c index e57f051a9c..bbe91a7f40 100644 --- a/src/detect-filename.c +++ b/src/detect-filename.c @@ -54,7 +54,7 @@ #include "detect-filename.h" #include "app-layer-parser.h" -static int DetectFilenameMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectFilenameMatch (DetectEngineThreadCtx *, Flow *, uint8_t, File *, const Signature *, const SigMatchCtx *); static int DetectFilenameSetup (DetectEngineCtx *, Signature *, const char *); static int DetectFilenameSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const char *str); @@ -173,7 +173,7 @@ void DetectFilenameRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectFilenameMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFilenameMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m) { SCEnter(); diff --git a/src/detect-filesize.c b/src/detect-filesize.c index 1e18178ec4..a62de03e6c 100644 --- a/src/detect-filesize.c +++ b/src/detect-filesize.c @@ -50,7 +50,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /*prototypes*/ -static int DetectFilesizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, +static int DetectFilesizeMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m); static int DetectFilesizeSetup (DetectEngineCtx *, Signature *, const char *); static void DetectFilesizeFree (void *); @@ -90,7 +90,7 @@ void DetectFilesizeRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectFilesizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, +static int DetectFilesizeMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m) { SCEnter(); diff --git a/src/detect-filestore.c b/src/detect-filestore.c index 1114974140..9667d52ca6 100644 --- a/src/detect-filestore.c +++ b/src/detect-filestore.c @@ -60,9 +60,9 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectFilestoreMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectFilestoreMatch (DetectEngineThreadCtx *, Flow *, uint8_t, File *, const Signature *, const SigMatchCtx *); -static int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFilestorePostMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx); static int DetectFilestoreSetup (DetectEngineCtx *, Signature *, const char *); static void DetectFilestoreFree(void *); @@ -190,7 +190,7 @@ static int FilestorePostMatchWithOptions(Packet *p, Flow *f, const DetectFilesto * When we are sure all parts of the signature matched, we run this function * to finalize the filestore. */ -static int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFilestorePostMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { uint8_t flags = 0; @@ -253,7 +253,7 @@ static int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ct * \todo when we start supporting more protocols, the logic in this function * needs to be put behind a api. */ -static int DetectFilestoreMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, +static int DetectFilestoreMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m) { uint32_t file_id = 0; diff --git a/src/detect-flow.c b/src/detect-flow.c index a47808edb2..236025b4d3 100644 --- a/src/detect-flow.c +++ b/src/detect-flow.c @@ -49,7 +49,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectFlowMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +int DetectFlowMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectFlowSetup (DetectEngineCtx *, Signature *, const char *); void DetectFlowRegisterTests(void); @@ -133,7 +133,7 @@ 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, +int DetectFlowMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { SCEnter(); diff --git a/src/detect-flowbits.c b/src/detect-flowbits.c index efb946d66c..651303bd0a 100644 --- a/src/detect-flowbits.c +++ b/src/detect-flowbits.c @@ -49,7 +49,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectFlowbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +int DetectFlowbitMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectFlowbitSetup (DetectEngineCtx *, Signature *, const char *); void DetectFlowbitFree (void *); @@ -123,7 +123,7 @@ static int DetectFlowbitMatchIsnotset (Packet *p, const DetectFlowbitsData *fd) * -1: error */ -int DetectFlowbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +int DetectFlowbitMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectFlowbitsData *fd = (const DetectFlowbitsData *)ctx; diff --git a/src/detect-flowint.c b/src/detect-flowint.c index 59fb0d8faf..42d5a3b7a3 100644 --- a/src/detect-flowint.c +++ b/src/detect-flowint.c @@ -53,7 +53,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectFlowintMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +int DetectFlowintMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectFlowintSetup(DetectEngineCtx *, Signature *, const char *); void DetectFlowintFree(void *); @@ -86,7 +86,7 @@ void DetectFlowintRegister(void) * \retval 1 match, when a var is initialized well, add/substracted, or a true * condition */ -int DetectFlowintMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +int DetectFlowintMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectFlowintData *sfd = (const DetectFlowintData *)ctx; diff --git a/src/detect-flowvar.c b/src/detect-flowvar.c index 3025df14f1..18850cc39f 100644 --- a/src/detect-flowvar.c +++ b/src/detect-flowvar.c @@ -45,10 +45,10 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectFlowvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +int DetectFlowvarMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectFlowvarSetup (DetectEngineCtx *, Signature *, const char *); -static int DetectFlowvarPostMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, +static int DetectFlowvarPostMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx); static void DetectFlowvarDataFree(void *ptr); @@ -96,7 +96,7 @@ static void DetectFlowvarDataFree(void *ptr) * -1: error */ -int DetectFlowvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +int DetectFlowvarMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { int ret = 0; @@ -291,7 +291,7 @@ error: * \param sm sigmatch containing the idx to store * \retval 1 or -1 in case of error */ -static int DetectFlowvarPostMatch(ThreadVars *tv, +static int DetectFlowvarPostMatch( DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { diff --git a/src/detect-fragbits.c b/src/detect-fragbits.c index a09041d366..06e5efc375 100644 --- a/src/detect-fragbits.c +++ b/src/detect-fragbits.c @@ -68,7 +68,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectFragBitsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectFragBitsMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectFragBitsSetup (DetectEngineCtx *, Signature *, const char *); static void DetectFragBitsFree(void *); @@ -136,7 +136,7 @@ FragBitsMatch(const uint8_t pbits, const uint8_t modifier, * \retval 0 no match * \retval 1 match */ -static int DetectFragBitsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFragBitsMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { if (!ctx || !PKT_IS_IPV4(p) || PKT_IS_PSEUDOPKT(p)) @@ -496,7 +496,7 @@ static int FragBitsTestParse03 (void) sm->type = DETECT_FRAGBITS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFragBitsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFragBitsMatch(NULL, p, NULL, sm->ctx); FAIL_IF(ret == 0); FlowShutdown(); @@ -586,7 +586,7 @@ static int FragBitsTestParse04 (void) sm->type = DETECT_FRAGBITS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFragBitsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFragBitsMatch(NULL, p, NULL, sm->ctx); FAIL_IF(ret); SCFree(de); SCFree(sm); diff --git a/src/detect-fragoffset.c b/src/detect-fragoffset.c index 052aa82ac3..7599703b4a 100644 --- a/src/detect-fragoffset.c +++ b/src/detect-fragoffset.c @@ -44,7 +44,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectFragOffsetMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectFragOffsetMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectFragOffsetSetup(DetectEngineCtx *, Signature *, const char *); void DetectFragOffsetRegisterTests(void); @@ -103,7 +103,7 @@ static inline int FragOffsetMatch(const uint16_t poffset, const uint8_t mode, * \retval 1 match * */ -static int DetectFragOffsetMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFragOffsetMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { uint16_t frag = 0; diff --git a/src/detect-ftpbounce.c b/src/detect-ftpbounce.c index 4f1eedaf01..ef66ab80d0 100644 --- a/src/detect-ftpbounce.c +++ b/src/detect-ftpbounce.c @@ -47,7 +47,7 @@ #include "stream-tcp.h" #include "util-byte.h" -static int DetectFtpbounceALMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectFtpbounceALMatch(DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); @@ -186,7 +186,7 @@ static int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len, * \retval 0 no match * \retval 1 match */ -static int DetectFtpbounceALMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFtpbounceALMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) diff --git a/src/detect-ftpdata.c b/src/detect-ftpdata.c index 1e186d7d31..b5c19b275f 100644 --- a/src/detect-ftpdata.c +++ b/src/detect-ftpdata.c @@ -42,7 +42,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /* Prototypes of functions registered in DetectFtpdataRegister below */ -static int DetectFtpdataMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectFtpdataMatch(DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectFtpdataSetup (DetectEngineCtx *, Signature *, const char *); @@ -109,7 +109,7 @@ static int DetectEngineInspectFtpdataGeneric(ThreadVars *tv, * \retval 0 no match * \retval 1 match */ -static int DetectFtpdataMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectFtpdataMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) diff --git a/src/detect-geoip.c b/src/detect-geoip.c index dfda987206..a231e52e6f 100644 --- a/src/detect-geoip.c +++ b/src/detect-geoip.c @@ -61,7 +61,7 @@ void DetectGeoipRegister(void) #include -static int DetectGeoipMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectGeoipMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectGeoipSetup(DetectEngineCtx *, Signature *, const char *); static void DetectGeoipRegisterTests(void); @@ -163,7 +163,7 @@ static int CheckGeoMatchIPv4(const DetectGeoipData *geoipdata, uint32_t ip) * \retval 0 no match * \retval 1 match */ -static int DetectGeoipMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectGeoipMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectGeoipData *geoipdata = (const DetectGeoipData *)ctx; diff --git a/src/detect-hostbits.c b/src/detect-hostbits.c index 76aa7fa2e0..abc840188b 100644 --- a/src/detect-hostbits.c +++ b/src/detect-hostbits.c @@ -68,7 +68,7 @@ TODO: static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectHostbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectHostbitMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectHostbitSetup (DetectEngineCtx *, Signature *, const char *); void DetectHostbitFree (void *); @@ -266,7 +266,7 @@ int DetectXbitMatchHost(Packet *p, const DetectXbitsData *xd) * -1: error */ -static int DetectHostbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectHostbitMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectXbitsData *xd = (const DetectXbitsData *)ctx; diff --git a/src/detect-icmp-id.c b/src/detect-icmp-id.c index 82da577c97..499c1fedcb 100644 --- a/src/detect-icmp-id.c +++ b/src/detect-icmp-id.c @@ -43,7 +43,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectIcmpIdMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectIcmpIdMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectIcmpIdSetup(DetectEngineCtx *, Signature *, const char *); void DetectIcmpIdRegisterTests(void); @@ -130,7 +130,7 @@ static inline _Bool GetIcmpId(Packet *p, uint16_t *id) * \retval 0 no match * \retval 1 match */ -static int DetectIcmpIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectIcmpIdMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { uint16_t pid; diff --git a/src/detect-icmp-seq.c b/src/detect-icmp-seq.c index 27313df684..e9875b5cb4 100644 --- a/src/detect-icmp-seq.c +++ b/src/detect-icmp-seq.c @@ -43,7 +43,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectIcmpSeqMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectIcmpSeqMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectIcmpSeqSetup(DetectEngineCtx *, Signature *, const char *); void DetectIcmpSeqRegisterTests(void); @@ -132,7 +132,7 @@ static inline _Bool GetIcmpSeq(Packet *p, uint16_t *seq) * \retval 0 no match * \retval 1 match */ -static int DetectIcmpSeqMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectIcmpSeqMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { uint16_t seqn; diff --git a/src/detect-icode.c b/src/detect-icode.c index 0faf454934..40f5c70ba5 100644 --- a/src/detect-icode.c +++ b/src/detect-icode.c @@ -46,7 +46,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectICodeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectICodeMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectICodeSetup(DetectEngineCtx *, Signature *, const char *); void DetectICodeRegisterTests(void); @@ -116,7 +116,7 @@ static inline int ICodeMatch(const uint8_t pcode, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -static int DetectICodeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectICodeMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { if (PKT_IS_PSEUDOPKT(p)) diff --git a/src/detect-id.c b/src/detect-id.c index c1010b2160..235a09c61d 100644 --- a/src/detect-id.c +++ b/src/detect-id.c @@ -49,7 +49,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectIdMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectIdMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectIdSetup (DetectEngineCtx *, Signature *, const char *); void DetectIdRegisterTests(void); @@ -88,7 +88,7 @@ void DetectIdRegister (void) * \retval 0 no match * \retval 1 match */ -static int DetectIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectIdMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectIdData *id_d = (const DetectIdData *)ctx; diff --git a/src/detect-ipopts.c b/src/detect-ipopts.c index ed826b58e9..952ef2100a 100644 --- a/src/detect-ipopts.c +++ b/src/detect-ipopts.c @@ -43,7 +43,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectIpOptsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectIpOptsMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectIpOptsSetup (DetectEngineCtx *, Signature *, const char *); void IpOptsRegisterTests(void); @@ -99,7 +99,7 @@ struct DetectIpOpts_ { * \retval 0 no match * \retval 1 match */ -static int DetectIpOptsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectIpOptsMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectIpOptsData *de = (const DetectIpOptsData *)ctx; @@ -287,7 +287,7 @@ static int IpOptsTestParse03 (void) sm->type = DETECT_IPOPTS; sm->ctx = (SigMatchCtx *)de; - ret = DetectIpOptsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectIpOptsMatch(NULL, p, NULL, sm->ctx); if(ret) { SCFree(p); @@ -337,7 +337,7 @@ static int IpOptsTestParse04 (void) sm->type = DETECT_IPOPTS; sm->ctx = (SigMatchCtx *)de; - ret = DetectIpOptsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectIpOptsMatch(NULL, p, NULL, sm->ctx); if(ret) { SCFree(p); diff --git a/src/detect-iprep.c b/src/detect-iprep.c index 765ceabdae..be1a91afd7 100644 --- a/src/detect-iprep.c +++ b/src/detect-iprep.c @@ -52,7 +52,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectIPRepMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectIPRepMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectIPRepSetup (DetectEngineCtx *, Signature *, const char *); void DetectIPRepFree (void *); @@ -167,7 +167,7 @@ static inline int RepMatch(uint8_t op, uint8_t val1, uint8_t val2) * 1: match * -1: error */ -static int DetectIPRepMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectIPRepMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectIPRepData *rd = (const DetectIPRepData *)ctx; diff --git a/src/detect-itype.c b/src/detect-itype.c index 8546c92bcb..5637cfabba 100644 --- a/src/detect-itype.c +++ b/src/detect-itype.c @@ -46,7 +46,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectITypeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectITypeMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectITypeSetup(DetectEngineCtx *, Signature *, const char *); void DetectITypeRegisterTests(void); @@ -116,7 +116,7 @@ static inline int ITypeMatch(const uint8_t ptype, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -static int DetectITypeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectITypeMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { if (PKT_IS_PSEUDOPKT(p)) diff --git a/src/detect-krb5-errcode.c b/src/detect-krb5-errcode.c index fb61819544..60e937d1a2 100644 --- a/src/detect-krb5-errcode.c +++ b/src/detect-krb5-errcode.c @@ -42,7 +42,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /* Prototypes of functions registered in DetectKrb5ErrCodeRegister below */ -static int DetectKrb5ErrCodeMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectKrb5ErrCodeMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectKrb5ErrCodeSetup (DetectEngineCtx *, Signature *, const char *); @@ -108,7 +108,7 @@ static int DetectEngineInspectKRB5Generic(ThreadVars *tv, * \retval 0 no match * \retval 1 match */ -static int DetectKrb5ErrCodeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectKrb5ErrCodeMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) diff --git a/src/detect-krb5-msgtype.c b/src/detect-krb5-msgtype.c index 9ec9449709..9f6132f2cc 100644 --- a/src/detect-krb5-msgtype.c +++ b/src/detect-krb5-msgtype.c @@ -42,7 +42,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /* Prototypes of functions registered in DetectKrb5MsgTypeRegister below */ -static int DetectKrb5MsgTypeMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectKrb5MsgTypeMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectKrb5MsgTypeSetup (DetectEngineCtx *, Signature *, const char *); @@ -108,7 +108,7 @@ static int DetectEngineInspectKRB5Generic(ThreadVars *tv, * \retval 0 no match * \retval 1 match */ -static int DetectKrb5MsgTypeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectKrb5MsgTypeMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) diff --git a/src/detect-lua.c b/src/detect-lua.c index 90f1e1d016..5d8bc47f5a 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -88,9 +88,9 @@ void DetectLuaRegister(void) #include "util-lua.h" -static int DetectLuaMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectLuaMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); -static int DetectLuaAppTxMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectLuaAppTxMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx); @@ -319,7 +319,7 @@ int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx, * \retval 0 no match * \retval 1 match */ -static int DetectLuaMatch (ThreadVars *tv, DetectEngineThreadCtx *det_ctx, +static int DetectLuaMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { SCEnter(); @@ -339,7 +339,7 @@ static int DetectLuaMatch (ThreadVars *tv, DetectEngineThreadCtx *det_ctx, else if (p->flowflags & FLOW_PKT_TOCLIENT) flags = STREAM_TOCLIENT; - LuaStateSetThreadVars(tlua->luastate, tv); + LuaStateSetThreadVars(tlua->luastate, det_ctx->tv); LuaExtensionsMatchSetup(tlua->luastate, lua, det_ctx, p->flow, p, flags); @@ -451,7 +451,7 @@ static int DetectLuaMatch (ThreadVars *tv, DetectEngineThreadCtx *det_ctx, SCReturnInt(ret); } -static int DetectLuaAppMatchCommon (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectLuaAppMatchCommon (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, const Signature *s, const SigMatchCtx *ctx) { @@ -564,12 +564,12 @@ static int DetectLuaAppMatchCommon (ThreadVars *t, DetectEngineThreadCtx *det_ct * \retval 0 no match * \retval 1 match */ -static int DetectLuaAppTxMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectLuaAppTxMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) { - return DetectLuaAppMatchCommon(t, det_ctx, f, flags, state, s, ctx); + return DetectLuaAppMatchCommon(det_ctx, f, flags, state, s, ctx); } #ifdef UNITTESTS diff --git a/src/detect-mark.c b/src/detect-mark.c index 093f1b126f..2ec6982b7e 100644 --- a/src/detect-mark.c +++ b/src/detect-mark.c @@ -43,7 +43,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; static int DetectMarkSetup (DetectEngineCtx *, Signature *, const char *); -static int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectMarkPacket(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx); void DetectMarkDataFree(void *ptr); @@ -214,7 +214,7 @@ void DetectMarkDataFree(void *ptr) } -static int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectMarkPacket(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { #ifdef NFQ diff --git a/src/detect-nfs-procedure.c b/src/detect-nfs-procedure.c index 935c830745..5fafcdc2a1 100644 --- a/src/detect-nfs-procedure.c +++ b/src/detect-nfs-procedure.c @@ -81,7 +81,7 @@ static int DetectEngineInspectNfsRequestGeneric(ThreadVars *tv, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); -static int DetectNfsProcedureMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectNfsProcedureMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); @@ -172,7 +172,7 @@ ProcedureMatch(const uint32_t procedure, * \retval 0 no match. * \retval 1 match. */ -static int DetectNfsProcedureMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectNfsProcedureMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) diff --git a/src/detect-nfs-version.c b/src/detect-nfs-version.c index e39b4cdba2..908a2b4e58 100644 --- a/src/detect-nfs-version.c +++ b/src/detect-nfs-version.c @@ -81,7 +81,7 @@ static int DetectEngineInspectNfsRequestGeneric(ThreadVars *tv, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); -static int DetectNfsVersionMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectNfsVersionMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); @@ -169,7 +169,7 @@ VersionMatch(const uint32_t version, * \retval 0 no match. * \retval 1 match. */ -static int DetectNfsVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectNfsVersionMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) diff --git a/src/detect-pktvar.c b/src/detect-pktvar.c index 4546efbf70..e2b4bd789a 100644 --- a/src/detect-pktvar.c +++ b/src/detect-pktvar.c @@ -40,7 +40,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectPktvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectPktvarMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectPktvarSetup (DetectEngineCtx *, Signature *, const char *); @@ -61,7 +61,7 @@ void DetectPktvarRegister (void) * -1: error */ -static int DetectPktvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectPktvarMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { int ret = 0; diff --git a/src/detect-replace.c b/src/detect-replace.c index 8e3b2aa707..b17cb6d666 100644 --- a/src/detect-replace.c +++ b/src/detect-replace.c @@ -62,8 +62,7 @@ extern int run_mode; static int DetectReplaceSetup(DetectEngineCtx *, Signature *, const char *); void DetectReplaceRegisterTests(void); -static int DetectReplacePostMatch(ThreadVars *tv, - DetectEngineThreadCtx *det_ctx, +static int DetectReplacePostMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx); void DetectReplaceRegister (void) @@ -76,8 +75,7 @@ void DetectReplaceRegister (void) sigmatch_table[DETECT_REPLACE].flags = (SIGMATCH_QUOTES_MANDATORY|SIGMATCH_HANDLE_NEGATION); } -static int DetectReplacePostMatch(ThreadVars *tv, - DetectEngineThreadCtx *det_ctx, +static int DetectReplacePostMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { if (det_ctx->replist) { diff --git a/src/detect-rpc.c b/src/detect-rpc.c index d40733f48d..abd28dc25c 100644 --- a/src/detect-rpc.c +++ b/src/detect-rpc.c @@ -48,7 +48,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectRpcMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectRpcMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectRpcSetup (DetectEngineCtx *, Signature *, const char *); void DetectRpcRegisterTests(void); @@ -87,7 +87,7 @@ void DetectRpcRegister (void) * \retval 0 no match * \retval 1 match */ -static int DetectRpcMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectRpcMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { /* PrintRawDataFp(stdout, p->payload, p->payload_len); */ diff --git a/src/detect-sameip.c b/src/detect-sameip.c index 828157461b..61d7d32c2f 100644 --- a/src/detect-sameip.c +++ b/src/detect-sameip.c @@ -37,7 +37,7 @@ #include "util-unittest.h" #include "util-unittest-helper.h" -static int DetectSameipMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectSameipMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectSameipSetup(DetectEngineCtx *, Signature *, const char *); static void DetectSameipRegisterTests(void); @@ -70,7 +70,7 @@ void DetectSameipRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectSameipMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectSameipMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { return CMP_ADDR(&p->src, &p->dst) ? 1 : 0; diff --git a/src/detect-snmp-pdu_type.c b/src/detect-snmp-pdu_type.c index 162826eddf..cd78ede521 100644 --- a/src/detect-snmp-pdu_type.c +++ b/src/detect-snmp-pdu_type.c @@ -58,7 +58,7 @@ static int DetectEngineInspectSNMPRequestGeneric(ThreadVars *tv, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); -static int DetectSNMPPduTypeMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectSNMPPduTypeMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); @@ -115,7 +115,7 @@ static int DetectEngineInspectSNMPRequestGeneric(ThreadVars *tv, * \retval 0 no match. * \retval 1 match. */ -static int DetectSNMPPduTypeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectSNMPPduTypeMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) diff --git a/src/detect-snmp-version.c b/src/detect-snmp-version.c index e8180797f4..206045825c 100644 --- a/src/detect-snmp-version.c +++ b/src/detect-snmp-version.c @@ -67,7 +67,7 @@ static int DetectEngineInspectSNMPRequestGeneric(ThreadVars *tv, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); -static int DetectSNMPVersionMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectSNMPVersionMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); @@ -156,7 +156,7 @@ VersionMatch(const uint32_t version, * \retval 0 no match. * \retval 1 match. */ -static int DetectSNMPVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectSNMPVersionMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) diff --git a/src/detect-ssh-proto-version.c b/src/detect-ssh-proto-version.c index a541d1cc4d..3a76501c5a 100644 --- a/src/detect-ssh-proto-version.c +++ b/src/detect-ssh-proto-version.c @@ -62,7 +62,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectSshVersionMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectSshVersionMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectSshVersionSetup (DetectEngineCtx *, Signature *, const char *); @@ -101,7 +101,7 @@ void DetectSshVersionRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectSshVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectSshVersionMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { diff --git a/src/detect-ssh-software-version.c b/src/detect-ssh-software-version.c index 448429962b..50d0f3fafa 100644 --- a/src/detect-ssh-software-version.c +++ b/src/detect-ssh-software-version.c @@ -66,7 +66,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectSshSoftwareVersionMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectSshSoftwareVersionMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectSshSoftwareVersionSetup (DetectEngineCtx *, Signature *, const char *); @@ -122,7 +122,7 @@ void DetectSshSoftwareVersionRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectSshSoftwareVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectSshSoftwareVersionMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { diff --git a/src/detect-ssl-state.c b/src/detect-ssl-state.c index 691ad8fcaf..babfed13da 100644 --- a/src/detect-ssl-state.c +++ b/src/detect-ssl-state.c @@ -59,7 +59,7 @@ static pcre_extra *parse_regex1_study; static pcre *parse_regex2; static pcre_extra *parse_regex2_study; -static int DetectSslStateMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectSslStateMatch(DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectSslStateSetup(DetectEngineCtx *, Signature *, const char *); @@ -128,7 +128,7 @@ static int InspectTlsGeneric(ThreadVars *tv, * \retval 1 Match. * \retval 0 No match. */ -static int DetectSslStateMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectSslStateMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *alstate, void *txv, const Signature *s, const SigMatchCtx *m) { diff --git a/src/detect-ssl-version.c b/src/detect-ssl-version.c index ba205b817f..fabe77e8c1 100644 --- a/src/detect-ssl-version.c +++ b/src/detect-ssl-version.c @@ -60,7 +60,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectSslVersionMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectSslVersionMatch(DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectSslVersionSetup(DetectEngineCtx *, Signature *, const char *); @@ -98,7 +98,7 @@ void DetectSslVersionRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectSslVersionMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectSslVersionMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { diff --git a/src/detect-stream_size.c b/src/detect-stream_size.c index 5607f86811..b6c72c24f3 100644 --- a/src/detect-stream_size.c +++ b/src/detect-stream_size.c @@ -44,7 +44,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /*prototypes*/ -static int DetectStreamSizeMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectStreamSizeMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectStreamSizeSetup (DetectEngineCtx *, Signature *, const char *); void DetectStreamSizeFree(void *); @@ -124,7 +124,7 @@ static int DetectStreamSizeCompare (uint32_t diff, uint32_t stream_size, uint8_t * \retval 0 no match * \retval 1 match */ -static int DetectStreamSizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectStreamSizeMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { @@ -432,7 +432,7 @@ static int DetectStreamSizeParseTest03 (void) p->tcph = &tcph; sm.ctx = (SigMatchCtx*)sd; - result = DetectStreamSizeMatch(&tv, &dtx, p, &s, sm.ctx); + result = DetectStreamSizeMatch(&dtx, p, &s, sm.ctx); if (result == 0) { printf("result 0 != 1: "); } @@ -492,7 +492,7 @@ static int DetectStreamSizeParseTest04 (void) p->ip4h = &ip4h; sm.ctx = (SigMatchCtx*)sd; - if (!DetectStreamSizeMatch(&tv, &dtx, p, &s, sm.ctx)) + if (!DetectStreamSizeMatch(&dtx, p, &s, sm.ctx)) result = 1; SCFree(p); diff --git a/src/detect-tag.c b/src/detect-tag.c index f51113082f..cd735d43ae 100644 --- a/src/detect-tag.c +++ b/src/detect-tag.c @@ -57,7 +57,7 @@ SC_ATOMIC_EXTERN(unsigned int, num_tags); static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectTagMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectTagMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectTagSetup(DetectEngineCtx *, Signature *, const char *); void DetectTagRegisterTests(void); @@ -89,7 +89,7 @@ void DetectTagRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectTagMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectTagMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectTagData *td = (const DetectTagData *)ctx; diff --git a/src/detect-tcp-ack.c b/src/detect-tcp-ack.c index 94d8b1a021..313b79acfb 100644 --- a/src/detect-tcp-ack.c +++ b/src/detect-tcp-ack.c @@ -44,7 +44,7 @@ /* prototypes */ static int DetectAckSetup(DetectEngineCtx *, Signature *, const char *); -static int DetectAckMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectAckMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static void DetectAckRegisterTests(void); static void DetectAckFree(void *); @@ -79,7 +79,7 @@ void DetectAckRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectAckMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectAckMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectAckData *data = (const DetectAckData *)ctx; diff --git a/src/detect-tcp-flags.c b/src/detect-tcp-flags.c index c8055b3395..1312e62b88 100644 --- a/src/detect-tcp-flags.c +++ b/src/detect-tcp-flags.c @@ -58,7 +58,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectFlagsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectFlagsMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectFlagsSetup (DetectEngineCtx *, Signature *, const char *); static void DetectFlagsFree(void *); @@ -140,7 +140,7 @@ 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, +static int DetectFlagsMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { SCEnter(); @@ -681,7 +681,7 @@ static int FlagsTestParse03 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -736,7 +736,7 @@ static int FlagsTestParse04 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -792,7 +792,7 @@ static int FlagsTestParse05 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -848,7 +848,7 @@ static int FlagsTestParse06 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -903,7 +903,7 @@ static int FlagsTestParse07 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -959,7 +959,7 @@ static int FlagsTestParse08 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -1014,7 +1014,7 @@ static int FlagsTestParse09 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -1069,7 +1069,7 @@ static int FlagsTestParse10 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -1124,7 +1124,7 @@ static int FlagsTestParse11 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -1182,7 +1182,7 @@ static int FlagsTestParse12 (void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if(ret) { if (de) SCFree(de); @@ -1267,7 +1267,7 @@ static int FlagsTestParse15(void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if (ret) { if (de) @@ -1320,7 +1320,7 @@ static int FlagsTestParse16(void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if (ret) { if (de) @@ -1376,7 +1376,7 @@ static int FlagsTestParse17(void) sm->type = DETECT_FLAGS; sm->ctx = (SigMatchCtx *)de; - ret = DetectFlagsMatch(&tv, NULL, p, NULL, sm->ctx); + ret = DetectFlagsMatch(NULL, p, NULL, sm->ctx); if (ret == 0) { if (de) diff --git a/src/detect-tcp-seq.c b/src/detect-tcp-seq.c index 63c5242f34..c5790b9087 100644 --- a/src/detect-tcp-seq.c +++ b/src/detect-tcp-seq.c @@ -41,7 +41,7 @@ #include "util-debug.h" static int DetectSeqSetup(DetectEngineCtx *, Signature *, const char *); -static int DetectSeqMatch(ThreadVars *, DetectEngineThreadCtx *, +static int DetectSeqMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static void DetectSeqRegisterTests(void); static void DetectSeqFree(void *); @@ -75,7 +75,7 @@ void DetectSeqRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectSeqMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectSeqMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectSeqData *data = (const DetectSeqData *)ctx; diff --git a/src/detect-tcp-window.c b/src/detect-tcp-window.c index 2e3fbd962c..92665c880f 100644 --- a/src/detect-tcp-window.c +++ b/src/detect-tcp-window.c @@ -47,7 +47,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectWindowMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectWindowMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectWindowSetup(DetectEngineCtx *, Signature *, const char *); void DetectWindowRegisterTests(void); @@ -81,7 +81,7 @@ void DetectWindowRegister (void) * \retval 0 no match * \retval 1 match */ -static int DetectWindowMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectWindowMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectWindowData *wd = (const DetectWindowData *)ctx; diff --git a/src/detect-tcpmss.c b/src/detect-tcpmss.c index 6096d73876..4aa0c58a06 100644 --- a/src/detect-tcpmss.c +++ b/src/detect-tcpmss.c @@ -39,7 +39,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /* prototypes */ -static int DetectTcpmssMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectTcpmssMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectTcpmssSetup (DetectEngineCtx *, Signature *, const char *); void DetectTcpmssFree (void *); @@ -97,7 +97,7 @@ static inline int TcpmssMatch(const uint16_t parg, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -static int DetectTcpmssMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectTcpmssMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { diff --git a/src/detect-template.c b/src/detect-template.c index 0f41027ff1..5c410915dc 100644 --- a/src/detect-template.c +++ b/src/detect-template.c @@ -39,7 +39,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /* Prototypes of functions registered in DetectTemplateRegister below */ -static int DetectTemplateMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectTemplateMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectTemplateSetup (DetectEngineCtx *, Signature *, const char *); static void DetectTemplateFree (void *); @@ -86,7 +86,7 @@ void DetectTemplateRegister(void) { * \retval 0 no match * \retval 1 match */ -static int DetectTemplateMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectTemplateMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { int ret = 0; diff --git a/src/detect-template2.c b/src/detect-template2.c index d45684a3ad..e9b8d83965 100644 --- a/src/detect-template2.c +++ b/src/detect-template2.c @@ -39,7 +39,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /* prototypes */ -static int DetectTemplate2Match (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectTemplate2Match (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectTemplate2Setup (DetectEngineCtx *, Signature *, const char *); void DetectTemplate2Free (void *); @@ -97,7 +97,7 @@ static inline int Template2Match(const uint8_t parg, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -static int DetectTemplate2Match (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectTemplate2Match (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { diff --git a/src/detect-threshold.c b/src/detect-threshold.c index 88949b56b1..505d9459b7 100644 --- a/src/detect-threshold.c +++ b/src/detect-threshold.c @@ -64,7 +64,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectThresholdMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectThresholdMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectThresholdSetup(DetectEngineCtx *, Signature *, const char *); static void DetectThresholdFree(void *); @@ -88,7 +88,7 @@ void DetectThresholdRegister(void) DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study); } -static int DetectThresholdMatch(ThreadVars *thv, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectThresholdMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { return 1; diff --git a/src/detect-tls-cert-validity.c b/src/detect-tls-cert-validity.c index f772d89796..47a242d1e6 100644 --- a/src/detect-tls-cert-validity.c +++ b/src/detect-tls-cert-validity.c @@ -56,7 +56,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectTlsValidityMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, +static int DetectTlsValidityMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); @@ -163,7 +163,7 @@ static int DetectEngineInspectTlsValidity(ThreadVars *tv, * \retval 0 no match. * \retval 1 match. */ -static int DetectTlsValidityMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTlsValidityMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *ctx) diff --git a/src/detect-tls-version.c b/src/detect-tls-version.c index da038d6a02..dfd2a517a1 100644 --- a/src/detect-tls-version.c +++ b/src/detect-tls-version.c @@ -59,7 +59,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectTlsVersionMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectTlsVersionMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectTlsVersionSetup (DetectEngineCtx *, Signature *, const char *); @@ -100,7 +100,7 @@ void DetectTlsVersionRegister (void) * \retval 0 no match * \retval 1 match */ -static int DetectTlsVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTlsVersionMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { diff --git a/src/detect-tls.c b/src/detect-tls.c index e7ec14b582..cd7caaf9dd 100644 --- a/src/detect-tls.c +++ b/src/detect-tls.c @@ -74,28 +74,28 @@ static pcre_extra *issuerdn_parse_regex_study; static pcre *fingerprint_parse_regex; static pcre_extra *fingerprint_parse_regex_study; -static int DetectTlsSubjectMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectTlsSubjectMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectTlsSubjectSetup (DetectEngineCtx *, Signature *, const char *); static void DetectTlsSubjectRegisterTests(void); static void DetectTlsSubjectFree(void *); -static int DetectTlsIssuerDNMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectTlsIssuerDNMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectTlsIssuerDNSetup (DetectEngineCtx *, Signature *, const char *); static void DetectTlsIssuerDNRegisterTests(void); static void DetectTlsIssuerDNFree(void *); -static int DetectTlsFingerprintMatch (ThreadVars *, DetectEngineThreadCtx *, +static int DetectTlsFingerprintMatch (DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *, const Signature *, const SigMatchCtx *); static int DetectTlsFingerprintSetup (DetectEngineCtx *, Signature *, const char *); static void DetectTlsFingerprintFree(void *); static int DetectTlsStoreSetup (DetectEngineCtx *, Signature *, const char *); -static int DetectTlsStorePostMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTlsStorePostMatch (DetectEngineThreadCtx *det_ctx, Packet *, const Signature *s, const SigMatchCtx *unused); static int g_tls_cert_list_id = 0; @@ -177,7 +177,7 @@ void DetectTlsRegister (void) * \retval 0 no match * \retval 1 match */ -static int DetectTlsSubjectMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTlsSubjectMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { @@ -377,7 +377,7 @@ static void DetectTlsSubjectRegisterTests(void) * \retval 0 no match * \retval 1 match */ -static int DetectTlsIssuerDNMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTlsIssuerDNMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { @@ -641,7 +641,7 @@ error: * \retval 0 no match * \retval 1 match */ -static int DetectTlsFingerprintMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTlsFingerprintMatch (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, const SigMatchCtx *m) { @@ -777,7 +777,7 @@ static int DetectTlsStoreSetup (DetectEngineCtx *de_ctx, Signature *s, const cha } /** \warning modifies Flow::alstate */ -static int DetectTlsStorePostMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, +static int DetectTlsStorePostMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *unused) { SCEnter(); diff --git a/src/detect-tos.c b/src/detect-tos.c index 4f6c2339f0..48bb43c9c5 100644 --- a/src/detect-tos.c +++ b/src/detect-tos.c @@ -49,7 +49,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; static int DetectTosSetup(DetectEngineCtx *, Signature *, const char *); -static int DetectTosMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectTosMatch(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static void DetectTosRegisterTests(void); static void DetectTosFree(void *); @@ -86,7 +86,7 @@ void DetectTosRegister(void) * \retval 0 no match * \retval 1 match */ -static int DetectTosMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectTosMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectTosData *tosd = (const DetectTosData *)ctx; diff --git a/src/detect-ttl.c b/src/detect-ttl.c index aee5122d3a..00c57359f2 100644 --- a/src/detect-ttl.c +++ b/src/detect-ttl.c @@ -43,7 +43,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /* prototypes */ -static int DetectTtlMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, +static int DetectTtlMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectTtlSetup (DetectEngineCtx *, Signature *, const char *); void DetectTtlFree (void *); @@ -102,7 +102,7 @@ static inline int TtlMatch(const uint8_t pttl, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -static int DetectTtlMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, +static int DetectTtlMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { if (PKT_IS_PSEUDOPKT(p)) diff --git a/src/detect-xbits.c b/src/detect-xbits.c index e722193609..4e40636e34 100644 --- a/src/detect-xbits.c +++ b/src/detect-xbits.c @@ -57,7 +57,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectXbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); +static int DetectXbitMatch (DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectXbitSetup (DetectEngineCtx *, Signature *, const char *); void DetectXbitFree (void *); void XBitsRegisterTests(void); @@ -161,7 +161,7 @@ static int DetectXbitMatchIPPair(Packet *p, const DetectXbitsData *xd) * -1: error */ -static int DetectXbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) +static int DetectXbitMatch (DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectXbitsData *fd = (const DetectXbitsData *)ctx; if (fd == NULL) diff --git a/src/detect.c b/src/detect.c index d224747e17..7318aa0b30 100644 --- a/src/detect.c +++ b/src/detect.c @@ -157,7 +157,7 @@ static void DetectRunPostMatch(ThreadVars *tv, while (1) { KEYWORD_PROFILING_START; - (void)sigmatch_table[smd->type].Match(tv, det_ctx, p, s, smd->ctx); + (void)sigmatch_table[smd->type].Match(det_ctx, p, s, smd->ctx); KEYWORD_PROFILING_END(det_ctx, smd->type, 1); if (smd->is_last) break; diff --git a/src/detect.h b/src/detect.h index c2117d7a49..f5f90f68cb 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1150,16 +1150,15 @@ typedef struct DetectEngineThreadCtx_ { */ typedef struct SigTableElmt_ { /** Packet match function pointer */ - int (*Match)(ThreadVars *, DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); + int (*Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); /** AppLayer TX match function pointer */ - int (*AppLayerTxMatch)(ThreadVars *, DetectEngineThreadCtx *, Flow *, + int (*AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *); /** File match function pointer */ - int (*FileMatch)(ThreadVars *, /**< thread local vars */ - DetectEngineThreadCtx *, + int (*FileMatch)(DetectEngineThreadCtx *, Flow *, /**< *LOCKED* flow */ uint8_t flags, File *, const Signature *, const SigMatchCtx *);