rust/ffi: move Flags for AppLayerParserState to ffi crate

Ticket: 7666
pull/15287/head
Philippe Antoine 5 months ago committed by Victor Julien
parent fb20c69d8d
commit 07f37676b6

@ -28,10 +28,10 @@ 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,
};
use suricata_ffi::applayer::{
AppLayerResultRust, StreamSliceRust, APP_LAYER_PARSER_OPT_ACCEPT_GAPS,
AppLayerResultRust, StreamSliceRust, APP_LAYER_PARSER_EOF_TC, APP_LAYER_PARSER_EOF_TS,
APP_LAYER_PARSER_OPT_ACCEPT_GAPS,
};
use suricata_ffi::conf::conf_get;
use suricata_ffi::{

@ -43,6 +43,18 @@ macro_rules! export_state_data_get {
};
}
/* Flags for AppLayerParserState. */
// flag available BIT_U16(0)
pub const APP_LAYER_PARSER_NO_INSPECTION: u16 = 1 << 1;
pub const APP_LAYER_PARSER_NO_REASSEMBLY: u16 = 1 << 2;
pub const APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD: u16 = 1 << 3;
pub const APP_LAYER_PARSER_BYPASS_READY: u16 = 1 << 4;
pub const APP_LAYER_PARSER_EOF_TS: u16 = 1 << 5;
pub const APP_LAYER_PARSER_EOF_TC: u16 = 1 << 6;
/* 2x vacancy */
pub const APP_LAYER_PARSER_SFRAME_TS: u16 = 1 << 9;
pub const APP_LAYER_PARSER_SFRAME_TC: u16 = 1 << 10;
/* Flags for AppLayerParserProtoCtx. */
pub const APP_LAYER_PARSER_OPT_ACCEPT_GAPS: u32 = 1 << 0;

@ -317,16 +317,11 @@ pub fn applayer_register_protocol_detection(parser: &RustParser, enable_default:
unsafe {SCAppLayerRegisterProtocolDetection(&det, enable_default) }
}
// Defined in app-layer-parser.h
pub const APP_LAYER_PARSER_NO_INSPECTION : u16 = BIT_U16!(1);
pub const APP_LAYER_PARSER_NO_REASSEMBLY : u16 = BIT_U16!(2);
pub const APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD : u16 = BIT_U16!(3);
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 use suricata_ffi::applayer::APP_LAYER_PARSER_OPT_ACCEPT_GAPS;
pub use suricata_ffi::applayer::{
APP_LAYER_PARSER_BYPASS_READY, APP_LAYER_PARSER_EOF_TC, APP_LAYER_PARSER_EOF_TS,
APP_LAYER_PARSER_NO_INSPECTION, APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD,
APP_LAYER_PARSER_NO_REASSEMBLY, 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);

@ -39,18 +39,6 @@ typedef enum LoggerId LoggerId;
// Forward declarations from util-file.h
typedef struct AppLayerGetFileState AppLayerGetFileState;
/* Flags for AppLayerParserState. */
// flag available BIT_U16(0)
#define APP_LAYER_PARSER_NO_INSPECTION BIT_U16(1)
#define APP_LAYER_PARSER_NO_REASSEMBLY BIT_U16(2)
#define APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD BIT_U16(3)
#define APP_LAYER_PARSER_BYPASS_READY BIT_U16(4)
#define APP_LAYER_PARSER_EOF_TS BIT_U16(5)
#define APP_LAYER_PARSER_EOF_TC BIT_U16(6)
/* 2x vacancy */
#define APP_LAYER_PARSER_SFRAME_TS BIT_U16(9)
#define APP_LAYER_PARSER_SFRAME_TC BIT_U16(10)
#define APP_LAYER_PARSER_INT_STREAM_DEPTH_SET BIT_U32(0)
/* for use with the detect_progress_ts|detect_progress_tc fields */

Loading…
Cancel
Save