From cd146adef0af3b3d4aeb556bb15c49f61fd01e03 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 19 Oct 2020 14:12:42 +0200 Subject: [PATCH] detect/dnp3: convert to v2 inspect API --- src/detect-dnp3.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/detect-dnp3.c b/src/detect-dnp3.c index ea1cb1c7f5..6ffa42f25a 100644 --- a/src/detect-dnp3.c +++ b/src/detect-dnp3.c @@ -176,12 +176,12 @@ static InspectionBuffer *GetDNP3Data(DetectEngineThreadCtx *det_ctx, return buffer; } -static int DetectEngineInspectDNP3(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static int DetectEngineInspectDNP3(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, + uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { - return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd, - f, flags, alstate, txv, tx_id); + return DetectEngineInspectGenericList( + NULL, de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id); } /** @@ -601,12 +601,10 @@ void DetectDNP3Register(void) DetectDNP3ObjRegister(); /* Register the list of func, ind and obj. */ - DetectAppLayerInspectEngineRegister("dnp3", - ALPROTO_DNP3, SIG_FLAG_TOSERVER, 0, - DetectEngineInspectDNP3); - DetectAppLayerInspectEngineRegister("dnp3", - ALPROTO_DNP3, SIG_FLAG_TOCLIENT, 0, - DetectEngineInspectDNP3); + DetectAppLayerInspectEngineRegister2( + "dnp3", ALPROTO_DNP3, SIG_FLAG_TOSERVER, 0, DetectEngineInspectDNP3, NULL); + DetectAppLayerInspectEngineRegister2( + "dnp3", ALPROTO_DNP3, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectDNP3, NULL); g_dnp3_match_buffer_id = DetectBufferTypeRegister("dnp3");