|
|
@ -235,7 +235,7 @@ pub struct DNSResponse {
|
|
|
|
pub authorities: Vec<DNSAnswerEntry>,
|
|
|
|
pub authorities: Vec<DNSAnswerEntry>,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
#[derive(Debug, Default)]
|
|
|
|
pub struct DNSTransaction {
|
|
|
|
pub struct DNSTransaction {
|
|
|
|
pub id: u64,
|
|
|
|
pub id: u64,
|
|
|
|
pub request: Option<DNSRequest>,
|
|
|
|
pub request: Option<DNSRequest>,
|
|
|
@ -250,14 +250,8 @@ impl Transaction for DNSTransaction {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl DNSTransaction {
|
|
|
|
impl DNSTransaction {
|
|
|
|
|
|
|
|
|
|
|
|
pub fn new() -> Self {
|
|
|
|
pub fn new() -> Self {
|
|
|
|
return Self {
|
|
|
|
Default::default()
|
|
|
|
id: 0,
|
|
|
|
|
|
|
|
request: None,
|
|
|
|
|
|
|
|
response: None,
|
|
|
|
|
|
|
|
tx_data: AppLayerTxData::new(),
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Get the DNS transactions ID (not the internal tracking ID).
|
|
|
|
/// Get the DNS transactions ID (not the internal tracking ID).
|
|
|
@ -345,10 +339,6 @@ impl DNSState {
|
|
|
|
Default::default()
|
|
|
|
Default::default()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn new_tcp() -> Self {
|
|
|
|
|
|
|
|
Default::default()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn new_tx(&mut self) -> DNSTransaction {
|
|
|
|
pub fn new_tx(&mut self) -> DNSTransaction {
|
|
|
|
let mut tx = DNSTransaction::new();
|
|
|
|
let mut tx = DNSTransaction::new();
|
|
|
|
self.tx_id += 1;
|
|
|
|
self.tx_id += 1;
|
|
|
@ -684,7 +674,7 @@ pub extern "C" fn rs_dns_state_new(_orig_state: *mut std::os::raw::c_void, _orig
|
|
|
|
/// Returns *mut DNSState
|
|
|
|
/// Returns *mut DNSState
|
|
|
|
#[no_mangle]
|
|
|
|
#[no_mangle]
|
|
|
|
pub extern "C" fn rs_dns_state_tcp_new() -> *mut std::os::raw::c_void {
|
|
|
|
pub extern "C" fn rs_dns_state_tcp_new() -> *mut std::os::raw::c_void {
|
|
|
|
let state = DNSState::new_tcp();
|
|
|
|
let state = DNSState::new();
|
|
|
|
let boxed = Box::new(state);
|
|
|
|
let boxed = Box::new(state);
|
|
|
|
return Box::into_raw(boxed) as *mut _;
|
|
|
|
return Box::into_raw(boxed) as *mut _;
|
|
|
|
}
|
|
|
|
}
|
|
|
|