From 238ec953b7ea5092f79e9383efcc893352190895 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 10 Nov 2021 13:38:22 -0600 Subject: [PATCH] krb5: use tx iterator --- rust/src/krb/krb5.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rust/src/krb/krb5.rs b/rust/src/krb/krb5.rs index 18048b2dc..e9dc49faa 100644 --- a/rust/src/krb/krb5.rs +++ b/rust/src/krb/krb5.rs @@ -50,6 +50,12 @@ pub struct KRB5State { tx_id: u64, } +impl State for KRB5State { + fn get_transactions(&self) -> &[KRB5Transaction] { + &self.transactions + } +} + pub struct KRB5Transaction { /// The message type: AS-REQ, AS-REP, etc. pub msg_type: MessageType, @@ -79,6 +85,12 @@ pub struct KRB5Transaction { tx_data: applayer::AppLayerTxData, } +impl Transaction for KRB5Transaction { + fn id(&self) -> u64 { + self.id + } +} + pub fn to_hex_string(bytes: &[u8]) -> String { let mut s = String::new(); for &b in bytes { @@ -589,7 +601,7 @@ pub unsafe extern "C" fn rs_register_krb5_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_krb5_get_tx_data, apply_tx_config : None, flags : APP_LAYER_PARSER_OPT_UNIDIR_TXS, -- 2.47.3