From: Jason Ish Date: Wed, 10 Nov 2021 19:34:10 +0000 (-0600) Subject: rdp: add tx iterator X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4b4d531b052f5499c121cf21a2b2ec2aa9fe818;p=people%2Fms%2Fsuricata.git rdp: add tx iterator --- diff --git a/rust/src/rdp/rdp.rs b/rust/src/rdp/rdp.rs index 8b197b598..75d7500fa 100644 --- a/rust/src/rdp/rdp.rs +++ b/rust/src/rdp/rdp.rs @@ -19,7 +19,7 @@ //! RDP application layer -use crate::applayer::*; +use crate::applayer::{self, *}; use crate::core::{self, AppProto, DetectEngineState, Flow, ALPROTO_UNKNOWN, IPPROTO_TCP}; use crate::rdp::parser::*; use nom; @@ -55,6 +55,12 @@ pub struct RdpTransaction { tx_data: AppLayerTxData, } +impl Transaction for RdpTransaction { + fn id(&self) -> u64 { + self.id + } +} + impl RdpTransaction { fn new(id: u64, item: RdpTransactionItem) -> Self { Self { @@ -120,6 +126,12 @@ pub struct RdpState { bypass_parsing: bool, } +impl State for RdpState { + fn get_transactions(&self) -> &[RdpTransaction] { + &self.transactions + } +} + impl RdpState { fn new() -> Self { Self { @@ -492,7 +504,7 @@ pub unsafe extern "C" fn rs_rdp_register_parser() { localstorage_new: None, localstorage_free: None, get_files: None, - get_tx_iterator: None, + get_tx_iterator: Some(applayer::state_get_tx_iterator::), get_tx_data: rs_rdp_get_tx_data, apply_tx_config: None, flags: APP_LAYER_PARSER_OPT_UNIDIR_TXS,