mirror of
https://github.com/OISF/suricata.git
synced 2026-02-03 20:41:46 -05:00
rust: bindgen SCSigMatchAppendSMToList
Ticket: 7667
This commit is contained in:
parent
78034b218d
commit
a2b5225612
110 changed files with 418 additions and 312 deletions
|
|
@ -291,7 +291,7 @@ static int DetectnDPIProtocolSetup(DetectEngineCtx *de_ctx, Signature *s, const
|
|||
}
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, ndpi_protocol_keyword_id, (SigMatchCtx *)data,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, ndpi_protocol_keyword_id, (SigMatchCtx *)data,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -420,7 +420,7 @@ static int DetectnDPIRiskSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
}
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, ndpi_risk_keyword_id, (SigMatchCtx *)data,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, ndpi_risk_keyword_id, (SigMatchCtx *)data,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ type DetectEngineCtx, Signature;
|
|||
|
||||
func(DetectEngineCtx *de_ctx, Signature *s, char *str) {
|
||||
...
|
||||
SigMatchAppendSMToList(s, ...)@p1;
|
||||
SCSigMatchAppendSMToList(s, ...)@p1;
|
||||
...
|
||||
if (s->alproto != E1 && ...) {
|
||||
...
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ pub mod tojson;
|
|||
pub mod vlan;
|
||||
pub mod datasets;
|
||||
|
||||
use std::os::raw::{c_int, c_void};
|
||||
use std::os::raw::c_int;
|
||||
use std::ffi::CString;
|
||||
|
||||
use suricata_sys::sys::{
|
||||
|
|
@ -75,7 +75,7 @@ pub struct SigTableElmtStickyBuffer {
|
|||
) -> c_int,
|
||||
}
|
||||
|
||||
pub fn helper_keyword_register_sticky_buffer(kw: &SigTableElmtStickyBuffer) -> c_int {
|
||||
pub fn helper_keyword_register_sticky_buffer(kw: &SigTableElmtStickyBuffer) -> u16 {
|
||||
let name = CString::new(kw.name.as_bytes()).unwrap().into_raw();
|
||||
let desc = CString::new(kw.desc.as_bytes()).unwrap().into_raw();
|
||||
let url = CString::new(kw.url.as_bytes()).unwrap().into_raw();
|
||||
|
|
@ -118,13 +118,6 @@ pub const SIGMATCH_NOOPT: u16 = 1; // BIT_U16(0) in detect.h
|
|||
pub(crate) const SIGMATCH_QUOTES_MANDATORY: u16 = 0x40; // BIT_U16(6) in detect.h
|
||||
pub const SIGMATCH_INFO_STICKY_BUFFER: u16 = 0x200; // BIT_U16(9)
|
||||
|
||||
/// cbindgen:ignore
|
||||
extern "C" {
|
||||
// from detect-parse.h
|
||||
pub fn SigMatchAppendSMToList(
|
||||
de: *mut DetectEngineCtx, s: *mut Signature, kwid: c_int, ctx: *const c_void, bufid: c_int,
|
||||
) -> *mut c_void;
|
||||
}
|
||||
#[repr(u8)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
// endian <big|little|dce>
|
||||
|
|
|
|||
|
|
@ -22,12 +22,11 @@ use super::dhcp::{
|
|||
use super::parser::DHCPOptionWrapper;
|
||||
use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER};
|
||||
use crate::detect::uint::{DetectUintData, SCDetectU64Free, SCDetectU64Match, SCDetectU64Parse};
|
||||
use crate::detect::SigMatchAppendSMToList;
|
||||
use std::os::raw::{c_int, c_void};
|
||||
use suricata_sys::sys::{
|
||||
DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectHelperBufferRegister,
|
||||
SCDetectHelperKeywordRegister, SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt,
|
||||
SigMatchCtx, Signature,
|
||||
SCDetectHelperKeywordRegister, SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList,
|
||||
SCSigTableAppLiteElmt, SigMatchCtx, Signature,
|
||||
};
|
||||
|
||||
fn dhcp_tx_get_time(tx: &DHCPTransaction, code: u8) -> Option<u64> {
|
||||
|
|
@ -41,11 +40,11 @@ fn dhcp_tx_get_time(tx: &DHCPTransaction, code: u8) -> Option<u64> {
|
|||
return None;
|
||||
}
|
||||
|
||||
static mut G_DHCP_LEASE_TIME_KW_ID: c_int = 0;
|
||||
static mut G_DHCP_LEASE_TIME_KW_ID: u16 = 0;
|
||||
static mut G_DHCP_LEASE_TIME_BUFFER_ID: c_int = 0;
|
||||
static mut G_DHCP_REBINDING_TIME_KW_ID: c_int = 0;
|
||||
static mut G_DHCP_REBINDING_TIME_KW_ID: u16 = 0;
|
||||
static mut G_DHCP_REBINDING_TIME_BUFFER_ID: c_int = 0;
|
||||
static mut G_DHCP_RENEWAL_TIME_KW_ID: c_int = 0;
|
||||
static mut G_DHCP_RENEWAL_TIME_KW_ID: u16 = 0;
|
||||
static mut G_DHCP_RENEWAL_TIME_BUFFER_ID: c_int = 0;
|
||||
|
||||
unsafe extern "C" fn dhcp_detect_leasetime_setup(
|
||||
|
|
@ -58,11 +57,11 @@ unsafe extern "C" fn dhcp_detect_leasetime_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_DHCP_LEASE_TIME_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_DHCP_LEASE_TIME_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -101,11 +100,11 @@ unsafe extern "C" fn dhcp_detect_rebindingtime_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_DHCP_REBINDING_TIME_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_DHCP_REBINDING_TIME_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -138,11 +137,11 @@ unsafe extern "C" fn dhcp_detect_renewaltime_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_DHCP_RENEWAL_TIME_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_DHCP_RENEWAL_TIME_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
|
|||
|
|
@ -21,9 +21,7 @@ use crate::detect::uint::{
|
|||
detect_match_uint, detect_parse_uint_enum, DetectUintData, SCDetectU16Free, SCDetectU8Free,
|
||||
SCDetectU8Parse,
|
||||
};
|
||||
use crate::detect::{
|
||||
helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer,
|
||||
};
|
||||
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
|
||||
use crate::direction::Direction;
|
||||
use std::ffi::CStr;
|
||||
use std::os::raw::{c_int, c_void};
|
||||
|
|
@ -31,7 +29,8 @@ use suricata_sys::sys::{
|
|||
DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList,
|
||||
SCDetectHelperBufferRegister, SCDetectHelperKeywordAliasRegister,
|
||||
SCDetectHelperKeywordRegister, SCDetectHelperMultiBufferProgressMpmRegister,
|
||||
SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature,
|
||||
SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList, SCSigTableAppLiteElmt, SigMatchCtx,
|
||||
Signature,
|
||||
};
|
||||
|
||||
/// Perform the DNS opcode match.
|
||||
|
|
@ -128,11 +127,11 @@ unsafe extern "C" fn dns_rrtype_match(
|
|||
static mut G_DNS_ANSWER_NAME_BUFFER_ID: c_int = 0;
|
||||
static mut G_DNS_QUERY_NAME_BUFFER_ID: c_int = 0;
|
||||
static mut G_DNS_QUERY_BUFFER_ID: c_int = 0;
|
||||
static mut G_DNS_OPCODE_KW_ID: c_int = 0;
|
||||
static mut G_DNS_OPCODE_KW_ID: u16 = 0;
|
||||
static mut G_DNS_OPCODE_BUFFER_ID: c_int = 0;
|
||||
static mut G_DNS_RCODE_KW_ID: c_int = 0;
|
||||
static mut G_DNS_RCODE_KW_ID: u16 = 0;
|
||||
static mut G_DNS_RCODE_BUFFER_ID: c_int = 0;
|
||||
static mut G_DNS_RRTYPE_KW_ID: c_int = 0;
|
||||
static mut G_DNS_RRTYPE_KW_ID: u16 = 0;
|
||||
static mut G_DNS_RRTYPE_BUFFER_ID: c_int = 0;
|
||||
|
||||
unsafe extern "C" fn dns_opcode_setup(
|
||||
|
|
@ -145,7 +144,15 @@ unsafe extern "C" fn dns_opcode_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_DNS_OPCODE_KW_ID, ctx, G_DNS_OPCODE_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_DNS_OPCODE_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_DNS_OPCODE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
dns_opcode_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -179,7 +186,15 @@ unsafe extern "C" fn dns_rcode_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_DNS_RCODE_KW_ID, ctx, G_DNS_RCODE_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_DNS_RCODE_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_DNS_RCODE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
dns_rcode_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -215,7 +230,15 @@ unsafe extern "C" fn dns_rrtype_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_DNS_RRTYPE_KW_ID, ctx, G_DNS_RRTYPE_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_DNS_RRTYPE_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_DNS_RRTYPE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
dns_rrtype_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,13 +35,12 @@ use crate::detect::uint::{
|
|||
SCDetectU16Parse, SCDetectU32Free, SCDetectU32Match, SCDetectU32Parse, SCDetectU8Free,
|
||||
SCDetectU8Match, SCDetectU8Parse,
|
||||
};
|
||||
use crate::detect::{
|
||||
helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer,
|
||||
};
|
||||
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
|
||||
use suricata_sys::sys::{
|
||||
DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList,
|
||||
SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister,
|
||||
SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature,
|
||||
SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList, SCSigTableAppLiteElmt, SigMatchCtx,
|
||||
Signature,
|
||||
};
|
||||
|
||||
use crate::direction::Direction;
|
||||
|
|
@ -402,39 +401,39 @@ fn tx_get_protocol_version(tx: &EnipTransaction, direction: Direction) -> Option
|
|||
return None;
|
||||
}
|
||||
|
||||
static mut G_ENIP_CIPSERVICE_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_CIPSERVICE_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_CIPSERVICE_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_CAPABILITIES_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_CAPABILITIES_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_CAPABILITIES_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_ATTRIBUTE_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_ATTRIBUTE_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_CIP_ATTRIBUTE_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_CLASS_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_CLASS_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_CIP_CLASS_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_VENDOR_ID_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_VENDOR_ID_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_VENDOR_ID_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_STATUS_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_STATUS_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_STATUS_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_STATE_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_STATE_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_STATE_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_SERIAL_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_SERIAL_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_SERIAL_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_REVISION_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_REVISION_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_REVISION_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_PROTOCOL_VERSION_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_PROTOCOL_VERSION_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_PROTOCOL_VERSION_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_PRODUCT_CODE_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_PRODUCT_CODE_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_PRODUCT_CODE_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_IDENTITY_STATUS_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_IDENTITY_STATUS_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_IDENTITY_STATUS_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_DEVICE_TYPE_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_DEVICE_TYPE_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_DEVICE_TYPE_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_COMMAND_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_COMMAND_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_COMMAND_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_STATUS_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_STATUS_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_CIP_STATUS_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_INSTANCE_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_INSTANCE_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_CIP_INSTANCE_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_EXTENDEDSTATUS_KW_ID: c_int = 0;
|
||||
static mut G_ENIP_CIP_EXTENDEDSTATUS_KW_ID: u16 = 0;
|
||||
static mut G_ENIP_CIP_EXTENDEDSTATUS_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_PRODUCT_NAME_BUFFER_ID: c_int = 0;
|
||||
static mut G_ENIP_SERVICE_NAME_BUFFER_ID: c_int = 0;
|
||||
|
|
@ -460,11 +459,11 @@ unsafe extern "C" fn cipservice_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_CIPSERVICE_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_CIPSERVICE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -498,11 +497,11 @@ unsafe extern "C" fn capabilities_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_CAPABILITIES_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_CAPABILITIES_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -554,11 +553,11 @@ unsafe extern "C" fn cip_attribute_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_CIP_ATTRIBUTE_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_CIP_ATTRIBUTE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -594,11 +593,11 @@ unsafe extern "C" fn cip_class_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_CIP_CLASS_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_CIP_CLASS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -634,11 +633,11 @@ unsafe extern "C" fn vendor_id_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_VENDOR_ID_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_VENDOR_ID_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -690,7 +689,15 @@ unsafe extern "C" fn status_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_ENIP_STATUS_KW_ID, ctx, G_ENIP_STATUS_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_STATUS_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_STATUS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
status_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -725,7 +732,15 @@ unsafe extern "C" fn state_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_ENIP_STATE_KW_ID, ctx, G_ENIP_STATE_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_STATE_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_STATE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
state_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -773,7 +788,15 @@ unsafe extern "C" fn serial_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_ENIP_SERIAL_KW_ID, ctx, G_ENIP_SERIAL_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_SERIAL_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_SERIAL_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
serial_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -821,8 +844,14 @@ unsafe extern "C" fn revision_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_ENIP_REVISION_KW_ID, ctx, G_ENIP_REVISION_BUFFER_ID)
|
||||
.is_null()
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_REVISION_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_REVISION_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
revision_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
|
|
@ -871,11 +900,11 @@ unsafe extern "C" fn protocol_version_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_PROTOCOL_VERSION_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_PROTOCOL_VERSION_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -914,11 +943,11 @@ unsafe extern "C" fn product_code_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_PRODUCT_CODE_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_PRODUCT_CODE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -970,11 +999,11 @@ unsafe extern "C" fn identity_status_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_IDENTITY_STATUS_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_IDENTITY_STATUS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -1026,11 +1055,11 @@ unsafe extern "C" fn device_type_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_DEVICE_TYPE_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_DEVICE_TYPE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -1082,7 +1111,14 @@ unsafe extern "C" fn command_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_ENIP_COMMAND_KW_ID, ctx, G_ENIP_COMMAND_BUFFER_ID).is_null()
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_COMMAND_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_COMMAND_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
command_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
|
|
@ -1130,11 +1166,11 @@ unsafe extern "C" fn cip_status_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_CIP_STATUS_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_CIP_STATUS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -1170,11 +1206,11 @@ unsafe extern "C" fn cip_instance_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_CIP_INSTANCE_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_CIP_INSTANCE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -1210,11 +1246,11 @@ unsafe extern "C" fn cip_extendedstatus_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_ENIP_CIP_EXTENDEDSTATUS_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_ENIP_CIP_EXTENDEDSTATUS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
|
|||
|
|
@ -21,15 +21,13 @@ use crate::detect::uint::{
|
|||
detect_match_uint, detect_parse_uint_enum, DetectUintData, SCDetectU32Free, SCDetectU32Parse,
|
||||
SCDetectU8Free,
|
||||
};
|
||||
use crate::detect::{
|
||||
helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer,
|
||||
};
|
||||
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
|
||||
use crate::ldap::types::{LdapMessage, LdapResultCode, ProtocolOp, ProtocolOpCode};
|
||||
use suricata_sys::sys::{
|
||||
DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList,
|
||||
SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister,
|
||||
SCDetectHelperMultiBufferMpmRegister, SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt,
|
||||
SigMatchCtx, Signature,
|
||||
SCDetectHelperMultiBufferMpmRegister, SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList,
|
||||
SCSigTableAppLiteElmt, SigMatchCtx, Signature,
|
||||
};
|
||||
|
||||
use std::collections::VecDeque;
|
||||
|
|
@ -63,15 +61,15 @@ struct DetectLdapRespResultData {
|
|||
pub index: LdapIndex,
|
||||
}
|
||||
|
||||
static mut G_LDAP_REQUEST_OPERATION_KW_ID: c_int = 0;
|
||||
static mut G_LDAP_REQUEST_OPERATION_KW_ID: u16 = 0;
|
||||
static mut G_LDAP_REQUEST_OPERATION_BUFFER_ID: c_int = 0;
|
||||
static mut G_LDAP_RESPONSES_OPERATION_KW_ID: c_int = 0;
|
||||
static mut G_LDAP_RESPONSES_OPERATION_KW_ID: u16 = 0;
|
||||
static mut G_LDAP_RESPONSES_OPERATION_BUFFER_ID: c_int = 0;
|
||||
static mut G_LDAP_RESPONSES_COUNT_KW_ID: c_int = 0;
|
||||
static mut G_LDAP_RESPONSES_COUNT_KW_ID: u16 = 0;
|
||||
static mut G_LDAP_RESPONSES_COUNT_BUFFER_ID: c_int = 0;
|
||||
static mut G_LDAP_REQUEST_DN_BUFFER_ID: c_int = 0;
|
||||
static mut G_LDAP_RESPONSES_DN_BUFFER_ID: c_int = 0;
|
||||
static mut G_LDAP_RESPONSES_RESULT_CODE_KW_ID: c_int = 0;
|
||||
static mut G_LDAP_RESPONSES_RESULT_CODE_KW_ID: u16 = 0;
|
||||
static mut G_LDAP_RESPONSES_RESULT_CODE_BUFFER_ID: c_int = 0;
|
||||
static mut G_LDAP_RESPONSES_MSG_BUFFER_ID: c_int = 0;
|
||||
static mut G_LDAP_REQUEST_ATTRIBUTE_TYPE_BUFFER_ID: c_int = 0;
|
||||
|
|
@ -100,11 +98,11 @@ unsafe extern "C" fn ldap_detect_request_operation_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_LDAP_REQUEST_OPERATION_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_LDAP_REQUEST_OPERATION_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -185,11 +183,11 @@ unsafe extern "C" fn ldap_detect_responses_operation_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_LDAP_RESPONSES_OPERATION_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_LDAP_RESPONSES_OPERATION_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -275,11 +273,11 @@ unsafe extern "C" fn ldap_detect_responses_count_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_LDAP_RESPONSES_COUNT_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_LDAP_RESPONSES_COUNT_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -425,11 +423,11 @@ unsafe extern "C" fn ldap_detect_responses_result_code_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_LDAP_RESPONSES_RESULT_CODE_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_LDAP_RESPONSES_RESULT_CODE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
|
|||
|
|
@ -22,14 +22,12 @@ use crate::detect::uint::{
|
|||
detect_match_uint, detect_parse_uint, detect_parse_uint_enum, DetectUintData, DetectUintMode,
|
||||
SCDetectU8Free, SCDetectU8Parse,
|
||||
};
|
||||
use crate::detect::{
|
||||
helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer,
|
||||
};
|
||||
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
|
||||
use suricata_sys::sys::{
|
||||
DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList,
|
||||
SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister,
|
||||
SCDetectHelperMultiBufferMpmRegister, SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt,
|
||||
SigMatchCtx, Signature,
|
||||
SCDetectHelperMultiBufferMpmRegister, SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList,
|
||||
SCSigTableAppLiteElmt, SigMatchCtx, Signature,
|
||||
};
|
||||
|
||||
use nom7::branch::alt;
|
||||
|
|
@ -277,19 +275,19 @@ fn mqtt_tx_suback_unsuback_has_reason_code(
|
|||
|
||||
static mut UNSUB_TOPIC_MATCH_LIMIT: isize = 100;
|
||||
static mut G_MQTT_UNSUB_TOPIC_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_TYPE_KW_ID: c_int = 0;
|
||||
static mut G_MQTT_TYPE_KW_ID: u16 = 0;
|
||||
static mut G_MQTT_TYPE_BUFFER_ID: c_int = 0;
|
||||
static mut SUB_TOPIC_MATCH_LIMIT: isize = 100;
|
||||
static mut G_MQTT_SUB_TOPIC_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_REASON_CODE_KW_ID: c_int = 0;
|
||||
static mut G_MQTT_REASON_CODE_KW_ID: u16 = 0;
|
||||
static mut G_MQTT_REASON_CODE_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_QOS_KW_ID: c_int = 0;
|
||||
static mut G_MQTT_QOS_KW_ID: u16 = 0;
|
||||
static mut G_MQTT_QOS_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_PUB_TOPIC_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_PUB_MSG_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_PROTOCOL_VERSION_KW_ID: c_int = 0;
|
||||
static mut G_MQTT_PROTOCOL_VERSION_KW_ID: u16 = 0;
|
||||
static mut G_MQTT_PROTOCOL_VERSION_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_FLAGS_KW_ID: c_int = 0;
|
||||
static mut G_MQTT_FLAGS_KW_ID: u16 = 0;
|
||||
static mut G_MQTT_FLAGS_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_CONN_WILLTOPIC_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_CONN_WILLMSG_BUFFER_ID: c_int = 0;
|
||||
|
|
@ -297,9 +295,9 @@ static mut G_MQTT_CONN_USERNAME_BUFFER_ID: c_int = 0;
|
|||
static mut G_MQTT_CONN_PROTOCOLSTRING_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_CONN_PASSWORD_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_CONN_CLIENTID_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_CONNACK_SESSIONPRESENT_KW_ID: c_int = 0;
|
||||
static mut G_MQTT_CONNACK_SESSIONPRESENT_KW_ID: u16 = 0;
|
||||
static mut G_MQTT_CONNACK_SESSIONPRESENT_BUFFER_ID: c_int = 0;
|
||||
static mut G_MQTT_CONN_FLAGS_KW_ID: c_int = 0;
|
||||
static mut G_MQTT_CONN_FLAGS_KW_ID: u16 = 0;
|
||||
static mut G_MQTT_CONN_FLAGS_BUFFER_ID: c_int = 0;
|
||||
|
||||
unsafe extern "C" fn unsub_topic_get_data(
|
||||
|
|
@ -405,7 +403,15 @@ unsafe extern "C" fn mqtt_type_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_MQTT_TYPE_KW_ID, ctx, G_MQTT_TYPE_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_MQTT_TYPE_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_MQTT_TYPE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
mqtt_type_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -437,11 +443,11 @@ unsafe extern "C" fn mqtt_reason_code_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_MQTT_REASON_CODE_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_MQTT_REASON_CODE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -495,7 +501,15 @@ unsafe extern "C" fn mqtt_qos_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_MQTT_QOS_KW_ID, ctx, G_MQTT_QOS_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_MQTT_QOS_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_MQTT_QOS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
mqtt_qos_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -547,11 +561,11 @@ unsafe extern "C" fn mqtt_connack_sessionpresent_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_MQTT_CONNACK_SESSIONPRESENT_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_MQTT_CONNACK_SESSIONPRESENT_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -620,11 +634,11 @@ unsafe extern "C" fn mqtt_protocol_version_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_MQTT_PROTOCOL_VERSION_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_MQTT_PROTOCOL_VERSION_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -727,7 +741,15 @@ unsafe extern "C" fn mqtt_flags_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_MQTT_FLAGS_KW_ID, ctx, G_MQTT_FLAGS_BUFFER_ID).is_null() {
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_MQTT_FLAGS_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_MQTT_FLAGS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
mqtt_flags_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -840,11 +862,11 @@ unsafe extern "C" fn mqtt_conn_flags_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_MQTT_CONN_FLAGS_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_MQTT_CONN_FLAGS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
|
|||
|
|
@ -23,16 +23,15 @@ use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER};
|
|||
use crate::detect::uint::{
|
||||
detect_match_uint, detect_parse_uint_enum, DetectUintData, SCDetectU32Free, SCDetectU32Parse,
|
||||
};
|
||||
use crate::detect::{
|
||||
helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer,
|
||||
};
|
||||
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
|
||||
use std::ffi::CStr;
|
||||
use std::os::raw::{c_int, c_void};
|
||||
use std::ptr;
|
||||
use suricata_sys::sys::{
|
||||
DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList,
|
||||
SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister,
|
||||
SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature,
|
||||
SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList, SCSigTableAppLiteElmt, SigMatchCtx,
|
||||
Signature,
|
||||
};
|
||||
|
||||
unsafe extern "C" fn rfb_name_get(
|
||||
|
|
@ -54,9 +53,9 @@ unsafe extern "C" fn rfb_name_get(
|
|||
}
|
||||
|
||||
static mut G_RFB_NAME_BUFFER_ID: c_int = 0;
|
||||
static mut G_RFB_SEC_TYPE_KW_ID: c_int = 0;
|
||||
static mut G_RFB_SEC_TYPE_KW_ID: u16 = 0;
|
||||
static mut G_RFB_SEC_TYPE_BUFFER_ID: c_int = 0;
|
||||
static mut G_RFB_SEC_RESULT_KW_ID: c_int = 0;
|
||||
static mut G_RFB_SEC_RESULT_KW_ID: u16 = 0;
|
||||
static mut G_RFB_SEC_RESULT_BUFFER_ID: c_int = 0;
|
||||
|
||||
unsafe extern "C" fn rfb_name_setup(
|
||||
|
|
@ -81,7 +80,14 @@ unsafe extern "C" fn rfb_sec_type_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_RFB_SEC_TYPE_KW_ID, ctx, G_RFB_SEC_TYPE_BUFFER_ID).is_null()
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_RFB_SEC_TYPE_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_RFB_SEC_TYPE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
rfb_sec_type_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
|
|
@ -135,11 +141,11 @@ unsafe extern "C" fn rfb_sec_result_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_RFB_SEC_RESULT_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_RFB_SEC_RESULT_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
|
|||
|
|
@ -20,19 +20,18 @@
|
|||
use super::snmp::{SNMPTransaction, ALPROTO_SNMP};
|
||||
use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER};
|
||||
use crate::detect::uint::{DetectUintData, SCDetectU32Free, SCDetectU32Match, SCDetectU32Parse};
|
||||
use crate::detect::{
|
||||
helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer,
|
||||
};
|
||||
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
|
||||
use std::os::raw::{c_int, c_void};
|
||||
use suricata_sys::sys::{
|
||||
DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList,
|
||||
SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister,
|
||||
SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature,
|
||||
SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList, SCSigTableAppLiteElmt, SigMatchCtx,
|
||||
Signature,
|
||||
};
|
||||
|
||||
static mut G_SNMP_VERSION_KW_ID: c_int = 0;
|
||||
static mut G_SNMP_VERSION_KW_ID: u16 = 0;
|
||||
static mut G_SNMP_VERSION_BUFFER_ID: c_int = 0;
|
||||
static mut G_SNMP_PDUTYPE_KW_ID: c_int = 0;
|
||||
static mut G_SNMP_PDUTYPE_KW_ID: u16 = 0;
|
||||
static mut G_SNMP_PDUTYPE_BUFFER_ID: c_int = 0;
|
||||
static mut G_SNMP_USM_BUFFER_ID: c_int = 0;
|
||||
static mut G_SNMP_COMMUNITY_BUFFER_ID: c_int = 0;
|
||||
|
|
@ -47,7 +46,14 @@ unsafe extern "C" fn snmp_detect_version_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_SNMP_VERSION_KW_ID, ctx, G_SNMP_VERSION_BUFFER_ID).is_null()
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_SNMP_VERSION_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_SNMP_VERSION_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
snmp_detect_version_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
|
|
@ -80,7 +86,14 @@ unsafe extern "C" fn snmp_detect_pdutype_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(de, s, G_SNMP_PDUTYPE_KW_ID, ctx, G_SNMP_PDUTYPE_BUFFER_ID).is_null()
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_SNMP_PDUTYPE_KW_ID,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_SNMP_PDUTYPE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
{
|
||||
snmp_detect_pdutype_free(std::ptr::null_mut(), ctx);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -21,14 +21,13 @@ use crate::detect::uint::{
|
|||
detect_parse_uint, detect_parse_uint_enum, DetectUintData, DetectUintMode, SCDetectU32Free,
|
||||
SCDetectU32Match, SCDetectU32Parse, SCDetectU8Free, SCDetectU8Match,
|
||||
};
|
||||
use crate::detect::{
|
||||
helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer,
|
||||
};
|
||||
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
|
||||
use crate::websocket::parser::WebSocketOpcode;
|
||||
use suricata_sys::sys::{
|
||||
DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList,
|
||||
SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister,
|
||||
SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature,
|
||||
SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList, SCSigTableAppLiteElmt, SigMatchCtx,
|
||||
Signature,
|
||||
};
|
||||
|
||||
use nom7::branch::alt;
|
||||
|
|
@ -113,11 +112,11 @@ unsafe extern "C" fn websocket_parse_flags(
|
|||
return std::ptr::null_mut();
|
||||
}
|
||||
|
||||
static mut G_WEBSOCKET_OPCODE_KW_ID: c_int = 0;
|
||||
static mut G_WEBSOCKET_OPCODE_KW_ID: u16 = 0;
|
||||
static mut G_WEBSOCKET_OPCODE_BUFFER_ID: c_int = 0;
|
||||
static mut G_WEBSOCKET_MASK_KW_ID: c_int = 0;
|
||||
static mut G_WEBSOCKET_MASK_KW_ID: u16 = 0;
|
||||
static mut G_WEBSOCKET_MASK_BUFFER_ID: c_int = 0;
|
||||
static mut G_WEBSOCKET_FLAGS_KW_ID: c_int = 0;
|
||||
static mut G_WEBSOCKET_FLAGS_KW_ID: u16 = 0;
|
||||
static mut G_WEBSOCKET_FLAGS_BUFFER_ID: c_int = 0;
|
||||
static mut G_WEBSOCKET_PAYLOAD_BUFFER_ID: c_int = 0;
|
||||
|
||||
|
|
@ -131,11 +130,11 @@ unsafe extern "C" fn websocket_detect_opcode_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_WEBSOCKET_OPCODE_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_WEBSOCKET_OPCODE_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -171,11 +170,11 @@ unsafe extern "C" fn websocket_detect_mask_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_WEBSOCKET_MASK_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_WEBSOCKET_MASK_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
@ -214,11 +213,11 @@ unsafe extern "C" fn websocket_detect_flags_setup(
|
|||
if ctx.is_null() {
|
||||
return -1;
|
||||
}
|
||||
if SigMatchAppendSMToList(
|
||||
if SCSigMatchAppendSMToList(
|
||||
de,
|
||||
s,
|
||||
G_WEBSOCKET_FLAGS_KW_ID,
|
||||
ctx,
|
||||
ctx as *mut SigMatchCtx,
|
||||
G_WEBSOCKET_FLAGS_BUFFER_ID,
|
||||
)
|
||||
.is_null()
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ extern "C" {
|
|||
) -> ::std::os::raw::c_int;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn SCDetectHelperKeywordSetCleanCString(id: ::std::os::raw::c_int);
|
||||
pub fn SCDetectHelperKeywordSetCleanCString(id: u16);
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
@ -191,6 +191,12 @@ pub struct Signature_ {
|
|||
_unused: [u8; 0],
|
||||
}
|
||||
pub type Signature = Signature_;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct SigMatch_ {
|
||||
_unused: [u8; 0],
|
||||
}
|
||||
pub type SigMatch = SigMatch_;
|
||||
extern "C" {
|
||||
pub fn SCDetectBufferSetActiveList(
|
||||
de_ctx: *mut DetectEngineCtx, s: *mut Signature, list: ::std::os::raw::c_int,
|
||||
|
|
@ -345,13 +351,10 @@ extern "C" {
|
|||
pub fn SCDetectHelperNewKeywordId() -> ::std::os::raw::c_int;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn SCDetectHelperKeywordRegister(kw: *const SCSigTableAppLiteElmt)
|
||||
-> ::std::os::raw::c_int;
|
||||
pub fn SCDetectHelperKeywordRegister(kw: *const SCSigTableAppLiteElmt) -> u16;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn SCDetectHelperKeywordAliasRegister(
|
||||
kwid: ::std::os::raw::c_int, alias: *const ::std::os::raw::c_char,
|
||||
);
|
||||
pub fn SCDetectHelperKeywordAliasRegister(kwid: u16, alias: *const ::std::os::raw::c_char);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn SCDetectHelperBufferRegister(
|
||||
|
|
@ -382,6 +385,12 @@ extern "C" {
|
|||
kw: *const SCTransformTableElmt,
|
||||
) -> ::std::os::raw::c_int;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn SCSigMatchAppendSMToList(
|
||||
arg1: *mut DetectEngineCtx, arg2: *mut Signature, arg3: u16, arg4: *mut SigMatchCtx,
|
||||
arg5: ::std::os::raw::c_int,
|
||||
) -> *mut SigMatch;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn SCDetectSignatureSetAppProto(
|
||||
s: *mut Signature, alproto: AppProto,
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ static int DetectAppLayerEventSetup(DetectEngineCtx *de_ctx, Signature *s, const
|
|||
SCLogDebug("data->event_id %u", data->event_id);
|
||||
|
||||
if (event_type == APP_LAYER_EVENT_TYPE_PACKET) {
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_EVENT, (SigMatchCtx *)data,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_EVENT, (SigMatchCtx *)data,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -282,7 +282,7 @@ static int DetectAppLayerEventSetup(DetectEngineCtx *de_ctx, Signature *s, const
|
|||
if (SCDetectSignatureSetAppProto(s, data->alproto) != 0)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_EVENT, (SigMatchCtx *)data,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_EVENT, (SigMatchCtx *)data,
|
||||
g_applayer_events_list_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ static int DetectAppLayerProtocolSetup(DetectEngineCtx *de_ctx,
|
|||
}
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_PROTOCOL, (SigMatchCtx *)data,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_PROTOCOL, (SigMatchCtx *)data,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ static int DetectAppLayerStateSetup(DetectEngineCtx *de_ctx, Signature *s, const
|
|||
data->progress = (uint8_t)progress;
|
||||
data->mode = (int8_t)mode;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_STATE, (SigMatchCtx *)data,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_STATE, (SigMatchCtx *)data,
|
||||
g_applayer_state_list_id) == NULL) {
|
||||
SCFree(data);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -101,8 +101,8 @@ static int DetectAsn1Setup(DetectEngineCtx *de_ctx, Signature *s, const char *as
|
|||
if (ad == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ASN1, (SigMatchCtx *)ad, DETECT_SM_LIST_PMATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ASN1, (SigMatchCtx *)ad, DETECT_SM_LIST_PMATCH) == NULL) {
|
||||
DetectAsn1Free(de_ctx, ad);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ static int DetectBase64DecodeSetup(DetectEngineCtx *de_ctx, Signature *s,
|
|||
}
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_BASE64_DECODE, (SigMatchCtx *)data, sm_list) ==
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_BASE64_DECODE, (SigMatchCtx *)data, sm_list) ==
|
||||
NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ static int DetectBsizeSetup (DetectEngineCtx *de_ctx, Signature *s, const char *
|
|||
if (bsz == NULL)
|
||||
SCReturnInt(-1);
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_BSIZE, (SigMatchCtx *)bsz, list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_BSIZE, (SigMatchCtx *)bsz, list) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@ static int DetectBypassSetup(DetectEngineCtx *de_ctx, Signature *s, const char *
|
|||
}
|
||||
s->flags |= SIG_FLAG_BYPASS;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_BYPASS, NULL, DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_BYPASS, NULL, DETECT_SM_LIST_POSTMATCH) ==
|
||||
NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ static int DetectByteExtractSetup(DetectEngineCtx *de_ctx, Signature *s, const c
|
|||
if (data->local_id > de_ctx->byte_extract_max_local_id)
|
||||
de_ctx->byte_extract_max_local_id = data->local_id;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_BYTE_EXTRACT, (SigMatchCtx *)data, sm_list) ==
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_BYTE_EXTRACT, (SigMatchCtx *)data, sm_list) ==
|
||||
NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -569,7 +569,8 @@ static int DetectBytejumpSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
offset = NULL;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_BYTEJUMP, (SigMatchCtx *)data, sm_list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_BYTEJUMP, (SigMatchCtx *)data, sm_list) ==
|
||||
NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,8 @@ static int DetectByteMathSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
de_ctx->byte_extract_max_local_id = data->local_id;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_BYTEMATH, (SigMatchCtx *)data, sm_list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_BYTEMATH, (SigMatchCtx *)data, sm_list) ==
|
||||
NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -686,7 +686,8 @@ static int DetectBytetestSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
nbytes = NULL;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_BYTETEST, (SigMatchCtx *)data, sm_list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_BYTETEST, (SigMatchCtx *)data, sm_list) ==
|
||||
NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ static int DetectConfigSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
s->flags |= SIG_FLAG_APPLAYER;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_CONFIG, (SigMatchCtx *)fd, DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ int DetectContentSetup(DetectEngineCtx *de_ctx, Signature *s, const char *conten
|
|||
}
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_CONTENT, (SigMatchCtx *)cd, sm_list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_CONTENT, (SigMatchCtx *)cd, sm_list) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ static int DetectIPV4CsumSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
if (DetectCsumParseArg(csum_str, cd) == 0)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_IPV4_CSUM, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -359,7 +359,7 @@ static int DetectTCPV4CsumSetup(DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (DetectCsumParseArg(csum_str, cd) == 0)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_TCPV4_CSUM, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -440,7 +440,7 @@ static int DetectTCPV6CsumSetup(DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (DetectCsumParseArg(csum_str, cd) == 0)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_TCPV6_CSUM, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -523,7 +523,7 @@ static int DetectUDPV4CsumSetup(DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (DetectCsumParseArg(csum_str, cd) == 0)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_UDPV4_CSUM, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -603,7 +603,7 @@ static int DetectUDPV6CsumSetup(DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (DetectCsumParseArg(csum_str, cd) == 0)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_UDPV6_CSUM, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -686,7 +686,7 @@ static int DetectICMPV4CsumSetup(DetectEngineCtx *de_ctx, Signature *s, const ch
|
|||
if (DetectCsumParseArg(csum_str, cd) == 0)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ICMPV4_CSUM, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -772,7 +772,7 @@ static int DetectICMPV6CsumSetup(DetectEngineCtx *de_ctx, Signature *s, const ch
|
|||
if (DetectCsumParseArg(csum_str, cd) == 0)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ICMPV6_CSUM, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ static int DetectDatarepSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_DATAREP, (SigMatchCtx *)cd, list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_DATAREP, (SigMatchCtx *)cd, list) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ int DetectDatasetSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawst
|
|||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_DATASET, (SigMatchCtx *)cd, list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_DATASET, (SigMatchCtx *)cd, list) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ static int DetectDceIfaceSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_DCE_IFACE, did, g_dce_generic_list_id) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_DCE_IFACE, did, g_dce_generic_list_id) == NULL) {
|
||||
DetectDceIfaceFree(de_ctx, did);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ static int DetectDceOpnumSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_DCE_OPNUM, (SigMatchCtx *)dod, g_dce_generic_list_id) == NULL) {
|
||||
DetectDceOpnumFree(de_ctx, dod);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ static int DetectDetectionFilterSetup(DetectEngineCtx *de_ctx, Signature *s, con
|
|||
if (df == NULL)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_DETECTION_FILTER, (SigMatchCtx *)df,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_DETECTION_FILTER, (SigMatchCtx *)df,
|
||||
DETECT_SM_LIST_THRESHOLD) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ static int DetectDNP3FuncSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
}
|
||||
dnp3->function_code = function_code;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_DNP3FUNC, (SigMatchCtx *)dnp3, g_dnp3_match_buffer_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -300,7 +300,7 @@ static int DetectDNP3IndSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
}
|
||||
detect->ind_flags = flags;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_DNP3IND, (SigMatchCtx *)detect, g_dnp3_match_buffer_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -367,7 +367,7 @@ static int DetectDNP3ObjSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
detect->obj_group = group;
|
||||
detect->obj_variation = variation;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_DNP3OBJ, (SigMatchCtx *)detect, g_dnp3_match_buffer_id) == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ static int DetectDsizeSetup (DetectEngineCtx *de_ctx, Signature *s, const char *
|
|||
|
||||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
SigMatch *sm = SigMatchAppendSMToList(
|
||||
SigMatch *sm = SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_DSIZE, (SigMatchCtx *)dd, DETECT_SM_LIST_MATCH);
|
||||
if (sm == NULL) {
|
||||
SCDetectU16Free(dd);
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ static int DetectEngineEventSetupDo(
|
|||
|
||||
SCLogDebug("rawstr %s %u", rawstr, de->event);
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, smtype, (SigMatchCtx *)de, DETECT_SM_LIST_MATCH) ==
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, smtype, (SigMatchCtx *)de, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
SCFree(de);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ int SCDetectHelperNewKeywordId(void)
|
|||
return DETECT_TBLSIZE_IDX - 1;
|
||||
}
|
||||
|
||||
int SCDetectHelperKeywordRegister(const SCSigTableAppLiteElmt *kw)
|
||||
uint16_t SCDetectHelperKeywordRegister(const SCSigTableAppLiteElmt *kw)
|
||||
{
|
||||
int keyword_id = SCDetectHelperNewKeywordId();
|
||||
if (keyword_id < 0) {
|
||||
|
|
@ -118,10 +118,10 @@ int SCDetectHelperKeywordRegister(const SCSigTableAppLiteElmt *kw)
|
|||
(int (*)(DetectEngineCtx * de, Signature * s, const char *raw)) kw->Setup;
|
||||
sigmatch_table[keyword_id].Free = (void (*)(DetectEngineCtx * de, void *ptr)) kw->Free;
|
||||
|
||||
return keyword_id;
|
||||
return (uint16_t)keyword_id;
|
||||
}
|
||||
|
||||
void SCDetectHelperKeywordAliasRegister(int kwid, const char *alias)
|
||||
void SCDetectHelperKeywordAliasRegister(uint16_t kwid, const char *alias)
|
||||
{
|
||||
sigmatch_table[kwid].alias = alias;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,8 +78,8 @@ typedef struct SCTransformTableElmt {
|
|||
|
||||
int SCDetectHelperNewKeywordId(void);
|
||||
|
||||
int SCDetectHelperKeywordRegister(const SCSigTableAppLiteElmt *kw);
|
||||
void SCDetectHelperKeywordAliasRegister(int kwid, const char *alias);
|
||||
uint16_t SCDetectHelperKeywordRegister(const SCSigTableAppLiteElmt *kw);
|
||||
void SCDetectHelperKeywordAliasRegister(uint16_t kwid, const char *alias);
|
||||
int SCDetectHelperBufferRegister(const char *name, AppProto alproto, uint8_t direction);
|
||||
|
||||
int SCDetectHelperBufferMpmRegister(const char *name, const char *desc, AppProto alproto,
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ static void SigCleanCString(SigTableElmt *base)
|
|||
SCDetectSigMatchNamesFree(&kw);
|
||||
}
|
||||
|
||||
void SCDetectHelperKeywordSetCleanCString(int id)
|
||||
void SCDetectHelperKeywordSetCleanCString(uint16_t id)
|
||||
{
|
||||
sigmatch_table[id].Cleanup = SigCleanCString;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -354,6 +354,6 @@ void SigTableSetup(void);
|
|||
int SCSigTablePreRegister(void (*KeywordsRegister)(void));
|
||||
void SigTableRegisterTests(void);
|
||||
bool SigTableHasKeyword(const char *keyword);
|
||||
void SCDetectHelperKeywordSetCleanCString(int id);
|
||||
void SCDetectHelperKeywordSetCleanCString(uint16_t id);
|
||||
|
||||
#endif /* SURICATA_DETECT_ENGINE_REGISTER_H */
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ static int DetectEntropySetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
sm_list = s->init_data->list;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ENTROPY, (SigMatchCtx *)ded, sm_list) != NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_ENTROPY, (SigMatchCtx *)ded, sm_list) != NULL) {
|
||||
SCReturnInt(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ int DetectFileHashSetup(
|
|||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, type, (SigMatchCtx *)filehash, list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, type, (SigMatchCtx *)filehash, list) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ static int DetectFilesizeSetup (DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (fsd == NULL)
|
||||
SCReturnInt(-1);
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FILESIZE, (SigMatchCtx *)fsd, g_file_match_list_id) == NULL) {
|
||||
DetectFilesizeFree(de_ctx, fsd);
|
||||
SCReturnInt(-1);
|
||||
|
|
|
|||
|
|
@ -468,14 +468,14 @@ static int DetectFilestoreSetup (DetectEngineCtx *de_ctx, Signature *s, const ch
|
|||
AppLayerHtpNeedFileInspection();
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FILESTORE, (SigMatchCtx *)fd, g_file_match_list_id) == NULL) {
|
||||
DetectFilestoreFree(de_ctx, fd);
|
||||
goto error;
|
||||
}
|
||||
s->filestore_ctx = fd;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FILESTORE_POSTMATCH, NULL, DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ static int DetectFlowAgeSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
if (du32 == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOW_AGE, (SigMatchCtx *)du32, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectFlowAgeFree(de_ctx, du32);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ static int DetectFlowPktsToServerSetup(DetectEngineCtx *de_ctx, Signature *s, co
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOW_PKTS, (SigMatchCtx *)df, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectFlowPktsFree(de_ctx, df);
|
||||
return -1;
|
||||
|
|
@ -74,7 +74,7 @@ static int DetectFlowPktsToClientSetup(DetectEngineCtx *de_ctx, Signature *s, co
|
|||
if (df == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOW_PKTS, (SigMatchCtx *)df, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectFlowPktsFree(de_ctx, df);
|
||||
return -1;
|
||||
|
|
@ -90,7 +90,7 @@ static int DetectFlowPktsSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
if (df == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOW_PKTS, (SigMatchCtx *)df, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectFlowPktsFree(de_ctx, df);
|
||||
return -1;
|
||||
|
|
@ -225,7 +225,7 @@ static int DetectFlowBytesToServerSetup(DetectEngineCtx *de_ctx, Signature *s, c
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOW_BYTES, (SigMatchCtx *)df, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectFlowBytesFree(de_ctx, df);
|
||||
return -1;
|
||||
|
|
@ -242,7 +242,7 @@ static int DetectFlowBytesToClientSetup(DetectEngineCtx *de_ctx, Signature *s, c
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOW_BYTES, (SigMatchCtx *)df, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectFlowBytesFree(de_ctx, df);
|
||||
return -1;
|
||||
|
|
@ -258,7 +258,7 @@ static int DetectFlowBytesSetup(DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (df == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOW_BYTES, (SigMatchCtx *)df, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectFlowBytesFree(de_ctx, df);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ int DetectFlowSetup (DetectEngineCtx *de_ctx, Signature *s, const char *flowstr)
|
|||
}
|
||||
|
||||
if (appendsm) {
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOW, (SigMatchCtx *)fd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ int DetectFlowbitSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawst
|
|||
case DETECT_FLOWBITS_CMD_ISNOTSET:
|
||||
case DETECT_FLOWBITS_CMD_ISSET:
|
||||
/* checks, so packet list */
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FLOWBITS, (SigMatchCtx *)cd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FLOWBITS, (SigMatchCtx *)cd,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -370,7 +370,7 @@ int DetectFlowbitSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawst
|
|||
case DETECT_FLOWBITS_CMD_UNSET:
|
||||
case DETECT_FLOWBITS_CMD_TOGGLE:
|
||||
/* modifiers, only run when entire sig has matched */
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FLOWBITS, (SigMatchCtx *)cd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FLOWBITS, (SigMatchCtx *)cd,
|
||||
DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ static int DetectFlowintSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
case FLOWINT_MODIFIER_SET:
|
||||
case FLOWINT_MODIFIER_ADD:
|
||||
case FLOWINT_MODIFIER_SUB:
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FLOWINT, (SigMatchCtx *)sfd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FLOWINT, (SigMatchCtx *)sfd,
|
||||
DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -398,7 +398,7 @@ static int DetectFlowintSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
case FLOWINT_MODIFIER_GT:
|
||||
case FLOWINT_MODIFIER_ISSET:
|
||||
case FLOWINT_MODIFIER_ISNOTSET:
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FLOWINT, (SigMatchCtx *)sfd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FLOWINT, (SigMatchCtx *)sfd,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static int DetectFlowvarSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLOWVAR, (SigMatchCtx *)fd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -266,7 +266,7 @@ int DetectFlowvarPostMatchSetup(DetectEngineCtx *de_ctx, Signature *s, uint32_t
|
|||
fv->idx = idx;
|
||||
fv->post_match = true;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FLOWVAR_POSTMATCH, (SigMatchCtx *)fv,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FLOWVAR_POSTMATCH, (SigMatchCtx *)fv,
|
||||
DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ static int DetectFragBitsSetup (DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (de == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FRAGBITS, (SigMatchCtx *)de, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ static int DetectFragOffsetSetup (DetectEngineCtx *de_ctx, Signature *s, const c
|
|||
fragoff = DetectFragOffsetParse(de_ctx, fragoffsetstr);
|
||||
if (fragoff == NULL) goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FRAGOFFSET, (SigMatchCtx *)fragoff,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FRAGOFFSET, (SigMatchCtx *)fragoff,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ static int DetectFtpDynamicPortSetup(DetectEngineCtx *de_ctx, Signature *s, cons
|
|||
}
|
||||
|
||||
SCLogDebug("low %u hi %u", fdp->arg1, fdp->arg2);
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FTP_DYNPORT, (SigMatchCtx *)fdp,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FTP_DYNPORT, (SigMatchCtx *)fdp,
|
||||
g_ftp_dynport_buffer_id) == NULL) {
|
||||
DetectFtpDynamicPortFree(de_ctx, fdp);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ static int DetectFtpModeSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
if (ftpmoded == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FTP_MODE, (SigMatchCtx *)ftpmoded,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FTP_MODE, (SigMatchCtx *)ftpmoded,
|
||||
g_ftp_mode_buffer_id) == NULL) {
|
||||
DetectFtpModeFree(de_ctx, ftpmoded);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ static int DetectFtpReplyReceivedSetup(DetectEngineCtx *de_ctx, Signature *s, co
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FTP_REPLY_RECEIVED, (SigMatchCtx *)frrd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FTP_REPLY_RECEIVED, (SigMatchCtx *)frrd,
|
||||
g_ftp_reply_received_buffer_id) == NULL) {
|
||||
DetectFtpReplyReceivedFree(de_ctx, frrd);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,8 @@ int DetectFtpbounceSetup(DetectEngineCtx *de_ctx, Signature *s, const char *ftpb
|
|||
* with a flow flag set lookup in the Match function.
|
||||
*/
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FTPBOUNCE, NULL, g_ftp_request_list_id) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FTPBOUNCE, NULL, g_ftp_request_list_id) ==
|
||||
NULL) {
|
||||
return -1;
|
||||
}
|
||||
SCReturnInt(0);
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ static int DetectFtpdataSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
if (ftpcommandd == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FTPDATA, (SigMatchCtx *)ftpcommandd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_FTPDATA, (SigMatchCtx *)ftpcommandd,
|
||||
g_ftpdata_buffer_id) == NULL) {
|
||||
DetectFtpdataFree(de_ctx, ftpcommandd);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ static int DetectGeoipSetup(DetectEngineCtx *de_ctx, Signature *s, const char *o
|
|||
|
||||
/* Get this into a SigMatch and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_GEOIP, (SigMatchCtx *)geoipdata, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ int DetectHostbitSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawst
|
|||
case DETECT_XBITS_CMD_ISNOTSET:
|
||||
case DETECT_XBITS_CMD_ISSET:
|
||||
/* checks, so packet list */
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_HOSTBITS, (SigMatchCtx *)cd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_HOSTBITS, (SigMatchCtx *)cd,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -423,7 +423,7 @@ int DetectHostbitSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawst
|
|||
case DETECT_XBITS_CMD_UNSET:
|
||||
case DETECT_XBITS_CMD_TOGGLE:
|
||||
/* modifiers, only run when entire sig has matched */
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_HOSTBITS, (SigMatchCtx *)cd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_HOSTBITS, (SigMatchCtx *)cd,
|
||||
DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ static int DetectHTTP2frametypeSetup (DetectEngineCtx *de_ctx, Signature *s, con
|
|||
return -1;
|
||||
*http2ft = frame_type;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_FRAMETYPE, (SigMatchCtx *)http2ft,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_FRAMETYPE, (SigMatchCtx *)http2ft,
|
||||
g_http2_match_buffer_id) == NULL) {
|
||||
DetectHTTP2frametypeFree(NULL, http2ft);
|
||||
return -1;
|
||||
|
|
@ -332,7 +332,7 @@ static int DetectHTTP2errorcodeSetup (DetectEngineCtx *de_ctx, Signature *s, con
|
|||
return -1;
|
||||
*http2ec = error_code;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_ERRORCODE, (SigMatchCtx *)http2ec,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_ERRORCODE, (SigMatchCtx *)http2ec,
|
||||
g_http2_match_buffer_id) == NULL) {
|
||||
DetectHTTP2errorcodeFree(NULL, http2ec);
|
||||
return -1;
|
||||
|
|
@ -394,7 +394,7 @@ static int DetectHTTP2prioritySetup (DetectEngineCtx *de_ctx, Signature *s, cons
|
|||
if (prio == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_PRIORITY, (SigMatchCtx *)prio,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_PRIORITY, (SigMatchCtx *)prio,
|
||||
g_http2_match_buffer_id) == NULL) {
|
||||
SCDetectU8Free(prio);
|
||||
return -1;
|
||||
|
|
@ -456,7 +456,7 @@ static int DetectHTTP2windowSetup (DetectEngineCtx *de_ctx, Signature *s, const
|
|||
if (wu == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_WINDOW, (SigMatchCtx *)wu,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_WINDOW, (SigMatchCtx *)wu,
|
||||
g_http2_match_buffer_id) == NULL) {
|
||||
SCDetectU32Free(wu);
|
||||
return -1;
|
||||
|
|
@ -508,7 +508,7 @@ static int DetectHTTP2sizeUpdateSetup (DetectEngineCtx *de_ctx, Signature *s, co
|
|||
if (su == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_SIZEUPDATE, (SigMatchCtx *)su,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_SIZEUPDATE, (SigMatchCtx *)su,
|
||||
g_http2_match_buffer_id) == NULL) {
|
||||
DetectHTTP2settingsFree(NULL, su);
|
||||
return -1;
|
||||
|
|
@ -560,7 +560,7 @@ static int DetectHTTP2settingsSetup (DetectEngineCtx *de_ctx, Signature *s, cons
|
|||
if (http2set == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_SETTINGS, (SigMatchCtx *)http2set,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_HTTP2_SETTINGS, (SigMatchCtx *)http2set,
|
||||
g_http2_match_buffer_id) == NULL) {
|
||||
DetectHTTP2settingsFree(NULL, http2set);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ static int DetectIcmpIdSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
iid = DetectIcmpIdParse(de_ctx, icmpidstr);
|
||||
if (iid == NULL) goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ICMP_ID, (SigMatchCtx *)iid, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ static int DetectIcmpSeqSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
iseq = DetectIcmpSeqParse(de_ctx, icmpseqstr);
|
||||
if (iseq == NULL) goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ICMP_SEQ, (SigMatchCtx *)iseq, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ static int DetectICMPv6mtuSetup (DetectEngineCtx *de_ctx, Signature *s, const ch
|
|||
if (icmpv6mtud == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ICMPV6MTU, (SigMatchCtx *)icmpv6mtud,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_ICMPV6MTU, (SigMatchCtx *)icmpv6mtud,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectICMPv6mtuFree(de_ctx, icmpv6mtud);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -123,8 +123,8 @@ static int DetectICodeSetup(DetectEngineCtx *de_ctx, Signature *s, const char *i
|
|||
if (icd == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ICODE, (SigMatchCtx *)icd, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ICODE, (SigMatchCtx *)icd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
SCDetectU8Free(icd);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ int DetectIdSetup (DetectEngineCtx *de_ctx, Signature *s, const char *idstr)
|
|||
|
||||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ID, (SigMatchCtx *)id_d, DETECT_SM_LIST_MATCH) ==
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_ID, (SigMatchCtx *)id_d, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
DetectIdFree(de_ctx, id_d);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ static int DetectIkeChosenSaSetup(DetectEngineCtx *de_ctx, Signature *s, const c
|
|||
/* okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_IKE_CHOSEN_SA, (SigMatchCtx *)dd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_IKE_CHOSEN_SA, (SigMatchCtx *)dd,
|
||||
g_ike_chosen_sa_buffer_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ static int DetectIkeExchTypeSetup(DetectEngineCtx *de_ctx, Signature *s, const c
|
|||
/* okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_IKE_EXCH_TYPE, (SigMatchCtx *)ike_exch_type,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_IKE_EXCH_TYPE, (SigMatchCtx *)ike_exch_type,
|
||||
g_ike_exch_type_buffer_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ static int DetectIkeKeyExchangePayloadLengthSetup(
|
|||
/* okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_IKE_KEY_EXCHANGE_PAYLOAD_LENGTH,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_IKE_KEY_EXCHANGE_PAYLOAD_LENGTH,
|
||||
(SigMatchCtx *)key_exchange_payload_length,
|
||||
g_ike_key_exch_payload_length_buffer_id) == NULL) {
|
||||
goto error;
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ static int DetectIkeNoncePayloadLengthSetup(
|
|||
/* okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_IKE_NONCE_PAYLOAD_LENGTH,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_IKE_NONCE_PAYLOAD_LENGTH,
|
||||
(SigMatchCtx *)nonce_payload_length,
|
||||
g_ike_nonce_payload_length_buffer_id) == NULL) {
|
||||
goto error;
|
||||
|
|
|
|||
|
|
@ -222,8 +222,8 @@ static int DetectIpOptsSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
if (de == NULL)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_IPOPTS, (SigMatchCtx *)de, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_IPOPTS, (SigMatchCtx *)de, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
s->flags |= SIG_FLAG_REQUIRE_PACKET;
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
break;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_IPPROTO, (SigMatchCtx *)data, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,8 +268,8 @@ int DetectIPRepSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
|
|||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_IPREP, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_IPREP, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,8 +107,8 @@ static int DetectAbsentSetup(DetectEngineCtx *de_ctx, Signature *s, const char *
|
|||
|
||||
dad->or_else = or_else;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ABSENT, (SigMatchCtx *)dad, s->init_data->list) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ABSENT, (SigMatchCtx *)dad, s->init_data->list) == NULL) {
|
||||
DetectAbsentFree(de_ctx, dad);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -372,7 +372,8 @@ int DetectIsdataatSetup (DetectEngineCtx *de_ctx, Signature *s, const char *isda
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ISDATAAT, (SigMatchCtx *)idad, sm_list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_ISDATAAT, (SigMatchCtx *)idad, sm_list) ==
|
||||
NULL) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ static int DetectITypeSetup(DetectEngineCtx *de_ctx, Signature *s, const char *i
|
|||
if (itd == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ITYPE, (SigMatchCtx *)itd, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ITYPE, (SigMatchCtx *)itd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectITypeFree(de_ctx, itd);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static int DetectKrb5ErrCodeSetup (DetectEngineCtx *de_ctx, Signature *s, const
|
|||
if (krb5d == NULL)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_KRB5_ERRCODE, (SigMatchCtx *)krb5d,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_KRB5_ERRCODE, (SigMatchCtx *)krb5d,
|
||||
g_krb5_err_code_list_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ static int DetectKrb5MsgTypeSetup (DetectEngineCtx *de_ctx, Signature *s, const
|
|||
if (krb5d == NULL)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_KRB5_MSGTYPE, (SigMatchCtx *)krb5d,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_KRB5_MSGTYPE, (SigMatchCtx *)krb5d,
|
||||
g_krb5_msg_type_list_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static int DetectKrb5TicketEncryptionSetup(
|
|||
if (krb5d == NULL)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_KRB5_TICKET_ENCRYPTION, (SigMatchCtx *)krb5d,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_KRB5_TICKET_ENCRYPTION, (SigMatchCtx *)krb5d,
|
||||
g_krb5_ticket_encryption_list_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -788,7 +788,7 @@ static int DetectLuaSetup (DetectEngineCtx *de_ctx, Signature *s, const char *st
|
|||
}
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_LUA, (SigMatchCtx *)lua, list) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_LUA, (SigMatchCtx *)lua, list) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ static int DetectMarkSetup (DetectEngineCtx *de_ctx, Signature *s, const char *r
|
|||
|
||||
/* Append it to the list of post match, so the mark is set if the
|
||||
* full signature matches. */
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_MARK, (SigMatchCtx *)data, DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
DetectMarkDataFree(de_ctx, data);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ static int DetectModbusSetup(DetectEngineCtx *de_ctx, Signature *s, const char *
|
|||
}
|
||||
|
||||
/* Okay so far so good, lets get this into a SigMatch and put it in the Signature. */
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_MODBUS, (SigMatchCtx *)modbus, g_modbus_buffer_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ static int DetectNfsProcedureSetup (DetectEngineCtx *de_ctx, Signature *s,
|
|||
* and put it in the Signature. */
|
||||
|
||||
SCLogDebug("low %u hi %u", dd->arg1, dd->arg2);
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_NFS_PROCEDURE, (SigMatchCtx *)dd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_NFS_PROCEDURE, (SigMatchCtx *)dd,
|
||||
g_nfs_request_buffer_id) == NULL) {
|
||||
DetectNfsProcedureFree(de_ctx, dd);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ static int DetectNfsVersionSetup (DetectEngineCtx *de_ctx, Signature *s,
|
|||
* and put it in the Signature. */
|
||||
|
||||
SCLogDebug("low %u hi %u", dd->arg1, dd->arg2);
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_NFS_VERSION, (SigMatchCtx *)dd,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_NFS_VERSION, (SigMatchCtx *)dd,
|
||||
g_nfs_request_buffer_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ void SigTableApplyStrictCommandLineOption(const char *str)
|
|||
* \param new The sig match to append.
|
||||
* \param list The list to append to.
|
||||
*/
|
||||
SigMatch *SigMatchAppendSMToList(
|
||||
SigMatch *SCSigMatchAppendSMToList(
|
||||
DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
|
||||
{
|
||||
SigMatch *new = SigMatchAlloc();
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ void SigParseRegisterTests(void);
|
|||
Signature *DetectEngineAppendSig(DetectEngineCtx *, const char *);
|
||||
Signature *DetectFirewallRuleAppendNew(DetectEngineCtx *, const char *);
|
||||
|
||||
SigMatch *SigMatchAppendSMToList(DetectEngineCtx *, Signature *, uint16_t, SigMatchCtx *, int);
|
||||
SigMatch *SCSigMatchAppendSMToList(DetectEngineCtx *, Signature *, uint16_t, SigMatchCtx *, int);
|
||||
void SigMatchRemoveSMFromList(Signature *, SigMatch *, int);
|
||||
int SigMatchListSMBelongsTo(const Signature *, const SigMatch *);
|
||||
|
||||
|
|
|
|||
|
|
@ -915,7 +915,7 @@ static int DetectPcreSetup (DetectEngineCtx *de_ctx, Signature *s, const char *r
|
|||
if (sm_list == -1)
|
||||
goto error;
|
||||
|
||||
SigMatch *sm = SigMatchAppendSMToList(de_ctx, s, DETECT_PCRE, (SigMatchCtx *)pd, sm_list);
|
||||
SigMatch *sm = SCSigMatchAppendSMToList(de_ctx, s, DETECT_PCRE, (SigMatchCtx *)pd, sm_list);
|
||||
if (sm == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,8 +152,8 @@ static int DetectPktvarSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
|
||||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_PKTVAR, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_PKTVAR, (SigMatchCtx *)cd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,8 @@ int DetectReplaceSetup(DetectEngineCtx *de_ctx, Signature *s, const char *replac
|
|||
SCFree(content);
|
||||
content = NULL;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_REPLACE, NULL, DETECT_SM_LIST_POSTMATCH) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_REPLACE, NULL, DETECT_SM_LIST_POSTMATCH) ==
|
||||
NULL) {
|
||||
goto error;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ int DetectRpcSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rpcstr)
|
|||
rd = DetectRpcParse(de_ctx, rpcstr);
|
||||
if (rd == NULL) goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_RPC, (SigMatchCtx *)rd, DETECT_SM_LIST_MATCH) ==
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_RPC, (SigMatchCtx *)rd, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ static int DetectSameipSetup(DetectEngineCtx *de_ctx, Signature *s, const char *
|
|||
|
||||
/* Get this into a SigMatch and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_SAMEIP, NULL, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_SAMEIP, NULL, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
s->flags |= SIG_FLAG_REQUIRE_PACKET;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ static int DetectSmbVersionSetup(DetectEngineCtx *de_ctx, Signature *s, const ch
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_SMB_VERSION, (SigMatchCtx *)dod, g_smb_version_list_id) == NULL) {
|
||||
DetectSmbVersionFree(de_ctx, dod);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ static int DetectSslStateSetup(DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
if (ssd == NULL)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_SSL_STATE, (SigMatchCtx *)ssd, g_tls_generic_list_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ static int DetectSslVersionSetup (DetectEngineCtx *de_ctx, Signature *s, const c
|
|||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_SSL_VERSION, (SigMatchCtx *)ssl, g_tls_generic_list_id) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ static int DetectStreamSizeSetup (DetectEngineCtx *de_ctx, Signature *s, const c
|
|||
if (sd == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_STREAM_SIZE, (SigMatchCtx *)sd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectStreamSizeFree(de_ctx, sd);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ int DetectTagSetup(DetectEngineCtx *de_ctx, Signature *s, const char *tagstr)
|
|||
return -1;
|
||||
|
||||
/* Append it to the list of tags */
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_TAG, (SigMatchCtx *)td, DETECT_SM_LIST_TMATCH) ==
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_TAG, (SigMatchCtx *)td, DETECT_SM_LIST_TMATCH) ==
|
||||
NULL) {
|
||||
DetectTagDataFree(de_ctx, td);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ static int DetectAckSetup(DetectEngineCtx *de_ctx, Signature *s, const char *opt
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_ACK, (SigMatchCtx *)data, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_ACK, (SigMatchCtx *)data, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
s->flags |= SIG_FLAG_REQUIRE_PACKET;
|
||||
|
|
|
|||
|
|
@ -488,8 +488,8 @@ static int DetectFlagsSetup (DetectEngineCtx *de_ctx, Signature *s, const char *
|
|||
if (de == NULL)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_FLAGS, (SigMatchCtx *)de, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_FLAGS, (SigMatchCtx *)de, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
s->flags |= SIG_FLAG_REQUIRE_PACKET;
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ static int DetectSeqSetup (DetectEngineCtx *de_ctx, Signature *s, const char *op
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_SEQ, (SigMatchCtx *)data, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_SEQ, (SigMatchCtx *)data, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
s->flags |= SIG_FLAG_REQUIRE_PACKET;
|
||||
|
|
|
|||
|
|
@ -190,8 +190,8 @@ static int DetectWindowSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
/* Okay so far so good, lets get this into a SigMatch
|
||||
* and put it in the Signature. */
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_WINDOW, (SigMatchCtx *)wd, DETECT_SM_LIST_MATCH) ==
|
||||
NULL) {
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_WINDOW, (SigMatchCtx *)wd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
s->flags |= SIG_FLAG_REQUIRE_PACKET;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ static int DetectTcpmssSetup (DetectEngineCtx *de_ctx, Signature *s, const char
|
|||
if (tcpmssd == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_TCPMSS, (SigMatchCtx *)tcpmssd, DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectTcpmssFree(de_ctx, tcpmssd);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ static int DetectTemplateSetup (DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (templated == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_TEMPLATE, (SigMatchCtx *)templated,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_TEMPLATE, (SigMatchCtx *)templated,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectTemplateFree(de_ctx, templated);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ static int DetectTemplate2Setup (DetectEngineCtx *de_ctx, Signature *s, const ch
|
|||
if (template2d == NULL)
|
||||
return -1;
|
||||
|
||||
if (SigMatchAppendSMToList(de_ctx, s, DETECT_TEMPLATE2, (SigMatchCtx *)template2d,
|
||||
if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_TEMPLATE2, (SigMatchCtx *)template2d,
|
||||
DETECT_SM_LIST_MATCH) == NULL) {
|
||||
DetectTemplate2Free(de_ctx, template2d);
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ static int DetectThresholdSetup(DetectEngineCtx *de_ctx, Signature *s, const cha
|
|||
if (de == NULL)
|
||||
goto error;
|
||||
|
||||
if (SigMatchAppendSMToList(
|
||||
if (SCSigMatchAppendSMToList(
|
||||
de_ctx, s, DETECT_THRESHOLD, (SigMatchCtx *)de, DETECT_SM_LIST_THRESHOLD) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue