]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
snmp: add tx detect flags
authorJason Ish <jason.ish@oisf.net>
Tue, 26 Nov 2019 22:08:18 +0000 (16:08 -0600)
committerJason Ish <jason.ish@oisf.net>
Wed, 27 Nov 2019 19:42:52 +0000 (13:42 -0600)
rust/src/snmp/snmp.rs

index ebd4d266414e0768f1f82dd48767e6bb8698e99b..a3c5307c283709a090a7c76fbf1d410036b56a1f 100644 (file)
@@ -97,6 +97,7 @@ pub struct SNMPTransaction {
     events: *mut core::AppLayerDecoderEvents,
 
     logged: applayer::LoggerFlags,
+    detect_flags: applayer::TxDetectFlags,
 }
 
 
@@ -274,6 +275,7 @@ impl SNMPTransaction {
             de_state: None,
             events: std::ptr::null_mut(),
             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";
 
 #[no_mangle]
@@ -607,8 +612,8 @@ pub unsafe extern "C" fn rs_register_snmp_parser() {
         set_tx_mpm_id      : None,
         get_files          : None,
         get_tx_iterator    : None,
-        get_tx_detect_flags: None,
-        set_tx_detect_flags: None,
+        get_tx_detect_flags: Some(rs_snmp_get_tx_detect_flags),
+        set_tx_detect_flags: Some(rs_snmp_set_tx_detect_flags),
     };
     let ip_proto_str = CString::new("udp").unwrap();
     if AppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {