detect: use InspectEngineFuncPtr in inspect engines

Replace explicit function pointer use by InspectEngineFuncPtr typedef
pull/2559/head
Victor Julien 9 years ago
parent 5f7e096be4
commit cf42fbf51f

@ -102,13 +102,7 @@ static uint32_t DetectEngineTentantGetIdFromPcap(const void *ctx, const Packet *
static DetectEngineAppInspectionEngine *g_app_inspect_engines = NULL;
void DetectAppLayerInspectEngineRegister(AppProto alproto,
uint32_t dir, int32_t sm_list,
int (*Callback)(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
const Signature *sig, Flow *f,
uint8_t flags, void *alstate,
void *tx, uint64_t tx_id))
uint32_t dir, int32_t sm_list, InspectEngineFuncPtr Callback)
{
if ((alproto >= ALPROTO_FAILED) ||
(!(dir == SIG_FLAG_TOSERVER || dir == SIG_FLAG_TOCLIENT)) ||

@ -84,14 +84,7 @@ int DetectEngineInspectGenericList(ThreadVars *, const DetectEngineCtx *,
* \param Callback The engine callback.
*/
void DetectAppLayerInspectEngineRegister(AppProto alproto,
uint32_t dir,
int32_t sm_list,
int (*Callback)(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
const Signature *sig, Flow *f,
uint8_t flags, void *alstate,
void *tx, uint64_t tx_id));
uint32_t dir, int32_t sm_list, InspectEngineFuncPtr Callback);
int DetectEngineAppInspectionEngine2Signature(Signature *s);

@ -375,6 +375,11 @@ typedef struct SigMatchData_ {
struct DetectEngineThreadCtx_;// DetectEngineThreadCtx;
typedef int (*InspectEngineFuncPtr)(ThreadVars *tv,
struct DetectEngineCtx_ *de_ctx, struct DetectEngineThreadCtx_ *det_ctx,
const struct Signature_ *sig, Flow *f, uint8_t flags, void *alstate,
void *tx, uint64_t tx_id);
typedef struct DetectEngineAppInspectionEngine_ {
AppProto alproto;
uint8_t dir;
@ -387,10 +392,7 @@ typedef struct DetectEngineAppInspectionEngine_ {
* 3 Special value used by filestore sigs to indicate disabling
* filestore for the tx.
*/
int (*Callback)(ThreadVars *tv,
struct DetectEngineCtx_ *de_ctx, struct DetectEngineThreadCtx_ *det_ctx,
const struct Signature_ *sig, Flow *f, uint8_t flags, void *alstate,
void *tx, uint64_t tx_id);
InspectEngineFuncPtr Callback;
struct DetectEngineAppInspectionEngine_ *next;
} DetectEngineAppInspectionEngine;

Loading…
Cancel
Save