From: Victor Julien Date: Sun, 7 Jun 2020 19:21:05 +0000 (+0200) Subject: app-layer/rust: don't use option for GetTxDataFn anymore X-Git-Tag: suricata-6.0.0-beta1~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c94a5e6392bed4e3bc85e150b566fedf7145a939;p=thirdparty%2Fsuricata.git app-layer/rust: don't use option for GetTxDataFn anymore --- diff --git a/rust/src/applayer.rs b/rust/src/applayer.rs index f4ad113dcc..b1a6fc9e60 100644 --- a/rust/src/applayer.rs +++ b/rust/src/applayer.rs @@ -227,7 +227,7 @@ pub struct RustParser { // Function to get TX detect flags. pub get_tx_detect_flags: Option, - pub get_tx_data: Option, + pub get_tx_data: GetTxDataFn, // Function to apply config to a TX. Optional. Normal (bidirectional) // transactions don't need to set this. It is meant for cases where diff --git a/rust/src/applayertemplate/template.rs b/rust/src/applayertemplate/template.rs index 97826a0994..33c4da128b 100644 --- a/rust/src/applayertemplate/template.rs +++ b/rust/src/applayertemplate/template.rs @@ -518,7 +518,7 @@ pub unsafe extern "C" fn rs_template_register_parser() { get_tx_iterator: Some(rs_template_state_get_tx_iterator), get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data: Some(rs_template_get_tx_data), + get_tx_data: rs_template_get_tx_data, apply_tx_config: None, }; diff --git a/rust/src/dhcp/dhcp.rs b/rust/src/dhcp/dhcp.rs index a87b292485..27750c60a4 100644 --- a/rust/src/dhcp/dhcp.rs +++ b/rust/src/dhcp/dhcp.rs @@ -437,7 +437,7 @@ pub unsafe extern "C" fn rs_dhcp_register_parser() { get_tx_iterator : Some(rs_dhcp_state_get_tx_iterator), set_tx_detect_flags: None, get_tx_detect_flags: None, - get_tx_data : Some(rs_dhcp_get_tx_data), + get_tx_data : rs_dhcp_get_tx_data, apply_tx_config : None, }; diff --git a/rust/src/dns/dns.rs b/rust/src/dns/dns.rs index e54b8cb3cb..1c721ae5eb 100644 --- a/rust/src/dns/dns.rs +++ b/rust/src/dns/dns.rs @@ -980,7 +980,7 @@ pub unsafe extern "C" fn rs_dns_udp_register_parser() { set_tx_detect_flags: None, get_de_state: rs_dns_state_get_tx_detect_state, set_de_state: rs_dns_state_set_tx_detect_state, - get_tx_data: Some(rs_dns_state_get_tx_data), + get_tx_data: rs_dns_state_get_tx_data, apply_tx_config: None, }; @@ -1025,7 +1025,7 @@ pub unsafe extern "C" fn rs_dns_tcp_register_parser() { set_tx_detect_flags: None, get_de_state: rs_dns_state_get_tx_detect_state, set_de_state: rs_dns_state_set_tx_detect_state, - get_tx_data: Some(rs_dns_state_get_tx_data), + get_tx_data: rs_dns_state_get_tx_data, apply_tx_config: None, }; diff --git a/rust/src/ikev2/ikev2.rs b/rust/src/ikev2/ikev2.rs index 2f6a911ebc..a51d00f949 100644 --- a/rust/src/ikev2/ikev2.rs +++ b/rust/src/ikev2/ikev2.rs @@ -712,7 +712,7 @@ pub unsafe extern "C" fn rs_register_ikev2_parser() { get_tx_iterator : None, get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data : Some(rs_ikev2_get_tx_data), + get_tx_data : rs_ikev2_get_tx_data, apply_tx_config : None, }; diff --git a/rust/src/krb/krb5.rs b/rust/src/krb/krb5.rs index 4240176039..499029189f 100644 --- a/rust/src/krb/krb5.rs +++ b/rust/src/krb/krb5.rs @@ -658,7 +658,7 @@ pub unsafe extern "C" fn rs_register_krb5_parser() { get_tx_iterator : None, get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data : Some(rs_krb5_get_tx_data), + get_tx_data : rs_krb5_get_tx_data, apply_tx_config : None, }; // register UDP parser diff --git a/rust/src/ntp/ntp.rs b/rust/src/ntp/ntp.rs index 64a9035f54..405efab0ef 100644 --- a/rust/src/ntp/ntp.rs +++ b/rust/src/ntp/ntp.rs @@ -408,7 +408,7 @@ pub unsafe extern "C" fn rs_register_ntp_parser() { get_tx_iterator : None, get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data : Some(rs_ntp_get_tx_data), + get_tx_data : rs_ntp_get_tx_data, apply_tx_config : None, }; diff --git a/rust/src/rdp/rdp.rs b/rust/src/rdp/rdp.rs index cfa813910f..147aa6a3e2 100644 --- a/rust/src/rdp/rdp.rs +++ b/rust/src/rdp/rdp.rs @@ -534,7 +534,7 @@ pub unsafe extern "C" fn rs_rdp_register_parser() { get_tx_iterator: None, get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data: Some(rs_rdp_get_tx_data), + get_tx_data: rs_rdp_get_tx_data, apply_tx_config: None, }; diff --git a/rust/src/rfb/rfb.rs b/rust/src/rfb/rfb.rs index fad695be44..bc3424c9f2 100644 --- a/rust/src/rfb/rfb.rs +++ b/rust/src/rfb/rfb.rs @@ -700,7 +700,7 @@ pub unsafe extern "C" fn rs_rfb_register_parser() { get_tx_iterator: Some(rs_rfb_state_get_tx_iterator), get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data: Some(rs_rfb_get_tx_data), + get_tx_data: rs_rfb_get_tx_data, apply_tx_config: None, }; diff --git a/rust/src/sip/sip.rs b/rust/src/sip/sip.rs index c1f1b8fa16..3c4563d674 100755 --- a/rust/src/sip/sip.rs +++ b/rust/src/sip/sip.rs @@ -393,7 +393,7 @@ pub unsafe extern "C" fn rs_sip_register_parser() { get_tx_iterator: None, get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data: Some(rs_sip_get_tx_data), + get_tx_data: rs_sip_get_tx_data, apply_tx_config: None, }; diff --git a/rust/src/snmp/snmp.rs b/rust/src/snmp/snmp.rs index 3c976d5def..55a7f2c73c 100644 --- a/rust/src/snmp/snmp.rs +++ b/rust/src/snmp/snmp.rs @@ -586,7 +586,7 @@ pub unsafe extern "C" fn rs_register_snmp_parser() { get_tx_iterator : None, get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data : Some(rs_snmp_get_tx_data), + get_tx_data : rs_snmp_get_tx_data, apply_tx_config : None, }; let ip_proto_str = CString::new("udp").unwrap(); diff --git a/rust/src/ssh/ssh.rs b/rust/src/ssh/ssh.rs index 1b5d5cea69..55b71b317e 100644 --- a/rust/src/ssh/ssh.rs +++ b/rust/src/ssh/ssh.rs @@ -560,7 +560,7 @@ pub unsafe extern "C" fn rs_ssh_register_parser() { get_tx_iterator: None, get_tx_detect_flags: None, set_tx_detect_flags: None, - get_tx_data: Some(rs_ssh_get_tx_data), + get_tx_data: rs_ssh_get_tx_data, apply_tx_config: None, };