]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: change InspectEngineFuncPtr2 to return uint8_t
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 3 Jun 2022 14:08:34 +0000 (16:08 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 9 Jun 2022 05:27:16 +0000 (07:27 +0200)
60 files changed:
src/detect-app-layer-event.c
src/detect-dce-iface.c
src/detect-dnp3.c
src/detect-dns-opcode.c
src/detect-dns-query.c
src/detect-engine-content-inspection.c
src/detect-engine-content-inspection.h
src/detect-engine-dcepayload.h
src/detect-engine-enip.c
src/detect-engine-enip.h
src/detect-engine-file.c
src/detect-engine-file.h
src/detect-engine-payload.c
src/detect-engine-payload.h
src/detect-engine.c
src/detect-engine.h
src/detect-file-data.c
src/detect-filemagic.c
src/detect-filename.c
src/detect-ftpbounce.c
src/detect-ftpdata.c
src/detect-http-client-body.c
src/detect-http-header.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-ike-vendor.c
src/detect-krb5-cname.c
src/detect-krb5-errcode.c
src/detect-krb5-msgtype.c
src/detect-krb5-sname.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-subscribe-topic.c
src/detect-mqtt-type.c
src/detect-mqtt-unsubscribe-topic.c
src/detect-nfs-procedure.c
src/detect-nfs-version.c
src/detect-quic-cyu-hash.c
src/detect-quic-cyu-string.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-template-rust-buffer.c
src/detect-tls-cert-validity.c
src/detect-tls-certs.c
src/detect-tls.c
src/detect.c
src/detect.h

index 174e25827ba57c6a5fe75f0676c9d1fa34c3cb43..a581812e2114a9583d6d1e0c160eece8c1c76c9a 100644 (file)
@@ -55,7 +55,7 @@ static int DetectAppLayerEventSetupP1(DetectEngineCtx *, Signature *, const char
 static void DetectAppLayerEventRegisterTests(void);
 #endif
 static void DetectAppLayerEventFree(DetectEngineCtx *, void *);
-static int DetectEngineAptEventInspect(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+static uint8_t DetectEngineAptEventInspect(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
         const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
         uint8_t flags, void *alstate, void *tx, uint64_t tx_id);
 static int g_applayer_events_list_id = 0;
@@ -85,7 +85,7 @@ void DetectAppLayerEventRegister(void)
     g_applayer_events_list_id = DetectBufferTypeGetByName("app-layer-events");
 }
 
-static int DetectEngineAptEventInspect(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+static uint8_t DetectEngineAptEventInspect(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
         const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
         uint8_t flags, void *alstate, void *tx, uint64_t tx_id)
 {
index d87fd57b9b53c14046a911725d9c28ab59214ed1..6631e685f920860a270f0e18b3fb85cfec16c655 100644 (file)
@@ -62,7 +62,7 @@ static void DetectDceIfaceRegisterTests(void);
 #endif
 static int g_dce_generic_list_id = 0;
 
-static int InspectDceGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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);
 
@@ -94,7 +94,7 @@ void DetectDceIfaceRegister(void)
             "dce_generic", ALPROTO_SMB, SIG_FLAG_TOCLIENT, 0, InspectDceGeneric, NULL);
 }
 
-static int InspectDceGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
index fa54c8d42f00c9c3f1eda28279dedc6c9168f2f2..ee73ebf89f2fb8b95f81eb8af1d9d28d8ff858a8 100644 (file)
@@ -175,7 +175,7 @@ static InspectionBuffer *GetDNP3Data(DetectEngineThreadCtx *det_ctx,
     return buffer;
 }
 
-static int DetectEngineInspectDNP3(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
index e4356c47bf189822815f9695c0ab06386e7f54b0..8e71ab6f0c1b12f636be3183e96ed9fd8b6fa1d1 100644 (file)
@@ -74,7 +74,7 @@ static int DetectDnsOpcodeMatch(DetectEngineThreadCtx *det_ctx,
     return rs_dns_opcode_match(txv, (void *)ctx, flags);
 }
 
-static int DetectEngineInspectRequestGenericDnsOpcode(DetectEngineCtx *de_ctx,
+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)
 {
index 9c688cd8b24c48b468c2b5de011175cde7e6abe7..8faa935fe4bde76d591e6b6b2f8c6936a50f4c13 100644 (file)
@@ -94,11 +94,9 @@ static InspectionBuffer *DnsQueryGetData(DetectEngineThreadCtx *det_ctx,
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectDnsQuery(
-        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 uint8_t DetectEngineInspectDnsQuery(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)
 {
     uint32_t local_id = 0;
 
@@ -199,17 +197,17 @@ static int PrefilterMpmDnsQueryRegister(DetectEngineCtx *de_ctx,
 }
 
 #ifdef HAVE_LUA
-static int 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)
+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 int 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)
+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);
index a34b4922221b4543ca170e2a5054f5157d60fd85..d0be34ca0d0a8f28cbbe366d20556cb5c58c37e5 100644 (file)
  *  \retval 0 no match
  *  \retval 1 match
  */
-int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-                                  const Signature *s, const SigMatchData *smd,
-                                  Packet *p, Flow *f,
-                                  const uint8_t *buffer, uint32_t buffer_len,
-                                  uint32_t stream_start_offset, uint8_t flags,
-                                  uint8_t inspection_mode)
+uint8_t DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+        const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const uint8_t *buffer,
+        uint32_t buffer_len, uint32_t stream_start_offset, uint8_t flags, uint8_t inspection_mode)
 {
     SCEnter();
     KEYWORD_PROFILING_START;
@@ -343,9 +340,8 @@ int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx
                     /* see if the next buffer keywords match. If not, we will
                      * search for another occurrence of this content and see
                      * if the others match then until we run out of matches */
-                    int r = DetectEngineContentInspection(de_ctx, det_ctx, s, smd+1,
-                            p, f, buffer, buffer_len, stream_start_offset, flags,
-                            inspection_mode);
+                    uint8_t r = DetectEngineContentInspection(de_ctx, det_ctx, s, smd + 1, p, f,
+                            buffer, buffer_len, stream_start_offset, flags, inspection_mode);
                     if (r == 1) {
                         SCReturnInt(1);
                     }
@@ -609,7 +605,7 @@ int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx
     } else if (smd->type == DETECT_AL_URILEN) {
         SCLogDebug("inspecting uri len");
 
-        int r = 0;
+        uint8_t r = 0;
         DetectUrilenData *urilend = (DetectUrilenData *) smd->ctx;
 
         switch (urilend->mode) {
@@ -680,9 +676,8 @@ match:
      * the buffer portion of the signature matched. */
     if (!smd->is_last) {
         KEYWORD_PROFILING_END(det_ctx, smd->type, 1);
-        int r = DetectEngineContentInspection(de_ctx, det_ctx, s, smd+1,
-                p, f, buffer, buffer_len, stream_start_offset, flags,
-                inspection_mode);
+        uint8_t r = DetectEngineContentInspection(de_ctx, det_ctx, s, smd + 1, p, f, buffer,
+                buffer_len, stream_start_offset, flags, inspection_mode);
         SCReturnInt(r);
     }
 final_match:
index 149109e60e081ea2ebd481862c09ce759ad737ff..ae1e8ed5bfa11823d565f81bf4b9d3d1624b34a6 100644 (file)
@@ -46,12 +46,9 @@ enum {
  *  inspection function contains both start and end of the data. */
 #define DETECT_CI_FLAGS_SINGLE  (DETECT_CI_FLAGS_START|DETECT_CI_FLAGS_END)
 
-int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-                                  const Signature *s, const SigMatchData *smd,
-                                  Packet *p, Flow *f,
-                                  const uint8_t *buffer, uint32_t buffer_len,
-                                  uint32_t stream_start_offset, uint8_t flags,
-                                  uint8_t inspection_mode);
+uint8_t DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+        const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const uint8_t *buffer,
+        uint32_t buffer_len, uint32_t stream_start_offset, uint8_t flags, uint8_t inspection_mode);
 
 void DetectEngineContentInspectionRegisterTests(void);
 
index d67a3cffe0937221429f215a5067c82c1bf18763..dc2fcd809b68642553bae11b6569f9b97e60303e 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __DETECT_ENGINE_DCEPAYLOAD_H__
 #define __DETECT_ENGINE_DCEPAYLOAD_H__
 
-//int DetectEngineInspectDcePayload(DetectEngineCtx *, DetectEngineThreadCtx *,
+// uint8_t DetectEngineInspectDcePayload(DetectEngineCtx *, DetectEngineThreadCtx *,
 //        const Signature *, Flow *, uint8_t, void *);
 
 void DcePayloadRegisterTests(void);
index c6f5d570ea8cf755cf9e8797b809c1a8277a518a..5e5ccaf1edd666b1ed6d68ef3ce7c204f1752ddf 100644 (file)
@@ -217,7 +217,7 @@ static int CIPServiceMatch(ENIPTransaction *enip_data,
  *
  *  \retval 0 no match or 1 match
  */
-int DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+uint8_t DetectEngineInspectCIP(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)
 {
@@ -256,7 +256,7 @@ int DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_c
  *  \retval 0 no match or 1 match
  */
 
-int DetectEngineInspectENIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+uint8_t DetectEngineInspectENIP(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)
 {
index 4ef333b200d4ae4bc142355e0f0ed9f13e6342f9..3c263f999770d7ce0cb03594b1222fa87b060fd2 100644 (file)
 #ifndef __DETECT_ENGINE_ENIP_H__
 #define __DETECT_ENGINE_ENIP_H__
 
-int DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *,
+uint8_t DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *,
         const struct DetectEngineAppInspectionEngine_ *, const Signature *, Flow *, uint8_t, void *,
         void *, uint64_t);
 
-int DetectEngineInspectENIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *,
+uint8_t DetectEngineInspectENIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *,
         const struct DetectEngineAppInspectionEngine_ *, const Signature *, Flow *, uint8_t, void *,
         void *, uint64_t);
 
index 87034c64757f9b6d518974f358b421c2d5e91dd5..84a1809e918379ebd1831b8c5adb579e9109f4cd 100644 (file)
  *  \retval 2 can't match
  *  \retval 3 can't match filestore signature
  */
-static int DetectFileInspect(DetectEngineThreadCtx *det_ctx, Flow *f, const Signature *s,
+static uint8_t DetectFileInspect(DetectEngineThreadCtx *det_ctx, Flow *f, const Signature *s,
         const SigMatchData *smd, uint8_t flags, FileContainer *ffc)
 {
-    int r = 0;
+    uint8_t r = 0;
     int match = 0;
     int store_r = 0;
 
@@ -213,7 +213,7 @@ static int DetectFileInspect(DetectEngineThreadCtx *det_ctx, Flow *f, const Sign
  *
  *  \note flow is not locked at this time
  */
-int DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+uint8_t DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
         const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
         uint8_t flags, void *_alstate, void *tx, uint64_t tx_id)
 {
@@ -226,8 +226,8 @@ int DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det
         SCReturnInt(DETECT_ENGINE_INSPECT_SIG_NO_MATCH);
     }
 
-    int r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
-    int match = DetectFileInspect(det_ctx, f, s, engine->smd, flags, ffc);
+    uint8_t r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
+    uint8_t match = DetectFileInspect(det_ctx, f, s, engine->smd, flags, ffc);
     if (match == DETECT_ENGINE_INSPECT_SIG_MATCH) {
         r = DETECT_ENGINE_INSPECT_SIG_MATCH;
     } else if (match == DETECT_ENGINE_INSPECT_SIG_CANT_MATCH) {
index d5cfa9f1f20d3b0e3daf65b042fb777712e6ce2c..3705a8f6e60176a1d8b8cadc4262cb77f1e0c649 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __DETECT_ENGINE_FILE_H__
 #define __DETECT_ENGINE_FILE_H__
 
-int DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+uint8_t DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
         const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f,
         uint8_t flags, void *_alstate, void *tx, uint64_t tx_id);
 
index 65cdf076daf229594bd97e3e2a9a01192eb85852..110ac6c26faaf3a0c3b7085d801130dd5393949d 100644 (file)
@@ -145,8 +145,8 @@ int PrefilterPktPayloadRegister(DetectEngineCtx *de_ctx,
  *  \retval 0 no match
  *  \retval 1 match
  */
-int DetectEngineInspectPacketPayload(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, Packet *p)
+uint8_t DetectEngineInspectPacketPayload(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+        const Signature *s, Flow *f, Packet *p)
 {
     SCEnter();
     int r = 0;
@@ -186,10 +186,9 @@ int DetectEngineInspectPacketPayload(DetectEngineCtx *de_ctx,
  *  \retval 0 no match
  *  \retval 1 match
  */
-static int DetectEngineInspectStreamUDPPayload(DetectEngineCtx *de_ctx,
-        DetectEngineThreadCtx *det_ctx,
-        const Signature *s, const SigMatchData *smd,
-        Flow *f, Packet *p)
+static uint8_t DetectEngineInspectStreamUDPPayload(DetectEngineCtx *de_ctx,
+        DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Flow *f,
+        Packet *p)
 {
     SCEnter();
     int r = 0;
@@ -314,7 +313,7 @@ static int StreamContentInspectEngineFunc(
  *
  *  Returns "can't match" if depth is reached.
  */
-int DetectEngineInspectStream(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+uint8_t DetectEngineInspectStream(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)
 {
index d10ee66a859e9c5d76685e3a63362ff565a7c80f..7ef29db6c66693bde2c9c3ab87d5d349aceceab0 100644 (file)
@@ -29,12 +29,12 @@ int PrefilterPktPayloadRegister(DetectEngineCtx *de_ctx,
 int PrefilterPktStreamRegister(DetectEngineCtx *de_ctx,
         SigGroupHead *sgh, MpmCtx *mpm_ctx);
 
-int DetectEngineInspectPacketPayload(DetectEngineCtx *,
-        DetectEngineThreadCtx *, const Signature *, Flow *, Packet *);
+uint8_t DetectEngineInspectPacketPayload(
+        DetectEngineCtx *, DetectEngineThreadCtx *, const Signature *, Flow *, Packet *);
 int DetectEngineInspectStreamPayload(DetectEngineCtx *,
         DetectEngineThreadCtx *, const Signature *, Flow *,
         Packet *);
-int DetectEngineInspectStream(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+uint8_t DetectEngineInspectStream(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);
 
index b969db79b4d113eb62af0d215974c23c3260f651..2189721f79cc71794eb797f43fadf97e231c8d71 100644 (file)
@@ -1946,9 +1946,9 @@ int DetectEngineReloadIsIdle(void)
  *  \retval 0 no match
  *  \retval 1 match
  */
-int 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(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)
 {
     SCLogDebug("running match functions, sm %p", smd);
     if (smd != NULL) {
@@ -1988,11 +1988,9 @@ int DetectEngineInspectGenericList(const DetectEngineCtx *de_ctx, DetectEngineTh
  * \retval 1 match.
  * \retval 2 Sig can't match.
  */
-int DetectEngineInspectBufferGeneric(
-        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)
+uint8_t DetectEngineInspectBufferGeneric(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)
 {
     const int list_id = engine->sm_list;
     SCLogDebug("running inspect on %d", list_id);
index 018149f7d385774cc74d509bb7c53b18cf89a860..a55b140d956f6c6aacaf2962c35f35c73be49154 100644 (file)
@@ -134,14 +134,12 @@ int DetectEngineTentantUnregisterVlanId(uint32_t tenant_id, uint16_t vlan_id);
 int DetectEngineTentantRegisterPcapFile(uint32_t tenant_id);
 int DetectEngineTentantUnregisterPcapFile(uint32_t tenant_id);
 
-int DetectEngineInspectGenericList(const DetectEngineCtx *, DetectEngineThreadCtx *,
+uint8_t DetectEngineInspectGenericList(const DetectEngineCtx *, DetectEngineThreadCtx *,
         const Signature *, const SigMatchData *, Flow *, const uint8_t, void *, void *, uint64_t);
 
-int DetectEngineInspectBufferGeneric(
-        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);
+uint8_t DetectEngineInspectBufferGeneric(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);
 
 int DetectEngineInspectPktBufferGeneric(
         DetectEngineThreadCtx *det_ctx,
index 4c15e448d44e6182bb152ed88e16b4a5c1322524..0904b7c527a0e7d648e95801b34f1a8b77cac734 100644 (file)
@@ -66,16 +66,14 @@ static int PrefilterMpmHTTPFiledataRegister(DetectEngineCtx *de_ctx, SigGroupHea
         MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id);
 
 /* file API */
-static int DetectEngineInspectFiledata(
-        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 uint8_t DetectEngineInspectFiledata(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);
 int PrefilterMpmFiledataRegister(DetectEngineCtx *de_ctx,
         SigGroupHead *sgh, MpmCtx *mpm_ctx,
         const DetectBufferMpmRegistery *mpm_reg, int list_id);
 
-static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx,
+static uint8_t DetectEngineInspectBufferHttpBody(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);
 
@@ -401,7 +399,7 @@ static InspectionBuffer *HttpServerBodyGetDataCallback(DetectEngineThreadCtx *de
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx,
+static uint8_t DetectEngineInspectBufferHttpBody(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)
 {
@@ -596,11 +594,9 @@ static InspectionBuffer *FiledataGetDataCallback(DetectEngineThreadCtx *det_ctx,
     }
 }
 
-static int DetectEngineInspectFiledata(
-        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 uint8_t DetectEngineInspectFiledata(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)
 {
     int r = 0;
     int match = 0;
index 93ac153d86cd38f01f327c33113d99e6ba0bfb3b..8b40f06ab49f8aa1a27a1bf507f64e700a112e6c 100644 (file)
@@ -93,11 +93,9 @@ static int g_file_magic_buffer_id = 0;
 static int PrefilterMpmFilemagicRegister(DetectEngineCtx *de_ctx,
         SigGroupHead *sgh, MpmCtx *mpm_ctx,
         const DetectBufferMpmRegistery *mpm_reg, int list_id);
-static int DetectEngineInspectFilemagic(
-        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 uint8_t DetectEngineInspectFilemagic(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_magic_thread_ctx_id = -1;
 
@@ -465,11 +463,9 @@ static InspectionBuffer *FilemagicGetDataCallback(DetectEngineThreadCtx *det_ctx
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectFilemagic(
-        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 uint8_t DetectEngineInspectFilemagic(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)
 {
     const DetectEngineTransforms *transforms = NULL;
     if (!engine->mpm) {
@@ -481,7 +477,7 @@ static int DetectEngineInspectFilemagic(
         return DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
     }
 
-    int r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
+    uint8_t r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
     int local_file_id = 0;
     for (File *file = ffc->head; file != NULL; file = file->next) {
         if (file->txid != tx_id)
index 63f5085dd3f170459e16e93e31852d258f3ea5c6..382881034eb603070b89926fa967575cc81a3999 100644 (file)
@@ -68,11 +68,9 @@ static int g_file_name_buffer_id = 0;
 static int PrefilterMpmFilenameRegister(DetectEngineCtx *de_ctx,
         SigGroupHead *sgh, MpmCtx *mpm_ctx,
         const DetectBufferMpmRegistery *mpm_reg, int list_id);
-static int DetectEngineInspectFilename(
-        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 uint8_t DetectEngineInspectFilename(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);
 
 /**
  * \brief Registration function for keyword: filename
@@ -371,11 +369,9 @@ static InspectionBuffer *FilenameGetDataCallback(DetectEngineThreadCtx *det_ctx,
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectFilename(
-        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 uint8_t DetectEngineInspectFilename(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)
 {
     const DetectEngineTransforms *transforms = NULL;
     if (!engine->mpm) {
@@ -387,7 +383,7 @@ static int DetectEngineInspectFilename(
         return DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
     }
 
-    int r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
+    uint8_t r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
     int local_file_id = 0;
     for (File *file = ffc->head; file != NULL; file = file->next) {
         if (file->txid != tx_id)
index fd0996832000cdaae0d91b3c25e96061aee8516e..3f556cedaa123fd2ff93a3c68f4f3144eeb4d167 100644 (file)
@@ -57,7 +57,7 @@ static void DetectFtpbounceRegisterTests(void);
 #endif
 static int g_ftp_request_list_id = 0;
 
-static int InspectFtpRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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);
 
@@ -83,7 +83,7 @@ void DetectFtpbounceRegister(void)
             "ftp_request", ALPROTO_FTP, SIG_FLAG_TOSERVER, 0, InspectFtpRequest, NULL);
 }
 
-static int InspectFtpRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
index 15ba03c4b41893266f13c5470f829dc57c220ae4..f058264dc1cacddf83428ed52d45cf73ebe69d6b 100644 (file)
@@ -49,7 +49,7 @@ static void DetectFtpdataFree (DetectEngineCtx *, void *);
 #ifdef UNITTESTS
 static void DetectFtpdataRegisterTests (void);
 #endif
-static int DetectEngineInspectFtpdataGeneric(DetectEngineCtx *de_ctx,
+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;
@@ -87,7 +87,7 @@ void DetectFtpdataRegister(void) {
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
 }
 
-static int DetectEngineInspectFtpdataGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 8fe1802bf657741babcbcc08d0c8644469555a52..f4511957634eb135e37d4b63af7eb1ac8ad3406f 100644 (file)
@@ -68,7 +68,7 @@ static void DetectHttpClientBodySetupCallback(const DetectEngineCtx *de_ctx,
                                               Signature *s);
 static int g_http_client_body_buffer_id = 0;
 
-static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx,
+static uint8_t DetectEngineInspectBufferHttpBody(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);
 
@@ -295,7 +295,7 @@ static InspectionBuffer *HttpRequestBodyGetDataCallback(DetectEngineThreadCtx *d
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx,
+static uint8_t DetectEngineInspectBufferHttpBody(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)
 {
index bedee8f0c74844081b21f4ff51d72d540c09b802..ea692c604e2a5a59e67de6d679b34398dae1e9fd 100644 (file)
@@ -166,11 +166,9 @@ static InspectionBuffer *GetBuffer2ForTX(DetectEngineThreadCtx *det_ctx,
 /** \internal
  *  \brief custom inspect function to utilize the cached headers
  */
-static int DetectEngineInspectBufferHttpHeader(
-        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 uint8_t DetectEngineInspectBufferHttpHeader(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)
 {
     SCEnter();
 
index e0682e05b195217ed74280e4a05d4e1ce9cc377c..75af58c43f9f535821de2e46399d991298147598 100644 (file)
@@ -86,21 +86,17 @@ static int DetectHTTP2headerNameSetup(DetectEngineCtx *de_ctx, Signature *s, con
 static int PrefilterMpmHttp2HeaderNameRegister(DetectEngineCtx *de_ctx,
                                                SigGroupHead *sgh, MpmCtx *mpm_ctx,
                                                const DetectBufferMpmRegistery *mpm_reg, int list_id);
-static int DetectEngineInspectHttp2HeaderName(
-                                              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 uint8_t DetectEngineInspectHttp2HeaderName(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 DetectHTTP2headerSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg);
 static int PrefilterMpmHttp2HeaderRegister(DetectEngineCtx *de_ctx,
                                                SigGroupHead *sgh, MpmCtx *mpm_ctx,
                                                const DetectBufferMpmRegistery *mpm_reg, int list_id);
-static int DetectEngineInspectHttp2Header(
-                                          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 uint8_t DetectEngineInspectHttp2Header(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 bool DetectHttp2HeaderValidateCallback(const Signature *s, const char **sigerror);
 
 #ifdef UNITTESTS
@@ -111,7 +107,7 @@ 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 int DetectEngineInspectHTTP2(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
@@ -759,11 +755,9 @@ static int PrefilterMpmHttp2HeaderNameRegister(DetectEngineCtx *de_ctx,
             pectx, PrefilterMpmHttp2HNameFree, mpm_reg->name);
 }
 
-static int DetectEngineInspectHttp2HeaderName(
-        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 uint8_t DetectEngineInspectHttp2HeaderName(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)
 {
     uint32_t local_id = 0;
 
@@ -891,11 +885,9 @@ static int PrefilterMpmHttp2HeaderRegister(DetectEngineCtx *de_ctx,
             pectx, PrefilterMpmHttp2HeaderFree, mpm_reg->name);
 }
 
-static int DetectEngineInspectHttp2Header(
-        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 uint8_t DetectEngineInspectHttp2Header(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)
 {
     uint32_t local_id = 0;
 
index 92b965c98c91c163e3d2a11d8da899d1246d0d93..3b2932e17f09f9529e942ef52181a1e18bb23552 100644 (file)
@@ -56,7 +56,7 @@ static int DetectIkeChosenSaSetup(DetectEngineCtx *, Signature *s, const char *s
 static void DetectIkeChosenSaFree(DetectEngineCtx *, void *);
 static int g_ike_chosen_sa_buffer_id = 0;
 
-static int DetectEngineInspectIkeChosenSaGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -87,7 +87,7 @@ void DetectIkeChosenSaRegister(void)
     g_ike_chosen_sa_buffer_id = DetectBufferTypeGetByName("ike.chosen_sa_attribute");
 }
 
-static int DetectEngineInspectIkeChosenSaGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 729d5848644afd593ac2b85c50aa593b76803e4a..13cb7e62828a3ebac5d3c1da7de344a1aacb4d50 100644 (file)
@@ -41,7 +41,7 @@ static int DetectIkeExchTypeSetup(DetectEngineCtx *, Signature *s, const char *s
 static void DetectIkeExchTypeFree(DetectEngineCtx *, void *);
 static int g_ike_exch_type_buffer_id = 0;
 
-static int DetectEngineInspectIkeExchTypeGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -70,7 +70,7 @@ void DetectIkeExchTypeRegister(void)
     g_ike_exch_type_buffer_id = DetectBufferTypeGetByName("ike.exchtype");
 }
 
-static int DetectEngineInspectIkeExchTypeGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 5fbb615adaba675670bed7ba0c93111f09cd3a9b..84961bf8e3d52fa2d354a835d4a146030f323e0b 100644 (file)
@@ -40,7 +40,7 @@ static int DetectIkeKeyExchangePayloadLengthSetup(DetectEngineCtx *, Signature *
 static void DetectIkeKeyExchangePayloadLengthFree(DetectEngineCtx *, void *);
 static int g_ike_key_exch_payload_length_buffer_id = 0;
 
-static int DetectEngineInspectIkeKeyExchangePayloadLengthGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -75,7 +75,7 @@ void DetectIkeKeyExchangePayloadLengthRegister(void)
             DetectBufferTypeGetByName("ike.key_exchange_payload_length");
 }
 
-static int DetectEngineInspectIkeKeyExchangePayloadLengthGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 7ec7b2ce0d154a8f946e7005305535a5445d562d..b29a8d2ef7aa714d0625ca56c66bb0b5ad240b81 100644 (file)
@@ -40,7 +40,7 @@ static int DetectIkeNoncePayloadLengthSetup(DetectEngineCtx *, Signature *s, con
 static void DetectIkeNoncePayloadLengthFree(DetectEngineCtx *, void *);
 static int g_ike_nonce_payload_length_buffer_id = 0;
 
-static int DetectEngineInspectIkeNoncePayloadLengthGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -70,7 +70,7 @@ void DetectIkeNoncePayloadLengthRegister(void)
     g_ike_nonce_payload_length_buffer_id = DetectBufferTypeGetByName("ike.nonce_payload_length");
 }
 
-static int DetectEngineInspectIkeNoncePayloadLengthGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index eaa1d52ed812805bde73ade1b89e4d5f6b997e19..73c2c0a7bf7bce95985766d2f6767d2a1f5473be 100644 (file)
@@ -132,7 +132,7 @@ static int PrefilterMpmIkeVendorRegister(DetectEngineCtx *de_ctx, SigGroupHead *
             mpm_reg->app_v2.tx_min_progress, pectx, PrefilterMpmIkeVendorFree, mpm_reg->pname);
 }
 
-static int DetectEngineInspectIkeVendor(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+static uint8_t DetectEngineInspectIkeVendor(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)
 {
index 9ae593a8f234e86f995829164f9d40400f1bd683..a7a2710178eb6bddffe7382ae69517e10b587c58 100644 (file)
@@ -81,11 +81,9 @@ static InspectionBuffer *GetKrb5CNameData(DetectEngineThreadCtx *det_ctx,
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectKrb5CName(
-        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 uint8_t DetectEngineInspectKrb5CName(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)
 {
     uint32_t local_id = 0;
 
index 8484daebd627d3203a8d52118cf76332a4272991..c39f18c543d720f70616abc4def50b2dacef751a 100644 (file)
@@ -49,9 +49,9 @@ static void DetectKrb5ErrCodeFree (DetectEngineCtx *, void *);
 static void DetectKrb5ErrCodeRegisterTests (void);
 #endif
 
-static int 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 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;
 
@@ -86,9 +86,9 @@ void DetectKrb5ErrCodeRegister(void)
     SCLogDebug("g_krb5_err_code_list_id %d", g_krb5_err_code_list_id);
 }
 
-static int 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 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);
index 4c661f38d676cbf1715191c78fbddd977044d2c5..ee5d7f0618b7a13b3dc27d59677899b90abef85c 100644 (file)
@@ -49,9 +49,9 @@ static void DetectKrb5MsgTypeFree (DetectEngineCtx *, void *);
 static void DetectKrb5MsgTypeRegisterTests (void);
 #endif
 
-static int 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 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;
 
@@ -86,9 +86,9 @@ void DetectKrb5MsgTypeRegister(void)
     SCLogDebug("g_krb5_msg_type_list_id %d", g_krb5_msg_type_list_id);
 }
 
-static int 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 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);
index 6adb73695f77c1e39ab0d55f11d6cb0206284ab0..318484b0861878cb0db5a59fc29b4b86037bba92 100644 (file)
@@ -81,11 +81,9 @@ static InspectionBuffer *GetKrb5SNameData(DetectEngineThreadCtx *det_ctx,
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectKrb5SName(
-        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 uint8_t DetectEngineInspectKrb5SName(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)
 {
     uint32_t local_id = 0;
 
index b94f19f931e5dea7c9e6dc14cfce028b1cd15fb2..4d055981ed6351501104884ee47d5dc11eeaea63 100644 (file)
@@ -103,7 +103,7 @@ static void DetectLuaRegisterTests(void);
 static void DetectLuaFree(DetectEngineCtx *, void *);
 static int g_smtp_generic_list_id = 0;
 
-static int InspectSmtpGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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);
 
@@ -134,7 +134,7 @@ void DetectLuaRegister(void)
     return;
 }
 
-static int InspectSmtpGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
index 6940a333a89ca7fd5dc642d92f845e5e6a1d3714..1c542ce391eb69bc3dc201db17a02aa590b3caa3 100644 (file)
@@ -133,7 +133,7 @@ static int DetectModbusMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t fl
  *
  *  \retval 0 no match or 1 match
  */
-static int DetectEngineInspectModbus(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
index b209c75558ebd34a6c210e65b660ae76f1c303d1..b27ce2b99a3b5418f05171ec4da46d916d450bfb 100644 (file)
@@ -45,7 +45,7 @@ static int DetectMQTTConnackSessionPresentSetup (DetectEngineCtx *, Signature *,
 void MQTTConnackSessionPresentRegisterTests(void);
 void DetectMQTTConnackSessionPresentFree(DetectEngineCtx *de_ctx, void *);
 
-static int DetectEngineInspectMQTTConnackSessionPresentGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -72,7 +72,7 @@ void DetectMQTTConnackSessionPresentRegister (void)
     mqtt_connack_session_present_id = DetectBufferTypeGetByName("mqtt.connack.session_present");
 }
 
-static int DetectEngineInspectMQTTConnackSessionPresentGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 5084a2e17203de31bae6363b0b31d80c607c7c23..476d8756e9e34b1bdd9466a0a04df308861f398d 100644 (file)
@@ -45,7 +45,7 @@ static int DetectMQTTConnectFlagsSetup (DetectEngineCtx *, Signature *, const ch
 void MQTTConnectFlagsRegisterTests(void);
 void DetectMQTTConnectFlagsFree(DetectEngineCtx *de_ctx, void *);
 
-static int DetectEngineInspectMQTTConnectFlagsGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -80,7 +80,7 @@ void DetectMQTTConnectFlagsRegister (void)
     mqtt_connect_flags_id = DetectBufferTypeGetByName("mqtt.connect.flags");
 }
 
-static int DetectEngineInspectMQTTConnectFlagsGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 3169a84601a0736c37e60c7a871e53a2817e270a..0a6560da374eedbaf24a031862c9459372072a91 100644 (file)
@@ -45,7 +45,7 @@ static int DetectMQTTFlagsSetup (DetectEngineCtx *, Signature *, const char *);
 void MQTTFlagsRegisterTests(void);
 void DetectMQTTFlagsFree(DetectEngineCtx *de_ctx, void *);
 
-static int DetectEngineInspectMQTTFlagsGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -76,7 +76,7 @@ void DetectMQTTFlagsRegister (void)
     mqtt_flags_id = DetectBufferTypeGetByName("mqtt.flags");
 }
 
-static int DetectEngineInspectMQTTFlagsGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 0483bfa3e27a3b029ee7ac71e6b10640cb12a7ac..7e5d26bc4009bcd2aa394f545a0acd8824ea6721 100644 (file)
@@ -44,7 +44,7 @@ static int DetectMQTTProtocolVersionSetup (DetectEngineCtx *, Signature *, const
 void MQTTProtocolVersionRegisterTests(void);
 void DetectMQTTProtocolVersionFree(DetectEngineCtx *de_ctx, void *);
 
-static int DetectEngineInspectMQTTProtocolVersionGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -69,7 +69,7 @@ void DetectMQTTProtocolVersionRegister (void)
     mqtt_protocol_version_id = DetectBufferTypeGetByName("mqtt.protocol_version");
 }
 
-static int DetectEngineInspectMQTTProtocolVersionGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index a5da29729d612bde7ce9eed2915f05a4efebe23f..2b28d04048526729a8d11d74c82cc341cba5db9c 100644 (file)
@@ -43,7 +43,7 @@ static int DetectMQTTQosSetup (DetectEngineCtx *, Signature *, const char *);
 void MQTTQosRegisterTests(void);
 void DetectMQTTQosFree(DetectEngineCtx *de_ctx, void *);
 
-static int DetectEngineInspectMQTTQosGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -68,7 +68,7 @@ void DetectMQTTQosRegister (void)
     mqtt_qos_id = DetectBufferTypeGetByName("mqtt.qos");
 }
 
-static int DetectEngineInspectMQTTQosGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index b5eb8e741f42397990bc9dcc289e1e0c64880ed0..ec6c7e7255d87ee6b1f3a7b123773ae764efd448 100644 (file)
@@ -46,7 +46,7 @@ static int DetectMQTTReasonCodeSetup (DetectEngineCtx *, Signature *, const char
 void MQTTReasonCodeRegisterTests(void);
 void DetectMQTTReasonCodeFree(DetectEngineCtx *de_ctx, void *);
 
-static int DetectEngineInspectMQTTReasonCodeGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -74,7 +74,7 @@ void DetectMQTTReasonCodeRegister (void)
     mqtt_reason_code_id = DetectBufferTypeGetByName("mqtt.reason_code");
 }
 
-static int DetectEngineInspectMQTTReasonCodeGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 32d7b1608354ffaa1ca7b16b9f3ed6f2270d8336..1e88259f19e71cd441a5b409a199a27f898a5ee6 100644 (file)
@@ -89,11 +89,9 @@ static InspectionBuffer *MQTTSubscribeTopicGetData(DetectEngineThreadCtx *det_ct
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectMQTTSubscribeTopic(
-        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 uint8_t DetectEngineInspectMQTTSubscribeTopic(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)
 {
     uint32_t local_id = 0;
 
index 8c21e11bbe8b554fc630a9a8863293a8c3ef1813..af01e21463c37a2a3ae39ebcb6cc7844fd3a6ed0 100644 (file)
@@ -42,7 +42,7 @@ static int DetectMQTTTypeSetup (DetectEngineCtx *, Signature *, const char *);
 void MQTTTypeRegisterTests(void);
 void DetectMQTTTypeFree(DetectEngineCtx *de_ctx, void *);
 
-static int DetectEngineInspectMQTTTypeGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -67,7 +67,7 @@ void DetectMQTTTypeRegister (void)
     mqtt_type_id = DetectBufferTypeGetByName("mqtt.type");
 }
 
-static int DetectEngineInspectMQTTTypeGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 671cfebaf4e60db555bcbca557ce86ed54f77415..94283fd4f4ec33fe2efa4b134aa148f9cfefb893 100644 (file)
@@ -89,11 +89,9 @@ static InspectionBuffer *MQTTUnsubscribeTopicGetData(DetectEngineThreadCtx *det_
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectMQTTUnsubscribeTopic(
-        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 uint8_t DetectEngineInspectMQTTUnsubscribeTopic(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)
 {
     uint32_t local_id = 0;
 
index 782ac9486cb3d23cb20eb36c674559f4b9c6cb68..0f3d33a637843a4c451879da5b0eebce0601e0aa 100644 (file)
@@ -76,7 +76,7 @@ static void DetectNfsProcedureRegisterTests(void);
 #endif
 static int g_nfs_request_buffer_id = 0;
 
-static int DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -110,7 +110,7 @@ void DetectNfsProcedureRegister (void)
     SCLogDebug("g_nfs_request_buffer_id %d", g_nfs_request_buffer_id);
 }
 
-static int DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index f30c308743c60fd06b1d49f90742e2deef355ef8..758c627833281cb4bc39eab00e17aeaa226d5abf 100644 (file)
@@ -76,7 +76,7 @@ static void DetectNfsVersionRegisterTests(void);
 #endif
 static int g_nfs_request_buffer_id = 0;
 
-static int DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -109,7 +109,7 @@ void DetectNfsVersionRegister (void)
     SCLogDebug("g_nfs_request_buffer_id %d", g_nfs_request_buffer_id);
 }
 
-static int DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 010a115610d1c183ba643c56985e2fdfbc84c659..50a8170ac12e0228925e2cf161681ab3210092a0 100644 (file)
@@ -80,7 +80,7 @@ static InspectionBuffer *QuicHashGetData(DetectEngineThreadCtx *det_ctx,
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectQuicHash(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+static uint8_t DetectEngineInspectQuicHash(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)
 {
index 9fa8d4d8228569a4aa8d5c4dd85e0884e75d0180..7e27ecd698dc9d3a19dfcaaf18120fa893f20a55 100644 (file)
@@ -80,9 +80,9 @@ static InspectionBuffer *QuicStringGetData(DetectEngineThreadCtx *det_ctx,
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectQuicString(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 uint8_t DetectEngineInspectQuicString(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)
 {
     uint32_t local_id = 0;
 
index f6e58ca7516575b28c4fc8a788bc1fd6f79c684e..bb5f53e771f13224567c0508d48658dcf88babb9 100644 (file)
@@ -47,7 +47,7 @@ static void RfbSecresultRegisterTests(void);
 #endif
 void DetectRfbSecresultFree(DetectEngineCtx *, void *);
 
-static int DetectEngineInspectRfbSecresultGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -77,7 +77,7 @@ void DetectRfbSecresultRegister (void)
     rfb_secresult_id = DetectBufferTypeGetByName("rfb.secresult");
 }
 
-static int DetectEngineInspectRfbSecresultGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index f6ac936c60e2a717681337a09f4246256a7732fb..67eb5cf005f42320c33aa4ba363258551ea3ad06 100644 (file)
@@ -56,7 +56,7 @@ static int DetectRfbSectypeSetup (DetectEngineCtx *, Signature *s, const char *s
 static void DetectRfbSectypeFree(DetectEngineCtx *, void *);
 static int g_rfb_sectype_buffer_id = 0;
 
-static int DetectEngineInspectRfbSectypeGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -84,7 +84,7 @@ void DetectRfbSectypeRegister (void)
     g_rfb_sectype_buffer_id = DetectBufferTypeGetByName("rfb.sectype");
 }
 
-static int DetectEngineInspectRfbSectypeGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index 82d79342ed7c7fef45cca152670ad844e46931bc..8284ad09cfcac03391754276158279b1a3e867e9 100644 (file)
@@ -49,7 +49,7 @@ static void DetectSNMPPduTypeRegisterTests(void);
 #endif
 static int g_snmp_pdu_type_buffer_id = 0;
 
-static int DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -81,7 +81,7 @@ void DetectSNMPPduTypeRegister(void)
     g_snmp_pdu_type_buffer_id = DetectBufferTypeGetByName("snmp.pdu_type");
 }
 
-static int DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index d42f3eef0da3d464f261d55a76e3eedb44dd739b..02120075898c45f509db5e7074cd1c2501cd27b8 100644 (file)
@@ -58,7 +58,7 @@ static void DetectSNMPVersionRegisterTests(void);
 #endif
 static int g_snmp_version_buffer_id = 0;
 
-static int DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx,
+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);
 
@@ -93,7 +93,7 @@ void DetectSNMPVersionRegister (void)
     g_snmp_version_buffer_id = DetectBufferTypeGetByName("snmp.version");
 }
 
-static int DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx,
+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)
 {
index da6708fe72bd17e319c19f5a1937e3e943a3acf5..35be28ee444119f483ee048d970b75f45aaf83c7 100644 (file)
@@ -76,7 +76,7 @@ static void DetectSshSoftwareVersionRegisterTests(void);
 static void DetectSshSoftwareVersionFree(DetectEngineCtx *de_ctx, void *);
 static int g_ssh_banner_list_id = 0;
 
-static int InspectSshBanner(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
index b9cbc3d6318cb180b65446f57805a88a4eff1bec..61674ad494bed2d5bb659cc04c3bdd01ae402f59 100644 (file)
@@ -66,7 +66,7 @@ static void DetectSslStateRegisterTests(void);
 #endif
 static void DetectSslStateFree(DetectEngineCtx *, void *);
 
-static int InspectTlsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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);
 
@@ -100,7 +100,7 @@ void DetectSslStateRegister(void)
             "tls_generic", ALPROTO_TLS, SIG_FLAG_TOCLIENT, 0, InspectTlsGeneric, NULL);
 }
 
-static int InspectTlsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
index dda96471804856cdaeb1facb44afc21334d6b901..5e118655aa75ee782e3be9583db25e40fafda440 100644 (file)
@@ -43,7 +43,7 @@
 
 static int DetectTemplateRustBufferSetup(DetectEngineCtx *, Signature *,
     const char *);
-static int DetectEngineInspectTemplateRustBuffer(DetectEngineCtx *de_ctx,
+static uint8_t DetectEngineInspectTemplateRustBuffer(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);
 #ifdef UNITTESTS
@@ -92,11 +92,11 @@ static int DetectTemplateRustBufferSetup(DetectEngineCtx *de_ctx, Signature *s,
     return 0;
 }
 
-static int DetectEngineInspectTemplateRustBuffer(DetectEngineCtx *de_ctx,
+static uint8_t DetectEngineInspectTemplateRustBuffer(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)
 {
-    int ret = 0;
+    uint8_t ret = 0;
     const uint8_t *data = NULL;
     uint32_t data_len = 0;
 
index 7be4d5bdf885f7600e4a5a6aed313870338d80d4..a15e0b94c4f5849bbe9b4b9be0406b66e4a9fff6 100644 (file)
@@ -75,9 +75,9 @@ static void TlsValidRegisterTests(void);
 static void DetectTlsValidityFree(DetectEngineCtx *, void *);
 static int g_tls_validity_buffer_id = 0;
 
-static int 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);
+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.
@@ -134,9 +134,9 @@ void DetectTlsValidityRegister (void)
     g_tls_validity_buffer_id = DetectBufferTypeGetByName("tls_validity");
 }
 
-static int 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)
+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);
index 8e8fd8c0f73c864aa47e9981a8abcf13ab30a6d2..b6f748f34c54b2beca0b8ff6c0ffd27cd4243def 100644 (file)
@@ -59,11 +59,9 @@ static int DetectTlsCertsSetup(DetectEngineCtx *, Signature *, const char *);
 #ifdef UNITTESTS
 static void DetectTlsCertsRegisterTests(void);
 #endif
-static int DetectEngineInspectTlsCerts(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 uint8_t DetectEngineInspectTlsCerts(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 PrefilterMpmTlsCertsRegister(DetectEngineCtx *de_ctx,
         SigGroupHead *sgh, MpmCtx *mpm_ctx,
         const DetectBufferMpmRegistery *mpm_reg, int list_id);
@@ -162,11 +160,9 @@ static InspectionBuffer *TlsCertsGetData(DetectEngineThreadCtx *det_ctx,
     SCReturnPtr(buffer, "InspectionBuffer");
 }
 
-static int DetectEngineInspectTlsCerts(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 uint8_t DetectEngineInspectTlsCerts(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)
 {
     const DetectEngineTransforms *transforms = NULL;
     if (!engine->mpm) {
index 9af57dab6c607695fa87ebc3ebde04be42a5f244..afa4a34a60c09a6626d0e82b3ebdd9ac11b54376 100644 (file)
@@ -95,7 +95,7 @@ static int DetectTlsStorePostMatch (DetectEngineThreadCtx *det_ctx,
 
 static int g_tls_cert_list_id = 0;
 
-static int InspectTlsCert(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+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)
 {
index 71ee309bb0514724f174aad39b2d5f2a65f12faf..99161348647433800e8aa0dd4552e6c51d6d65de 100644 (file)
@@ -1137,7 +1137,7 @@ static bool DetectRunTxInspectRule(ThreadVars *tv,
             }
 
             /* run callback: but bypass stream callback if we can */
-            int match;
+            uint8_t match;
             if (unlikely(engine->stream && can->stream_stored)) {
                 match = can->stream_result;
                 TRACE_SID_TXS(s->id, tx, "stream skipped, stored result %d used instead", match);
@@ -1149,8 +1149,7 @@ static bool DetectRunTxInspectRule(ThreadVars *tv,
                 TRACE_SID_TXS(s->id, tx, "engine %p match %d", engine, match);
                 if (engine->stream) {
                     can->stream_stored = true;
-                    // TODO change Callback prototype ?
-                    can->stream_result = (uint8_t)match;
+                    can->stream_result = match;
                     TRACE_SID_TXS(s->id, tx, "stream ran, store result %d for next tx (if any)", match);
                 }
             }
index b01c6edf91f475c849eb4f34561b7e943061b45d..586da2bd67eed4dff4b7bb8ce112cdc5330a661b 100644 (file)
@@ -392,11 +392,10 @@ typedef InspectionBuffer *(*InspectionBufferGetDataPtr)(
         void *txv, const int list_id);
 struct DetectEngineAppInspectionEngine_;
 
-typedef int (*InspectEngineFuncPtr2)(
-        struct DetectEngineCtx_ *de_ctx, struct DetectEngineThreadCtx_ *det_ctx,
-        const struct DetectEngineAppInspectionEngine_ *engine,
-        const struct Signature_ *s,
-        Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
+typedef uint8_t (*InspectEngineFuncPtr2)(struct DetectEngineCtx_ *de_ctx,
+        struct DetectEngineThreadCtx_ *det_ctx,
+        const struct DetectEngineAppInspectionEngine_ *engine, const struct Signature_ *s, Flow *f,
+        uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
 
 typedef struct DetectEngineAppInspectionEngine_ {
     AppProto alproto;