]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: remove wrappers around DetectEngineInspectGenericList
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 12 Jul 2022 12:30:05 +0000 (14:30 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 28 Jul 2022 14:40:02 +0000 (16:40 +0200)
34 files changed:
src/detect-dce-iface.c
src/detect-dnp3.c
src/detect-dns-opcode.c
src/detect-dns-query.c
src/detect-engine.c
src/detect-engine.h
src/detect-ftpbounce.c
src/detect-ftpdata.c
src/detect-http2.c
src/detect-ike-chosen-sa.c
src/detect-ike-exch-type.c
src/detect-ike-key-exchange-payload-length.c
src/detect-ike-nonce-payload-length.c
src/detect-krb5-errcode.c
src/detect-krb5-msgtype.c
src/detect-lua.c
src/detect-modbus.c
src/detect-mqtt-connack-sessionpresent.c
src/detect-mqtt-connect-flags.c
src/detect-mqtt-flags.c
src/detect-mqtt-protocol-version.c
src/detect-mqtt-qos.c
src/detect-mqtt-reason-code.c
src/detect-mqtt-type.c
src/detect-nfs-procedure.c
src/detect-nfs-version.c
src/detect-rfb-secresult.c
src/detect-rfb-sectype.c
src/detect-snmp-pdu_type.c
src/detect-snmp-version.c
src/detect-ssh-software-version.c
src/detect-ssl-state.c
src/detect-tls-cert-validity.c
src/detect-tls.c

index 431c1925f538ad8912b255fbb3d0b7adab76bc78..066f3806e64aa74019b1bd55a835dfb49ee9dbe9 100644 (file)
@@ -63,10 +63,6 @@ static void DetectDceIfaceRegisterTests(void);
 #endif
 static int g_dce_generic_list_id = 0;
 
-static uint8_t InspectDceGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registers the keyword handlers for the "dce_iface" keyword.
  */
@@ -84,23 +80,15 @@ void DetectDceIfaceRegister(void)
 
     g_dce_generic_list_id = DetectBufferTypeRegister("dce_generic");
 
+    DetectAppLayerInspectEngineRegister2("dce_generic", ALPROTO_DCERPC, SIG_FLAG_TOSERVER, 0,
+            DetectEngineInspectGenericList, NULL);
     DetectAppLayerInspectEngineRegister2(
-            "dce_generic", ALPROTO_DCERPC, SIG_FLAG_TOSERVER, 0, InspectDceGeneric, NULL);
-    DetectAppLayerInspectEngineRegister2(
-            "dce_generic", ALPROTO_SMB, SIG_FLAG_TOSERVER, 0, InspectDceGeneric, NULL);
+            "dce_generic", ALPROTO_SMB, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
 
+    DetectAppLayerInspectEngineRegister2("dce_generic", ALPROTO_DCERPC, SIG_FLAG_TOCLIENT, 0,
+            DetectEngineInspectGenericList, NULL);
     DetectAppLayerInspectEngineRegister2(
-            "dce_generic", ALPROTO_DCERPC, SIG_FLAG_TOCLIENT, 0, InspectDceGeneric, NULL);
-    DetectAppLayerInspectEngineRegister2(
-            "dce_generic", ALPROTO_SMB, SIG_FLAG_TOCLIENT, 0, InspectDceGeneric, NULL);
-}
-
-static uint8_t InspectDceGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
+            "dce_generic", ALPROTO_SMB, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectGenericList, NULL);
 }
 
 /**
index 042dc058ebd5286555f0002f3cb7d05d0bbf0f77..f3d64c3b326ed3079a0dfdbca7ec9f75b4a6b530 100644 (file)
@@ -176,14 +176,6 @@ static InspectionBuffer *GetDNP3Data(DetectEngineThreadCtx *det_ctx,
     return buffer;
 }
 
-static uint8_t DetectEngineInspectDNP3(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \brief Parse the provided function name or code to its integer
  *     value.
@@ -598,9 +590,9 @@ void DetectDNP3Register(void)
 
     /* Register the list of func, ind and obj. */
     DetectAppLayerInspectEngineRegister2(
-            "dnp3", ALPROTO_DNP3, SIG_FLAG_TOSERVER, 0, DetectEngineInspectDNP3, NULL);
+            "dnp3", ALPROTO_DNP3, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
     DetectAppLayerInspectEngineRegister2(
-            "dnp3", ALPROTO_DNP3, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectDNP3, NULL);
+            "dnp3", ALPROTO_DNP3, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectGenericList, NULL);
 
     g_dnp3_match_buffer_id = DetectBufferTypeRegister("dnp3");
 
index 8e71ab6f0c1b12f636be3183e96ed9fd8b6fa1d1..c3e03627d8b28fe1120c89746a4afdd29490d78f 100644 (file)
@@ -74,14 +74,6 @@ static int DetectDnsOpcodeMatch(DetectEngineThreadCtx *det_ctx,
     return rs_dns_opcode_match(txv, (void *)ctx, flags);
 }
 
