diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index edf151f67e..3256d0bd06 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -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; diff --git a/rust/sys/src/sys.rs b/rust/sys/src/sys.rs index b44d540026..9f8f8c826f 100644 --- a/rust/sys/src/sys.rs +++ b/rust/sys/src/sys.rs @@ -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_ { diff --git a/src/app-layer-http2.c b/src/app-layer-http2.c index b480deaf5b..fc299cdaec 100644 --- a/src/app-layer-http2.c +++ b/src/app-layer-http2.c @@ -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) { diff --git a/src/app-layer-http2.h b/src/app-layer-http2.h index b2d4d0ef77..371f8afdde 100644 --- a/src/app-layer-http2.h +++ b/src/app-layer-http2.h @@ -26,6 +26,6 @@ void RegisterHTTP2Parsers(void); -void HTTP2MimicHttp1Request(void *, void *); +void SCHTTP2MimicHttp1Request(void *, void *); #endif /* SURICATA_APP_LAYER_HTTP2_H */ diff --git a/src/bindgen.h b/src/bindgen.h index c356208f0f..80d5bc56ba 100644 --- a/src/bindgen.h +++ b/src/bindgen.h @@ -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"