From: Philippe Antoine Date: Mon, 2 May 2022 20:50:04 +0000 (+0200) Subject: rust: RustParser same fields as AppLayerParser X-Git-Tag: suricata-7.0.0-beta1~632 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c78722a671e819261dea9ce148966718cfca7c64;p=thirdparty%2Fsuricata.git rust: RustParser same fields as AppLayerParser So that there is no problem when crossing FFI --- diff --git a/rust/src/applayer.rs b/rust/src/applayer.rs index a7193472e0..642172a518 100644 --- a/rust/src/applayer.rs +++ b/rust/src/applayer.rs @@ -247,7 +247,7 @@ pub struct RustParser { pub default_port: *const c_char, /// IP Protocol (core::IPPROTO_UDP, core::IPPROTO_TCP, etc.) - pub ipproto: c_int, + pub ipproto: u8, /// Probing function, for packets going to server pub probe_ts: Option, diff --git a/rust/src/core.rs b/rust/src/core.rs index 7a037d1ff1..9f4dc16cd3 100644 --- a/rust/src/core.rs +++ b/rust/src/core.rs @@ -82,8 +82,8 @@ pub type AppProto = u16; pub const ALPROTO_UNKNOWN : AppProto = 0; pub static mut ALPROTO_FAILED : AppProto = 0; // updated during init -pub const IPPROTO_TCP : i32 = 6; -pub const IPPROTO_UDP : i32 = 17; +pub const IPPROTO_TCP : u8 = 6; +pub const IPPROTO_UDP : u8 = 17; macro_rules!BIT_U8 { ($x:expr) => (1 << $x);