]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ldap: rename DetectLdapRespData struct to be more specific
authorAlice Akaki <akakialice@gmail.com>
Mon, 10 Feb 2025 15:56:23 +0000 (11:56 -0400)
committerVictor Julien <victor@inliniac.net>
Wed, 5 Mar 2025 14:59:53 +0000 (15:59 +0100)
rust/src/ldap/detect.rs

index 1e80c970fe2892924602d6f7303451aa5bd4cdf1..fad15816b93073f0bba9e93c94f248a2ff5dbfba 100644 (file)
@@ -40,8 +40,8 @@ enum LdapIndex {
 }
 
 #[derive(Debug, PartialEq)]
-struct DetectLdapRespData {
-    /// Ldap response code
+struct DetectLdapRespOpData {
+    /// Ldap response operation code
     pub du8: DetectUintData<u8>,
     /// Index can be Any to match with any responses index,
     /// All to match if all indices, or an i32 integer
@@ -115,7 +115,7 @@ unsafe extern "C" fn ldap_detect_request_free(_de: *mut c_void, ctx: *mut c_void
     rs_detect_u8_free(ctx);
 }
 
-fn aux_ldap_parse_protocol_resp_op(s: &str) -> Option<DetectLdapRespData> {
+fn aux_ldap_parse_protocol_resp_op(s: &str) -> Option<DetectLdapRespOpData> {
     let parts: Vec<&str> = s.split(',').collect();
     if parts.len() > 2 {
         return None;
@@ -134,7 +134,7 @@ fn aux_ldap_parse_protocol_resp_op(s: &str) -> Option<DetectLdapRespData> {
     };
     if let Some(ctx) = detect_parse_uint_enum::<u8, ProtocolOpCode>(parts[0]) {
         let du8 = ctx;
-        return Some(DetectLdapRespData { du8, index });
+        return Some(DetectLdapRespOpData { du8, index });
     }
     return None;
 }
@@ -182,7 +182,7 @@ unsafe extern "C" fn ldap_detect_responses_operation_match(
     _sig: *const c_void, ctx: *const c_void,
 ) -> c_int {
     let tx = cast_pointer!(tx, LdapTransaction);
-    let ctx = cast_pointer!(ctx, DetectLdapRespData);
+    let ctx = cast_pointer!(ctx, DetectLdapRespOpData);
 
     match ctx.index {
         LdapIndex::Any => {
@@ -222,7 +222,7 @@ unsafe extern "C" fn ldap_detect_responses_operation_match(
 
 unsafe extern "C" fn ldap_detect_responses_free(_de: *mut c_void, ctx: *mut c_void) {
     // Just unbox...
-    let ctx = cast_pointer!(ctx, DetectLdapRespData);
+    let ctx = cast_pointer!(ctx, DetectLdapRespOpData);
     std::mem::drop(Box::from_raw(ctx));
 }