sip: add tx iterator

pull/6629/head
Jason Ish 3 years ago committed by Victor Julien
parent d6b2d7e16a
commit 871fb035b4

@ -36,6 +36,12 @@ pub struct SIPState {
tx_id: u64,
}
impl State<SIPTransaction> for SIPState {
fn get_transactions(&self) -> &[SIPTransaction] {
&self.transactions
}
}
pub struct SIPTransaction {
id: u64,
pub request: Option<Request>,
@ -47,6 +53,12 @@ pub struct SIPTransaction {
tx_data: applayer::AppLayerTxData,
}
impl Transaction for SIPTransaction {
fn id(&self) -> u64 {
self.id
}
}
impl SIPState {
pub fn new() -> SIPState {
SIPState {
@ -326,7 +338,7 @@ pub unsafe extern "C" fn rs_sip_register_parser() {
localstorage_new: None,
localstorage_free: None,
get_files: None,
get_tx_iterator: None,
get_tx_iterator: Some(applayer::state_get_tx_iterator::<SIPState, SIPTransaction>),
get_tx_data: rs_sip_get_tx_data,
apply_tx_config: None,
flags: APP_LAYER_PARSER_OPT_UNIDIR_TXS,

Loading…
Cancel
Save