]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/http2: inspect API v2
authorVictor Julien <victor@inliniac.net>
Mon, 12 Oct 2020 12:19:15 +0000 (14:19 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 7 Dec 2020 15:01:52 +0000 (16:01 +0100)
src/detect-http2.c

index c73b42e59b1fd492ceb9d687fbb1eb426c6dda93..3a986d99cb0db8d8992d179b46c0e46704fad140 100644 (file)
@@ -111,12 +111,12 @@ static int g_http2_match_buffer_id = 0;
 static int g_http2_header_name_buffer_id = 0;
 static int g_http2_header_buffer_id = 0;
 
-static int DetectEngineInspectHTTP2(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 DetectEngineInspectHTTP2(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);
 }
 
 /**
@@ -238,12 +238,10 @@ void DetectHttp2Register(void)
     DetectBufferTypeRegisterValidateCallback("http2_header", DetectHttp2HeaderValidateCallback);
     g_http2_header_buffer_id = DetectBufferTypeGetByName("http2_header");
 
-    DetectAppLayerInspectEngineRegister("http2",
-                                        ALPROTO_HTTP2, SIG_FLAG_TOSERVER, 0,
-                                        DetectEngineInspectHTTP2);
-    DetectAppLayerInspectEngineRegister("http2",
-                                        ALPROTO_HTTP2, SIG_FLAG_TOCLIENT, 0,
-                                        DetectEngineInspectHTTP2);
+    DetectAppLayerInspectEngineRegister2(
+            "http2", ALPROTO_HTTP2, SIG_FLAG_TOSERVER, 0, DetectEngineInspectHTTP2, NULL);
+    DetectAppLayerInspectEngineRegister2(
+            "http2", ALPROTO_HTTP2, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectHTTP2, NULL);
 
     g_http2_match_buffer_id = DetectBufferTypeRegister("http2");
     DetectUintRegister();