detect-engine-mpm: api cleanup

pull/2559/head
Victor Julien 8 years ago
parent 8bd1422948
commit a1465bc4fa

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

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

Loading…
Cancel
Save