From: Jason Ish Date: Thu, 31 May 2018 22:38:53 +0000 (-0600) Subject: rust: add get_tx_iterator to parser registration X-Git-Tag: suricata-4.1.0-rc1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da4912dfe738be8542a0b8c1dda40dfe5a85ef30;p=thirdparty%2Fsuricata.git rust: add get_tx_iterator to parser registration --- diff --git a/rust/src/ikev2/ikev2.rs b/rust/src/ikev2/ikev2.rs index 39941367a1..304f3063c5 100644 --- a/rust/src/ikev2/ikev2.rs +++ b/rust/src/ikev2/ikev2.rs @@ -671,6 +671,7 @@ pub unsafe extern "C" fn rs_register_ikev2_parser() { get_tx_mpm_id : None, set_tx_mpm_id : None, get_files : None, + get_tx_iterator : None, }; let ip_proto_str = CString::new("udp").unwrap(); diff --git a/rust/src/krb/krb5.rs b/rust/src/krb/krb5.rs index 2d0e4f5155..43a30eda65 100644 --- a/rust/src/krb/krb5.rs +++ b/rust/src/krb/krb5.rs @@ -627,6 +627,7 @@ pub unsafe extern "C" fn rs_register_krb5_parser() { get_tx_mpm_id : None, set_tx_mpm_id : None, get_files : None, + get_tx_iterator : None, }; // register UDP parser let ip_proto_str = CString::new("udp").unwrap(); diff --git a/rust/src/ntp/ntp.rs b/rust/src/ntp/ntp.rs index b1b9fa752a..78727414fd 100644 --- a/rust/src/ntp/ntp.rs +++ b/rust/src/ntp/ntp.rs @@ -394,6 +394,7 @@ pub unsafe extern "C" fn rs_register_ntp_parser() { get_tx_mpm_id : None, set_tx_mpm_id : None, get_files : None, + get_tx_iterator : None, }; let ip_proto_str = CString::new("udp").unwrap(); diff --git a/rust/src/parser.rs b/rust/src/parser.rs index c5c689af7b..227f3fc938 100644 --- a/rust/src/parser.rs +++ b/rust/src/parser.rs @@ -23,7 +23,7 @@ use core::{DetectEngineState,Flow,AppLayerEventType,AppLayerDecoderEvents,AppPro use filecontainer::FileContainer; use libc::{c_void,c_char,c_int}; - +use applayer::{AppLayerGetTxIterTuple}; /// Rust parser declaration #[repr(C)] @@ -94,6 +94,9 @@ pub struct RustParser { /// Function to get files pub get_files: Option, + + /// Function to get the TX iterator + pub get_tx_iterator: Option, } @@ -140,6 +143,12 @@ pub type LocalStorageFreeFn = extern "C" fn (*mut c_void); pub type GetTxMpmIDFn = extern "C" fn (*mut c_void) -> u64; pub type SetTxMpmIDFn = extern "C" fn (*mut c_void, u64) -> c_int; pub type GetFilesFn = extern "C" fn (*mut c_void, u8) -> *mut FileContainer; +pub type GetTxIteratorFn = extern "C" fn (ipproto: u8, alproto: AppProto, + state: *mut c_void, + min_tx_id: u64, + max_tx_id: u64, + istate: &mut u64) + -> AppLayerGetTxIterTuple; // Defined in app-layer-register.h extern {