From: Philippe Antoine Date: Mon, 2 May 2022 20:50:04 +0000 (+0200) Subject: rust: RustParser same fields as AppLayerParser X-Git-Tag: suricata-6.0.6~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfe3da7765b698e75040143d89a6b145a0c5b898;p=thirdparty%2Fsuricata.git rust: RustParser same fields as AppLayerParser So that there is no problem when crossing FFI (cherry picked from commit c78722a671e819261dea9ce148966718cfca7c64) --- diff --git a/rust/src/applayer.rs b/rust/src/applayer.rs index f7db579253..795db989a4 100644 --- a/rust/src/applayer.rs +++ b/rust/src/applayer.rs @@ -179,7 +179,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 61073ed657..3a5440039e 100644 --- a/rust/src/core.rs +++ b/rust/src/core.rs @@ -45,8 +45,8 @@ pub type AppProto = std::os::raw::c_int; 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); diff --git a/src/app-layer-register.h b/src/app-layer-register.h index 47da98dade..8da026b907 100644 --- a/src/app-layer-register.h +++ b/src/app-layer-register.h @@ -27,7 +27,7 @@ typedef struct AppLayerParser { const char *name; const char *default_port; - int ip_proto; + uint8_t ip_proto; ProbingParserFPtr ProbeTS; ProbingParserFPtr ProbeTC;