]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: use bool for 'HasDecoderEvents'
authorVictor Julien <victor@inliniac.net>
Sun, 8 Oct 2017 16:23:22 +0000 (18:23 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 20 Dec 2017 09:51:20 +0000 (10:51 +0100)
src/app-layer-parser.c
src/app-layer-parser.h
src/detect-engine-build.c
src/detect-engine-build.h
src/detect.c

index cc1b82536c43a7dc5346680017fb5220b0f1e2e6..3e5ba2436a121a7e21bccaea481640fa26b897bf 100644 (file)
@@ -1130,9 +1130,9 @@ void AppLayerParserSetEOF(AppLayerParserState *pstate)
     SCReturn;
 }
 
-int AppLayerParserHasDecoderEvents(const Flow *f,
-                                   void *alstate, AppLayerParserState *pstate,
-                                   uint8_t flags)
+bool AppLayerParserHasDecoderEvents(const Flow *f,
+        void *alstate, AppLayerParserState *pstate,
+        const uint8_t flags)
 {
     SCEnter();
 
@@ -1169,9 +1169,9 @@ int AppLayerParserHasDecoderEvents(const Flow *f,
 
     /* if we have reached here, we don't have events */
  not_present:
-    SCReturnInt(0);
+    return false;
  present:
-    SCReturnInt(1);
+    return true;
 }
 
 /** \brief simpler way to globally test if a alproto is registered
index efaa02c87a5b0c497a935b73f08ceae3e9f2ad52..29a7df70ca603d74bae9cf52a4ad0639556b0eaa 100644 (file)
@@ -218,8 +218,8 @@ int AppLayerParserSetTxMpmIDs(uint8_t ipproto, AppProto alproto, void *tx, uint6
 int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *tctx, Flow *f, AppProto alproto,
                    uint8_t flags, uint8_t *input, uint32_t input_len);
 void AppLayerParserSetEOF(AppLayerParserState *pstate);
-int AppLayerParserHasDecoderEvents(const Flow *f, void *alstate, AppLayerParserState *pstate,
-                        uint8_t flags);
+bool AppLayerParserHasDecoderEvents(const Flow *f, void *alstate, AppLayerParserState *pstate,
+                        const uint8_t flags);
 int AppLayerParserIsTxAware(AppProto alproto);
 int AppLayerParserProtocolIsTxAware(uint8_t ipproto, AppProto alproto);
 int AppLayerParserProtocolIsTxEventAware(uint8_t ipproto, AppProto alproto);
index 15f3c6fbd7ecec09e0d23b34946a2d09c3c76189..d3e7bc40aa98c00ad3dc6af8b0ed836ecbf35654 100644 (file)
@@ -403,7 +403,7 @@ deonly:
  */
 void
 PacketCreateMask(Packet *p, SignatureMask *mask, AppProto alproto,
-        bool has_state, int app_decoder_events)
+        bool has_state, bool app_decoder_events)
 {
     if (!(p->flags & PKT_NOPAYLOAD_INSPECTION) && p->payload_len > 0) {
         SCLogDebug("packet has payload");
index 7eb41d760bf288aea987fd1cb5b69884a67ba06b..25322f64107ee1e70c6260746f089c1ccff0a994 100644 (file)
@@ -19,7 +19,7 @@
 #define __DETECT_ENGINE_BUILD_H__
 
 void PacketCreateMask(Packet *p, SignatureMask *mask, AppProto alproto,
-        bool has_state, int app_decoder_events);
+        bool has_state, bool app_decoder_events);
 
 int SignatureIsFilestoring(const Signature *);
 int SignatureIsFilemagicInspecting(const Signature *);
index 0e16ca2fb76049317e16f3b305dc6f4fe0516394..8c056221121f2677bfb9024396b5c5d554584705 100644 (file)
@@ -418,7 +418,7 @@ void SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineT
     const Signature *s = NULL;
     const Signature *next_s = NULL;
     int state_alert = 0;
-    int app_decoder_events = 0;
+    bool app_decoder_events = false;
     bool has_state = false;     /* do we have an alstate to work with? */
 
     SCEnter();