]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mpm: remove useless flag from factory
authorVictor Julien <victor@inliniac.net>
Wed, 28 Oct 2015 07:37:28 +0000 (08:37 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Apr 2016 07:37:42 +0000 (09:37 +0200)
src/detect-engine-mpm.c
src/detect.c
src/util-mpm.c
src/util-mpm.h

index 0e1c7839c3cf7a6e4f5a43d3033ebc0769a6a071..c923b593611898eec2052573c619c07331ba6f05 100644 (file)
@@ -116,8 +116,7 @@ void DetectMpmInitializeAppMpms(DetectEngineCtx *de_ctx)
     for (i = 0; i < APP_MPMS_MAX; i++) {
         AppLayerMpms *am = &app_mpms[i];
 
-        am->sgh_mpm_context = MpmFactoryRegisterMpmCtxProfile(de_ctx, am->name,
-                MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
+        am->sgh_mpm_context = MpmFactoryRegisterMpmCtxProfile(de_ctx, am->name);
 
         SCLogDebug("AppLayer MPM %s: %u", am->name, am->sgh_mpm_context);
     }
index 8acacc1c9289cfbaace1085dd6f73e9bcb729923..40ba84bbb6af09898815cfbd476b130d9ba642c9 100644 (file)
@@ -2731,17 +2731,13 @@ static int SignatureCreateMask(Signature *s)
 static void SigInitStandardMpmFactoryContexts(DetectEngineCtx *de_ctx)
 {
     de_ctx->sgh_mpm_context_proto_tcp_packet =
-        MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_tcp",
-                                        MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
+        MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_tcp");
     de_ctx->sgh_mpm_context_proto_udp_packet =
-        MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_udp",
-                                        MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
+        MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_udp");
     de_ctx->sgh_mpm_context_proto_other_packet =
-        MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_other",
-                                        MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
+        MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_other");
     de_ctx->sgh_mpm_context_stream =
-        MpmFactoryRegisterMpmCtxProfile(de_ctx, "stream",
-                                        MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
+        MpmFactoryRegisterMpmCtxProfile(de_ctx, "stream");
 
     DetectMpmInitializeAppMpms(de_ctx);
 
index 73e13d2260be9acffa9ab485e4865a19165faf75..af2ecffc4a13085383ebbd9d97e4b2cd636d7988 100644 (file)
@@ -54,7 +54,7 @@
  *
  * \retval id Return the id created for the new MpmCtx profile.
  */
-int32_t MpmFactoryRegisterMpmCtxProfile(DetectEngineCtx *de_ctx, const char *name, uint8_t flags)
+int32_t MpmFactoryRegisterMpmCtxProfile(DetectEngineCtx *de_ctx, const char *name)
 {
     void *ptmp;
     /* the very first entry */
@@ -96,9 +96,6 @@ int32_t MpmFactoryRegisterMpmCtxProfile(DetectEngineCtx *de_ctx, const char *nam
          * the array */
         item[0].id = 0;
 
-        /* store the flag */
-        item[0].flags = flags;
-
         /* store the newly created item */
         de_ctx->mpm_ctx_factory_container->items = item;
         de_ctx->mpm_ctx_factory_container->no_of_items++;
@@ -129,7 +126,6 @@ int32_t MpmFactoryRegisterMpmCtxProfile(DetectEngineCtx *de_ctx, const char *nam
                     memset(items[i].mpm_ctx_tc, 0, sizeof(MpmCtx));
                     items[i].mpm_ctx_tc->global = 1;
                 }
-                items[i].flags = flags;
                 return items[i].id;
             }
         }
@@ -169,7 +165,6 @@ int32_t MpmFactoryRegisterMpmCtxProfile(DetectEngineCtx *de_ctx, const char *nam
         new_item[0].mpm_ctx_tc->global = 1;
 
         new_item[0].id = de_ctx->mpm_ctx_factory_container->no_of_items;
-        new_item[0].flags = flags;
         de_ctx->mpm_ctx_factory_container->no_of_items++;
 
         /* the newly created id */
index 50a0b8a58648e5afc5e9a3ced0f06ee2ab7b6bfd..d689cc9fc433789ce538fb1ee51c50ebfc82c8f5 100644 (file)
@@ -125,14 +125,11 @@ typedef struct MpmCtx_ {
  * we should supply this as the key */
 #define MPM_CTX_FACTORY_UNIQUE_CONTEXT -1
 
-#define MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD 0x01
-
 typedef struct MpmCtxFactoryItem_ {
     const char *name;
     MpmCtx *mpm_ctx_ts;
     MpmCtx *mpm_ctx_tc;
     int32_t id;
-    uint8_t flags;
 } MpmCtxFactoryItem;
 
 typedef struct MpmCtxFactoryContainer_ {
@@ -224,7 +221,7 @@ void MpmCudaEnvironmentSetup();
 
 struct DetectEngineCtx_;
 
-int32_t MpmFactoryRegisterMpmCtxProfile(struct DetectEngineCtx_ *, const char *, uint8_t);
+int32_t MpmFactoryRegisterMpmCtxProfile(struct DetectEngineCtx_ *, const char *);
 void MpmFactoryReClaimMpmCtx(const struct DetectEngineCtx_ *, MpmCtx *);
 MpmCtx *MpmFactoryGetMpmCtxForProfile(const struct DetectEngineCtx_ *, int32_t, int);
 void MpmFactoryDeRegisterAllMpmCtxProfiles(struct DetectEngineCtx_ *);