]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: bindgen SCDetectHelperKeywordAliasRegister
authorPhilippe Antoine <pantoine@oisf.net>
Mon, 12 May 2025 18:44:21 +0000 (20:44 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 13 May 2025 18:24:05 +0000 (20:24 +0200)
Ticket: 7667

rust/src/detect/mod.rs
rust/src/dns/detect.rs
rust/sys/src/sys.rs
src/detect-engine-helper.c
src/detect-engine-helper.h

index 6999ff4f1cf719cca7d6004adef7de7e3926dc3d..a0df2995b069b107e7d932dc8b18104fa14ca780 100644 (file)
@@ -35,7 +35,7 @@ pub mod tojson;
 pub mod vlan;
 pub mod datasets;
 
-use std::os::raw::{c_char, c_int, c_void};
+use std::os::raw::{c_int, c_void};
 use std::ffi::CString;
 
 use suricata_sys::sys::{AppProto, DetectEngineCtx, Signature};
@@ -169,7 +169,6 @@ extern "C" {
         ) -> *mut c_void,
     ) -> c_int;
     pub fn DetectHelperKeywordRegister(kw: *const SCSigTableAppLiteElmt) -> c_int;
-    pub fn DetectHelperKeywordAliasRegister(kwid: c_int, alias: *const c_char);
     pub fn DetectSignatureSetAppProto(s: *mut Signature, alproto: AppProto) -> c_int;
     pub fn SigMatchAppendSMToList(
         de: *mut DetectEngineCtx, s: *mut Signature, kwid: c_int, ctx: *const c_void, bufid: c_int,
index 9e891e3dc88d7e24da1d5d3a1f3f3069a118beb4..c8d8664e68d6553a28681953425d78df34f8ae90 100644 (file)
@@ -22,16 +22,16 @@ use crate::detect::uint::{
     SCDetectU8Parse,
 };
 use crate::detect::{
-    helper_keyword_register_sticky_buffer, DetectHelperKeywordAliasRegister,
-    DetectHelperKeywordRegister, DetectSignatureSetAppProto, SCSigTableAppLiteElmt,
-    SigMatchAppendSMToList, SigTableElmtStickyBuffer,
+    helper_keyword_register_sticky_buffer, DetectHelperKeywordRegister, DetectSignatureSetAppProto,
+    SCSigTableAppLiteElmt, SigMatchAppendSMToList, SigTableElmtStickyBuffer,
 };
 use crate::direction::Direction;
 use std::ffi::CStr;
 use std::os::raw::{c_int, c_void};
 use suricata_sys::sys::{
     DetectEngineCtx, DetectEngineThreadCtx, SCDetectBufferSetActiveList,
-    SCDetectHelperBufferRegister, SCDetectHelperMultiBufferProgressMpmRegister, Signature,
+    SCDetectHelperBufferRegister, SCDetectHelperKeywordAliasRegister,
+    SCDetectHelperMultiBufferProgressMpmRegister, Signature,
 };
 
 /// Perform the DNS opcode match.
@@ -411,7 +411,7 @@ pub unsafe extern "C" fn SCDetectDNSRegister() {
         setup: dns_detect_query_setup,
     };
     let g_dns_query_name_kw_id = helper_keyword_register_sticky_buffer(&kw);
-    DetectHelperKeywordAliasRegister(
+    SCDetectHelperKeywordAliasRegister(
         g_dns_query_name_kw_id,
         b"dns_query\0".as_ptr() as *const libc::c_char,
     );
index 9acbb6b131e9e94636505440ae25f71db201e19d..7dc5c9468eb94de0568066f5f972e9c2c9138c8c 100644 (file)
@@ -326,6 +326,11 @@ pub struct SCTransformTableElmt {
 extern "C" {
     pub fn SCDetectHelperNewKeywordId() -> ::std::os::raw::c_int;
 }
+extern "C" {
+    pub fn SCDetectHelperKeywordAliasRegister(
+        kwid: ::std::os::raw::c_int, alias: *const ::std::os::raw::c_char,
+    );
+}
 extern "C" {
     pub fn SCDetectHelperBufferRegister(
         name: *const ::std::os::raw::c_char, alproto: AppProto, direction: u8,
index 2c0d6d14a638ec74fd62050da97f401d15483b9d..ea6610c90aa6d5b21c4c02496243155d44992151 100644 (file)
@@ -139,7 +139,7 @@ int DetectHelperKeywordRegister(const SCSigTableAppLiteElmt *kw)
     return keyword_id;
 }
 
-void DetectHelperKeywordAliasRegister(int kwid, const char *alias)
+void SCDetectHelperKeywordAliasRegister(int kwid, const char *alias)
 {
     sigmatch_table[kwid].alias = alias;
 }
index 706fa28259efa22c5fa60c623e0e83b2f8b907a9..125adfa657261650d298ef21f788ea33f7d9ad23 100644 (file)
@@ -76,7 +76,7 @@ typedef struct SCTransformTableElmt {
 int SCDetectHelperNewKeywordId(void);
 
 int DetectHelperKeywordRegister(const SCSigTableAppLiteElmt *kw);
-void DetectHelperKeywordAliasRegister(int kwid, const char *alias);
+void SCDetectHelperKeywordAliasRegister(int kwid, const char *alias);
 int SCDetectHelperBufferRegister(const char *name, AppProto alproto, uint8_t direction);
 
 typedef bool (*SimpleGetTxBuffer)(void *, uint8_t, const uint8_t **, uint32_t *);