ntp: support AppLayerTxData

pull/5169/head
Victor Julien 5 years ago
parent e0f75157a0
commit cc1210c956

@ -74,7 +74,7 @@ pub struct NTPTransaction {
/// The events associated with this transaction /// The events associated with this transaction
events: *mut core::AppLayerDecoderEvents, events: *mut core::AppLayerDecoderEvents,
logged: applayer::LoggerFlags, tx_data: applayer::AppLayerTxData,
} }
@ -158,7 +158,7 @@ impl NTPTransaction {
id: id, id: id,
de_state: None, de_state: None,
events: std::ptr::null_mut(), events: std::ptr::null_mut(),
logged: applayer::LoggerFlags::new(), tx_data: applayer::AppLayerTxData::new(),
} }
} }
@ -175,11 +175,6 @@ impl Drop for NTPTransaction {
} }
} }
/// Returns *mut NTPState /// Returns *mut NTPState
#[no_mangle] #[no_mangle]
pub extern "C" fn rs_ntp_state_new() -> *mut std::os::raw::c_void { pub extern "C" fn rs_ntp_state_new() -> *mut std::os::raw::c_void {
@ -273,27 +268,6 @@ pub extern "C" fn rs_ntp_tx_get_alstate_progress(_tx: *mut std::os::raw::c_void,
1 1
} }
#[no_mangle]
pub extern "C" fn rs_ntp_tx_set_logged(_state: &mut NTPState,
tx: &mut NTPTransaction,
logged: u32)
{
tx.logged.set(logged);
}
#[no_mangle]
pub extern "C" fn rs_ntp_tx_get_logged(_state: &mut NTPState,
tx: &mut NTPTransaction)
-> u32
{
return tx.logged.get();
}
#[no_mangle] #[no_mangle]
pub extern "C" fn rs_ntp_state_set_tx_detect_state( pub extern "C" fn rs_ntp_state_set_tx_detect_state(
tx: *mut std::os::raw::c_void, tx: *mut std::os::raw::c_void,
@ -399,6 +373,8 @@ pub extern "C" fn ntp_probing_parser(_flow: *const Flow,
} }
} }
export_tx_data_get!(rs_ntp_get_tx_data, NTPTransaction);
const PARSER_NAME : &'static [u8] = b"ntp\0"; const PARSER_NAME : &'static [u8] = b"ntp\0";
#[no_mangle] #[no_mangle]
@ -434,7 +410,7 @@ pub unsafe extern "C" fn rs_register_ntp_parser() {
get_tx_iterator : None, get_tx_iterator : None,
get_tx_detect_flags: None, get_tx_detect_flags: None,
set_tx_detect_flags: None, set_tx_detect_flags: None,
get_tx_data : None, get_tx_data : Some(rs_ntp_get_tx_data),
apply_tx_config : None, apply_tx_config : None,
}; };

Loading…
Cancel
Save