From ef0c35195308384b9f2bbf8a78fb69167f76f889 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 10 Nov 2021 13:31:54 -0600 Subject: [PATCH] ntp: add tx iterator --- rust/src/ntp/ntp.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/rust/src/ntp/ntp.rs b/rust/src/ntp/ntp.rs index df5fb470c..6a454bcd2 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, -- 2.47.3