From: Jason Ish Date: Wed, 10 Nov 2021 19:38:22 +0000 (-0600) Subject: krb5: use tx iterator X-Git-Tag: suricata-7.0.0-beta1~1197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=238ec953b7ea5092f79e9383efcc893352190895;p=thirdparty%2Fsuricata.git krb5: use tx iterator --- diff --git a/rust/src/krb/krb5.rs b/rust/src/krb/krb5.rs index 18048b2dc1..e9dc49faa2 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,