rust/ffi: move APP_LAYER_PARSER_OPT_X const to ffi crate

Ticket: 7666
This commit is contained in:
Philippe Antoine 2026-04-26 19:56:11 +02:00 committed by Victor Julien
parent f1c66ff6f0
commit fb20c69d8d
4 changed files with 8 additions and 6 deletions

View file

@ -28,9 +28,11 @@ use std::ffi::CString;
use std::os::raw::{c_char, c_int, c_void};
use suricata::applayer::{
state_get_tx_iterator, AppLayerEvent, AppLayerTxData, State, Transaction,
APP_LAYER_PARSER_EOF_TC, APP_LAYER_PARSER_EOF_TS, APP_LAYER_PARSER_OPT_ACCEPT_GAPS,
APP_LAYER_PARSER_EOF_TC, APP_LAYER_PARSER_EOF_TS,
};
use suricata_ffi::applayer::{
AppLayerResultRust, StreamSliceRust, APP_LAYER_PARSER_OPT_ACCEPT_GAPS,
};
use suricata_ffi::applayer::{AppLayerResultRust, StreamSliceRust};
use suricata_ffi::conf::conf_get;
use suricata_ffi::{
build_slice, cast_pointer, export_state_data_get, export_tx_data_get, SCLogError, SCLogNotice,

View file

@ -43,6 +43,9 @@ macro_rules! export_state_data_get {
};
}
/* Flags for AppLayerParserProtoCtx. */
pub const APP_LAYER_PARSER_OPT_ACCEPT_GAPS: u32 = 1 << 0;
pub trait AppLayerResultRust {
fn ok() -> Self;
fn err() -> Self;

View file

@ -326,7 +326,7 @@ pub const APP_LAYER_PARSER_BYPASS_READY : u16 = BIT_U16!(4);
pub const APP_LAYER_PARSER_EOF_TS : u16 = BIT_U16!(5);
pub const APP_LAYER_PARSER_EOF_TC : u16 = BIT_U16!(6);
pub const APP_LAYER_PARSER_OPT_ACCEPT_GAPS: u32 = BIT_U32!(0);
pub use suricata_ffi::applayer::APP_LAYER_PARSER_OPT_ACCEPT_GAPS;
pub const APP_LAYER_TX_SKIP_INSPECT_TS: u8 = BIT_U8!(0);
pub const APP_LAYER_TX_SKIP_INSPECT_TC: u8 = BIT_U8!(1);

View file

@ -51,9 +51,6 @@ typedef struct AppLayerGetFileState AppLayerGetFileState;
#define APP_LAYER_PARSER_SFRAME_TS BIT_U16(9)
#define APP_LAYER_PARSER_SFRAME_TC BIT_U16(10)
/* Flags for AppLayerParserProtoCtx. */
#define APP_LAYER_PARSER_OPT_ACCEPT_GAPS BIT_U32(0)
#define APP_LAYER_PARSER_INT_STREAM_DEPTH_SET BIT_U32(0)
/* for use with the detect_progress_ts|detect_progress_tc fields */