SMBTransactionDCERPC::new_request(cmd, call_id)));
SCLogDebug!("SMB: TX DCERPC created: ID {} hdr {:?}", tx.id, tx.hdr);
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}
SMBTransactionDCERPC::new_response(call_id)));
SCLogDebug!("SMB: TX DCERPC created: ID {} hdr {:?}", tx.id, tx.hdr);
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}
use nom;
+use std::collections::VecDeque;
+
use crate::core::*;
use crate::applayer;
use crate::applayer::{AppLayerResult, AppLayerTxData};
tx.response_done = self.tc_trunc; // no response expected if tc is truncated
SCLogDebug!("SMB: TX SETFILEPATHINFO created: ID {}", tx.id);
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}
tx.response_done = self.tc_trunc; // no response expected if tc is truncated
SCLogDebug!("SMB: TX SETFILEPATHINFO created: ID {}", tx.id);
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}
}
tx.response_done = self.tc_trunc; // no response expected if tc is truncated
SCLogDebug!("SMB: TX RENAME created: ID {}", tx.id);
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}
}
post_gap_files_checked: bool,
/// transactions list
- pub transactions: Vec<SMBTransaction>,
+ pub transactions: VecDeque<SMBTransaction>,
/// tx counter for assigning incrementing id's to tx's
tx_id: u64,
tc_trunc: false,
check_post_gap_file_txs: false,
post_gap_files_checked: false,
- transactions: Vec::new(),
+ transactions: VecDeque::new(),
tx_id:0,
dialect:0,
dialect_vec: None,
SCLogDebug!("SMB: TX GENERIC created: ID {} tx list {} {:?}",
tx.id, self.transactions.len(), &tx);
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}
pub fn get_last_tx(&mut self, smb_ver: u8, smb_cmd: u16)
-> Option<&mut SMBTransaction>
{
- let tx_ref = self.transactions.last_mut();
+ let tx_ref = self.transactions.back_mut();
match tx_ref {
Some(tx) => {
let found = if tx.vercmd.get_version() == smb_ver {
tx.response_done = self.tc_trunc; // no response expected if tc is truncated
SCLogDebug!("SMB: TX NEGOTIATE created: ID {} SMB ver {}", tx.id, smb_ver);
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}
SCLogDebug!("SMB: TX TREECONNECT created: ID {} NAME {}",
tx.id, String::from_utf8_lossy(&name));
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}
tx.request_done = true;
tx.response_done = self.tc_trunc; // no response expected if tc is truncated
- self.transactions.push(tx);
- let tx_ref = self.transactions.last_mut();
+ self.transactions.push_back(tx);
+ let tx_ref = self.transactions.back_mut();
return tx_ref.unwrap();
}