diff --git a/rust/src/applayertemplate/template.rs b/rust/src/applayertemplate/template.rs index a254f30393..bb02267f6c 100644 --- a/rust/src/applayertemplate/template.rs +++ b/rust/src/applayertemplate/template.rs @@ -544,6 +544,8 @@ pub unsafe extern "C" fn rs_template_register_parser() { set_tx_mpm_id: None, get_files: None, get_tx_iterator: Some(rs_template_state_get_tx_iterator), + get_tx_detect_flags: None, + set_tx_detect_flags: None, }; let ip_proto_str = CString::new("tcp").unwrap(); diff --git a/rust/src/dhcp/dhcp.rs b/rust/src/dhcp/dhcp.rs index 891b9b5d77..6aa576669d 100644 --- a/rust/src/dhcp/dhcp.rs +++ b/rust/src/dhcp/dhcp.rs @@ -452,6 +452,8 @@ pub unsafe extern "C" fn rs_dhcp_register_parser() { set_tx_mpm_id : None, get_files : None, get_tx_iterator : Some(rs_dhcp_state_get_tx_iterator), + set_tx_detect_flags: None, + get_tx_detect_flags: None, }; let ip_proto_str = CString::new("udp").unwrap(); diff --git a/rust/src/ikev2/ikev2.rs b/rust/src/ikev2/ikev2.rs index 89f1acfe10..0eaf9bcf9d 100644 --- a/rust/src/ikev2/ikev2.rs +++ b/rust/src/ikev2/ikev2.rs @@ -730,6 +730,8 @@ pub unsafe extern "C" fn rs_register_ikev2_parser() { set_tx_mpm_id : None, get_files : None, get_tx_iterator : None, + get_tx_detect_flags: None, + set_tx_detect_flags: None, }; let ip_proto_str = CString::new("udp").unwrap(); diff --git a/rust/src/krb/krb5.rs b/rust/src/krb/krb5.rs index 64c377418f..7cb911a72d 100644 --- a/rust/src/krb/krb5.rs +++ b/rust/src/krb/krb5.rs @@ -669,6 +669,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, }; // register UDP parser let ip_proto_str = CString::new("udp").unwrap(); diff --git a/rust/src/ntp/ntp.rs b/rust/src/ntp/ntp.rs index c6bcbfc4a1..ad3b519e9c 100644 --- a/rust/src/ntp/ntp.rs +++ b/rust/src/ntp/ntp.rs @@ -429,6 +429,8 @@ pub unsafe extern "C" fn rs_register_ntp_parser() { set_tx_mpm_id : None, get_files : None, get_tx_iterator : None, + get_tx_detect_flags: None, + set_tx_detect_flags: None, }; let ip_proto_str = CString::new("udp").unwrap(); diff --git a/rust/src/parser.rs b/rust/src/parser.rs index 1704bb2064..5dec9f2c32 100644 --- a/rust/src/parser.rs +++ b/rust/src/parser.rs @@ -100,6 +100,12 @@ pub struct RustParser { /// Function to get the TX iterator pub get_tx_iterator: Option, + + // Function to set TX detect flags. + pub set_tx_detect_flags: Option, + + // Function to get TX detect flags. + pub get_tx_detect_flags: Option, } @@ -154,6 +160,8 @@ pub type GetTxIteratorFn = extern "C" fn (ipproto: u8, alproto: AppProto, max_tx_id: u64, istate: &mut u64) -> AppLayerGetTxIterTuple; +pub type GetTxDetectFlagsFn = unsafe extern "C" fn(*mut c_void, u8) -> u64; +pub type SetTxDetectFlagsFn = unsafe extern "C" fn(*mut c_void, u8, u64); // Defined in app-layer-register.h extern { @@ -185,4 +193,10 @@ extern { pub fn AppLayerParserStateIssetFlag(state: *mut c_void, flag: u8) -> c_int; pub fn AppLayerParserConfParserEnabled(ipproto: *const c_char, proto: *const c_char) -> c_int; pub fn AppLayerParserRegisterGetTxIterator(ipproto: u8, alproto: AppProto, fun: AppLayerGetTxIteratorFn); + pub fn AppLayerParserRegisterDetectFlagsFuncs( + ipproto: u8, + alproto: AppProto, + GetTxDetectFlats: GetTxDetectFlagsFn, + SetTxDetectFlags: SetTxDetectFlagsFn, + ); } diff --git a/rust/src/rdp/rdp.rs b/rust/src/rdp/rdp.rs index 2867485b47..3b66935413 100644 --- a/rust/src/rdp/rdp.rs +++ b/rust/src/rdp/rdp.rs @@ -531,6 +531,8 @@ pub unsafe extern "C" fn rs_rdp_register_parser() { set_tx_mpm_id: None, get_files: None, get_tx_iterator: None, + get_tx_detect_flags: None, + set_tx_detect_flags: None, }; /* For 5.0 we want this disabled by default, so check that it diff --git a/rust/src/sip/sip.rs b/rust/src/sip/sip.rs index 39be7c66ba..b33526003d 100755 --- a/rust/src/sip/sip.rs +++ b/rust/src/sip/sip.rs @@ -422,6 +422,8 @@ pub unsafe extern "C" fn rs_sip_register_parser() { set_tx_mpm_id: None, get_files: None, get_tx_iterator: None, + get_tx_detect_flags: None, + set_tx_detect_flags: None, }; /* For 5.0 we want this disabled by default, so check that it diff --git a/rust/src/snmp/snmp.rs b/rust/src/snmp/snmp.rs index 01c2fa97ba..ebd4d26641 100644 --- a/rust/src/snmp/snmp.rs +++ b/rust/src/snmp/snmp.rs @@ -607,6 +607,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, }; let ip_proto_str = CString::new("udp").unwrap(); if AppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {