]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix clippy missing_abi warning
authorPhilippe Antoine <pantoine@oisf.net>
Mon, 31 Mar 2025 19:12:22 +0000 (21:12 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 4 Apr 2025 00:35:16 +0000 (02:35 +0200)
warning: extern declarations without an explicit ABI are deprecated
  --> src/core.rs:72:1
   |
72 | extern {
   | ^^^^^^ help: explicitly specify the "C" ABI: `extern "C"`
   |
   = note: `#[warn(missing_abi)]` on by default

rust/src/applayer.rs
rust/src/core.rs
rust/src/detect/mod.rs
rust/src/filecontainer.rs
rust/src/frames.rs
rust/src/lua.rs

index 943d35c16ac17a4aee42118049ea136e77519bbb..2663d9a515b232f40fd3db8442995003d705e680 100644 (file)
@@ -494,7 +494,7 @@ pub type GetFrameNameById = unsafe extern "C" fn(u8) -> *const c_char;
 
 // Defined in app-layer-register.h
 /// cbindgen:ignore
-extern {
+extern "C" {
     pub fn AppLayerRegisterProtocolDetection(parser: *const RustParser, enable_default: c_int) -> AppProto;
     pub fn AppLayerRegisterParserAlias(parser_name: *const c_char, alias_name: *const c_char);
     pub fn AppLayerRegisterParser(parser: *const RustParser, alproto: AppProto) -> c_int;
@@ -503,7 +503,7 @@ extern {
 
 // Defined in app-layer-detect-proto.h
 /// cbindgen:ignore
-extern {
+extern "C" {
     pub fn AppLayerForceProtocolChange(f: *const Flow, new_proto: AppProto);
     pub fn AppLayerProtoDetectPPRegister(ipproto: u8, portstr: *const c_char, alproto: AppProto,
                                          min_depth: u16, max_depth: u16, dir: u8,
@@ -543,7 +543,7 @@ pub const _APP_LAYER_TX_INSPECTED_TS: u8 = BIT_U8!(2);
 pub const _APP_LAYER_TX_INSPECTED_TC: u8 = BIT_U8!(3);
 
 /// cbindgen:ignore
-extern {
+extern "C" {
     pub fn AppLayerParserStateSetFlag(state: *mut c_void, flag: u16);
     pub fn AppLayerParserStateIssetFlag(state: *mut c_void, flag: u16) -> u16;
     pub fn AppLayerParserSetStreamDepth(ipproto: u8, alproto: AppProto, stream_depth: u32);
index 07fe219c50769d16f6f2dbf2b5caf9bb446f3b13..59be1e52fb6f5822809feddddf1080dcdf806f83 100644 (file)
@@ -69,7 +69,7 @@ macro_rules!BIT_U64 {
 
 // Defined in app-layer-protos.h
 /// cbindgen:ignore
-extern {
+extern "C" {
     pub fn StringToAppProto(proto_name: *const u8) -> AppProto;
 }
 
@@ -181,7 +181,7 @@ pub struct SuricataFileContext {
 }
 
 /// cbindgen:ignore
-extern {
+extern "C" {
     pub fn SCGetContext() -> &'static mut SuricataContext;
 }
 
index b970c2062963666521d45d13ee8ac09dbbcdd355..19a5e34818a679611238f45b4bbf8a449d22e5e1 100644 (file)
@@ -86,7 +86,7 @@ pub(crate) const SIGMATCH_QUOTES_MANDATORY: u16 = 0x40; // BIT_U16(6) in detect.
 pub const SIGMATCH_INFO_STICKY_BUFFER: u16 = 0x200; // BIT_U16(9)
 
 /// cbindgen:ignore
-extern {
+extern "C" {
     pub fn DetectBufferSetActiveList(de: *mut c_void, s: *mut c_void, bufid: c_int) -> c_int;
     pub fn DetectHelperGetData(
         de: *mut c_void, transforms: *const c_void, flow: *const c_void, flow_flags: u8,
index 28d10cf05cf200aab2ea1f2c435951dddffb7e1a..2db0b40cc6bb787967a03e6df8e0c552c1ae6b76 100644 (file)
@@ -24,7 +24,7 @@ use crate::core::*;
 
 // Defined in util-file.h
 /// cbindgen:ignore
-extern {
+extern "C" {
     pub fn FileFlowFlagsToFlags(flow_file_flags: u16, flags: u8) -> u16;
 }
 
index b1dba3ea40af582b3238f08838278dcf83d74d6f..2e8ffb5354f6da7ffeceda8c9196eeb1b730a153 100644 (file)
@@ -31,7 +31,7 @@ struct CFrame {
 
 // Defined in app-layer-register.h
 /// cbindgen:ignore
-extern {
+extern "C" {
     #[cfg(not(test))]
     fn AppLayerFrameNewByRelativeOffset(
         flow: *const Flow, stream_slice: *const StreamSlice, frame_start_rel: u32, len: i64,
index e68ba18be564f36451bce5013b16991ae484e4a3..43855574de99222dc6569d5611331cb6ee15a230 100644 (file)
@@ -25,7 +25,7 @@ use std::os::raw::c_long;
 pub enum CLuaState {}
 
 /// cbindgen:ignore
-extern {
+extern "C" {
     fn lua_createtable(lua: *mut CLuaState, narr: c_int, nrec: c_int);
     fn lua_settable(lua: *mut CLuaState, idx: c_long);
     fn lua_pushlstring(lua: *mut CLuaState, s: *const c_char, len: usize);