rust: bindgen SIGMATCH_ constants

pull/15147/head
Philippe Antoine 4 months ago committed by Victor Julien
parent 4ec5f22951
commit 4f4912c042

@ -156,6 +156,7 @@ if HAVE_BINDGEN
--no-copy 'AppLayerTxData' \
--allowlist-function 'SC.*' \
--allowlist-var 'SC.*' \
--allowlist-var 'SIGMATCH.*' \
--opaque-type 'SCConfNode' \
--allowlist-type 'ThreadVars.?' \
--opaque-type 'ThreadVars.?' \

@ -130,19 +130,12 @@ pub unsafe extern "C" fn SCDetectSigMatchNamesFree(kw: &mut SCSigTableNamesElmt)
let _ = CString::from_raw(kw.url);
}
// TODO bindgen these
pub const SIGMATCH_NOOPT: u32 = 1; // BIT_U16(0) in detect.h
pub(crate) const SIGMATCH_OPTIONAL_OPT: u32 = 0x10; // BIT_U16(4) in detect.h
pub(crate) const SIGMATCH_QUOTES_MANDATORY: u32 = 0x40; // BIT_U16(6) in detect.h
pub const SIGMATCH_INFO_STICKY_BUFFER: u32 = 0x200; // BIT_U16(9)
pub const SIGMATCH_INFO_MULTI_BUFFER: u32 = 0x4000; // BIT_U16(14)
pub const SIGMATCH_INFO_UINT8: u32 = 0x8000; // BIT_U32(15)
pub const SIGMATCH_INFO_UINT16: u32 = 0x10000; // BIT_U32(16)
pub const SIGMATCH_INFO_UINT32: u32 = 0x20000; // BIT_U32(17)
pub const SIGMATCH_INFO_UINT64: u32 = 0x40000; // BIT_U32(18)
pub const SIGMATCH_INFO_MULTI_UINT: u32 = 0x80000; // BIT_U32(19)
pub const SIGMATCH_INFO_ENUM_UINT: u32 = 0x100000; // BIT_U32(20)
pub const SIGMATCH_INFO_BITFLAGS_UINT: u32 = 0x200000; // BIT_U32(21)
pub use suricata_sys::sys::{
SIGMATCH_INFO_BITFLAGS_UINT, SIGMATCH_INFO_ENUM_UINT, SIGMATCH_INFO_MULTI_BUFFER,
SIGMATCH_INFO_MULTI_UINT, SIGMATCH_INFO_STICKY_BUFFER, SIGMATCH_INFO_UINT16,
SIGMATCH_INFO_UINT32, SIGMATCH_INFO_UINT64, SIGMATCH_INFO_UINT8, SIGMATCH_NOOPT,
SIGMATCH_OPTIONAL_OPT, SIGMATCH_QUOTES_MANDATORY,
};
#[repr(u8)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]

@ -1,6 +1,27 @@
// This file is automatically generated. Do not edit.
pub const SC_PACKAGE_VERSION: &[u8; 10] = b"9.0.0-dev\0";
pub const SIGMATCH_NOOPT: u32 = 1;
pub const SIGMATCH_IPONLY_COMPAT: u32 = 2;
pub const SIGMATCH_DEONLY_COMPAT: u32 = 4;
pub const SIGMATCH_OPTIONAL_OPT: u32 = 8;
pub const SIGMATCH_QUOTES_OPTIONAL: u32 = 16;
pub const SIGMATCH_QUOTES_MANDATORY: u32 = 32;
pub const SIGMATCH_HANDLE_NEGATION: u32 = 64;
pub const SIGMATCH_INFO_CONTENT_MODIFIER: u32 = 128;
pub const SIGMATCH_INFO_STICKY_BUFFER: u32 = 256;
pub const SIGMATCH_INFO_DEPRECATED: u32 = 512;
pub const SIGMATCH_STRICT_PARSING: u32 = 1024;
pub const SIGMATCH_SUPPORT_FIREWALL: u32 = 2048;
pub const SIGMATCH_SUPPORT_DIR: u32 = 4096;
pub const SIGMATCH_INFO_MULTI_BUFFER: u32 = 8192;
pub const SIGMATCH_INFO_UINT8: u32 = 16384;
pub const SIGMATCH_INFO_UINT16: u32 = 32768;
pub const SIGMATCH_INFO_UINT32: u32 = 65536;
pub const SIGMATCH_INFO_UINT64: u32 = 131072;
pub const SIGMATCH_INFO_MULTI_UINT: u32 = 262144;
pub const SIGMATCH_INFO_ENUM_UINT: u32 = 524288;
pub const SIGMATCH_INFO_BITFLAGS_UINT: u32 = 1048576;
pub type __intmax_t = ::std::os::raw::c_long;
pub type intmax_t = __intmax_t;
#[repr(u32)]

