diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index a7930dee85..3447ab3813 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -56,11 +56,11 @@ 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, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, + void *tx, uint64_t tx_id); + /** * \brief Registers the keyword handlers for the "app-layer-event" keyword. */ @@ -87,11 +87,10 @@ void DetectAppLayerEventRegister(void) } static int DetectEngineAptEventInspect(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *smi, + Flow *f, uint8_t flags, void *alstate, + void *tx, uint64_t tx_id) { AppLayerDecoderEvents *decoder_events = NULL; int r = 0; diff --git a/src/detect-dnp3.c b/src/detect-dnp3.c index 1a515905bb..92922e8f05 100644 --- a/src/detect-dnp3.c +++ b/src/detect-dnp3.c @@ -139,8 +139,8 @@ static char *TrimString(char *str) } static int DetectEngineInspectDNP3Data(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) + DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { SCEnter(); DNP3Transaction *tx = (DNP3Transaction *)txv; @@ -163,8 +163,8 @@ static int DetectEngineInspectDNP3Data(ThreadVars *tv, DetectEngineCtx *de_ctx, } static int DetectEngineInspectDNP3(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) + DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags, alstate, txv, tx_id, DETECT_SM_LIST_DNP3_MATCH); diff --git a/src/detect-engine-dns.c b/src/detect-engine-dns.c index b9a4ce39fa..4b15996195 100644 --- a/src/detect-engine-dns.c +++ b/src/detect-engine-dns.c @@ -61,10 +61,10 @@ * \retval 1 match */ int DetectEngineInspectDnsQueryName(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, + void *txv, uint64_t tx_id) { DNSTransaction *tx = (DNSTransaction *)txv; DNSQueryEntry *query = NULL; @@ -139,10 +139,9 @@ int PrefilterTxDnsQueryRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) } int DetectEngineInspectDnsRequest(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags, alstate, txv, tx_id, @@ -150,10 +149,9 @@ int DetectEngineInspectDnsRequest(ThreadVars *tv, } int DetectEngineInspectDnsResponse(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags, alstate, txv, tx_id, diff --git a/src/detect-engine-dns.h b/src/detect-engine-dns.h index 56ebea2589..be25eb3ac1 100644 --- a/src/detect-engine-dns.h +++ b/src/detect-engine-dns.h @@ -25,18 +25,17 @@ int PrefilterTxDnsQueryRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); -int DetectEngineInspectDnsQueryName(ThreadVars *, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *, const Signature *, - Flow *, uint8_t, void *, void *, uint64_t); +int DetectEngineInspectDnsQueryName(ThreadVars *, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *, + const Signature *, const SigMatch *sm, + Flow *, uint8_t, void *, void *, uint64_t); int DetectEngineInspectDnsRequest(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); int DetectEngineInspectDnsResponse(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); #endif /* __DETECT_ENGINE_DNS_H__ */ diff --git a/src/detect-engine-enip.c b/src/detect-engine-enip.c index 8160d0bae5..814be1c020 100644 --- a/src/detect-engine-enip.c +++ b/src/detect-engine-enip.c @@ -217,8 +217,9 @@ int CIPServiceMatch(ENIPTransaction *enip_data, * * \retval 0 no match or 1 match */ -int DetectEngineInspectCIP(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, +int DetectEngineInspectCIP(ThreadVars *tv, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *smi, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { SCEnter(); @@ -257,9 +258,10 @@ int DetectEngineInspectCIP(ThreadVars *tv, DetectEngineCtx *de_ctx, * \retval 0 no match or 1 match */ -int DetectEngineInspectENIP(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) +int DetectEngineInspectENIP(ThreadVars *tv, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *smi, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { SCEnter(); diff --git a/src/detect-engine-enip.h b/src/detect-engine-enip.h index 9e0e719d85..eb55917d2c 100644 --- a/src/detect-engine-enip.h +++ b/src/detect-engine-enip.h @@ -23,13 +23,15 @@ #ifndef __DETECT_ENGINE_ENIP_H__ #define __DETECT_ENGINE_ENIP_H__ -int DetectEngineInspectCIP(ThreadVars *, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *, const Signature *, - Flow *, uint8_t, void *, void *, uint64_t); +int DetectEngineInspectCIP(ThreadVars *, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *, + const Signature *, const SigMatch *sm, + Flow *, uint8_t, void *, void *, uint64_t); -int DetectEngineInspectENIP(ThreadVars *, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *, const Signature *, - Flow *, uint8_t, void *, void *, uint64_t); +int DetectEngineInspectENIP(ThreadVars *, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *, + const Signature *, const SigMatch *sm, + Flow *, uint8_t, void *, void *, uint64_t); void DetectEngineInspectENIPRegisterTests(void); #endif /* __DETECT_ENGINE_ENIP_H__ */ diff --git a/src/detect-engine-file.c b/src/detect-engine-file.c index 9b9462ab5d..588c72fbbf 100644 --- a/src/detect-engine-file.c +++ b/src/detect-engine-file.c @@ -229,9 +229,9 @@ static int DetectFileInspect(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, * \note flow should be locked when this function's called. */ int DetectFileInspectHttp(ThreadVars *tv, - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, void *alstate, - void *tx, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { int r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH; FileContainer *ffc; @@ -274,9 +274,9 @@ int DetectFileInspectHttp(ThreadVars *tv, * \note flow is not locked at this time */ int DetectFileInspectSmtp(ThreadVars *tv, - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, void *alstate, - void *tx, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { SCEnter(); int r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH; diff --git a/src/detect-engine-file.h b/src/detect-engine-file.h index 4934ed0a2c..f7ea8405f1 100644 --- a/src/detect-engine-file.h +++ b/src/detect-engine-file.h @@ -25,13 +25,13 @@ #define __DETECT_ENGINE_FILE_H__ int DetectFileInspectHttp(ThreadVars *tv, - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); -int DetectFileInspectSmtp(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, 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, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); #endif /* __DETECT_ENGINE_FILE_H__ */ diff --git a/src/detect-engine-filedata-smtp.c b/src/detect-engine-filedata-smtp.c index 4635ad10ee..fa27c4c90e 100644 --- a/src/detect-engine-filedata-smtp.c +++ b/src/detect-engine-filedata-smtp.c @@ -174,11 +174,9 @@ end: } int DetectEngineInspectSMTPFiledata(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { SMTPState *smtp_state = (SMTPState *)alstate; FileContainer *ffc = smtp_state->files_ts; diff --git a/src/detect-engine-filedata-smtp.h b/src/detect-engine-filedata-smtp.h index d659e22241..f9c55e3222 100644 --- a/src/detect-engine-filedata-smtp.h +++ b/src/detect-engine-filedata-smtp.h @@ -28,11 +28,10 @@ int PrefilterTxSmtpFiledataRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectSMTPFiledata(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); + void DetectEngineCleanSMTPBuffers(DetectEngineThreadCtx *det_ctx); void DetectEngineSMTPFiledataRegisterTests(void); diff --git a/src/detect-engine-hcbd.c b/src/detect-engine-hcbd.c index 62d12517cb..aad694a68c 100644 --- a/src/detect-engine-hcbd.c +++ b/src/detect-engine-hcbd.c @@ -257,10 +257,9 @@ int PrefilterTxHttpRequestBodyRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) } int DetectEngineInspectHttpClientBody(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, - void *alstate, void *tx, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { HtpState *htp_state = (HtpState *)alstate; uint32_t buffer_len = 0; diff --git a/src/detect-engine-hcbd.h b/src/detect-engine-hcbd.h index c990bb083d..2cdc3e77f9 100644 --- a/src/detect-engine-hcbd.h +++ b/src/detect-engine-hcbd.h @@ -30,11 +30,10 @@ int PrefilterTxHttpRequestBodyRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpClientBody(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); + void DetectEngineCleanHCBDBuffers(DetectEngineThreadCtx *); void DetectEngineHttpClientBodyRegisterTests(void); diff --git a/src/detect-engine-hcd.c b/src/detect-engine-hcd.c index 4be2ba6903..7bee6534b8 100644 --- a/src/detect-engine-hcd.c +++ b/src/detect-engine-hcd.c @@ -166,11 +166,9 @@ int PrefilterTxResponseCookieRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpCookie(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; htp_header_t *h = NULL; diff --git a/src/detect-engine-hcd.h b/src/detect-engine-hcd.h index 9ed0e6c1d7..621d722801 100644 --- a/src/detect-engine-hcd.h +++ b/src/detect-engine-hcd.h @@ -29,11 +29,9 @@ int PrefilterTxRequestCookieRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int PrefilterTxResponseCookieRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpCookie(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineHttpCookieRegisterTests(void); diff --git a/src/detect-engine-hhd.c b/src/detect-engine-hhd.c index 41cb22d1ff..5586db41dd 100644 --- a/src/detect-engine-hhd.c +++ b/src/detect-engine-hhd.c @@ -382,11 +382,9 @@ int PrefilterTxHttpResponseHeadersRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) } int DetectEngineInspectHttpHeader(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { HtpState *htp_state = (HtpState *)alstate; uint32_t buffer_len = 0; diff --git a/src/detect-engine-hhd.h b/src/detect-engine-hhd.h index e0da35b186..41e6c5252f 100644 --- a/src/detect-engine-hhd.h +++ b/src/detect-engine-hhd.h @@ -29,11 +29,10 @@ int PrefilterTxHttpRequestHeadersRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int PrefilterTxHttpResponseHeadersRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpHeader(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); + void DetectEngineCleanHHDBuffers(DetectEngineThreadCtx *det_ctx); void DetectEngineHttpHeaderRegisterTests(void); diff --git a/src/detect-engine-hhhd.c b/src/detect-engine-hhhd.c index 5c53ef7097..619136e0ff 100644 --- a/src/detect-engine-hhhd.c +++ b/src/detect-engine-hhhd.c @@ -115,11 +115,9 @@ int PrefilterTxHostnameRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpHH(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; if (tx->parsed_uri == NULL || tx->request_hostname == NULL) diff --git a/src/detect-engine-hhhd.h b/src/detect-engine-hhhd.h index 932a38f6d4..04c2cf0be8 100644 --- a/src/detect-engine-hhhd.h +++ b/src/detect-engine-hhhd.h @@ -28,11 +28,9 @@ int PrefilterTxHostnameRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpHH(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineHttpHHRegisterTests(void); diff --git a/src/detect-engine-hmd.c b/src/detect-engine-hmd.c index 31df7e24ae..74b004c737 100644 --- a/src/detect-engine-hmd.c +++ b/src/detect-engine-hmd.c @@ -112,11 +112,9 @@ int PrefilterTxMethodRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpMethod(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; if (tx->request_method == NULL) { diff --git a/src/detect-engine-hmd.h b/src/detect-engine-hmd.h index cf40eeba61..71f2009b64 100644 --- a/src/detect-engine-hmd.h +++ b/src/detect-engine-hmd.h @@ -26,11 +26,9 @@ #include "app-layer-htp.h" int DetectEngineInspectHttpMethod(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); int PrefilterTxMethodRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); diff --git a/src/detect-engine-hrhd.c b/src/detect-engine-hrhd.c index 526c6b1424..8f7ad5a9f3 100644 --- a/src/detect-engine-hrhd.c +++ b/src/detect-engine-hrhd.c @@ -163,11 +163,9 @@ int PrefilterTxResponseHeadersRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpRawHeader(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { HtpTxUserData *tx_ud = NULL; uint8_t *headers_raw = NULL; diff --git a/src/detect-engine-hrhd.h b/src/detect-engine-hrhd.h index 99c379b225..b6deda8627 100644 --- a/src/detect-engine-hrhd.h +++ b/src/detect-engine-hrhd.h @@ -29,11 +29,10 @@ int PrefilterTxRequestHeadersRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int PrefilterTxResponseHeadersRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpRawHeader(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); + void DetectEngineHttpRawHeaderRegisterTests(void); #endif /* __DETECT_ENGINE_HHD_H__ */ diff --git a/src/detect-engine-hrhhd.c b/src/detect-engine-hrhhd.c index d6b265235d..d9e79f7604 100644 --- a/src/detect-engine-hrhhd.c +++ b/src/detect-engine-hrhhd.c @@ -127,11 +127,9 @@ int PrefilterTxHostnameRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpHRH(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint8_t *hname; uint32_t hname_len; diff --git a/src/detect-engine-hrhhd.h b/src/detect-engine-hrhhd.h index 30aec3b8c7..e45b8b3bf5 100644 --- a/src/detect-engine-hrhhd.h +++ b/src/detect-engine-hrhhd.h @@ -28,11 +28,9 @@ int PrefilterTxHostnameRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpHRH(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineHttpHRHRegisterTests(void); diff --git a/src/detect-engine-hrud.c b/src/detect-engine-hrud.c index 876dcc5e80..811092c28e 100644 --- a/src/detect-engine-hrud.c +++ b/src/detect-engine-hrud.c @@ -112,11 +112,9 @@ int PrefilterTxRawUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpRawUri(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; if (tx->request_uri == NULL) { diff --git a/src/detect-engine-hrud.h b/src/detect-engine-hrud.h index 4b7933badc..10137d6d2b 100644 --- a/src/detect-engine-hrud.h +++ b/src/detect-engine-hrud.h @@ -29,11 +29,10 @@ int PrefilterTxRawUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpRawUri(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); + void DetectEngineHttpRawUriRegisterTests(void); #endif /* __DETECT_ENGINE_HRUD_H__ */ diff --git a/src/detect-engine-hsbd.c b/src/detect-engine-hsbd.c index 84856fc51b..326f834f6e 100644 --- a/src/detect-engine-hsbd.c +++ b/src/detect-engine-hsbd.c @@ -262,11 +262,9 @@ int PrefilterTxHttpResponseBodyRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpServerBody(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { HtpState *htp_state = (HtpState *)alstate; uint32_t buffer_len = 0; diff --git a/src/detect-engine-hsbd.h b/src/detect-engine-hsbd.h index 0512ba4661..7126aabb2c 100644 --- a/src/detect-engine-hsbd.h +++ b/src/detect-engine-hsbd.h @@ -30,11 +30,11 @@ int PrefilterTxHttpResponseBodyRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpServerBody(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, + void *tx, uint64_t tx_id); + void DetectEngineCleanHSBDBuffers(DetectEngineThreadCtx *det_ctx); void DetectEngineHttpServerBodyRegisterTests(void); diff --git a/src/detect-engine-hscd.c b/src/detect-engine-hscd.c index e9354a91b8..77ea0632cf 100644 --- a/src/detect-engine-hscd.c +++ b/src/detect-engine-hscd.c @@ -111,11 +111,9 @@ int PrefilterTxHttpStatCodeRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpStatCode(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; if (tx->response_status == NULL) { diff --git a/src/detect-engine-hscd.h b/src/detect-engine-hscd.h index 390abf5b9b..bdcc0cfc0c 100644 --- a/src/detect-engine-hscd.h +++ b/src/detect-engine-hscd.h @@ -28,11 +28,10 @@ int PrefilterTxHttpStatCodeRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpStatCode(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); + void DetectEngineHttpStatCodeRegisterTests(void); #endif /* __DETECT_ENGINE_HSCD_H__ */ diff --git a/src/detect-engine-hsmd.c b/src/detect-engine-hsmd.c index 4bee372dbc..7cecf37d6b 100644 --- a/src/detect-engine-hsmd.c +++ b/src/detect-engine-hsmd.c @@ -111,11 +111,9 @@ int PrefilterTxHttpStatMsgRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpStatMsg(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; if (tx->response_message == NULL) { diff --git a/src/detect-engine-hsmd.h b/src/detect-engine-hsmd.h index 075d34d713..fd48176ece 100644 --- a/src/detect-engine-hsmd.h +++ b/src/detect-engine-hsmd.h @@ -28,11 +28,10 @@ int PrefilterTxHttpStatMsgRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpStatMsg(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); + void DetectEngineHttpStatMsgRegisterTests(void); #endif /* __DETECT_ENGINE_HSMD_H__ */ diff --git a/src/detect-engine-hua.c b/src/detect-engine-hua.c index 1cc2a39418..18f716f234 100644 --- a/src/detect-engine-hua.c +++ b/src/detect-engine-hua.c @@ -120,11 +120,9 @@ int PrefilterTxUARegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match. */ int DetectEngineInspectHttpUA(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; htp_header_t *h = (htp_header_t *)htp_table_get_c(tx->request_headers, diff --git a/src/detect-engine-hua.h b/src/detect-engine-hua.h index 499539ee92..fba2d88458 100644 --- a/src/detect-engine-hua.h +++ b/src/detect-engine-hua.h @@ -28,11 +28,9 @@ int PrefilterTxUARegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpUA(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineHttpUARegisterTests(void); diff --git a/src/detect-engine-modbus.c b/src/detect-engine-modbus.c index e08cde10d7..102ffe39cd 100644 --- a/src/detect-engine-modbus.c +++ b/src/detect-engine-modbus.c @@ -200,6 +200,7 @@ int DetectEngineInspectModbus(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const Signature *s, + const SigMatch *smi, Flow *f, uint8_t flags, void *alstate, diff --git a/src/detect-engine-modbus.h b/src/detect-engine-modbus.h index ae0935c977..66a174c760 100644 --- a/src/detect-engine-modbus.h +++ b/src/detect-engine-modbus.h @@ -33,9 +33,10 @@ #ifndef __DETECT_ENGINE_MODBUS_H__ #define __DETECT_ENGINE_MODBUS_H__ -int DetectEngineInspectModbus(ThreadVars *, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *, const Signature *, - Flow *, uint8_t, void *, void *, uint64_t); +int DetectEngineInspectModbus(ThreadVars *, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *, + const Signature *, const SigMatch *, + Flow *, uint8_t, void *, void *, uint64_t); void DetectEngineInspectModbusRegisterTests(void); #endif /* __DETECT_ENGINE_MODBUS_H__ */ diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index f130a5ca00..82a40228e1 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -533,9 +533,8 @@ int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx, SCLogDebug("inspect_flags %x", inspect_flags); if (direction == engine->dir) { KEYWORD_PROFILING_SET_LIST(det_ctx, engine->sm_list); - int match = engine->Callback(tv, de_ctx, det_ctx, s, f, - flags, alstate, - tx, tx_id); + int match = engine->Callback(tv, de_ctx, det_ctx, + s, engine->sm, f, flags, alstate, tx, tx_id); SCLogDebug("engine %p match %d", engine, match); if (match == DETECT_ENGINE_INSPECT_SIG_MATCH) { inspect_flags |= BIT_U32(engine->id); @@ -859,8 +858,9 @@ static int DoInspectItem(ThreadVars *tv, { SCLogDebug("inspect_flags %x", inspect_flags); KEYWORD_PROFILING_SET_LIST(det_ctx, engine->sm_list); - int match = engine->Callback(tv, de_ctx, det_ctx, s, f, - flags, alstate, inspect_tx, inspect_tx_id); + int match = engine->Callback(tv, de_ctx, det_ctx, + s, engine->sm, + f, flags, alstate, inspect_tx, inspect_tx_id); if (match == DETECT_ENGINE_INSPECT_SIG_MATCH) { inspect_flags |= BIT_U32(engine->id); engine = engine->next; diff --git a/src/detect-engine-template.c b/src/detect-engine-template.c index 70785da1e3..9ad8ff5936 100644 --- a/src/detect-engine-template.c +++ b/src/detect-engine-template.c @@ -36,9 +36,10 @@ #include "app-layer-template.h" -int DetectEngineInspectTemplateBuffer(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) +int DetectEngineInspectTemplateBuffer(ThreadVars *tv, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { TemplateTransaction *tx = (TemplateTransaction *)txv; int ret = 0; diff --git a/src/detect-engine-template.h b/src/detect-engine-template.h index e1f39065bd..60bf5d4786 100644 --- a/src/detect-engine-template.h +++ b/src/detect-engine-template.h @@ -24,8 +24,9 @@ #ifndef __DETECT_TEMPLATE_ENGINE_H__ #define __DETECT_TEMPLATE_ENGINE_H__ -int DetectEngineInspectTemplateBuffer(ThreadVars *, DetectEngineCtx *, - DetectEngineThreadCtx *, const Signature *, Flow *, uint8_t, void *, void *, - uint64_t); +int DetectEngineInspectTemplateBuffer(ThreadVars *, + DetectEngineCtx *, DetectEngineThreadCtx *, + const Signature *, const SigMatch *, + Flow *, uint8_t, void *, void *tx, uint64_t tx_id); #endif /* __DETECT_TEMPLATE_ENGINE_H__ */ diff --git a/src/detect-engine-tls.c b/src/detect-engine-tls.c index e3e7881e02..e488fd3301 100644 --- a/src/detect-engine-tls.c +++ b/src/detect-engine-tls.c @@ -97,10 +97,10 @@ int PrefilterTxTlsSniRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 0 No match * \retval 1 Match */ -int DetectEngineInspectTlsSni(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, - uint64_t tx_id) +int DetectEngineInspectTlsSni(ThreadVars *tv, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint8_t *buffer; uint16_t buffer_len; @@ -173,10 +173,10 @@ int PrefilterTxTlsIssuerRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 0 No match * \retval 1 Match */ -int DetectEngineInspectTlsIssuer(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, 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, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint8_t *buffer; uint32_t buffer_len; @@ -249,10 +249,10 @@ int PrefilterTxTlsSubjectRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 0 No match * \retval 1 Match */ -int DetectEngineInspectTlsSubject(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, 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, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint8_t *buffer; uint32_t buffer_len; @@ -274,10 +274,11 @@ int DetectEngineInspectTlsSubject(ThreadVars *tv, DetectEngineCtx *de_ctx, return cnt; } -int DetectEngineInspectTlsValidity(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, 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, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, + void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags, alstate, txv, tx_id, diff --git a/src/detect-engine-tls.h b/src/detect-engine-tls.h index e35281caf3..4172b4a043 100644 --- a/src/detect-engine-tls.h +++ b/src/detect-engine-tls.h @@ -27,24 +27,25 @@ int PrefilterTxTlsSniRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int PrefilterTxTlsIssuerRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int PrefilterTxTlsSubjectRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); -int DetectEngineInspectTlsSni(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - 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, - 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, - 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, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id); +int DetectEngineInspectTlsSni(ThreadVars *tv, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); + +int DetectEngineInspectTlsIssuer(ThreadVars *tv, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); + +int DetectEngineInspectTlsSubject(ThreadVars *tv, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id); + +int DetectEngineInspectTlsValidity(ThreadVars *tv, + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); #endif /* __DETECT_ENGINE_TLS_H__ */ diff --git a/src/detect-engine-uri.c b/src/detect-engine-uri.c index 9058afba14..7f8a46fd80 100644 --- a/src/detect-engine-uri.c +++ b/src/detect-engine-uri.c @@ -105,11 +105,9 @@ int PrefilterTxUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 2 Sig can't match. */ int DetectEngineInspectHttpUri(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { HtpTxUserData *tx_ud = htp_tx_get_user_data(txv); diff --git a/src/detect-engine-uri.h b/src/detect-engine-uri.h index bc5933aa0d..4760dd184d 100644 --- a/src/detect-engine-uri.h +++ b/src/detect-engine-uri.h @@ -27,11 +27,10 @@ int PrefilterTxUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpUri(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *tx, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); + void UriRegisterTests(void); #endif /* __DETECT_ENGINE_URICONTENT_H__ */ diff --git a/src/detect-http-request-line.c b/src/detect-http-request-line.c index 6e316f568f..057f84a514 100644 --- a/src/detect-http-request-line.c +++ b/src/detect-http-request-line.c @@ -65,11 +65,10 @@ void DetectHttpRequestLineRegisterTests(void); void DetectHttpRequestLineFree(void *); static int PrefilterTxHttpRequestLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); static int DetectEngineInspectHttpRequestLine(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); + /** * \brief Registers the keyword handlers for the "http_request_line" keyword. */ @@ -172,11 +171,9 @@ static int PrefilterTxHttpRequestLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx * \retval 2 Sig can't match. */ static int DetectEngineInspectHttpRequestLine(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; diff --git a/src/detect-http-response-line.c b/src/detect-http-response-line.c index 606c740746..04f7a8e539 100644 --- a/src/detect-http-response-line.c +++ b/src/detect-http-response-line.c @@ -65,11 +65,9 @@ void DetectHttpResponseLineRegisterTests(void); void DetectHttpResponseLineFree(void *); static int PrefilterTxHttpResponseLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); static int DetectEngineInspectHttpResponseLine(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id); + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); /** * \brief Registers the keyword handlers for the "http_response_line" keyword. @@ -173,11 +171,9 @@ static int PrefilterTxHttpResponseLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ct * \retval 2 Sig can't match. */ int DetectEngineInspectHttpResponseLine(ThreadVars *tv, - DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, Flow *f, uint8_t flags, - void *alstate, - void *txv, uint64_t tx_id) + DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, + Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { htp_tx_t *tx = (htp_tx_t *)txv; diff --git a/src/detect.h b/src/detect.h index 72280b6ead..a9617a6b03 100644 --- a/src/detect.h +++ b/src/detect.h @@ -377,7 +377,8 @@ struct DetectEngineThreadCtx_;// DetectEngineThreadCtx; typedef int (*InspectEngineFuncPtr)(ThreadVars *tv, struct DetectEngineCtx_ *de_ctx, struct DetectEngineThreadCtx_ *det_ctx, - const struct Signature_ *sig, Flow *f, uint8_t flags, void *alstate, + const struct Signature_ *sig, const SigMatch *sm_list, + Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); typedef struct DetectEngineAppInspectionEngine_ { @@ -394,6 +395,8 @@ typedef struct DetectEngineAppInspectionEngine_ { */ InspectEngineFuncPtr Callback; + SigMatch *sm; + struct DetectEngineAppInspectionEngine_ *next; } DetectEngineAppInspectionEngine;