-static uint8_t DetectEngineInspectRequestGenericDnsOpcode(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 void DetectDnsOpcodeRegister(void)
 {
     sigmatch_table[DETECT_AL_DNS_OPCODE].name  = "dns.opcode";
@@ -92,11 +84,11 @@ void DetectDnsOpcodeRegister(void)
     sigmatch_table[DETECT_AL_DNS_OPCODE].AppLayerTxMatch =
         DetectDnsOpcodeMatch;
 
-    DetectAppLayerInspectEngineRegister2("dns.opcode", ALPROTO_DNS, SIG_FLAG_TOSERVER, 0,
-            DetectEngineInspectRequestGenericDnsOpcode, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "dns.opcode", ALPROTO_DNS, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
 
-    DetectAppLayerInspectEngineRegister2("dns.opcode", ALPROTO_DNS, SIG_FLAG_TOCLIENT, 0,
-            DetectEngineInspectRequestGenericDnsOpcode, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "dns.opcode", ALPROTO_DNS, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectGenericList, NULL);
 
     dns_opcode_list_id = DetectBufferTypeGetByName("dns.opcode");
 }
index 10cd19b008567fd78e64dd46c5abd4bf6753ca18..559d6f735fca4f252669c9b36ed1ca4d16f8644a 100644 (file)
@@ -197,24 +197,6 @@ static int PrefilterMpmDnsQueryRegister(DetectEngineCtx *de_ctx,
             pectx, PrefilterMpmDnsQueryFree, mpm_reg->pname);
 }
 
-#ifdef HAVE_LUA
-static uint8_t DetectEngineInspectDnsRequest(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
-static uint8_t DetectEngineInspectDnsResponse(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-#endif
-
 /**
  * \brief Registration function for keyword: dns_query
  */
@@ -247,9 +229,9 @@ void DetectDnsQueryRegister (void)
 #ifdef HAVE_LUA
     /* register these generic engines from here for now */
     DetectAppLayerInspectEngineRegister2(
-            "dns_request", ALPROTO_DNS, SIG_FLAG_TOSERVER, 1, DetectEngineInspectDnsRequest, NULL);
+            "dns_request", ALPROTO_DNS, SIG_FLAG_TOSERVER, 1, DetectEngineInspectGenericList, NULL);
     DetectAppLayerInspectEngineRegister2("dns_response", ALPROTO_DNS, SIG_FLAG_TOCLIENT, 1,
-            DetectEngineInspectDnsResponse, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     DetectBufferTypeSetDescriptionByName("dns_request",
             "dns requests");
index 81250cc758a14a1f0e729cb089b8bd96009440b0..5696d3587d557185c74efde0346a4f578246f5b8 100644 (file)
@@ -1949,10 +1949,11 @@ int DetectEngineReloadIsIdle(void)
  *  \retval 0 no match
  *  \retval 1 match
  */
-uint8_t DetectEngineInspectGenericList(const DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Flow *f,
-        const uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
+uint8_t DetectEngineInspectGenericList(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
+        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
 {
+    SigMatchData *smd = engine->smd;
     SCLogDebug("running match functions, sm %p", smd);
     if (smd != NULL) {
         while (1) {
index ab1e05ce954be3ad8228500287c7065e9db549ad..755d4ac1df9877a3370aba0cea1098be49bf8cbf 100644 (file)
@@ -131,8 +131,9 @@ int DetectEngineTentantUnregisterVlanId(uint32_t tenant_id, uint16_t vlan_id);
 int DetectEngineTentantRegisterPcapFile(uint32_t tenant_id);
 int DetectEngineTentantUnregisterPcapFile(uint32_t tenant_id);
 
-uint8_t DetectEngineInspectGenericList(const DetectEngineCtx *, DetectEngineThreadCtx *,
-        const Signature *, const SigMatchData *, Flow *, const uint8_t, void *, void *, uint64_t);
+uint8_t DetectEngineInspectGenericList(DetectEngineCtx *, DetectEngineThreadCtx *,
+        const struct DetectEngineAppInspectionEngine_ *, const Signature *, Flow *, uint8_t, void *,
+        void *, uint64_t);
 
 uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
         const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags,
index cf74dd59f5f8c3ede749d9b7674ce2d4bbfbec84..427e1f6800fb061f0c16091d4b848adb001fce5c 100644 (file)
@@ -58,10 +58,6 @@ static void DetectFtpbounceRegisterTests(void);
 #endif
 static int g_ftp_request_list_id = 0;
 
-static uint8_t InspectFtpRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registration function for ftpbounce: keyword
  * \todo add support for no_stream and stream_only
@@ -81,15 +77,7 @@ void DetectFtpbounceRegister(void)
     g_ftp_request_list_id = DetectBufferTypeRegister("ftp_request");
 
     DetectAppLayerInspectEngineRegister2(
-            "ftp_request", ALPROTO_FTP, SIG_FLAG_TOSERVER, 0, InspectFtpRequest, NULL);
-}
-
-static uint8_t InspectFtpRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
+            "ftp_request", ALPROTO_FTP, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
 }
 
 /**
index f058264dc1cacddf83428ed52d45cf73ebe69d6b..d914071ca17dd6669d01127a1273df9acc537041 100644 (file)
@@ -49,9 +49,6 @@ static void DetectFtpdataFree (DetectEngineCtx *, void *);
 #ifdef UNITTESTS
 static void DetectFtpdataRegisterTests (void);
 #endif
-static uint8_t DetectEngineInspectFtpdataGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
 static int g_ftpdata_buffer_id = 0;
 
 /**
@@ -77,24 +74,16 @@ void DetectFtpdataRegister(void) {
     sigmatch_table[DETECT_FTPDATA].RegisterTests = DetectFtpdataRegisterTests;
 #endif
     DetectAppLayerInspectEngineRegister2("ftpdata_command", ALPROTO_FTPDATA, SIG_FLAG_TOSERVER, 0,
-            DetectEngineInspectFtpdataGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     DetectAppLayerInspectEngineRegister2("ftpdata_command", ALPROTO_FTPDATA, SIG_FLAG_TOCLIENT, 0,
-            DetectEngineInspectFtpdataGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
     g_ftpdata_buffer_id = DetectBufferTypeGetByName("ftpdata_command");
 
     /* set up the PCRE for keyword parsing */
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 }
 
-static uint8_t DetectEngineInspectFtpdataGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \brief This function is used to check matches from the FTP App Layer Parser
  *
index bcc23a39886171833f412b63816ccd3b6591632b..09657fa461a1a51418b01d8f96dfcf49f10bfcd0 100644 (file)
@@ -109,13 +109,6 @@ static int g_http2_match_buffer_id = 0;
 static int g_http2_header_name_buffer_id = 0;
 static int g_http2_header_buffer_id = 0;
 
-static uint8_t DetectEngineInspectHTTP2(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
 
 /**
  * \brief Registration function for HTTP2 keywords
@@ -237,9 +230,9 @@ void DetectHttp2Register(void)
     g_http2_header_buffer_id = DetectBufferTypeGetByName("http2_header");
 
     DetectAppLayerInspectEngineRegister2(
-            "http2", ALPROTO_HTTP2, SIG_FLAG_TOSERVER, 0, DetectEngineInspectHTTP2, NULL);
+            "http2", ALPROTO_HTTP2, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
     DetectAppLayerInspectEngineRegister2(
-            "http2", ALPROTO_HTTP2, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectHTTP2, NULL);
+            "http2", ALPROTO_HTTP2, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectGenericList, NULL);
 
     g_http2_match_buffer_id = DetectBufferTypeRegister("http2");
     return;
index 3b2932e17f09f9529e942ef52181a1e18bb23552..3b7e224e4e8238ecce93e28acc834a0e98496540 100644 (file)
@@ -56,10 +56,6 @@ static int DetectIkeChosenSaSetup(DetectEngineCtx *, Signature *s, const char *s
 static void DetectIkeChosenSaFree(DetectEngineCtx *, void *);
 static int g_ike_chosen_sa_buffer_id = 0;
 
-static uint8_t DetectEngineInspectIkeChosenSaGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectIkeChosenSaMatch(DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *,
         const Signature *, const SigMatchCtx *);
 void IKEChosenSaRegisterTests(void);
@@ -82,19 +78,11 @@ void DetectIkeChosenSaRegister(void)
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 
     DetectAppLayerInspectEngineRegister2("ike.chosen_sa_attribute", ALPROTO_IKE, SIG_FLAG_TOCLIENT,
-            1, DetectEngineInspectIkeChosenSaGeneric, NULL);
+            1, DetectEngineInspectGenericList, NULL);
 
     g_ike_chosen_sa_buffer_id = DetectBufferTypeGetByName("ike.chosen_sa_attribute");
 }
 
-static uint8_t DetectEngineInspectIkeChosenSaGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match SA attributes of a IKE state
index 13cb7e62828a3ebac5d3c1da7de344a1aacb4d50..3beb2c3a25194db12b8c46c394d005e074aa1054 100644 (file)
@@ -41,10 +41,6 @@ static int DetectIkeExchTypeSetup(DetectEngineCtx *, Signature *s, const char *s
 static void DetectIkeExchTypeFree(DetectEngineCtx *, void *);
 static int g_ike_exch_type_buffer_id = 0;
 
-static uint8_t DetectEngineInspectIkeExchTypeGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectIkeExchTypeMatch(DetectEngineThreadCtx *, Flow *, uint8_t, void *, void *,
         const Signature *, const SigMatchCtx *);
 
@@ -62,22 +58,14 @@ void DetectIkeExchTypeRegister(void)
     sigmatch_table[DETECT_AL_IKE_EXCH_TYPE].Free = DetectIkeExchTypeFree;
 
     DetectAppLayerInspectEngineRegister2("ike.exchtype", ALPROTO_IKE, SIG_FLAG_TOSERVER, 1,
-            DetectEngineInspectIkeExchTypeGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     DetectAppLayerInspectEngineRegister2("ike.exchtype", ALPROTO_IKE, SIG_FLAG_TOCLIENT, 1,
-            DetectEngineInspectIkeExchTypeGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     g_ike_exch_type_buffer_id = DetectBufferTypeGetByName("ike.exchtype");
 }
 
-static uint8_t DetectEngineInspectIkeExchTypeGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match exchange type of a IKE state
index 84961bf8e3d52fa2d354a835d4a146030f323e0b..998948f4827c1adcd9df031f636099cb9e1fb6e7 100644 (file)
@@ -40,10 +40,6 @@ static int DetectIkeKeyExchangePayloadLengthSetup(DetectEngineCtx *, Signature *
 static void DetectIkeKeyExchangePayloadLengthFree(DetectEngineCtx *, void *);
 static int g_ike_key_exch_payload_length_buffer_id = 0;
 
-static uint8_t DetectEngineInspectIkeKeyExchangePayloadLengthGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectIkeKeyExchangePayloadLengthMatch(DetectEngineThreadCtx *, Flow *, uint8_t, void *,
         void *, const Signature *, const SigMatchCtx *);
 
@@ -66,23 +62,15 @@ void DetectIkeKeyExchangePayloadLengthRegister(void)
             DetectIkeKeyExchangePayloadLengthFree;
 
     DetectAppLayerInspectEngineRegister2("ike.key_exchange_payload_length", ALPROTO_IKE,
-            SIG_FLAG_TOSERVER, 1, DetectEngineInspectIkeKeyExchangePayloadLengthGeneric, NULL);
+            SIG_FLAG_TOSERVER, 1, DetectEngineInspectGenericList, NULL);
 
     DetectAppLayerInspectEngineRegister2("ike.key_exchange_payload_length", ALPROTO_IKE,
-            SIG_FLAG_TOCLIENT, 1, DetectEngineInspectIkeKeyExchangePayloadLengthGeneric, NULL);
+            SIG_FLAG_TOCLIENT, 1, DetectEngineInspectGenericList, NULL);
 
     g_ike_key_exch_payload_length_buffer_id =
             DetectBufferTypeGetByName("ike.key_exchange_payload_length");
 }
 
-static uint8_t DetectEngineInspectIkeKeyExchangePayloadLengthGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match key exchange payload length of a IKE state
index b29a8d2ef7aa714d0625ca56c66bb0b5ad240b81..91bc6c200cac3d91430dfda3d7fcda6dfaff5f56 100644 (file)
@@ -40,10 +40,6 @@ static int DetectIkeNoncePayloadLengthSetup(DetectEngineCtx *, Signature *s, con
 static void DetectIkeNoncePayloadLengthFree(DetectEngineCtx *, void *);
 static int g_ike_nonce_payload_length_buffer_id = 0;
 
-static uint8_t DetectEngineInspectIkeNoncePayloadLengthGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectIkeNoncePayloadLengthMatch(DetectEngineThreadCtx *, Flow *, uint8_t, void *,
         void *, const Signature *, const SigMatchCtx *);
 
@@ -62,22 +58,14 @@ void DetectIkeNoncePayloadLengthRegister(void)
     sigmatch_table[DETECT_AL_IKE_NONCE_PAYLOAD_LENGTH].Free = DetectIkeNoncePayloadLengthFree;
 
     DetectAppLayerInspectEngineRegister2("ike.nonce_payload_length", ALPROTO_IKE, SIG_FLAG_TOSERVER,
-            1, DetectEngineInspectIkeNoncePayloadLengthGeneric, NULL);
+            1, DetectEngineInspectGenericList, NULL);
 
     DetectAppLayerInspectEngineRegister2("ike.nonce_payload_length", ALPROTO_IKE, SIG_FLAG_TOCLIENT,
-            1, DetectEngineInspectIkeNoncePayloadLengthGeneric, NULL);
+            1, DetectEngineInspectGenericList, NULL);
 
     g_ike_nonce_payload_length_buffer_id = DetectBufferTypeGetByName("ike.nonce_payload_length");
 }
 
-static uint8_t DetectEngineInspectIkeNoncePayloadLengthGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match nonce length of a IKE state
index c39f18c543d720f70616abc4def50b2dacef751a..62d498bf1b41ab3dfaef06963ba0061139b8631e 100644 (file)
@@ -49,10 +49,6 @@ static void DetectKrb5ErrCodeFree (DetectEngineCtx *, void *);
 static void DetectKrb5ErrCodeRegisterTests (void);
 #endif
 
-static uint8_t DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int g_krb5_err_code_list_id = 0;
 
 /**
@@ -74,10 +70,10 @@ void DetectKrb5ErrCodeRegister(void)
 #endif
 
     DetectAppLayerInspectEngineRegister2("krb5_err_code", ALPROTO_KRB5, SIG_FLAG_TOSERVER, 0,
-            DetectEngineInspectKRB5Generic, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     DetectAppLayerInspectEngineRegister2("krb5_err_code", ALPROTO_KRB5, SIG_FLAG_TOCLIENT, 0,
-            DetectEngineInspectKRB5Generic, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     /* set up the PCRE for keyword parsing */
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
@@ -86,14 +82,6 @@ void DetectKrb5ErrCodeRegister(void)
     SCLogDebug("g_krb5_err_code_list_id %d", g_krb5_err_code_list_id);
 }
 
-static uint8_t DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \brief This function is used to match KRB5 rule option on a packet
  *
index ee5d7f0618b7a13b3dc27d59677899b90abef85c..7850d344a3434d146dbd4620033e78966b96114c 100644 (file)
@@ -49,10 +49,6 @@ static void DetectKrb5MsgTypeFree (DetectEngineCtx *, void *);
 static void DetectKrb5MsgTypeRegisterTests (void);
 #endif
 
-static uint8_t DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int g_krb5_msg_type_list_id = 0;
 
 /**
@@ -74,10 +70,10 @@ void DetectKrb5MsgTypeRegister(void)
 #endif
 
     DetectAppLayerInspectEngineRegister2("krb5_msg_type", ALPROTO_KRB5, SIG_FLAG_TOSERVER, 0,
-            DetectEngineInspectKRB5Generic, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     DetectAppLayerInspectEngineRegister2("krb5_msg_type", ALPROTO_KRB5, SIG_FLAG_TOCLIENT, 0,
-            DetectEngineInspectKRB5Generic, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     /* set up the PCRE for keyword parsing */
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
@@ -86,14 +82,6 @@ void DetectKrb5MsgTypeRegister(void)
     SCLogDebug("g_krb5_msg_type_list_id %d", g_krb5_msg_type_list_id);
 }
 
-static uint8_t DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \brief This function is used to match KRB5 rule option on a packet
  *
index e3c27228408e1610832c881eb58bc9192896db4b..e4765d0a5f4993b7bb53a5d009302b0fc377cd81 100644 (file)
@@ -104,10 +104,6 @@ static void DetectLuaRegisterTests(void);
 static void DetectLuaFree(DetectEngineCtx *, void *);
 static int g_smtp_generic_list_id = 0;
 
-static uint8_t InspectSmtpGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registration function for keyword: lua
  */
@@ -126,23 +122,15 @@ void DetectLuaRegister(void)
 #endif
     g_smtp_generic_list_id = DetectBufferTypeRegister("smtp_generic");
 
-    DetectAppLayerInspectEngineRegister2(
-            "smtp_generic", ALPROTO_SMTP, SIG_FLAG_TOSERVER, 0, InspectSmtpGeneric, NULL);
-    DetectAppLayerInspectEngineRegister2(
-            "smtp_generic", ALPROTO_SMTP, SIG_FLAG_TOCLIENT, 0, InspectSmtpGeneric, NULL);
+    DetectAppLayerInspectEngineRegister2("smtp_generic", ALPROTO_SMTP, SIG_FLAG_TOSERVER, 0,
+            DetectEngineInspectGenericList, NULL);
+    DetectAppLayerInspectEngineRegister2("smtp_generic", ALPROTO_SMTP, SIG_FLAG_TOCLIENT, 0,
+            DetectEngineInspectGenericList, NULL);
 
     SCLogDebug("registering lua rule option");
     return;
 }
 
-static uint8_t InspectSmtpGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 #define DATATYPE_PACKET  BIT_U32(0)
 #define DATATYPE_PAYLOAD BIT_U32(1)
 #define DATATYPE_STREAM  BIT_U32(2)
index 1c542ce391eb69bc3dc201db17a02aa590b3caa3..964defd6dcd16cd463b1e9eb2f46297adf101f8f 100644 (file)
@@ -121,26 +121,6 @@ static int DetectModbusMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t fl
     return rs_modbus_inspect(txv, (void *)ctx);
 }
 
-/** \brief Do the content inspection & validation for a signature
- *
- *  \param de_ctx   Detection engine context
- *  \param det_ctx  Detection engine thread context
- *  \param s        Signature to inspect ( and sm: SigMatch to inspect)
- *  \param f        Flow
- *  \param flags    App layer flags
- *  \param alstate  App layer state
- *  \param txv      Pointer to Modbus Transaction structure
- *
- *  \retval 0 no match or 1 match
- */
-static uint8_t DetectEngineInspectModbus(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \brief Registration function for Modbus keyword
  */
@@ -155,7 +135,7 @@ void DetectModbusRegister(void)
     sigmatch_table[DETECT_AL_MODBUS].AppLayerTxMatch = DetectModbusMatch;
 
     DetectAppLayerInspectEngineRegister2(
-            "modbus", ALPROTO_MODBUS, SIG_FLAG_TOSERVER, 0, DetectEngineInspectModbus, NULL);
+            "modbus", ALPROTO_MODBUS, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
 
     g_modbus_buffer_id = DetectBufferTypeGetByName("modbus");
 }
index b27ce2b99a3b5418f05171ec4da46d916d450bfb..271d2a9ac49a98f4407306af9ca217de3132fec3 100644 (file)
@@ -45,10 +45,6 @@ static int DetectMQTTConnackSessionPresentSetup (DetectEngineCtx *, Signature *,
 void MQTTConnackSessionPresentRegisterTests(void);
 void DetectMQTTConnackSessionPresentFree(DetectEngineCtx *de_ctx, void *);
 
-static uint8_t DetectEngineInspectMQTTConnackSessionPresentGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registration function for mqtt.connack.session_present: keyword
  */
@@ -67,19 +63,11 @@ void DetectMQTTConnackSessionPresentRegister (void)
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 
     DetectAppLayerInspectEngineRegister2("mqtt.connack.session_present", ALPROTO_MQTT,
-            SIG_FLAG_TOSERVER, 1, DetectEngineInspectMQTTConnackSessionPresentGeneric, NULL);
+            SIG_FLAG_TOSERVER, 1, DetectEngineInspectGenericList, NULL);
 
     mqtt_connack_session_present_id = DetectBufferTypeGetByName("mqtt.connack.session_present");
 }
 
-static uint8_t DetectEngineInspectMQTTConnackSessionPresentGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match session_present flag of an MQTT CONNACK message
index 476d8756e9e34b1bdd9466a0a04df308861f398d..c5ff4261f392494392e2c5b2de56419e10db271d 100644 (file)
@@ -45,10 +45,6 @@ static int DetectMQTTConnectFlagsSetup (DetectEngineCtx *, Signature *, const ch
 void MQTTConnectFlagsRegisterTests(void);
 void DetectMQTTConnectFlagsFree(DetectEngineCtx *de_ctx, void *);
 
-static uint8_t DetectEngineInspectMQTTConnectFlagsGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 typedef struct DetectMQTTConnectFlagsData_ {
     MQTTFlagState username,
                   password,
@@ -75,19 +71,11 @@ void DetectMQTTConnectFlagsRegister (void)
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 
     DetectAppLayerInspectEngineRegister2("mqtt.connect.flags", ALPROTO_MQTT, SIG_FLAG_TOSERVER, 1,
-            DetectEngineInspectMQTTConnectFlagsGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     mqtt_connect_flags_id = DetectBufferTypeGetByName("mqtt.connect.flags");
 }
 
-static uint8_t DetectEngineInspectMQTTConnectFlagsGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match variable header flags of an MQTT CONNECT Tx
index 0a6560da374eedbaf24a031862c9459372072a91..bbde89e9a2c41bb39b0e773adf4febb2facec5d3 100644 (file)
@@ -45,10 +45,6 @@ static int DetectMQTTFlagsSetup (DetectEngineCtx *, Signature *, const char *);
 void MQTTFlagsRegisterTests(void);
 void DetectMQTTFlagsFree(DetectEngineCtx *de_ctx, void *);
 
-static uint8_t DetectEngineInspectMQTTFlagsGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 typedef struct DetectMQTTFlagsData_ {
     MQTTFlagState retain, dup;
 } DetectMQTTFlagsData;
@@ -70,20 +66,12 @@ void DetectMQTTFlagsRegister (void)
 
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 
-    DetectAppLayerInspectEngineRegister2("mqtt.flags", ALPROTO_MQTT, SIG_FLAG_TOSERVER, 1,
-            DetectEngineInspectMQTTFlagsGeneric, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "mqtt.flags", ALPROTO_MQTT, SIG_FLAG_TOSERVER, 1, DetectEngineInspectGenericList, NULL);
 
     mqtt_flags_id = DetectBufferTypeGetByName("mqtt.flags");
 }
 
-static uint8_t DetectEngineInspectMQTTFlagsGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match fixed header flags of an MQTT Tx
index 7e5d26bc4009bcd2aa394f545a0acd8824ea6721..39a9ce67d6f9857457979c2c3905d6b6b2d1342d 100644 (file)
@@ -44,10 +44,6 @@ static int DetectMQTTProtocolVersionSetup (DetectEngineCtx *, Signature *, const
 void MQTTProtocolVersionRegisterTests(void);
 void DetectMQTTProtocolVersionFree(DetectEngineCtx *de_ctx, void *);
 
-static uint8_t DetectEngineInspectMQTTProtocolVersionGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registration function for mqtt.protocol_version: keyword
  */
@@ -64,19 +60,11 @@ void DetectMQTTProtocolVersionRegister (void)
 #endif
 
     DetectAppLayerInspectEngineRegister2("mqtt.protocol_version", ALPROTO_MQTT, SIG_FLAG_TOSERVER,
-            1, DetectEngineInspectMQTTProtocolVersionGeneric, NULL);
+            1, DetectEngineInspectGenericList, NULL);
 
     mqtt_protocol_version_id = DetectBufferTypeGetByName("mqtt.protocol_version");
 }
 
-static uint8_t DetectEngineInspectMQTTProtocolVersionGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match protocol version of an MQTT Tx
index 2b28d04048526729a8d11d74c82cc341cba5db9c..c6fed65892c84f8a3473da3a8fe4f2e77f1052d4 100644 (file)
@@ -43,10 +43,6 @@ static int DetectMQTTQosSetup (DetectEngineCtx *, Signature *, const char *);
 void MQTTQosRegisterTests(void);
 void DetectMQTTQosFree(DetectEngineCtx *de_ctx, void *);
 
-static uint8_t DetectEngineInspectMQTTQosGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registration function for mqtt.qos: keyword
  */
@@ -62,20 +58,12 @@ void DetectMQTTQosRegister (void)
     sigmatch_table[DETECT_AL_MQTT_QOS].RegisterTests = MQTTQosRegisterTests;
 #endif
 
-    DetectAppLayerInspectEngineRegister2("mqtt.qos", ALPROTO_MQTT, SIG_FLAG_TOSERVER, 1,
-            DetectEngineInspectMQTTQosGeneric, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "mqtt.qos", ALPROTO_MQTT, SIG_FLAG_TOSERVER, 1, DetectEngineInspectGenericList, NULL);
 
     mqtt_qos_id = DetectBufferTypeGetByName("mqtt.qos");
 }
 
