diff --git a/rust/src/websocket/logger.rs b/rust/src/websocket/logger.rs index f63522c89541..8dd9113df768 100644 --- a/rust/src/websocket/logger.rs +++ b/rust/src/websocket/logger.rs @@ -58,8 +58,9 @@ pub unsafe extern "C" fn rs_websocket_logger_log( #[no_mangle] pub unsafe extern "C" fn SCWebSocketLogDetails( - tx: &WebSocketTransaction, js: *mut std::os::raw::c_void, pp: bool, pb64: bool, + tx: *const std::os::raw::c_void, js: *mut std::os::raw::c_void, pp: bool, pb64: bool, ) -> bool { let js = cast_pointer!(js, JsonBuilder); + let tx = cast_pointer!(tx, WebSocketTransaction); log_websocket(tx, js, pp, pb64).is_ok() } diff --git a/rust/src/websocket/parser.rs b/rust/src/websocket/parser.rs index eb6dc900e5ce..10da604e271c 100644 --- a/rust/src/websocket/parser.rs +++ b/rust/src/websocket/parser.rs @@ -23,7 +23,7 @@ use suricata_derive::EnumStringU8; #[derive(Clone, Debug, Default, EnumStringU8)] #[repr(u8)] -pub enum WebSocketOpcode { +pub(super) enum WebSocketOpcode { #[default] Continuation = 0, Text = 1, @@ -34,7 +34,7 @@ pub enum WebSocketOpcode { } #[derive(Clone, Debug, Default)] -pub struct WebSocketPdu { +pub(super) struct WebSocketPdu { pub flags: u8, pub fin: bool, pub compress: bool, diff --git a/rust/src/websocket/websocket.rs b/rust/src/websocket/websocket.rs index 1138ab759ab1..b21e24102c92 100644 --- a/rust/src/websocket/websocket.rs +++ b/rust/src/websocket/websocket.rs @@ -39,20 +39,20 @@ pub(super) static mut ALPROTO_WEBSOCKET: AppProto = ALPROTO_UNKNOWN; static mut WEBSOCKET_MAX_PAYLOAD_SIZE: u32 = 0xFFFF; #[derive(AppLayerFrameType)] -pub enum WebSocketFrameType { +enum WebSocketFrameType { Header, Pdu, Data, } #[derive(AppLayerEvent)] -pub enum WebSocketEvent { +enum WebSocketEvent { SkipEndOfPayload, ReassemblyLimitReached, } #[derive(Default)] -pub struct WebSocketTransaction { +pub(super) struct WebSocketTransaction { tx_id: u64, pub pdu: parser::WebSocketPdu, tx_data: AppLayerTxData, @@ -80,7 +80,7 @@ struct WebSocketReassemblyBuffer { } #[derive(Default)] -pub struct WebSocketState { +struct WebSocketState { state_data: AppLayerStateData, tx_id: u64, transactions: VecDeque,