]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Rust: fix probing function prototype: change sign and add Flow
authorPierre Chifflier <chifflier@wzdftpd.net>
Wed, 29 Nov 2017 11:07:44 +0000 (12:07 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 21 Dec 2017 09:45:08 +0000 (10:45 +0100)
rust/src/ntp/ntp.rs
rust/src/parser.rs

index 00c1a860c930ac261632c9841a5a0f3c5f4241ae..186faa0773807886a9d69c322d1e630bdc7d3ca1 100644 (file)
@@ -20,7 +20,7 @@
 extern crate ntp_parser;
 use self::ntp_parser::*;
 use core;
-use core::{AppProto,ALPROTO_UNKNOWN,ALPROTO_FAILED};
+use core::{AppProto,Flow,ALPROTO_UNKNOWN,ALPROTO_FAILED};
 use applayer;
 use parser::*;
 use libc;
@@ -361,7 +361,7 @@ pub extern "C" fn rs_ntp_state_get_event_info(event_name: *const libc::c_char,
 static mut ALPROTO_NTP : AppProto = ALPROTO_UNKNOWN;
 
 #[no_mangle]
-pub extern "C" fn ntp_probing_parser(input:*const i8, input_len: u32, _offset: *const i8) -> AppProto {
+pub extern "C" fn ntp_probing_parser(_flow: *const Flow, input:*const u8, input_len: u32, _offset: *const u32) -> AppProto {
     let slice: &[u8] = unsafe { std::slice::from_raw_parts(input as *mut u8, input_len as usize) };
     let alproto = unsafe{ ALPROTO_NTP };
     match parse_ntp(slice) {
index acbb8183c507ab0e9d4f14e5066abdd23cc4d54a..4c1e7c73372ff32bd973e4c9e24eccad1052d6ad 100644 (file)
@@ -125,7 +125,7 @@ pub type ParseFn      = extern "C" fn (flow: *const Flow,
                                        input: *const u8,
                                        input_len: u32,
                                        data: *const c_void) -> i8;
-pub type ProbeFn      = extern "C" fn (input:*const i8, input_len: u32, offset: *const i8) -> AppProto;
+pub type ProbeFn      = extern "C" fn (flow: *const Flow,input:*const u8, input_len: u32, offset: *const u32) -> AppProto;
 pub type StateAllocFn = extern "C" fn () -> *mut c_void;
 pub type StateFreeFn  = extern "C" fn (*mut c_void);
 pub type StateTxFreeFn  = extern "C" fn (*mut c_void, u64);