-static uint8_t DetectEngineInspectMQTTQosGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match fixed header QOS field of an MQTT Tx
index ec6c7e7255d87ee6b1f3a7b123773ae764efd448..50553aa63de9a8aa546a680ed97a7b942b702dab 100644 (file)
@@ -46,10 +46,6 @@ static int DetectMQTTReasonCodeSetup (DetectEngineCtx *, Signature *, const char
 void MQTTReasonCodeRegisterTests(void);
 void DetectMQTTReasonCodeFree(DetectEngineCtx *de_ctx, void *);
 
-static uint8_t DetectEngineInspectMQTTReasonCodeGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registration function for mqtt.reason_code: keyword
  */
@@ -69,19 +65,11 @@ void DetectMQTTReasonCodeRegister (void)
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 
     DetectAppLayerInspectEngineRegister2("mqtt.reason_code", ALPROTO_MQTT, SIG_FLAG_TOSERVER, 1,
-            DetectEngineInspectMQTTReasonCodeGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     mqtt_reason_code_id = DetectBufferTypeGetByName("mqtt.reason_code");
 }
 
-static uint8_t DetectEngineInspectMQTTReasonCodeGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match reason code of an MQTT 5.0 Tx
index af01e21463c37a2a3ae39ebcb6cc7844fd3a6ed0..5d5a32ed58f4164bbe646e77e3e425aef51db231 100644 (file)
@@ -42,10 +42,6 @@ static int DetectMQTTTypeSetup (DetectEngineCtx *, Signature *, const char *);
 void MQTTTypeRegisterTests(void);
 void DetectMQTTTypeFree(DetectEngineCtx *de_ctx, void *);
 
-static uint8_t DetectEngineInspectMQTTTypeGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registration function for ipopts: keyword
  */
@@ -61,20 +57,12 @@ void DetectMQTTTypeRegister (void)
     sigmatch_table[DETECT_AL_MQTT_TYPE].RegisterTests = MQTTTypeRegisterTests;
 #endif
 
-    DetectAppLayerInspectEngineRegister2("mqtt.type", ALPROTO_MQTT, SIG_FLAG_TOSERVER, 1,
-            DetectEngineInspectMQTTTypeGeneric, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "mqtt.type", ALPROTO_MQTT, SIG_FLAG_TOSERVER, 1, DetectEngineInspectGenericList, NULL);
 
     mqtt_type_id = DetectBufferTypeGetByName("mqtt.type");
 }
 
