mpm: remove useless flag from factory

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

@ -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);
}

@ -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);

@ -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 */

@ -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_ *);

Loading…
Cancel
Save