Skip to content

Commit

Permalink
mpm: Use typedef for mpm registration
Browse files Browse the repository at this point in the history
Issue: 4145
  • Loading branch information
jlucovsky authored and victorjulien committed Jul 14, 2023
1 parent d4e674b commit f1ddd31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/detect-engine-mpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ static int g_mpm_list_cnt[DETECT_BUFFER_MPM_TYPE_SIZE] = { 0, 0, 0 };
* \note to be used at start up / registration only. Errors are fatal.
*/
void DetectAppLayerMpmRegister2(const char *name, int direction, int priority,
int (*PrefilterRegister)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
const DetectBufferMpmRegistry *mpm_reg, int list_id),
InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData,
AppProto alproto, int tx_min_progress)
{
SCLogDebug("registering %s/%d/%d/%p/%p/%u/%d", name, direction, priority,
PrefilterRegister, GetData, alproto, tx_min_progress);
Expand Down
12 changes: 6 additions & 6 deletions src/detect-engine-mpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ MpmStore *MpmStorePrepareBuffer(DetectEngineCtx *de_ctx, SigGroupHead *sgh, enum
*/
int DetectSetFastPatternAndItsId(DetectEngineCtx *de_ctx);

typedef int (*PrefilterRegisterFunc)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
const DetectBufferMpmRegistry *mpm_reg, int list_id);

/** \brief register an app layer keyword for mpm
* \param name buffer name
* \param direction SIG_FLAG_TOSERVER or SIG_FLAG_TOCLIENT
Expand All @@ -88,17 +91,14 @@ int DetectSetFastPatternAndItsId(DetectEngineCtx *de_ctx);
* If both are needed, register the keyword twice.
*/
void DetectAppLayerMpmRegister2(const char *name, int direction, int priority,
int (*PrefilterRegister)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
const DetectBufferMpmRegistry *mpm_reg, int list_id),
InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress);
PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData,
AppProto alproto, int tx_min_progress);
void DetectAppLayerMpmRegisterByParentId(
DetectEngineCtx *de_ctx,
const int id, const int parent_id,
DetectEngineTransforms *transforms);

void DetectPktMpmRegister(const char *name, int priority,
int (*PrefilterRegister)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
const DetectBufferMpmRegistry *mpm_reg, int list_id),
void DetectPktMpmRegister(const char *name, int priority, PrefilterRegisterFunc PrefilterRegister,
InspectionBufferGetPktDataPtr GetData);
void DetectPktMpmRegisterByParentId(DetectEngineCtx *de_ctx,
const int id, const int parent_id,
Expand Down

0 comments on commit f1ddd31

Please sign in to comment.