snmp: add tx detect flags

pull/4405/head
Jason Ish 6 years ago
parent 21f014f5c3
commit e2c846d01f

@ -97,6 +97,7 @@ pub struct SNMPTransaction {
events: *mut core::AppLayerDecoderEvents, events: *mut core::AppLayerDecoderEvents,
logged: applayer::LoggerFlags, logged: applayer::LoggerFlags,
detect_flags: applayer::TxDetectFlags,
} }
@ -274,6 +275,7 @@ impl SNMPTransaction {
de_state: None, de_state: None,
events: std::ptr::null_mut(), events: std::ptr::null_mut(),
logged: applayer::LoggerFlags::new(), logged: applayer::LoggerFlags::new(),
detect_flags: applayer::TxDetectFlags::default(),
} }
} }
@ -572,6 +574,9 @@ pub extern "C" fn rs_snmp_probing_parser(_flow: *const Flow,
} }
} }
export_tx_detect_flags_set!(rs_snmp_set_tx_detect_flags, SNMPTransaction);
export_tx_detect_flags_get!(rs_snmp_get_tx_detect_flags, SNMPTransaction);
const PARSER_NAME : &'static [u8] = b"snmp\0"; const PARSER_NAME : &'static [u8] = b"snmp\0";
#[no_mangle] #[no_mangle]
@ -607,8 +612,8 @@ pub unsafe extern "C" fn rs_register_snmp_parser() {
set_tx_mpm_id : None, set_tx_mpm_id : None,
get_files : None, get_files : None,
get_tx_iterator : None, get_tx_iterator : None,
get_tx_detect_flags: None, get_tx_detect_flags: Some(rs_snmp_get_tx_detect_flags),
set_tx_detect_flags: None, set_tx_detect_flags: Some(rs_snmp_set_tx_detect_flags),
}; };
let ip_proto_str = CString::new("udp").unwrap(); let ip_proto_str = CString::new("udp").unwrap();
if AppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 { if AppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {

Loading…
Cancel
Save