]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect-engine-mpm: api cleanup
authorVictor Julien <victor@inliniac.net>
Wed, 14 Dec 2016 12:08:39 +0000 (13:08 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 09:35:40 +0000 (10:35 +0100)
src/detect-engine-mpm.c
src/detect-engine-mpm.h

index 073600aa134dc57b0b6dffd2f67700553bb3738e..069ea6306d9f66be86f8be8445b9952d46ac5264 100644 (file)
@@ -92,10 +92,14 @@ const char *builtin_mpms[] = {
 static DetectMpmAppLayerRegistery *g_app_mpms_list = NULL;
 static int g_app_mpms_list_cnt = 0;
 
-void DetectMpmAppLayerRegister(const char *name,
-        int direction, int sm_list, int priority,
+void DetectAppLayerMpmRegister(const char *name,
+        int direction, int priority,
         int (*PrefilterRegister)(SigGroupHead *sgh, MpmCtx *mpm_ctx))
 {
+    DetectBufferTypeSupportsMpm(name);
+    int sm_list = DetectBufferTypeGetByName(name);
+    BUG_ON(sm_list == -1);
+
     DetectMpmAppLayerRegistery *am = SCCalloc(1, sizeof(*am));
     BUG_ON(am == NULL);
     am->name = name;
@@ -119,17 +123,6 @@ void DetectMpmAppLayerRegister(const char *name,
     SupportFastPatternForSigMatchList(sm_list, priority);
 }
 
-void DetectAppLayerMpmRegister(const char *name,
-        int direction, int priority,
-        int (*PrefilterRegister)(SigGroupHead *sgh, MpmCtx *mpm_ctx))
-{
-    DetectBufferTypeSupportsMpm(name);
-    int sm_list = DetectBufferTypeGetByName(name);
-    BUG_ON(sm_list == -1);
-    DetectMpmAppLayerRegister(name, direction, sm_list, priority,
-            PrefilterRegister);
-}
-
 void DetectMpmInitializeAppMpms(DetectEngineCtx *de_ctx)
 {
     BUG_ON(g_app_mpms_list_cnt == 0);
index 9d53c456a8f58248fc8d2ebf4e5efd8206b52f5f..d3fee45229d4c2bb2e6f232b9ae57a988c08eb52 100644 (file)
@@ -83,16 +83,11 @@ int DetectSetFastPatternAndItsId(DetectEngineCtx *de_ctx);
 /** \brief register an app layer keyword for mpm
  *  \param name keyword name
  *  \param direction SIG_FLAG_TOSERVER or SIG_FLAG_TOCLIENT
- *  \param sm_list list that contains the keyword's sigmatches
  *  \param PrefilterRegister Prefilter api registration function
  *
  *  \note direction must be set to either toserver or toclient.
  *        If both are needed, register the keyword twice.
  */
-void DetectMpmAppLayerRegister(const char *name,
-        int direction, int sm_list, int priority,
-        int (*PrefilterRegister)(SigGroupHead *sgh, MpmCtx *mpm_ctx));
-
 void DetectAppLayerMpmRegister(const char *name,
         int direction, int priority,
         int (*PrefilterRegister)(SigGroupHead *sgh, MpmCtx *mpm_ctx));