]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: define generic PrefilterIsPrefilterableById
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 6 Mar 2020 08:55:02 +0000 (09:55 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 19 Mar 2020 08:29:26 +0000 (09:29 +0100)
src/detect-engine-prefilter-common.h

index b2bd461e2e3692d843a978a00bc304a9acdf13a9..2ae1098a051ae29238f99275843d1b460118448b 100644 (file)
@@ -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__ */