]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: RustParser same fields as AppLayerParser
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 2 May 2022 20:50:04 +0000 (22:50 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 3 May 2022 09:18:27 +0000 (11:18 +0200)
So that there is no problem when crossing FFI

rust/src/applayer.rs
rust/src/core.rs

index a7193472e06636bb84ddb1bb2d3fde7ede739ded..642172a51816a8bd0470a35bd926b363105b8725 100644 (file)
@@ -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<ProbeFn>,
index 7a037d1ff11f8bfc9f47db7310f84349b529efb5..9f4dc16cd30f31c97ebb52c2f2f30ccfe20a61b4 100644 (file)
@@ -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);