/// List of transactions for this session
transactions: Vec<NTPTransaction>,
- /// Detection engine states counter
- de_state_count: u64,
-
/// Events counter
events: u16,
pub fn new() -> NTPState {
NTPState{
transactions: Vec::new(),
- de_state_count: 0,
events: 0,
tx_id: 0,
}
#[no_mangle]
pub extern "C" fn rs_ntp_state_set_tx_detect_state(
- state: *mut libc::c_void,
tx: *mut libc::c_void,
de_state: &mut core::DetectEngineState) -> libc::c_int
{
- let state = cast_pointer!(state,NTPState);
let tx = cast_pointer!(tx,NTPTransaction);
- state.de_state_count += 1;
tx.de_state = Some(de_state);
0
}
set_tx_logged : None,
get_de_state : rs_ntp_state_get_tx_detect_state,
set_de_state : rs_ntp_state_set_tx_detect_state,
- has_de_state : None,
has_events : Some(rs_ntp_state_has_events),
get_events : Some(rs_ntp_state_get_events),
get_eventinfo : Some(rs_ntp_state_get_event_info),
pub get_de_state: GetDetectStateFn,
/// Function called to set a detection state
pub set_de_state: SetDetectStateFn,
- /// Function to check if a detection state is present
- pub has_de_state: Option<HasDetectStateFn>,
/// Function to check if there are events
pub has_events: Option<HasEventsFn>,
pub type StateGetTxCntFn = extern "C" fn (*mut c_void) -> u64;
pub type StateGetTxCompletionStatusFn = extern "C" fn (u8) -> c_int;
pub type StateGetProgressFn = extern "C" fn (*mut c_void, u8) -> c_int;
-pub type HasDetectStateFn = extern "C" fn (*mut c_void) -> c_int;
pub type GetDetectStateFn = extern "C" fn (*mut c_void) -> *mut DetectEngineState;
-pub type SetDetectStateFn = extern "C" fn (*mut c_void, *mut c_void, &mut DetectEngineState) -> c_int;
+pub type SetDetectStateFn = extern "C" fn (*mut c_void, &mut DetectEngineState) -> c_int;
pub type GetEventInfoFn = extern "C" fn (*const c_char, *mut c_int, *mut AppLayerEventType) -> c_int;
pub type GetEventsFn = extern "C" fn (*mut c_void, u64) -> *mut AppLayerDecoderEvents;
pub type HasEventsFn = extern "C" fn (*mut c_void) -> c_int;