From: Jason Ish Date: Wed, 10 Nov 2021 19:31:54 +0000 (-0600) Subject: ntp: add tx iterator X-Git-Tag: suricata-7.0.0-beta1~1198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef0c35195308384b9f2bbf8a78fb69167f76f889;p=thirdparty%2Fsuricata.git ntp: add tx iterator --- diff --git a/rust/src/ntp/ntp.rs b/rust/src/ntp/ntp.rs index df5fb470c8..6a454bcd2b 100644 --- a/rust/src/ntp/ntp.rs +++ b/rust/src/ntp/ntp.rs @@ -63,7 +63,11 @@ pub struct NTPTransaction { tx_data: applayer::AppLayerTxData, } - +impl Transaction for NTPTransaction { + fn id(&self) -> u64 { + self.id + } +} impl NTPState { pub fn new() -> NTPState { @@ -75,6 +79,12 @@ impl NTPState { } } +impl State for NTPState { + fn get_transactions(&self) -> &[NTPTransaction] { + &self.transactions + } +} + impl NTPState { /// Parse an NTP request message /// @@ -338,7 +348,7 @@ pub unsafe extern "C" fn rs_register_ntp_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_ntp_get_tx_data, apply_tx_config : None, flags : APP_LAYER_PARSER_OPT_UNIDIR_TXS,