]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: bindgen SCHTTP2MimicHttp1Request
authorPhilippe Antoine <pantoine@oisf.net>
Mon, 6 Oct 2025 08:08:51 +0000 (10:08 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 18 Oct 2025 01:53:38 +0000 (03:53 +0200)
Ticket: 7667

rust/src/http2/http2.rs
rust/sys/src/sys.rs
src/app-layer-http2.c
src/app-layer-http2.h
src/bindgen.h

index edf151f67eb227da5941f0330e6ec3ea00da0b48..3256d0bd06ec144aa38cc2ebfbd4f63a4a2c1242 100644 (file)
@@ -42,6 +42,7 @@ use suricata_sys::sys::{
     AppLayerParserState, AppProto, SCAppLayerForceProtocolChange,
     SCAppLayerParserConfParserEnabled, SCAppLayerParserRegisterLogger,
     SCAppLayerProtoDetectConfProtoDetectionEnabled, SCFileFlowFlagsToFlags,
+    SCHTTP2MimicHttp1Request,
 };
 
 static mut ALPROTO_HTTP2: AppProto = ALPROTO_UNKNOWN;
@@ -1431,13 +1432,6 @@ unsafe extern "C" fn http2_probing_parser_tc(
     return ALPROTO_UNKNOWN;
 }
 
-// Extern functions operating on HTTP2.
-extern "C" {
-    pub fn HTTP2MimicHttp1Request(
-        orig_state: *mut std::os::raw::c_void, new_state: *mut std::os::raw::c_void,
-    );
-}
-
 // Suppress the unsafe warning here as creating a state for an app-layer
 // is typically not unsafe.
 #[allow(clippy::not_unsafe_ptr_arg_deref)]
@@ -1450,7 +1444,7 @@ extern "C" fn http2_state_new(
     if !orig_state.is_null() {
         //we could check ALPROTO_HTTP1 == orig_proto
         unsafe {
-            HTTP2MimicHttp1Request(orig_state, r);
+            SCHTTP2MimicHttp1Request(orig_state, r);
         }
     }
     return r;
index b44d5400264d7a4d6009957edf9055c0d26b01ec..9f8f8c826fae753fb21d3c8eaeef8372f6763fb9 100644 (file)
@@ -829,6 +829,11 @@ extern "C" {
         event_name: *const ::std::os::raw::c_char, table: *mut SCEnumCharMap, event_id: *mut u8,
     ) -> ::std::os::raw::c_int;
 }
+extern "C" {
+    pub fn SCHTTP2MimicHttp1Request(
+        arg1: *mut ::std::os::raw::c_void, arg2: *mut ::std::os::raw::c_void,
+    );
+}
 #[repr(C)]
 #[derive(Debug, Copy, Clone)]
 pub struct MpmPattern_ {
index b480deaf5bc502ea95e48dad90641de03a662b58..fc299cdaec57c64880b1f21b893f1d46457e079c 100644 (file)
@@ -69,7 +69,7 @@ void RegisterHTTP2Parsers(void)
 #endif
 }
 
-void HTTP2MimicHttp1Request(void *alstate_orig, void *h2s)
+void SCHTTP2MimicHttp1Request(void *alstate_orig, void *h2s)
 {
     htp_tx_t *h1tx = HtpGetTxForH2(alstate_orig);
     if (h2s == NULL || h1tx == NULL) {
index b2d4d0ef778f8020bb47588fe008258a44a559d2..371f8afdde3a3ecfee758b496c996e4a5365e5f6 100644 (file)
@@ -26,6 +26,6 @@
 
 void RegisterHTTP2Parsers(void);
 
-void HTTP2MimicHttp1Request(void *, void *);
+void SCHTTP2MimicHttp1Request(void *, void *);
 
 #endif /* SURICATA_APP_LAYER_HTTP2_H */
index c356208f0fbf04a9208366217254d76b350c774b..80d5bc56ba3bc65eab913744723c151f56647f0d 100644 (file)
@@ -52,6 +52,7 @@
 #include "app-layer-parser.h"
 #include "app-layer-register.h"
 #include "app-layer-events.h"
+#include "app-layer-http2.h"
 
 #include "util-mpm.h"
 #include "util-file.h"