From: Pierre Chifflier Date: Sat, 21 Apr 2018 14:05:33 +0000 (+0200) Subject: Rust: expose function AppLayerParserRegisterGetTxIterator X-Git-Tag: suricata-5.0.0-rc1~431 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b65896c0defd104c1d632be7390b2728d3dbe4b3;p=thirdparty%2Fsuricata.git Rust: expose function AppLayerParserRegisterGetTxIterator --- diff --git a/rust/src/parser.rs b/rust/src/parser.rs index 1f9102bf8d..e304dead23 100644 --- a/rust/src/parser.rs +++ b/rust/src/parser.rs @@ -21,6 +21,7 @@ use core::{DetectEngineState,Flow,AppLayerEventType,AppLayerDecoderEvents,AppProto}; use filecontainer::FileContainer; +use applayer; use libc::{c_void,c_char,c_int}; use applayer::{AppLayerGetTxIterTuple}; @@ -169,8 +170,16 @@ pub const APP_LAYER_PARSER_NO_REASSEMBLY : u8 = 0b10; pub const APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD : u8 = 0b100; pub const APP_LAYER_PARSER_BYPASS_READY : u8 = 0b1000; +pub type AppLayerGetTxIteratorFn = extern "C" fn (ipproto: u8, + alproto: AppProto, + alstate: *mut c_void, + min_tx_id: u64, + max_tx_id: u64, + istate: &mut u64) -> applayer::AppLayerGetTxIterTuple; + extern { pub fn AppLayerParserStateSetFlag(state: *mut c_void, flag: u8); pub fn AppLayerParserStateIssetFlag(state: *mut c_void, flag: u8) -> c_int; pub fn AppLayerParserConfParserEnabled(ipproto: *const c_char, proto: *const c_char) -> c_int; + pub fn AppLayerParserRegisterGetTxIterator(ipproto: u8, alproto: AppProto, fun: AppLayerGetTxIteratorFn); }