]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: add SigMatch arg to inspect functions
authorVictor Julien <victor@inliniac.net>
Sat, 15 Oct 2016 12:10:23 +0000 (14:10 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 09:35:36 +0000 (10:35 +0100)
46 files changed:
src/detect-app-layer-event.c
src/detect-dnp3.c
src/detect-engine-dns.c
src/detect-engine-dns.h
src/detect-engine-enip.c
src/detect-engine-enip.h
src/detect-engine-file.c
src/detect-engine-file.h
src/detect-engine-filedata-smtp.c
src/detect-engine-filedata-smtp.h
src/detect-engine-hcbd.c
src/detect-engine-hcbd.h
src/detect-engine-hcd.c
src/detect-engine-hcd.h
src/detect-engine-hhd.c
src/detect-engine-hhd.h
src/detect-engine-hhhd.c
src/detect-engine-hhhd.h
src/detect-engine-hmd.c
src/detect-engine-hmd.h
src/detect-engine-hrhd.c
src/detect-engine-hrhd.h
src/detect-engine-hrhhd.c
src/detect-engine-hrhhd.h
src/detect-engine-hrud.c
src/detect-engine-hrud.h
src/detect-engine-hsbd.c
src/detect-engine-hsbd.h
src/detect-engine-hscd.c
src/detect-engine-hscd.h
src/detect-engine-hsmd.c
src/detect-engine-hsmd.h
src/detect-engine-hua.c
src/detect-engine-hua.h
src/detect-engine-modbus.c
src/detect-engine-modbus.h
src/detect-engine-state.c
src/detect-engine-template.c
src/detect-engine-template.h
src/detect-engine-tls.c
src/detect-engine-tls.h
src/detect-engine-uri.c
src/detect-engine-uri.h
src/detect-http-request-line.c
src/detect-http-response-line.c
src/detect.h

index a7930dee85df8be86151eab1b7f254b11e061fb7..3447ab3813e51b0d76e373be050e5f2777182c6d 100644 (file)
@@ -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;
index 1a515905bb80e19c171b6524c987f90d0a1c9067..92922e8f05bec6c20621b9476c0e94b5eaa9f13d 100644 (file)
@@ -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);
index b9a4ce39fa50770f11382f65dc1d6777f0e4282e..4b15996195f46b34869f2fd61bcec1a7ec6215a1 100644 (file)
  *  \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,
index 56ebea25899ca56bd3ea0a4de1b5014e77f277aa..be25eb3ac1ccc13480bada9b3777100d248f03d7 100644 (file)
 
 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__ */
index 8160d0bae5d88b06dbe250a58dc6e15159b9338f..814be1c02071bb73eef5054449e63933b0a487f8 100644 (file)
@@ -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();
 
index 9e0e719d850b9b600d37f0ee0aa09b911ae7a798..eb55917d2c7548f6872a022b93451df9bec7c7dc 100644 (file)
 #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__ */
index 9b9462ab5ddadd106d7d12c6e3ba66616dec7663..588c72fbbf79235eac3d5fdfc83f8d45dd6e6e2f 100644 (file)
@@ -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;
index 4934ed0a2cbfec750b6c751439355e3c5f0dffad..f7ea8405f18fc3fb09f7240902a91a7f0c11c199 100644 (file)
 #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__ */
index 4635ad10ee2265e1bf926060831ce9191897a4b9..fa27c4c90e5ee03b140c1552771f21d26da40a5f 100644 (file)
@@ -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;
index d659e22241628dcaffcc656ee10950e1115c6858..f9c55e3222efd1b9654c9ec89694bed4ea9ea731 100644 (file)
 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);
index 62d12517cb44215ca24052a3f7739acbf2449c99..aad694a68c0a2889888343a660aa548ea0f76ef2 100644 (file)
@@ -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;
index c990bb083dc90a863d4f12929af0cb7119fb2d7f..2cdc3e77f9ba07eddba5359e511d650d8245bbb7 100644 (file)
 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);
index 4be2ba6903f7718566f9a535955bd90683b72bc3..7bee6534b8dec6fee9f67b1d3af7a0150b16b315 100644 (file)
@@ -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;
index 9ed0e6c1d758033900415a0b1d0afc251bc77bf1..621d722801fe8afbe62b9d56b6a4ea0a239540a7 100644 (file)
@@ -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);
 
index 41cb22d1ffb9f48a449f44c94081097023332f32..5586db41dd5ae6b88f6cb1e5c07bce99bf7776a6 100644 (file)
@@ -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;
index e0da35b186cd8ec7abd7c22730dafe0a70a91c63..41e6c5252f660582cd0d920eca2ceb2d7b7cdde5 100644 (file)
@@ -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);
index 5c53ef7097da505cf38cd337cc4e0d6ccffd05ed..619136e0ff3718e0d56ed1a063da6164511445c4 100644 (file)
@@ -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)
index 932a38f6d4f6d0ce68a3c7802fb44eb371382220..04c2cf0be8dcc2520dc9bb6cc3bf267ddf35fc23 100644 (file)
 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);
 
