From 5062023ffead9b7d6e6c20c150b6a49f2276703e Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 20 Oct 2020 11:03:27 +0200 Subject: [PATCH] detect/ftp: convert to v2 inspect API --- src/detect-ftpdata.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/detect-ftpdata.c b/src/detect-ftpdata.c index 20c670e217..0c08e2f383 100644 --- a/src/detect-ftpdata.c +++ b/src/detect-ftpdata.c @@ -49,11 +49,9 @@ static void DetectFtpdataFree (DetectEngineCtx *, void *); #ifdef UNITTESTS static void DetectFtpdataRegisterTests (void); #endif -static int DetectEngineInspectFtpdataGeneric(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 DetectEngineInspectFtpdataGeneric(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); static int g_ftpdata_buffer_id = 0; /** @@ -78,27 +76,23 @@ void DetectFtpdataRegister(void) { #ifdef UNITTESTS sigmatch_table[DETECT_FTPDATA].RegisterTests = DetectFtpdataRegisterTests; #endif - DetectAppLayerInspectEngineRegister("ftpdata_command", - ALPROTO_FTPDATA, SIG_FLAG_TOSERVER, 0, - DetectEngineInspectFtpdataGeneric); + DetectAppLayerInspectEngineRegister2("ftpdata_command", ALPROTO_FTPDATA, SIG_FLAG_TOSERVER, 0, + DetectEngineInspectFtpdataGeneric, NULL); - DetectAppLayerInspectEngineRegister("ftpdata_command", - ALPROTO_FTPDATA, SIG_FLAG_TOCLIENT, 0, - DetectEngineInspectFtpdataGeneric); + DetectAppLayerInspectEngineRegister2("ftpdata_command", ALPROTO_FTPDATA, SIG_FLAG_TOCLIENT, 0, + DetectEngineInspectFtpdataGeneric, NULL); g_ftpdata_buffer_id = DetectBufferTypeGetByName("ftpdata_command"); /* set up the PCRE for keyword parsing */ DetectSetupParseRegexes(PARSE_REGEX, &parse_regex); } -static int DetectEngineInspectFtpdataGeneric(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 DetectEngineInspectFtpdataGeneric(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); } /** @@ -263,4 +257,4 @@ static void DetectFtpdataRegisterTests(void) UtRegisterTest("DetectFtpdataSignatureTest01", DetectFtpdataSignatureTest01); } -#endif /* UNITTESTS */ \ No newline at end of file +#endif /* UNITTESTS */