]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
applayer/ftp: Move MPM declaration
authorJeff Lucovsky <jlucovsky@oisf.net>
Thu, 27 Feb 2025 16:48:16 +0000 (11:48 -0500)
committerJeff Lucovsky <jlucovsky@oisf.net>
Thu, 27 Feb 2025 16:48:16 +0000 (11:48 -0500)
This commit moves the MPM fn declaration into core.rs making it
available for other Rust modules.

Issue: 4082

rust/src/core.rs
rust/src/ftp/ftp.rs

index bef967b0e10ad58697174bc0b96cc26ad76a83ef..3366f37838200b89aa0e983ebada635b6bb95ca2 100644 (file)
@@ -18,6 +18,7 @@
 //! This module exposes items from the core "C" code to Rust.
 
 use std;
+use std::os::raw::{c_int, c_void};
 use suricata_sys::sys::{AppProto, AppProtoEnum};
 
 use crate::filecontainer::*;
@@ -72,6 +73,15 @@ extern {
     pub fn StringToAppProto(proto_name: *const u8) -> AppProto;
 }
 
+/// cbindgen:ignore
+extern "C" {
+    pub fn MpmAddPatternCI(
+        ctx: *const c_void, pat: *const libc::c_char, pat_len: c_int, _offset: c_int,
+        _depth: c_int, id: c_int, rule_id: c_int, _flags: c_int,
+    ) -> c_void;
+}
+
+
 //
 // Function types for calls into C.
 //
index 3963a2adfa770a5ef1c409607db1e84c3d9cf4e6..f294c54a574abd131a18ffd1e144c3c41e6f709b 100644 (file)
@@ -19,6 +19,7 @@ use std;
 use std::ffi::CString;
 use std::os::raw::{c_char, c_int, c_void};
 
+use crate::core::*;
 use crate::conf::{conf_get, get_memval};
 use crate::ftp::constant::*;
 use lazy_static::lazy_static;
@@ -97,14 +98,6 @@ lazy_static! {
     ];
 }
 
-/// cbindgen:ignore
-extern "C" {
-    pub fn MpmAddPatternCI(
-        ctx: *const c_void, pat: *const libc::c_char, pat_len: c_int, _offset: c_int,
-        _depth: c_int, id: c_int, rule_id: c_int, _flags: c_int,
-    ) -> c_void;
-}
-
 #[allow(non_snake_case)]
 #[no_mangle]
 pub unsafe extern "C" fn SCGetFtpCommandInfo(