From: Victor Julien Date: Mon, 27 Feb 2017 22:39:41 +0000 (+0100) Subject: detect: simplify state detect code: remove unused params X-Git-Tag: suricata-4.0.0-beta1~257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c6802b9576df68a0d5de7b84339a72918484af5;p=thirdparty%2Fsuricata.git detect: simplify state detect code: remove unused params --- diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index 687e3b397b..5e3431b6bf 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -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; diff --git a/src/detect-engine-state.h b/src/detect-engine-state.h index 9c46d84ef4..31bd413226 100644 --- a/src/detect-engine-state.h +++ b/src/detect-engine-state.h @@ -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 diff --git a/src/detect.c b/src/detect.c index 58c4809559..5a2355faa5 100644 --- a/src/detect.c +++ b/src/detect.c @@ -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,