]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/core: Make AppProto type u16
authorShivani Bhardwaj <shivanib134@gmail.com>
Mon, 17 May 2021 10:49:41 +0000 (16:19 +0530)
committerVictor Julien <victor@inliniac.net>
Fri, 21 May 2021 09:01:26 +0000 (11:01 +0200)
rust/src/core.rs
rust/src/dcerpc/dcerpc.rs
rust/src/dcerpc/dcerpc_udp.rs

index cf88b1127fe3ec12c7c937565aa169d277f1e480..7fab32876682516cc3b26d9d6352bee2e47368a4 100644 (file)
@@ -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
index 70ebb17977a16a46dddcd45d3a539ee0477a6909..0069f13cc84f429a381d73ba01e78ad99dde6649 100644 (file)
@@ -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 {
index 1ed151859b6241109a6994b7d9ff5104632f16bd..f73d160339c3db2515c240e0d89a6469cd56dfd8 100644 (file)
@@ -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 {