diff --git a/plugins/ndpi/ndpi.c b/plugins/ndpi/ndpi.c index df558ab4ec..2a6024061a 100644 --- a/plugins/ndpi/ndpi.c +++ b/plugins/ndpi/ndpi.c @@ -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; } diff --git a/qa/coccinelle/siginit.cocci b/qa/coccinelle/siginit.cocci index 2bfcbd678f..fe5f14ff46 100644 --- a/qa/coccinelle/siginit.cocci +++ b/qa/coccinelle/siginit.cocci @@ -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 && ...) { ... diff --git a/rust/src/detect/mod.rs b/rust/src/detect/mod.rs index 48460d8b47..2c5888c942 100644 --- a/rust/src/detect/mod.rs +++ b/rust/src/detect/mod.rs @@ -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 diff --git a/rust/src/dhcp/detect.rs b/rust/src/dhcp/detect.rs index 70501e2304..9507e1c747 100644 --- a/rust/src/dhcp/detect.rs +++ b/rust/src/dhcp/detect.rs @@ -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 { @@ -41,11 +40,11 @@ fn dhcp_tx_get_time(tx: &DHCPTransaction, code: u8) -> Option { 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() diff --git a/rust/src/dns/detect.rs b/rust/src/dns/detect.rs index 4359bb44ad..6495931704 100644 --- a/rust/src/dns/detect.rs +++ b/rust/src/dns/detect.rs @@ -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; } diff --git a/rust/src/enip/detect.rs b/rust/src/enip/detect.rs index 838d95217a..bac624b5ff 100644 --- a/rust/src/enip/detect.rs +++ b/rust/src/enip/detect.rs @@ -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() diff --git a/rust/src/ldap/detect.rs b/rust/src/ldap/detect.rs index 99cef0bbd6..8942e573f2 100644 --- a/rust/src/ldap/detect.rs +++ b/rust/src/ldap/detect.rs @@ -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() diff --git a/rust/src/mqtt/detect.rs b/rust/src/mqtt/detect.rs index 143815bbc4..97d75cc4c0 100644 --- a/rust/src/mqtt/detect.rs +++ b/rust/src/mqtt/detect.rs @@ -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() diff --git a/rust/src/rfb/detect.rs b/rust/src/rfb/detect.rs index 09264afe97..087ddca333 100644 --- a/rust/src/rfb/detect.rs +++ b/rust/src/rfb/detect.rs @@ -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() diff --git a/rust/src/snmp/detect.rs b/rust/src/snmp/detect.rs index 11ddb02f53..15012d6551 100644 --- a/rust/src/snmp/detect.rs +++ b/rust/src/snmp/detect.rs @@ -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; diff --git a/rust/src/websocket/detect.rs b/rust/src/websocket/detect.rs index 124b80424b..1c607df8fe 100644 --- a/rust/src/websocket/detect.rs +++ b/rust/src/websocket/detect.rs @@ -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() diff --git a/rust/sys/src/sys.rs b/rust/sys/src/sys.rs index 4b637f8e4e..74a29339e8 100644 --- a/rust/sys/src/sys.rs +++ b/rust/sys/src/sys.rs @@ -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, diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index 9ec7c004d1..88db53fa50 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -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; } diff --git a/src/detect-app-layer-protocol.c b/src/detect-app-layer-protocol.c index 071a3ee939..46c8254960 100644 --- a/src/detect-app-layer-protocol.c +++ b/src/detect-app-layer-protocol.c @@ -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; } diff --git a/src/detect-app-layer-state.c b/src/detect-app-layer-state.c index fc3c73e715..6ec8d013cd 100644 --- a/src/detect-app-layer-state.c +++ b/src/detect-app-layer-state.c @@ -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; diff --git a/src/detect-asn1.c b/src/detect-asn1.c index 63d40d6219..f0f160748c 100644 --- a/src/detect-asn1.c +++ b/src/detect-asn1.c @@ -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; } diff --git a/src/detect-base64-decode.c b/src/detect-base64-decode.c index 35d79c9004..6381babeb2 100644 --- a/src/detect-base64-decode.c +++ b/src/detect-base64-decode.c @@ -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; } diff --git a/src/detect-bsize.c b/src/detect-bsize.c index fba8c896e7..0c61034528 100644 --- a/src/detect-bsize.c +++ b/src/detect-bsize.c @@ -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; } diff --git a/src/detect-bypass.c b/src/detect-bypass.c index 4dbff3ab28..44af06cd63 100644 --- a/src/detect-bypass.c +++ b/src/detect-bypass.c @@ -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; } diff --git a/src/detect-byte-extract.c b/src/detect-byte-extract.c index 5e10b4cbb4..82f79f2556 100644 --- a/src/detect-byte-extract.c +++ b/src/detect-byte-extract.c @@ -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; } diff --git a/src/detect-bytejump.c b/src/detect-bytejump.c index 75342dde39..0efdc44999 100644 --- a/src/detect-bytejump.c +++ b/src/detect-bytejump.c @@ -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; } diff --git a/src/detect-bytemath.c b/src/detect-bytemath.c index 686448b66b..140cbb8510 100644 --- a/src/detect-bytemath.c +++ b/src/detect-bytemath.c @@ -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; } diff --git a/src/detect-bytetest.c b/src/detect-bytetest.c index dbc3ed1a59..faf4804373 100644 --- a/src/detect-bytetest.c +++ b/src/detect-bytetest.c @@ -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; } diff --git a/src/detect-config.c b/src/detect-config.c index c1f0e10340..64be0ae456 100644 --- a/src/detect-config.c +++ b/src/detect-config.c @@ -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; } diff --git a/src/detect-content.c b/src/detect-content.c index 43529a3cb6..7073a640f1 100644 --- a/src/detect-content.c +++ b/src/detect-content.c @@ -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; } diff --git a/src/detect-csum.c b/src/detect-csum.c index 3a2c372641..0ec38af06b 100644 --- a/src/detect-csum.c +++ b/src/detect-csum.c @@ -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; } diff --git a/src/detect-datarep.c b/src/detect-datarep.c index a5e3540701..8dd05fd574 100644 --- a/src/detect-datarep.c +++ b/src/detect-datarep.c @@ -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; diff --git a/src/detect-dataset.c b/src/detect-dataset.c index 4efa2dce74..5d9a932bda 100644 --- a/src/detect-dataset.c +++ b/src/detect-dataset.c @@ -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; diff --git a/src/detect-dce-iface.c b/src/detect-dce-iface.c index 9c97d76d6f..4639f9f5d4 100644 --- a/src/detect-dce-iface.c +++ b/src/detect-dce-iface.c @@ -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; } diff --git a/src/detect-dce-opnum.c b/src/detect-dce-opnum.c index d5e69c7bab..1e73c9de7c 100644 --- a/src/detect-dce-opnum.c +++ b/src/detect-dce-opnum.c @@ -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; diff --git a/src/detect-detection-filter.c b/src/detect-detection-filter.c index dbc73dd59a..47cbfeb95f 100644 --- a/src/detect-detection-filter.c +++ b/src/detect-detection-filter.c @@ -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; } diff --git a/src/detect-dnp3.c b/src/detect-dnp3.c index ab48a762b1..ca481dc75f 100644 --- a/src/detect-dnp3.c +++ b/src/detect-dnp3.c @@ -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; } diff --git a/src/detect-dsize.c b/src/detect-dsize.c index 1462ccc05b..ec6cf1c01a 100644 --- a/src/detect-dsize.c +++ b/src/detect-dsize.c @@ -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); diff --git a/src/detect-engine-event.c b/src/detect-engine-event.c index 1144d7a3cc..a50a6790a8 100644 --- a/src/detect-engine-event.c +++ b/src/detect-engine-event.c @@ -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; diff --git a/src/detect-engine-helper.c b/src/detect-engine-helper.c index 025aeba04f..29b3b86a38 100644 --- a/src/detect-engine-helper.c +++ b/src/detect-engine-helper.c @@ -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; } diff --git a/src/detect-engine-helper.h b/src/detect-engine-helper.h index 30abe6e22c..72034fd7b8 100644 --- a/src/detect-engine-helper.h +++ b/src/detect-engine-helper.h @@ -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, diff --git a/src/detect-engine-register.c b/src/detect-engine-register.c index 58370a6dfa..741baffdc4 100644 --- a/src/detect-engine-register.c +++ b/src/detect-engine-register.c @@ -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; } diff --git a/src/detect-engine-register.h b/src/detect-engine-register.h index d2f459f946..bd37e46eca 100644 --- a/src/detect-engine-register.h +++ b/src/detect-engine-register.h @@ -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 */ diff --git a/src/detect-entropy.c b/src/detect-entropy.c index 34a7e8b80b..4b21a7ac0b 100644 --- a/src/detect-entropy.c +++ b/src/detect-entropy.c @@ -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); } diff --git a/src/detect-file-hash-common.c b/src/detect-file-hash-common.c index f81ce4be29..15f94ee6bd 100644 --- a/src/detect-file-hash-common.c +++ b/src/detect-file-hash-common.c @@ -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; } diff --git a/src/detect-filesize.c b/src/detect-filesize.c index 8128b2f634..1d866bbb23 100644 --- a/src/detect-filesize.c +++ b/src/detect-filesize.c @@ -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); diff --git a/src/detect-filestore.c b/src/detect-filestore.c index d281bbf2a1..fcfa19fb71 100644 --- a/src/detect-filestore.c +++ b/src/detect-filestore.c @@ -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; } diff --git a/src/detect-flow-age.c b/src/detect-flow-age.c index 665b081a3b..255364f1d7 100644 --- a/src/detect-flow-age.c +++ b/src/detect-flow-age.c @@ -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; diff --git a/src/detect-flow-pkts.c b/src/detect-flow-pkts.c index d223c1c5b3..b7cf3ae34d 100644 --- a/src/detect-flow-pkts.c +++ b/src/detect-flow-pkts.c @@ -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; diff --git a/src/detect-flow.c b/src/detect-flow.c index 1e5fdb0ca4..2a0ef1c9c2 100644 --- a/src/detect-flow.c +++ b/src/detect-flow.c @@ -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; } diff --git a/src/detect-flowbits.c b/src/detect-flowbits.c index 9b1152d886..49b7d13735 100644 --- a/src/detect-flowbits.c +++ b/src/detect-flowbits.c @@ -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; } diff --git a/src/detect-flowint.c b/src/detect-flowint.c index bba378adbf..758f79f0d8 100644 --- a/src/detect-flowint.c +++ b/src/detect-flowint.c @@ -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; } diff --git a/src/detect-flowvar.c b/src/detect-flowvar.c index f8af531d06..a3e8279cf0 100644 --- a/src/detect-flowvar.c +++ b/src/detect-flowvar.c @@ -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; } diff --git a/src/detect-fragbits.c b/src/detect-fragbits.c index 50112224c6..60c82a1d0a 100644 --- a/src/detect-fragbits.c +++ b/src/detect-fragbits.c @@ -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; } diff --git a/src/detect-fragoffset.c b/src/detect-fragoffset.c index ac2482cd75..f8c9e4dc28 100644 --- a/src/detect-fragoffset.c +++ b/src/detect-fragoffset.c @@ -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; } diff --git a/src/detect-ftp-dynamic-port.c b/src/detect-ftp-dynamic-port.c index f033351374..e13a36ccad 100644 --- a/src/detect-ftp-dynamic-port.c +++ b/src/detect-ftp-dynamic-port.c @@ -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; diff --git a/src/detect-ftp-mode.c b/src/detect-ftp-mode.c index 9e7eab67e7..1359c9482d 100644 --- a/src/detect-ftp-mode.c +++ b/src/detect-ftp-mode.c @@ -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; diff --git a/src/detect-ftp-reply-received.c b/src/detect-ftp-reply-received.c index 5f4738eeeb..145f82439b 100644 --- a/src/detect-ftp-reply-received.c +++ b/src/detect-ftp-reply-received.c @@ -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; diff --git a/src/detect-ftpbounce.c b/src/detect-ftpbounce.c index 515953cf2c..63eb9b4140 100644 --- a/src/detect-ftpbounce.c +++ b/src/detect-ftpbounce.c @@ -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); diff --git a/src/detect-ftpdata.c b/src/detect-ftpdata.c index d68db7c173..1fc4944eb1 100644 --- a/src/detect-ftpdata.c +++ b/src/detect-ftpdata.c @@ -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; diff --git a/src/detect-geoip.c b/src/detect-geoip.c index 63593fde3a..a48b505527 100644 --- a/src/detect-geoip.c +++ b/src/detect-geoip.c @@ -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; } diff --git a/src/detect-hostbits.c b/src/detect-hostbits.c index 5fb050f301..b43d519f0c 100644 --- a/src/detect-hostbits.c +++ b/src/detect-hostbits.c @@ -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; } diff --git a/src/detect-http2.c b/src/detect-http2.c index 04dcc016d8..ea65d9131c 100644 --- a/src/detect-http2.c +++ b/src/detect-http2.c @@ -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; diff --git a/src/detect-icmp-id.c b/src/detect-icmp-id.c index f29cc0f747..3b9aa755bf 100644 --- a/src/detect-icmp-id.c +++ b/src/detect-icmp-id.c @@ -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; } diff --git a/src/detect-icmp-seq.c b/src/detect-icmp-seq.c index bb0831c650..c4ee2f1a9a 100644 --- a/src/detect-icmp-seq.c +++ b/src/detect-icmp-seq.c @@ -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; } diff --git a/src/detect-icmpv6-mtu.c b/src/detect-icmpv6-mtu.c index 864efee515..34beb50b50 100644 --- a/src/detect-icmpv6-mtu.c +++ b/src/detect-icmpv6-mtu.c @@ -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; diff --git a/src/detect-icode.c b/src/detect-icode.c index 494bec4fa7..0149e546c2 100644 --- a/src/detect-icode.c +++ b/src/detect-icode.c @@ -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; } diff --git a/src/detect-id.c b/src/detect-id.c index 8a10195727..bd2525901b 100644 --- a/src/detect-id.c +++ b/src/detect-id.c @@ -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; diff --git a/src/detect-ike-chosen-sa.c b/src/detect-ike-chosen-sa.c index 6c426cc8dc..40e6a798ed 100644 --- a/src/detect-ike-chosen-sa.c +++ b/src/detect-ike-chosen-sa.c @@ -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; } diff --git a/src/detect-ike-exch-type.c b/src/detect-ike-exch-type.c index 0dc5973cd4..de53414ea1 100644 --- a/src/detect-ike-exch-type.c +++ b/src/detect-ike-exch-type.c @@ -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; } diff --git a/src/detect-ike-key-exchange-payload-length.c b/src/detect-ike-key-exchange-payload-length.c index 96922e390a..e918cd3bdb 100644 --- a/src/detect-ike-key-exchange-payload-length.c +++ b/src/detect-ike-key-exchange-payload-length.c @@ -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; diff --git a/src/detect-ike-nonce-payload-length.c b/src/detect-ike-nonce-payload-length.c index b86b47e9e0..09a5f7b3dd 100644 --- a/src/detect-ike-nonce-payload-length.c +++ b/src/detect-ike-nonce-payload-length.c @@ -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; diff --git a/src/detect-ipopts.c b/src/detect-ipopts.c index 5e807d3933..27e2ddf612 100644 --- a/src/detect-ipopts.c +++ b/src/detect-ipopts.c @@ -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; diff --git a/src/detect-ipproto.c b/src/detect-ipproto.c index 08f3b405f2..8c30c17b23 100644 --- a/src/detect-ipproto.c +++ b/src/detect-ipproto.c @@ -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; } diff --git a/src/detect-iprep.c b/src/detect-iprep.c index d4ba6ced55..ff4ca771d6 100644 --- a/src/detect-iprep.c +++ b/src/detect-iprep.c @@ -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; } diff --git a/src/detect-isdataat.c b/src/detect-isdataat.c index b12d055df3..03516ec6f7 100644 --- a/src/detect-isdataat.c +++ b/src/detect-isdataat.c @@ -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; } diff --git a/src/detect-itype.c b/src/detect-itype.c index 201c36ca6c..b7372cbcb8 100644 --- a/src/detect-itype.c +++ b/src/detect-itype.c @@ -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; } diff --git a/src/detect-krb5-errcode.c b/src/detect-krb5-errcode.c index 08dc01880f..613746da4e 100644 --- a/src/detect-krb5-errcode.c +++ b/src/detect-krb5-errcode.c @@ -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; } diff --git a/src/detect-krb5-msgtype.c b/src/detect-krb5-msgtype.c index 5e317d6571..ab83a6b5be 100644 --- a/src/detect-krb5-msgtype.c +++ b/src/detect-krb5-msgtype.c @@ -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; } diff --git a/src/detect-krb5-ticket-encryption.c b/src/detect-krb5-ticket-encryption.c index c65826bdcd..b4514a0483 100644 --- a/src/detect-krb5-ticket-encryption.c +++ b/src/detect-krb5-ticket-encryption.c @@ -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; } diff --git a/src/detect-lua.c b/src/detect-lua.c index 2c5ae176fe..ac2b6dc3f3 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -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; } diff --git a/src/detect-mark.c b/src/detect-mark.c index cccdefe8fd..985865cedd 100644 --- a/src/detect-mark.c +++ b/src/detect-mark.c @@ -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; diff --git a/src/detect-modbus.c b/src/detect-modbus.c index d11437eab5..866428537b 100644 --- a/src/detect-modbus.c +++ b/src/detect-modbus.c @@ -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; } diff --git a/src/detect-nfs-procedure.c b/src/detect-nfs-procedure.c index f0688c03d1..2d82523f0c 100644 --- a/src/detect-nfs-procedure.c +++ b/src/detect-nfs-procedure.c @@ -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; diff --git a/src/detect-nfs-version.c b/src/detect-nfs-version.c index f46c6ad7dc..c2946f5fee 100644 --- a/src/detect-nfs-version.c +++ b/src/detect-nfs-version.c @@ -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; } diff --git a/src/detect-parse.c b/src/detect-parse.c index bdc678a6fe..c78e5fcd47 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -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(); diff --git a/src/detect-parse.h b/src/detect-parse.h index f739277637..5406972994 100644 --- a/src/detect-parse.h +++ b/src/detect-parse.h @@ -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 *); diff --git a/src/detect-pcre.c b/src/detect-pcre.c index da0eb125e4..ab6fe42c40 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -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; } diff --git a/src/detect-pktvar.c b/src/detect-pktvar.c index 7166188eb2..7b3eb47757 100644 --- a/src/detect-pktvar.c +++ b/src/detect-pktvar.c @@ -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; } diff --git a/src/detect-replace.c b/src/detect-replace.c index 620e9ed935..3f8086c1b5 100644 --- a/src/detect-replace.c +++ b/src/detect-replace.c @@ -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; diff --git a/src/detect-rpc.c b/src/detect-rpc.c index e604e2c99a..c6b01b4fc6 100644 --- a/src/detect-rpc.c +++ b/src/detect-rpc.c @@ -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; } diff --git a/src/detect-sameip.c b/src/detect-sameip.c index 2ed72cf00e..c1a7c0d932 100644 --- a/src/detect-sameip.c +++ b/src/detect-sameip.c @@ -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; diff --git a/src/detect-smb-version.c b/src/detect-smb-version.c index 3909359d89..b014ea7b26 100644 --- a/src/detect-smb-version.c +++ b/src/detect-smb-version.c @@ -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; diff --git a/src/detect-ssl-state.c b/src/detect-ssl-state.c index 715cbd70bf..bdad809511 100644 --- a/src/detect-ssl-state.c +++ b/src/detect-ssl-state.c @@ -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; } diff --git a/src/detect-ssl-version.c b/src/detect-ssl-version.c index 31eb272e23..e9dd93bf93 100644 --- a/src/detect-ssl-version.c +++ b/src/detect-ssl-version.c @@ -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; } diff --git a/src/detect-stream_size.c b/src/detect-stream_size.c index 3343f7b719..cce50c0c08 100644 --- a/src/detect-stream_size.c +++ b/src/detect-stream_size.c @@ -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; diff --git a/src/detect-tag.c b/src/detect-tag.c index 1828b1b701..f49a08aac2 100644 --- a/src/detect-tag.c +++ b/src/detect-tag.c @@ -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; diff --git a/src/detect-tcp-ack.c b/src/detect-tcp-ack.c index d58ac4008a..e702253e77 100644 --- a/src/detect-tcp-ack.c +++ b/src/detect-tcp-ack.c @@ -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; diff --git a/src/detect-tcp-flags.c b/src/detect-tcp-flags.c index 9c3a2260a5..83e12b9a9a 100644 --- a/src/detect-tcp-flags.c +++ b/src/detect-tcp-flags.c @@ -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; diff --git a/src/detect-tcp-seq.c b/src/detect-tcp-seq.c index 660e2717c8..ac120bd861 100644 --- a/src/detect-tcp-seq.c +++ b/src/detect-tcp-seq.c @@ -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; diff --git a/src/detect-tcp-window.c b/src/detect-tcp-window.c index 6adfe487be..2571842ce9 100644 --- a/src/detect-tcp-window.c +++ b/src/detect-tcp-window.c @@ -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; diff --git a/src/detect-tcpmss.c b/src/detect-tcpmss.c index b1b504960d..632f04d2a0 100644 --- a/src/detect-tcpmss.c +++ b/src/detect-tcpmss.c @@ -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; diff --git a/src/detect-template.c b/src/detect-template.c index 980607f0c3..c8c32bdaf3 100644 --- a/src/detect-template.c +++ b/src/detect-template.c @@ -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; diff --git a/src/detect-template2.c b/src/detect-template2.c index 2dbe684f18..746ad0be7a 100644 --- a/src/detect-template2.c +++ b/src/detect-template2.c @@ -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; diff --git a/src/detect-threshold.c b/src/detect-threshold.c index bc590d87ce..f4b381bf2a 100644 --- a/src/detect-threshold.c +++ b/src/detect-threshold.c @@ -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; } diff --git a/src/detect-tls-cert-validity.c b/src/detect-tls-cert-validity.c index 5132e463e9..7b27163862 100644 --- a/src/detect-tls-cert-validity.c +++ b/src/detect-tls-cert-validity.c @@ -431,7 +431,7 @@ static int DetectTlsExpiredSetup (DetectEngineCtx *de_ctx, Signature *s, dd->epoch = 0; dd->epoch2 = 0; - if (SigMatchAppendSMToList(de_ctx, s, DETECT_TLS_EXPIRED, (SigMatchCtx *)dd, + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_TLS_EXPIRED, (SigMatchCtx *)dd, g_tls_validity_buffer_id) == NULL) { goto error; } @@ -476,7 +476,7 @@ static int DetectTlsValidSetup (DetectEngineCtx *de_ctx, Signature *s, dd->epoch = 0; dd->epoch2 = 0; - if (SigMatchAppendSMToList( + if (SCSigMatchAppendSMToList( de_ctx, s, DETECT_TLS_VALID, (SigMatchCtx *)dd, g_tls_validity_buffer_id) == NULL) { goto error; } @@ -565,7 +565,7 @@ static int DetectTlsValiditySetup (DetectEngineCtx *de_ctx, Signature *s, goto error; } - if (SigMatchAppendSMToList(de_ctx, s, DETECT_TLS_NOTAFTER, (SigMatchCtx *)dd, + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_TLS_NOTAFTER, (SigMatchCtx *)dd, g_tls_validity_buffer_id) == NULL) { goto error; } diff --git a/src/detect-tls-certs.c b/src/detect-tls-certs.c index e1ba5dd9bf..8e71a985b0 100644 --- a/src/detect-tls-certs.c +++ b/src/detect-tls-certs.c @@ -226,7 +226,7 @@ static int DetectTLSCertChainLenSetup(DetectEngineCtx *de_ctx, Signature *s, con return -1; } - if (SigMatchAppendSMToList(de_ctx, s, KEYWORD_ID, (SigMatchCtx *)dd, g_tls_cert_buffer_id) == + if (SCSigMatchAppendSMToList(de_ctx, s, KEYWORD_ID, (SigMatchCtx *)dd, g_tls_cert_buffer_id) == NULL) { SCDetectU32Free(dd); return -1; diff --git a/src/detect-tls-version.c b/src/detect-tls-version.c index 9985722e20..7a11249a7a 100644 --- a/src/detect-tls-version.c +++ b/src/detect-tls-version.c @@ -249,7 +249,7 @@ static int DetectTlsVersionSetup (DetectEngineCtx *de_ctx, Signature *s, const c list = s->init_data->hook.sm_list; } - if (SigMatchAppendSMToList(de_ctx, s, DETECT_TLS_VERSION, (SigMatchCtx *)tls, list) == NULL) { + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_TLS_VERSION, (SigMatchCtx *)tls, list) == NULL) { goto error; } diff --git a/src/detect-tls.c b/src/detect-tls.c index 1a5322dd80..d08833e5a0 100644 --- a/src/detect-tls.c +++ b/src/detect-tls.c @@ -311,7 +311,7 @@ static int DetectTlsSubjectSetup (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_TLS_SUBJECT, (SigMatchCtx *)tls, g_tls_cert_list_id) == NULL) { goto error; } @@ -501,7 +501,7 @@ static int DetectTlsIssuerDNSetup (DetectEngineCtx *de_ctx, Signature *s, const /* 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_TLS_ISSUERDN, (SigMatchCtx *)tls, g_tls_cert_list_id) == NULL) { goto error; } @@ -590,7 +590,7 @@ static int DetectTlsStoreSetup (DetectEngineCtx *de_ctx, Signature *s, const cha s->flags |= SIG_FLAG_TLSSTORE; - if (SigMatchAppendSMToList(de_ctx, s, DETECT_TLS_STORE, NULL, DETECT_SM_LIST_POSTMATCH) == + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_TLS_STORE, NULL, DETECT_SM_LIST_POSTMATCH) == NULL) { return -1; } diff --git a/src/detect-tos.c b/src/detect-tos.c index dc43a0e34f..ff920be6d9 100644 --- a/src/detect-tos.c +++ b/src/detect-tos.c @@ -187,8 +187,8 @@ static int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg if (tosd == NULL) return -1; - if (SigMatchAppendSMToList(de_ctx, s, DETECT_TOS, (SigMatchCtx *)tosd, DETECT_SM_LIST_MATCH) == - NULL) { + if (SCSigMatchAppendSMToList( + de_ctx, s, DETECT_TOS, (SigMatchCtx *)tosd, DETECT_SM_LIST_MATCH) == NULL) { DetectTosFree(de_ctx, tosd); return -1; } diff --git a/src/detect-ttl.c b/src/detect-ttl.c index 3190179ee8..f96f3b93d1 100644 --- a/src/detect-ttl.c +++ b/src/detect-ttl.c @@ -115,8 +115,8 @@ static int DetectTtlSetup (DetectEngineCtx *de_ctx, Signature *s, const char *tt if (ttld == NULL) return -1; - if (SigMatchAppendSMToList(de_ctx, s, DETECT_TTL, (SigMatchCtx *)ttld, DETECT_SM_LIST_MATCH) == - NULL) { + if (SCSigMatchAppendSMToList( + de_ctx, s, DETECT_TTL, (SigMatchCtx *)ttld, DETECT_SM_LIST_MATCH) == NULL) { DetectTtlFree(de_ctx, ttld); return -1; } diff --git a/src/detect-urilen.c b/src/detect-urilen.c index 5374db7ee7..5305d35015 100644 --- a/src/detect-urilen.c +++ b/src/detect-urilen.c @@ -111,12 +111,12 @@ static int DetectUrilenSetup (DetectEngineCtx *de_ctx, Signature *s, const char goto error; if (urilend->raw_buffer) { - if (SigMatchAppendSMToList(de_ctx, s, DETECT_URILEN, (SigMatchCtx *)urilend, + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_URILEN, (SigMatchCtx *)urilend, g_http_raw_uri_buffer_id) == NULL) { goto error; } } else { - if (SigMatchAppendSMToList(de_ctx, s, DETECT_URILEN, (SigMatchCtx *)urilend, + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_URILEN, (SigMatchCtx *)urilend, g_http_uri_buffer_id) == NULL) { goto error; } diff --git a/src/detect-vlan.c b/src/detect-vlan.c index d938030eb9..1fba348059 100644 --- a/src/detect-vlan.c +++ b/src/detect-vlan.c @@ -72,7 +72,7 @@ static int DetectVlanIdSetup(DetectEngineCtx *de_ctx, Signature *s, const char * return -1; } - if (SigMatchAppendSMToList( + if (SCSigMatchAppendSMToList( de_ctx, s, DETECT_VLAN_ID, (SigMatchCtx *)vdata, DETECT_SM_LIST_MATCH) == NULL) { DetectVlanIdFree(de_ctx, vdata); return -1; @@ -169,7 +169,7 @@ static int DetectVlanLayersSetup(DetectEngineCtx *de_ctx, Signature *s, const ch return -1; } - if (SigMatchAppendSMToList( + if (SCSigMatchAppendSMToList( de_ctx, s, DETECT_VLAN_LAYERS, (SigMatchCtx *)du8, DETECT_SM_LIST_MATCH) == NULL) { DetectVlanLayersFree(de_ctx, du8); return -1; diff --git a/src/detect-xbits.c b/src/detect-xbits.c index 6bf5e5134b..e1762aed07 100644 --- a/src/detect-xbits.c +++ b/src/detect-xbits.c @@ -430,7 +430,8 @@ int DetectXbitSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr) SCLogDebug("adding match/txmatch"); /* checks, so packet list */ - if (SigMatchAppendSMToList(de_ctx, s, DETECT_XBITS, (SigMatchCtx *)cd, list) == NULL) { + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_XBITS, (SigMatchCtx *)cd, list) == + NULL) { SCFree(cd); return -1; } @@ -441,7 +442,7 @@ int DetectXbitSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr) default: SCLogDebug("adding post-match"); /* modifiers, only run when entire sig has matched */ - if (SigMatchAppendSMToList(de_ctx, s, DETECT_XBITS, (SigMatchCtx *)cd, + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_XBITS, (SigMatchCtx *)cd, DETECT_SM_LIST_POSTMATCH) == NULL) { SCFree(cd); return -1; diff --git a/src/util-threshold-config.c b/src/util-threshold-config.c index 105496b7da..e665d1ca91 100644 --- a/src/util-threshold-config.c +++ b/src/util-threshold-config.c @@ -268,7 +268,7 @@ static int SetupSuppressRule(DetectEngineCtx *de_ctx, uint32_t id, uint32_t gid, if (unlikely(de == NULL)) goto error; - if (SigMatchAppendSMToList(de_ctx, s, DETECT_THRESHOLD, (SigMatchCtx *)de, + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_THRESHOLD, (SigMatchCtx *)de, DETECT_SM_LIST_SUPPRESS) == NULL) { goto error; } @@ -292,7 +292,7 @@ static int SetupSuppressRule(DetectEngineCtx *de_ctx, uint32_t id, uint32_t gid, if (unlikely(de == NULL)) goto error; - if (SigMatchAppendSMToList(de_ctx, s, DETECT_THRESHOLD, (SigMatchCtx *)de, + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_THRESHOLD, (SigMatchCtx *)de, DETECT_SM_LIST_SUPPRESS) == NULL) { goto error; } @@ -318,7 +318,7 @@ static int SetupSuppressRule(DetectEngineCtx *de_ctx, uint32_t id, uint32_t gid, if (unlikely(de == NULL)) goto error; - if (SigMatchAppendSMToList(de_ctx, s, DETECT_THRESHOLD, (SigMatchCtx *)de, + if (SCSigMatchAppendSMToList(de_ctx, s, DETECT_THRESHOLD, (SigMatchCtx *)de, DETECT_SM_LIST_SUPPRESS) == NULL) { goto error; } @@ -397,7 +397,7 @@ static int SetupThresholdRule(DetectEngineCtx *de_ctx, uint32_t id, uint32_t gid if (parsed_type == TYPE_RATE) smtype = DETECT_DETECTION_FILTER; - if (SigMatchAppendSMToList( + if (SCSigMatchAppendSMToList( de_ctx, s, smtype, (SigMatchCtx *)de, DETECT_SM_LIST_THRESHOLD) == NULL) { goto error; } @@ -432,7 +432,7 @@ static int SetupThresholdRule(DetectEngineCtx *de_ctx, uint32_t id, uint32_t gid if (parsed_type == TYPE_RATE) smtype = DETECT_DETECTION_FILTER; - if (SigMatchAppendSMToList(de_ctx, s, smtype, (SigMatchCtx *)de, + if (SCSigMatchAppendSMToList(de_ctx, s, smtype, (SigMatchCtx *)de, DETECT_SM_LIST_THRESHOLD) == NULL) { goto error; } @@ -499,7 +499,7 @@ static int SetupThresholdRule(DetectEngineCtx *de_ctx, uint32_t id, uint32_t gid if (parsed_type == TYPE_RATE) smtype = DETECT_DETECTION_FILTER; - if (SigMatchAppendSMToList( + if (SCSigMatchAppendSMToList( de_ctx, s, smtype, (SigMatchCtx *)de, DETECT_SM_LIST_THRESHOLD) == NULL) { goto error; }