From: Shivani Bhardwaj Date: Mon, 17 May 2021 10:49:41 +0000 (+0530) Subject: rust/core: Make AppProto type u16 X-Git-Tag: suricata-7.0.0-beta1~1618 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dee972b863dadb73011c57eb87ab892859647c03;p=thirdparty%2Fsuricata.git rust/core: Make AppProto type u16 --- diff --git a/rust/src/core.rs b/rust/src/core.rs index cf88b1127f..7fab328766 100644 --- a/rust/src/core.rs +++ b/rust/src/core.rs @@ -40,7 +40,7 @@ pub const STREAM_DEPTH: u8 = 0x20; pub const STREAM_MIDSTREAM:u8 = 0x40; // Application layer protocol identifiers (app-layer-protos.h) -pub type AppProto = std::os::raw::c_int; +pub type AppProto = u16; pub const ALPROTO_UNKNOWN : AppProto = 0; pub static mut ALPROTO_FAILED : AppProto = 0; // updated during init diff --git a/rust/src/dcerpc/dcerpc.rs b/rust/src/dcerpc/dcerpc.rs index 70ebb17977..0069f13cc8 100644 --- a/rust/src/dcerpc/dcerpc.rs +++ b/rust/src/dcerpc/dcerpc.rs @@ -1363,7 +1363,7 @@ fn probe(input: &[u8]) -> (bool, bool) { #[no_mangle] pub extern "C" fn rs_dcerpc_probe_tcp(direction: u8, input: *const u8, - len: u32, rdir: *mut u8) -> i32 + len: u32, rdir: *mut u8) -> AppProto { SCLogDebug!("Probing packet for DCERPC"); if len == 0 { diff --git a/rust/src/dcerpc/dcerpc_udp.rs b/rust/src/dcerpc/dcerpc_udp.rs index 1ed151859b..f73d160339 100644 --- a/rust/src/dcerpc/dcerpc_udp.rs +++ b/rust/src/dcerpc/dcerpc_udp.rs @@ -306,7 +306,7 @@ fn probe(input: &[u8]) -> (bool, bool) { #[no_mangle] pub extern "C" fn rs_dcerpc_probe_udp(direction: u8, input: *const u8, - len: u32, rdir: *mut u8) -> i32 + len: u32, rdir: *mut u8) -> core::AppProto { SCLogDebug!("Probing the packet for DCERPC/UDP"); if len == 0 {