rust: fix clippy warnings for unspecified extern ABI

Fix done by clippy --fix.

Ticket: #7652
pull/12999/head
Jason Ish 6 months ago
parent f19e28f121
commit 1504dcea4a

@ -475,7 +475,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);
}
@ -487,7 +487,7 @@ pub unsafe fn AppLayerRegisterParser(parser: *const RustParser, alproto: AppProt
// Defined in app-layer-detect-proto.h
/// cbindgen:ignore
extern {
extern "C" {
pub fn AppLayerProtoDetectPPRegister(ipproto: u8, portstr: *const c_char, alproto: AppProto,
min_depth: u16, max_depth: u16, dir: u8,
pparser1: ProbeFn, pparser2: ProbeFn);
@ -522,7 +522,7 @@ pub const APP_LAYER_PARSER_OPT_ACCEPT_GAPS: u32 = BIT_U32!(0);
pub const APP_LAYER_TX_SKIP_INSPECT_FLAG: u64 = BIT_U64!(62);
/// 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);

@ -32,7 +32,7 @@ use nom7::{
};
/// cbindgen:ignore
extern {
extern "C" {
fn ConfGet(key: *const c_char, res: *mut *const c_char) -> i8;
fn ConfGetChildValue(conf: *const c_void, key: *const c_char,
vptr: *mut *const c_char) -> i8;
@ -141,7 +141,6 @@ impl ConfNode {
}
return false;
}
}
const BYTE: u64 = 1;

@ -129,7 +129,7 @@ pub const FLOW_DIR_REVERSED: u32 = BIT_U32!(26);
// Defined in app-layer-protos.h
/// cbindgen:ignore
extern {
extern "C" {
pub fn StringToAppProto(proto_name: *const u8) -> AppProto;
}
@ -224,7 +224,7 @@ pub struct SuricataContext {
pub FileAppendGAP: SCFileAppendGAPById,
pub FileContainerRecycle: SCFileContainerRecycle,
pub AppLayerRegisterParser: extern fn(parser: *const crate::applayer::RustParser, alproto: AppProto) -> std::os::raw::c_int,
pub AppLayerRegisterParser: extern "C" fn(parser: *const crate::applayer::RustParser, alproto: AppProto) -> std::os::raw::c_int,
}
#[allow(non_snake_case)]
@ -234,7 +234,7 @@ pub struct SuricataFileContext {
}
/// cbindgen:ignore
extern {
extern "C" {
pub fn SCGetContext() -> &'static mut SuricataContext;
pub fn SCLogGetLogLevel() -> i32;
}
@ -301,7 +301,7 @@ pub enum Flow {}
// Extern functions operating on Flow.
/// cbindgen:ignore
extern {
extern "C" {
pub fn FlowGetLastTimeAsParts(flow: &Flow, secs: *mut u64, usecs: *mut u64);
pub fn FlowGetFlags(flow: &Flow) -> u32;
pub fn FlowGetSourcePort(flow: &Flow) -> u16;

@ -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;
}

@ -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,

@ -31,7 +31,7 @@ type LuaInteger = i32;
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);

Loading…
Cancel
Save