mpm: remove useless flag from factory

pull/1980/head
Victor Julien 10 years ago
parent fdd05e8fb4
commit 157ca89dd7

@ -116,8 +116,7 @@ void DetectMpmInitializeAppMpms(DetectEngineCtx *de_ctx)
for (i = 0; i < APP_MPMS_MAX; i++) { for (i = 0; i < APP_MPMS_MAX; i++) {
AppLayerMpms *am = &app_mpms[i]; AppLayerMpms *am = &app_mpms[i];
am->sgh_mpm_context = MpmFactoryRegisterMpmCtxProfile(de_ctx, am->name, am->sgh_mpm_context = MpmFactoryRegisterMpmCtxProfile(de_ctx, am->name);
MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
SCLogDebug("AppLayer MPM %s: %u", am->name, am->sgh_mpm_context); SCLogDebug("AppLayer MPM %s: %u", am->name, am->sgh_mpm_context);
} }

@ -2731,17 +2731,13 @@ static int SignatureCreateMask(Signature *s)
static void SigInitStandardMpmFactoryContexts(DetectEngineCtx *de_ctx) static void SigInitStandardMpmFactoryContexts(DetectEngineCtx *de_ctx)
{ {
de_ctx->sgh_mpm_context_proto_tcp_packet = de_ctx->sgh_mpm_context_proto_tcp_packet =
MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_tcp", MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_tcp");
MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
de_ctx->sgh_mpm_context_proto_udp_packet = de_ctx->sgh_mpm_context_proto_udp_packet =
MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_udp", MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_udp");
MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
de_ctx->sgh_mpm_context_proto_other_packet = de_ctx->sgh_mpm_context_proto_other_packet =
MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_other", MpmFactoryRegisterMpmCtxProfile(de_ctx, "packet_proto_other");
MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
de_ctx->sgh_mpm_context_stream = de_ctx->sgh_mpm_context_stream =
MpmFactoryRegisterMpmCtxProfile(de_ctx, "stream", MpmFactoryRegisterMpmCtxProfile(de_ctx, "stream");
MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD);
DetectMpmInitializeAppMpms(de_ctx); DetectMpmInitializeAppMpms(de_ctx);

@ -54,7 +54,7 @@
* *
* \retval id Return the id created for the new MpmCtx profile. * \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; void *ptmp;
/* the very first entry */ /* the very first entry */
@ -96,9 +96,6 @@ int32_t MpmFactoryRegisterMpmCtxProfile(DetectEngineCtx *de_ctx, const char *nam
* the array */ * the array */
item[0].id = 0; item[0].id = 0;
/* store the flag */
item[0].flags = flags;
/* store the newly created item */ /* store the newly created item */
de_ctx->mpm_ctx_factory_container->items = item; de_ctx->mpm_ctx_factory_container->items = item;
de_ctx->mpm_ctx_factory_container->no_of_items++; 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)); memset(items[i].mpm_ctx_tc, 0, sizeof(MpmCtx));
items[i].mpm_ctx_tc->global = 1; items[i].mpm_ctx_tc->global = 1;
} }
items[i].flags = flags;
return items[i].id; 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].mpm_ctx_tc->global = 1;
new_item[0].id = de_ctx->mpm_ctx_factory_container->no_of_items; 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++; de_ctx->mpm_ctx_factory_container->no_of_items++;
/* the newly created id */ /* the newly created id */

@ -125,14 +125,11 @@ typedef struct MpmCtx_ {
* we should supply this as the key */ * we should supply this as the key */
#define MPM_CTX_FACTORY_UNIQUE_CONTEXT -1 #define MPM_CTX_FACTORY_UNIQUE_CONTEXT -1
#define MPM_CTX_FACTORY_FLAGS_PREPARE_WITH_SIG_GROUP_BUILD 0x01
typedef struct MpmCtxFactoryItem_ { typedef struct MpmCtxFactoryItem_ {
const char *name; const char *name;
MpmCtx *mpm_ctx_ts; MpmCtx *mpm_ctx_ts;
MpmCtx *mpm_ctx_tc; MpmCtx *mpm_ctx_tc;
int32_t id; int32_t id;
uint8_t flags;
} MpmCtxFactoryItem; } MpmCtxFactoryItem;
typedef struct MpmCtxFactoryContainer_ { typedef struct MpmCtxFactoryContainer_ {
@ -224,7 +221,7 @@ void MpmCudaEnvironmentSetup();
struct DetectEngineCtx_; struct DetectEngineCtx_;
int32_t MpmFactoryRegisterMpmCtxProfile(struct DetectEngineCtx_ *, const char *, uint8_t); int32_t MpmFactoryRegisterMpmCtxProfile(struct DetectEngineCtx_ *, const char *);
void MpmFactoryReClaimMpmCtx(const struct DetectEngineCtx_ *, MpmCtx *); void MpmFactoryReClaimMpmCtx(const struct DetectEngineCtx_ *, MpmCtx *);
MpmCtx *MpmFactoryGetMpmCtxForProfile(const struct DetectEngineCtx_ *, int32_t, int); MpmCtx *MpmFactoryGetMpmCtxForProfile(const struct DetectEngineCtx_ *, int32_t, int);
void MpmFactoryDeRegisterAllMpmCtxProfiles(struct DetectEngineCtx_ *); void MpmFactoryDeRegisterAllMpmCtxProfiles(struct DetectEngineCtx_ *);

Loading…
Cancel
Save