index 31df7e24ae9875f07aba2c3a6878b2f466e965c9..74b004c737acd382c2dd3d7b85de7461b693fe90 100644 (file)
@@ -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) {
index cf40eeba617cb0b89c886ceb24a58ebb9a3a48c2..71f2009b6401deb8b71c71969d440c5442f59b0d 100644 (file)
 #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);
 
index 526c6b1424ced47a7f7315d7a57336d8a6eee648..8f7ad5a9f3f25fd3240c5e8ede77a16cab6eb43c 100644 (file)
@@ -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;
index 99c379b225bdbca43f8737f80ed84e02f5ff50fe..b6deda862753805ef1936c76a60bc2870c2433a1 100644 (file)
@@ -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__ */
index d6b265235de429efc8b35e7bc7bf11b33605130e..d9e79f7604b61c47e5f1cb6114f49e5817b9b103 100644 (file)
@@ -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;
index 30aec3b8c702d860603e02d71e71b6c8a3121f08..e45b8b3bf501ea7bfb76b91d6b3c277135fcc48e 100644 (file)
 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);
 
index 876dcc5e806e1d038864ce7d2039fadea1fe2688..811092c28e90c7fb3f5449ef677e146ba4ff221e 100644 (file)
@@ -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) {
index 4b7933badcf532ddb2f6090a1beb64e42035bb7e..10137d6d2bfebfe644b600f2d0d5bfe8dd8afdf4 100644 (file)
 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__ */
index 84856fc51bf94fbece3838c7ca6e704480351340..326f834f6e1c9f7dce5790c9708807ec6f474891 100644 (file)
@@ -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;
index 0512ba46615e6ab9e1727f62ef3e5bd7b5551bf0..7126aabb2ca016424efdd4dd64db3c84d6c7f09e 100644 (file)
 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);
index e9354a91b882552ef512d598020c9ac3d404c195..77ea0632cf8cfe0e1684696397dcfa4fab5b8d0e 100644 (file)
@@ -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) {
index 390abf5b9b04e5e5a5ac19cd1ab8218637971d3a..bdcc0cfc0cd3c64ed7e07aa6185a5e2c46947290 100644 (file)
 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__ */
index 4bee372dbc0e98197779f1b2f2d418781103e6b3..7cecf37d6b0654416d6cda03cdc144cbb8186d6b 100644 (file)
@@ -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) {
index 075d34d7132e3a77b3f30698da2dc238224768e2..fd48176ecef053db818ae4e7d1195b9e7583a5b7 100644 (file)
 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__ */
index 1cc2a394189e390c8d8d13f0f1ac19603e334798..18f716f234b3e80626b3becf8209cae0fe365e2f 100644 (file)
@@ -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,
index 499539ee92b4c9e21662f6ba53b12671313c82ad..fba2d88458328499d0d1d8dd65feaabe988292b9 100644 (file)
 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);
 
index e08cde10d7ceeb372eb703902de9365536777f9c..102ffe39cd49b720dc9d72d04bba5da172c55dee 100644 (file)
@@ -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,
index ae0935c977a8696b4c1f3a2c33fc7cdd55f07def..66a174c76049768fe6a36a7631c239dca982b473 100644 (file)
 #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__ */
index f130a5ca0094ac42654afa9568fa824b173f89b1..82a40228e1ef195ce3df1c2688c9ccc87a60c7dc 100644 (file)
@@ -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;
index 70785da1e3400e4bfaf1d27ae7c34b8857330fe5..9ad8ff5936e18713ee7a88d5c404fd8dabd92f67 100644 (file)
 
 #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;
index e1f39065bdb2f2d0a9fa79358df6d8f95af19f2f..60bf5d47863f2c04ec4241f4a2047bcfdf7b0996 100644 (file)
@@ -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__ */
index e3e7881e02108c7098013720d42ab7a021a4cf7c..e488fd3301620b95f77afd5381c2e7ec167c2e18 100644 (file)
@@ -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,
index e35281caf31e2448863c2538375c158ce77c9f59..4172b4a043917e6116277610ee0b1ae8a3b2539e 100644 (file)
@@ -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__ */
index 9058afba1415e98862d084fe8ba122a2c53e9c0a..7f8a46fd80e9368b526fa44ff77f6245b5f469cb 100644 (file)
@@ -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);
 
index bc5933aa0d5497b7b4aff8e117f38cb621e0d451..4760dd184de746148f7f8e7cc24fc7155007aec0 100644 (file)
 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__ */
index 6e316f568f84d6005f54cf4af4ded07c0d3a1609..057f84a51486567425d379d9bebd37a86f8e2389 100644 (file)
@@ -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;
 
index 606c740746886c896ae6c944c77e59eedea9378c..04f7a8e53984d5882e66f31b2abb07236d1802d7 100644 (file)
@@ -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;
 
index 72280b6ead9595cf5dc3c122e42eeb56593dc7ff..a9617a6b0392b20dfcfd5c76d504df5c02e8cc6a 100644 (file)
@@ -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;