From f4b4d531b052f5499c121cf21a2b2ec2aa9fe818 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 10 Nov 2021 13:34:10 -0600 Subject: [PATCH] rdp: add tx iterator --- rust/src/rdp/rdp.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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, -- 2.47.3