From: Philippe Antoine Date: Fri, 6 Mar 2020 08:55:02 +0000 (+0100) Subject: detect: define generic PrefilterIsPrefilterableById X-Git-Tag: suricata-6.0.0-beta1~630 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0355b70f5a7c41b6f41a83cfd56bc095e3d5287e;p=thirdparty%2Fsuricata.git detect: define generic PrefilterIsPrefilterableById --- diff --git a/src/detect-engine-prefilter-common.h b/src/detect-engine-prefilter-common.h index b2bd461e2e..2ae1098a05 100644 --- a/src/detect-engine-prefilter-common.h +++ b/src/detect-engine-prefilter-common.h @@ -94,4 +94,15 @@ PrefilterPacketHeaderExtraMatch(const PrefilterPacketHeaderCtx *ctx, return TRUE; } +static inline bool PrefilterIsPrefilterableById(const Signature *s, enum DetectKeywordId kid) +{ + const SigMatch *sm; + for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) { + if (sm->type == kid) { + return true; + } + } + return false; +} + #endif /* __DETECT_ENGINE_PREFILTER_COMMON_H__ */