-static uint8_t DetectEngineInspectMQTTTypeGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match control packet type of an MQTT Tx
index 2eba1794cfef215aa144bd44be33a11290dfa0e0..0aa8333fc8840f8fee217afe9fad2baa89fb072d 100644 (file)
@@ -55,10 +55,6 @@ static void DetectNfsProcedureRegisterTests(void);
 #endif
 static int g_nfs_request_buffer_id = 0;
 
-static uint8_t DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectNfsProcedureMatch (DetectEngineThreadCtx *, Flow *,
                                    uint8_t, void *, void *, const Signature *,
                                    const SigMatchCtx *);
@@ -79,22 +75,14 @@ void DetectNfsProcedureRegister (void)
     sigmatch_table[DETECT_AL_NFS_PROCEDURE].RegisterTests = DetectNfsProcedureRegisterTests;
 #endif
 
-    DetectAppLayerInspectEngineRegister2("nfs_request", ALPROTO_NFS, SIG_FLAG_TOSERVER, 0,
-            DetectEngineInspectNfsRequestGeneric, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "nfs_request", ALPROTO_NFS, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
 
     g_nfs_request_buffer_id = DetectBufferTypeGetByName("nfs_request");
 
     SCLogDebug("g_nfs_request_buffer_id %d", g_nfs_request_buffer_id);
 }
 
