]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: simplify state detect code: remove unused params
authorVictor Julien <victor@inliniac.net>
Mon, 27 Feb 2017 22:39:41 +0000 (23:39 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 25 Mar 2017 08:12:57 +0000 (09:12 +0100)
src/detect-engine-state.c
src/detect-engine-state.h
src/detect.c

index 687e3b397ba698f859aebf66ff04b694f1ccd98a..5e3431b6bf647ebd838674e6fbb2ebb373819661 100644 (file)
@@ -244,7 +244,7 @@ void DetectEngineStateFree(DetectEngineState *state)
     return;
 }
 
-static int HasStoredSigs(Flow *f, uint8_t flags)
+static int HasStoredSigs(const Flow *f, const uint8_t flags)
 {
     if (AppLayerParserProtocolSupportsTxs(f->proto, f->alproto)) {
         AppProto alproto = f->alproto;
@@ -290,8 +290,7 @@ static int HasStoredSigs(Flow *f, uint8_t flags)
  *  \retval 0 no inspectable state
  *  \retval 1 inspectable state
  */
-int DeStateFlowHasInspectableState(Flow *f, AppProto alproto,
-                                   const uint8_t alversion, uint8_t flags)
+int DeStateFlowHasInspectableState(const Flow *f, const uint8_t flags)
 {
     int r = 0;
 
index 9c46d84ef4a23adc594171fd17390767819df5d6..31bd4132264f77401e5a01b273f7c86190def632 100644 (file)
@@ -125,13 +125,12 @@ void DetectEngineStateFree(DetectEngineState *state);
  * \brief Check if a flow already contains(newly updated as well) de state.
  *
  * \param f Pointer to the flow.
- * \param alversino The alversion to check against de_state's.
- * \param direction Direction to check.  0 - ts, 1 - tc.
+ * \param flags direction
  *
  * \retval 1 Has state.
  * \retval 0 Has no state.
  */
-int DeStateFlowHasInspectableState(Flow *f, AppProto alproto, uint8_t alversion, uint8_t flags);
+int DeStateFlowHasInspectableState(const Flow *f, const uint8_t flags);
 
 /**
  * \brief Match app layer sig list against app state and store relevant match
index 58c4809559f66c150fefb4a4b20a87f98697a4d0..5a2355faa50971d15a550add6bfd8a9d3a9792c7 100644 (file)
@@ -1166,7 +1166,7 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh
     /* stateful app layer detection */
     if ((p->flags & PKT_HAS_FLOW) && has_state) {
         memset(det_ctx->de_state_sig_array, 0x00, det_ctx->de_state_sig_array_len);
-        int has_inspectable_state = DeStateFlowHasInspectableState(pflow, alproto, alversion, flow_flags);
+        int has_inspectable_state = DeStateFlowHasInspectableState(pflow, flow_flags);
         if (has_inspectable_state == 1) {
             /* initialize to 0(DE_STATE_MATCH_HAS_NEW_STATE) */
             DeStateDetectContinueDetection(th_v, de_ctx, det_ctx, p, pflow,