]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
krb5: register tx detect flags
authorJason Ish <jason.ish@oisf.net>
Thu, 21 Nov 2019 18:26:32 +0000 (12:26 -0600)
committerJason Ish <jason.ish@oisf.net>
Wed, 27 Nov 2019 19:05:17 +0000 (13:05 -0600)
Related ticker #3345:
https://redmine.openinfosecfoundation.org/issues/3345

rust/src/krb/krb5.rs

index 7cb911a72da94e71c27fa5acc581d9177a6c9a7c..1c87449a6a2b1d0642d55812ec643bd7ea0be6d7 100644 (file)
@@ -89,6 +89,7 @@ pub struct KRB5Transaction {
     events: *mut core::AppLayerDecoderEvents,
 
     logged: applayer::LoggerFlags,
+    detect_flags: applayer::TxDetectFlags,
 }
 
 pub fn to_hex_string(bytes: &[u8]) -> String {
@@ -240,6 +241,7 @@ impl KRB5Transaction {
             de_state: None,
             events: std::ptr::null_mut(),
             logged: applayer::LoggerFlags::new(),
+            detect_flags: applayer::TxDetectFlags::default(),
         }
     }
 }
@@ -633,6 +635,8 @@ pub extern "C" fn rs_krb5_parse_response_tcp(_flow: *const core::Flow,
     status
 }
 
+export_tx_detect_flags_set!(rs_krb5_tx_detect_flags_set, KRB5Transaction);
+export_tx_detect_flags_get!(rs_krb5_tx_detect_flags_get, KRB5Transaction);
 
 const PARSER_NAME : &'static [u8] = b"krb5\0";
 
@@ -669,8 +673,8 @@ pub unsafe extern "C" fn rs_register_krb5_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_krb5_tx_detect_flags_get),
+        set_tx_detect_flags: Some(rs_krb5_tx_detect_flags_set),
     };
     // register UDP parser
     let ip_proto_str = CString::new("udp").unwrap();