@ -305,6 +305,57 @@ extern int DETECT_TBLSIZE;
extern int DETECT_TBLSIZE_IDX;
// step for reallocating sigmatch_table
#define DETECT_TBLSIZE_STEP 256
// no macro for bindgen
/** sigmatch has no options, so the parser shouldn't expect any */
#define SIGMATCH_NOOPT (1UL << (0))
/** sigmatch is compatible with a ip only rule */
#define SIGMATCH_IPONLY_COMPAT (1UL << (1))
/** sigmatch is compatible with a decode event only rule */
#define SIGMATCH_DEONLY_COMPAT (1UL << (2))
/** sigmatch may have options, so the parser should be ready to
* deal with both cases */
#define SIGMATCH_OPTIONAL_OPT (1UL << (3))
/** input may be wrapped in double quotes. They will be stripped before
* input data is passed to keyword parser */
#define SIGMATCH_QUOTES_OPTIONAL (1UL << (4))
/** input MUST be wrapped in double quotes. They will be stripped before
* input data is passed to keyword parser. Missing double quotes lead to
* error and signature invalidation. */
#define SIGMATCH_QUOTES_MANDATORY (1UL << (5))
/** negation parsing is handled by the rule parser. Signature::init_data::negated
* will be set to true or false prior to calling the keyword parser. Exclamation
* mark is stripped from the input to the keyword parser. */
#define SIGMATCH_HANDLE_NEGATION (1UL << (6))
/** keyword is a content modifier */
#define SIGMATCH_INFO_CONTENT_MODIFIER (1UL << (7))
/** keyword is a sticky buffer */
#define SIGMATCH_INFO_STICKY_BUFFER (1UL << (8))
/** keyword is deprecated: used to suggest an alternative */
#define SIGMATCH_INFO_DEPRECATED (1UL << (9))
/** strict parsing is enabled */
#define SIGMATCH_STRICT_PARSING (1UL << (10))
/** keyword supported by firewall rules */
#define SIGMATCH_SUPPORT_FIREWALL (1UL << (11))
/** keyword supporting setting an optional direction */
#define SIGMATCH_SUPPORT_DIR (1UL << (12))
/** keyword is a multi buffer */
#define SIGMATCH_INFO_MULTI_BUFFER (1UL << (13))
/** keyword is a unsigned 8-bit integer */
#define SIGMATCH_INFO_UINT8 (1UL << (14))
/** keyword is a unsigned 16-bit integer */
#define SIGMATCH_INFO_UINT16 (1UL << (15))
/** keyword is a unsigned 32-bit integer */
#define SIGMATCH_INFO_UINT32 (1UL << (16))
/** keyword is a unsigned 64-bit integer */
#define SIGMATCH_INFO_UINT64 (1UL << (17))
/** keyword is a multi uint */
#define SIGMATCH_INFO_MULTI_UINT (1UL << (18))
/** keyword is an uint with enumeration stringer */
#define SIGMATCH_INFO_ENUM_UINT (1UL << (19))
/** keyword is an uint with bitflags */
#define SIGMATCH_INFO_BITFLAGS_UINT (1UL << (20))
int SigTableList(const char *keyword);
void SigTableCleanup(void);
void SigTableInit(void);

@ -1656,58 +1656,6 @@ typedef struct SigGroupHead_ {
} SigGroupHead;
/** sigmatch has no options, so the parser shouldn't expect any */
#define SIGMATCH_NOOPT BIT_U32(0)
/** sigmatch is compatible with a ip only rule */
#define SIGMATCH_IPONLY_COMPAT BIT_U16(1)
/** sigmatch is compatible with a decode event only rule */
#define SIGMATCH_DEONLY_COMPAT BIT_U16(2)
// vacancy
/** sigmatch may have options, so the parser should be ready to
* deal with both cases */
#define SIGMATCH_OPTIONAL_OPT BIT_U32(4)
/** input may be wrapped in double quotes. They will be stripped before
* input data is passed to keyword parser */
#define SIGMATCH_QUOTES_OPTIONAL BIT_U32(5)
/** input MUST be wrapped in double quotes. They will be stripped before
* input data is passed to keyword parser. Missing double quotes lead to
* error and signature invalidation. */
#define SIGMATCH_QUOTES_MANDATORY BIT_U32(6)
/** negation parsing is handled by the rule parser. Signature::init_data::negated
* will be set to true or false prior to calling the keyword parser. Exclamation
* mark is stripped from the input to the keyword parser. */
#define SIGMATCH_HANDLE_NEGATION BIT_U32(7)
/** keyword is a content modifier */
#define SIGMATCH_INFO_CONTENT_MODIFIER BIT_U32(8)
/** keyword is a sticky buffer */
#define SIGMATCH_INFO_STICKY_BUFFER BIT_U32(9)
/** keyword is deprecated: used to suggest an alternative */
#define SIGMATCH_INFO_DEPRECATED BIT_U32(10)
/** strict parsing is enabled */
#define SIGMATCH_STRICT_PARSING BIT_U32(11)
/** keyword supported by firewall rules */
#define SIGMATCH_SUPPORT_FIREWALL BIT_U32(12)
/** keyword supporting setting an optional direction */
#define SIGMATCH_SUPPORT_DIR BIT_U32(13)
/** keyword is a multi buffer */
#define SIGMATCH_INFO_MULTI_BUFFER BIT_U32(14)
/** keyword is a unsigned 8-bit integer */
#define SIGMATCH_INFO_UINT8 BIT_U32(15)
/** keyword is a unsigned 16-bit integer */
#define SIGMATCH_INFO_UINT16 BIT_U32(16)
/** keyword is a unsigned 32-bit integer */
#define SIGMATCH_INFO_UINT32 BIT_U32(17)
/** keyword is a unsigned 64-bit integer */
#define SIGMATCH_INFO_UINT64 BIT_U32(18)
/** keyword is a multi uint */
#define SIGMATCH_INFO_MULTI_UINT BIT_U32(19)
/** keyword is an uint with enumeration stringer */
#define SIGMATCH_INFO_ENUM_UINT BIT_U32(20)
/** keyword is an uint with bitflags */
#define SIGMATCH_INFO_BITFLAGS_UINT BIT_U32(21)
enum DetectEngineTenantSelectors
{
TENANT_SELECTOR_UNKNOWN = 0, /**< not set */

Loading…
Cancel
Save