extern "C" {
pub fn AppLayerParserConfParserEnabled(ipproto: *const c_char, proto: *const c_char) -> c_int;
pub fn AppLayerParserRegisterLogger(pproto: u8, alproto: AppProto);
- pub fn AppLayerParserRegisterParserAcceptableDataDirection(ipproto: u8, alproto: AppProto, dir: u8);
}
#[repr(C)]
use std::ffi::CString;
use std::os::raw::{c_char, c_int, c_void};
use suricata_sys::sys::{
- AppLayerParserState, AppProto, SCAppLayerParserStateIssetFlag,
- SCAppLayerProtoDetectConfProtoDetectionEnabled,
+ AppLayerParserState, AppProto, SCAppLayerParserRegisterParserAcceptableDataDirection,
+ SCAppLayerParserStateIssetFlag, SCAppLayerProtoDetectConfProtoDetectionEnabled,
};
pub(super) static mut ALPROTO_ENIP: AppProto = ALPROTO_UNKNOWN;
let _ = AppLayerRegisterParser(&parser, alproto);
}
SCLogDebug!("Rust enip parser registered for UDP.");
- AppLayerParserRegisterParserAcceptableDataDirection(
+ SCAppLayerParserRegisterParserAcceptableDataDirection(
IPPROTO_UDP,
ALPROTO_ENIP,
STREAM_TOSERVER | STREAM_TOCLIENT,
let _ = AppLayerRegisterParser(&parser, alproto);
}
SCLogDebug!("Rust enip parser registered for TCP.");
- AppLayerParserRegisterParserAcceptableDataDirection(
+ SCAppLayerParserRegisterParserAcceptableDataDirection(
IPPROTO_TCP,
ALPROTO_ENIP,
STREAM_TOSERVER | STREAM_TOCLIENT,
_unused: [u8; 0],
}
pub type AppLayerParserState = AppLayerParserState_;
+extern "C" {
+ pub fn SCAppLayerParserRegisterParserAcceptableDataDirection(
+ ipproto: u8, alproto: AppProto, direction: u8,
+ );
+}
extern "C" {
pub fn SCAppLayerParserSetStreamDepth(ipproto: u8, alproto: AppProto, stream_depth: u32);
}
AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_FTP, STREAM_TOCLIENT,
FTPParseResponse);
AppLayerParserRegisterStateFuncs(IPPROTO_TCP, ALPROTO_FTP, FTPStateAlloc, FTPStateFree);
- AppLayerParserRegisterParserAcceptableDataDirection(IPPROTO_TCP, ALPROTO_FTP, STREAM_TOSERVER | STREAM_TOCLIENT);
+ SCAppLayerParserRegisterParserAcceptableDataDirection(
+ IPPROTO_TCP, ALPROTO_FTP, STREAM_TOSERVER | STREAM_TOCLIENT);
AppLayerParserRegisterTxFreeFunc(IPPROTO_TCP, ALPROTO_FTP, FTPStateTransactionFree);
AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_FTPDATA, STREAM_TOCLIENT,
FTPDataParseResponse);
AppLayerParserRegisterStateFuncs(IPPROTO_TCP, ALPROTO_FTPDATA, FTPDataStateAlloc, FTPDataStateFree);
- AppLayerParserRegisterParserAcceptableDataDirection(IPPROTO_TCP, ALPROTO_FTPDATA, STREAM_TOSERVER | STREAM_TOCLIENT);
+ SCAppLayerParserRegisterParserAcceptableDataDirection(
+ IPPROTO_TCP, ALPROTO_FTPDATA, STREAM_TOSERVER | STREAM_TOCLIENT);
AppLayerParserRegisterTxFreeFunc(IPPROTO_TCP, ALPROTO_FTPDATA, FTPDataStateTransactionFree);
AppLayerParserRegisterGetTxFilesFunc(IPPROTO_TCP, ALPROTO_FTPDATA, FTPDataStateGetTxFiles);
/* This parser accepts gaps. */
AppLayerParserRegisterOptionFlags(
IPPROTO_TCP, ALPROTO_HTTP1, APP_LAYER_PARSER_OPT_ACCEPT_GAPS);
- AppLayerParserRegisterParserAcceptableDataDirection(
+ SCAppLayerParserRegisterParserAcceptableDataDirection(
IPPROTO_TCP, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_TOCLIENT);
/* app-layer-frame-documentation tag start: registering relevant callbacks */
AppLayerParserRegisterGetFrameFuncs(
SCReturnInt(0);
}
-void AppLayerParserRegisterParserAcceptableDataDirection(uint8_t ipproto, AppProto alproto,
- uint8_t direction)
+void SCAppLayerParserRegisterParserAcceptableDataDirection(
+ uint8_t ipproto, AppProto alproto, uint8_t direction)
{
SCEnter();
int AppLayerParserRegisterParser(uint8_t ipproto, AppProto alproto,
uint8_t direction,
AppLayerParserFPtr Parser);
-void AppLayerParserRegisterParserAcceptableDataDirection(uint8_t ipproto,
- AppProto alproto,
- uint8_t direction);
+void SCAppLayerParserRegisterParserAcceptableDataDirection(
+ uint8_t ipproto, AppProto alproto, uint8_t direction);
void AppLayerParserRegisterOptionFlags(uint8_t ipproto, AppProto alproto,
uint32_t flags);
void AppLayerParserRegisterStateFuncs(uint8_t ipproto, AppProto alproto,
AppLayerParserRegisterStateFuncs(IPPROTO_TCP, ALPROTO_TLS, SSLStateAlloc, SSLStateFree);
- AppLayerParserRegisterParserAcceptableDataDirection(IPPROTO_TCP, ALPROTO_TLS, STREAM_TOSERVER);
+ SCAppLayerParserRegisterParserAcceptableDataDirection(
+ IPPROTO_TCP, ALPROTO_TLS, STREAM_TOSERVER);
AppLayerParserRegisterTxFreeFunc(IPPROTO_TCP, ALPROTO_TLS, SSLStateTransactionFree);