]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/ftpbounce: switch to inspect api v2
authorVictor Julien <victor@inliniac.net>
Sun, 5 Apr 2020 16:14:39 +0000 (18:14 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 7 Dec 2020 15:01:52 +0000 (16:01 +0100)
src/detect-ftpbounce.c

index 77ac3e9891b942d90d81cb1a51ede1c55706d227..5e55676b276b663db502d1cbb9b77c50b8522dbf 100644 (file)
@@ -57,11 +57,9 @@ static void DetectFtpbounceRegisterTests(void);
 #endif
 static int g_ftp_request_list_id = 0;
 
-static int InspectFtpRequest(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 InspectFtpRequest(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);
 
 /**
  * \brief Registration function for ftpbounce: keyword
@@ -81,19 +79,16 @@ void DetectFtpbounceRegister(void)
 
     g_ftp_request_list_id = DetectBufferTypeRegister("ftp_request");
 
-    DetectAppLayerInspectEngineRegister("ftp_request",
-            ALPROTO_FTP, SIG_FLAG_TOSERVER, 0,
-            InspectFtpRequest);
+    DetectAppLayerInspectEngineRegister2(
+            "ftp_request", ALPROTO_FTP, SIG_FLAG_TOSERVER, 0, InspectFtpRequest, NULL);
 }
 
-static int InspectFtpRequest(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 InspectFtpRequest(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);
 }
 
 /**