-static uint8_t DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match procedure of a TX
index d90fd3e17c3e5f673e363087d32d8cb735f31574..ee6feeddc0e004151015c26c8cd273f432edf874 100644 (file)
@@ -53,10 +53,6 @@ static int DetectNfsVersionSetup (DetectEngineCtx *, Signature *s, const char *s
 static void DetectNfsVersionFree(DetectEngineCtx *de_ctx, void *);
 static int g_nfs_request_buffer_id = 0;
 
-static uint8_t DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectNfsVersionMatch (DetectEngineThreadCtx *, Flow *,
                                    uint8_t, void *, void *, const Signature *,
                                    const SigMatchCtx *);
@@ -74,22 +70,14 @@ void DetectNfsVersionRegister (void)
     sigmatch_table[DETECT_AL_NFS_VERSION].Setup = DetectNfsVersionSetup;
     sigmatch_table[DETECT_AL_NFS_VERSION].Free = DetectNfsVersionFree;
     // unit tests were the same as DetectNfsProcedureRegisterTests
-    DetectAppLayerInspectEngineRegister2("nfs_request", ALPROTO_NFS, SIG_FLAG_TOSERVER, 0,
-            DetectEngineInspectNfsRequestGeneric, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "nfs_request", ALPROTO_NFS, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
 
     g_nfs_request_buffer_id = DetectBufferTypeGetByName("nfs_request");
 
     SCLogDebug("g_nfs_request_buffer_id %d", g_nfs_request_buffer_id);
 }
 
-static uint8_t DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match version of a TX
index bb5f53e771f13224567c0508d48658dcf88babb9..1e5236811ce1f2217dd49ed5135b855fa7f2b5f6 100644 (file)
@@ -47,10 +47,6 @@ static void RfbSecresultRegisterTests(void);
 #endif
 void DetectRfbSecresultFree(DetectEngineCtx *, void *);
 
-static uint8_t DetectEngineInspectRfbSecresultGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 typedef struct DetectRfbSecresultData_ {
     uint32_t result; /** result code */
 } DetectRfbSecresultData;
@@ -72,19 +68,11 @@ void DetectRfbSecresultRegister (void)
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 
     DetectAppLayerInspectEngineRegister2("rfb.secresult", ALPROTO_RFB, SIG_FLAG_TOCLIENT, 1,
-            DetectEngineInspectRfbSecresultGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     rfb_secresult_id = DetectBufferTypeGetByName("rfb.secresult");
 }
 
-static uint8_t DetectEngineInspectRfbSecresultGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 enum {
     RFB_SECRESULT_OK = 0,
     RFB_SECRESULT_FAIL,
index 263e2a66f97708ef9c5d245a690d45f0ad20ef0d..5b53287b49e6466977b4c112ab97ab62eb1a08ec 100644 (file)
@@ -38,10 +38,6 @@ static int DetectRfbSectypeSetup (DetectEngineCtx *, Signature *s, const char *s
 static void DetectRfbSectypeFree(DetectEngineCtx *, void *);
 static int g_rfb_sectype_buffer_id = 0;
 
-static uint8_t DetectEngineInspectRfbSectypeGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectRfbSectypeMatch (DetectEngineThreadCtx *, Flow *,
                                    uint8_t, void *, void *, const Signature *,
                                    const SigMatchCtx *);
@@ -58,20 +54,12 @@ void DetectRfbSectypeRegister (void)
     sigmatch_table[DETECT_AL_RFB_SECTYPE].Setup = DetectRfbSectypeSetup;
     sigmatch_table[DETECT_AL_RFB_SECTYPE].Free = DetectRfbSectypeFree;
 
-    DetectAppLayerInspectEngineRegister2("rfb.sectype", ALPROTO_RFB, SIG_FLAG_TOSERVER, 1,
-            DetectEngineInspectRfbSectypeGeneric, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "rfb.sectype", ALPROTO_RFB, SIG_FLAG_TOSERVER, 1, DetectEngineInspectGenericList, NULL);
 
     g_rfb_sectype_buffer_id = DetectBufferTypeGetByName("rfb.sectype");
 }
 
-static uint8_t DetectEngineInspectRfbSectypeGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match security type of a RFB TX
index 8284ad09cfcac03391754276158279b1a3e867e9..f5169448fea496837b2615d9a8cee93d82e10650 100644 (file)
@@ -49,10 +49,6 @@ static void DetectSNMPPduTypeRegisterTests(void);
 #endif
 static int g_snmp_pdu_type_buffer_id = 0;
 
-static uint8_t DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectSNMPPduTypeMatch (DetectEngineThreadCtx *, Flow *,
                                    uint8_t, void *, void *, const Signature *,
                                    const SigMatchCtx *);
@@ -73,22 +69,14 @@ void DetectSNMPPduTypeRegister(void)
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 
     DetectAppLayerInspectEngineRegister2("snmp.pdu_type", ALPROTO_SNMP, SIG_FLAG_TOSERVER, 0,
-            DetectEngineInspectSNMPRequestGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     DetectAppLayerInspectEngineRegister2("snmp.pdu_type", ALPROTO_SNMP, SIG_FLAG_TOCLIENT, 0,
-            DetectEngineInspectSNMPRequestGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     g_snmp_pdu_type_buffer_id = DetectBufferTypeGetByName("snmp.pdu_type");
 }
 
-static uint8_t DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match pdu_type of a TX
index 56c7ca398f516e5a9e062fc05a9a0d41d0fd3c42..f7ff2b6dd22555951987e9162fdf75a73341ee7a 100644 (file)
@@ -40,10 +40,6 @@ static void DetectSNMPVersionRegisterTests(void);
 #endif
 static int g_snmp_version_buffer_id = 0;
 
-static uint8_t DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int DetectSNMPVersionMatch (DetectEngineThreadCtx *, Flow *,
                                    uint8_t, void *, void *, const Signature *,
                                    const SigMatchCtx *);
@@ -65,22 +61,14 @@ void DetectSNMPVersionRegister (void)
 #endif
 
     DetectAppLayerInspectEngineRegister2("snmp.version", ALPROTO_SNMP, SIG_FLAG_TOSERVER, 0,
-            DetectEngineInspectSNMPRequestGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     DetectAppLayerInspectEngineRegister2("snmp.version", ALPROTO_SNMP, SIG_FLAG_TOCLIENT, 0,
-            DetectEngineInspectSNMPRequestGeneric, NULL);
+            DetectEngineInspectGenericList, NULL);
 
     g_snmp_version_buffer_id = DetectBufferTypeGetByName("snmp.version");
 }
 
-static uint8_t DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match version of a TX
index b85ad7203a41991d2b4098bc841429556388396b..c0ef98e331d6c895c684c37f86474373a5a328c8 100644 (file)
@@ -77,13 +77,6 @@ static void DetectSshSoftwareVersionRegisterTests(void);
 static void DetectSshSoftwareVersionFree(DetectEngineCtx *de_ctx, void *);
 static int g_ssh_banner_list_id = 0;
 
-static uint8_t InspectSshBanner(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
 
 /**
  * \brief Registration function for keyword: ssh.softwareversion
@@ -107,9 +100,9 @@ void DetectSshSoftwareVersionRegister(void)
     g_ssh_banner_list_id = DetectBufferTypeRegister("ssh_banner");
 
     DetectAppLayerInspectEngineRegister2("ssh_banner", ALPROTO_SSH, SIG_FLAG_TOSERVER,
-            SshStateBannerDone, InspectSshBanner, NULL);
+            SshStateBannerDone, DetectEngineInspectGenericList, NULL);
     DetectAppLayerInspectEngineRegister2("ssh_banner", ALPROTO_SSH, SIG_FLAG_TOCLIENT,
-            SshStateBannerDone, InspectSshBanner, NULL);
+            SshStateBannerDone, DetectEngineInspectGenericList, NULL);
 }
 
 /**
index 61674ad494bed2d5bb659cc04c3bdd01ae402f59..548689dba65610d410805d911b5deeb6aeb812f4 100644 (file)
@@ -66,10 +66,6 @@ static void DetectSslStateRegisterTests(void);
 #endif
 static void DetectSslStateFree(DetectEngineCtx *, void *);
 
-static uint8_t InspectTlsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 static int g_tls_generic_list_id = 0;
 
 /**
@@ -95,17 +91,9 @@ void DetectSslStateRegister(void)
             "generic ssl/tls inspection");
 
     DetectAppLayerInspectEngineRegister2(
-            "tls_generic", ALPROTO_TLS, SIG_FLAG_TOSERVER, 0, InspectTlsGeneric, NULL);
+            "tls_generic", ALPROTO_TLS, SIG_FLAG_TOSERVER, 0, DetectEngineInspectGenericList, NULL);
     DetectAppLayerInspectEngineRegister2(
-            "tls_generic", ALPROTO_TLS, SIG_FLAG_TOCLIENT, 0, InspectTlsGeneric, NULL);
-}
-
-static uint8_t InspectTlsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
+            "tls_generic", ALPROTO_TLS, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectGenericList, NULL);
 }
 
 /**
index a15e0b94c4f5849bbe9b4b9be0406b66e4a9fff6..7b9225c3fc90ded0b3d61648b1bfa9ef70fcbb75 100644 (file)
@@ -75,10 +75,6 @@ static void TlsValidRegisterTests(void);
 static void DetectTlsValidityFree(DetectEngineCtx *, void *);
 static int g_tls_validity_buffer_id = 0;
 
-static uint8_t DetectEngineInspectTlsValidity(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
 /**
  * \brief Registration function for tls validity keywords.
  */
@@ -129,19 +125,11 @@ void DetectTlsValidityRegister (void)
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 
     DetectAppLayerInspectEngineRegister2("tls_validity", ALPROTO_TLS, SIG_FLAG_TOCLIENT,
-            TLS_STATE_CERT_READY, DetectEngineInspectTlsValidity, NULL);
+            TLS_STATE_CERT_READY, DetectEngineInspectGenericList, NULL);
 
     g_tls_validity_buffer_id = DetectBufferTypeGetByName("tls_validity");
 }
 
-static uint8_t DetectEngineInspectTlsValidity(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine,
-        const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
-
 /**
  * \internal
  * \brief Function to match validity field in a tls certificate.
index 74f076236bb69634bd6aa0d90dde7fdfae5bab47..b8973b1fdd6dc238b8045ea0a3f3fae1b8080f39 100644 (file)
@@ -96,13 +96,6 @@ static int DetectTlsStorePostMatch (DetectEngineThreadCtx *det_ctx,
 
 static int g_tls_cert_list_id = 0;
 
-static uint8_t InspectTlsCert(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
-        uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(
-            de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id);
-}
 
 /**
  * \brief Registration function for keyword: tls.version
@@ -150,8 +143,8 @@ void DetectTlsRegister (void)
 
     g_tls_cert_list_id = DetectBufferTypeRegister("tls_cert");
 
-    DetectAppLayerInspectEngineRegister2(
-            "tls_cert", ALPROTO_TLS, SIG_FLAG_TOCLIENT, TLS_STATE_CERT_READY, InspectTlsCert, NULL);
+    DetectAppLayerInspectEngineRegister2("tls_cert", ALPROTO_TLS, SIG_FLAG_TOCLIENT,
+            TLS_STATE_CERT_READY, DetectEngineInspectGenericList, NULL);
 }
 
 /**