]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: bindgen SCSigMatchAppendSMToList
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 20 May 2025 11:33:10 +0000 (13:33 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 21 May 2025 07:37:22 +0000 (09:37 +0200)
Ticket: 7667

110 files changed:
plugins/ndpi/ndpi.c
qa/coccinelle/siginit.cocci
rust/src/detect/mod.rs
rust/src/dhcp/detect.rs
rust/src/dns/detect.rs
rust/src/enip/detect.rs
rust/src/ldap/detect.rs
rust/src/mqtt/detect.rs
rust/src/rfb/detect.rs
rust/src/snmp/detect.rs
rust/src/websocket/detect.rs
rust/sys/src/sys.rs
src/detect-app-layer-event.c
src/detect-app-layer-protocol.c
src/detect-app-layer-state.c
src/detect-asn1.c
src/detect-base64-decode.c
src/detect-bsize.c
src/detect-bypass.c
src/detect-byte-extract.c
src/detect-bytejump.c
src/detect-bytemath.c
src/detect-bytetest.c
src/detect-config.c
src/detect-content.c
src/detect-csum.c
src/detect-datarep.c
src/detect-dataset.c
src/detect-dce-iface.c
src/detect-dce-opnum.c
src/detect-detection-filter.c
src/detect-dnp3.c
src/detect-dsize.c
src/detect-engine-event.c
src/detect-engine-helper.c
src/detect-engine-helper.h
src/detect-engine-register.c
src/detect-engine-register.h
src/detect-entropy.c
src/detect-file-hash-common.c
src/detect-filesize.c
src/detect-filestore.c
src/detect-flow-age.c
src/detect-flow-pkts.c
src/detect-flow.c
src/detect-flowbits.c
src/detect-flowint.c
src/detect-flowvar.c
src/detect-fragbits.c
src/detect-fragoffset.c
src/detect-ftp-dynamic-port.c
src/detect-ftp-mode.c
src/detect-ftp-reply-received.c
src/detect-ftpbounce.c
src/detect-ftpdata.c
src/detect-geoip.c
src/detect-hostbits.c
src/detect-http2.c
src/detect-icmp-id.c
src/detect-icmp-seq.c
src/detect-icmpv6-mtu.c
src/detect-icode.c
src/detect-id.c
src/detect-ike-chosen-sa.c
src/detect-ike-exch-type.c
src/detect-ike-key-exchange-payload-length.c
src/detect-ike-nonce-payload-length.c
src/detect-ipopts.c
src/detect-ipproto.c
src/detect-iprep.c
src/detect-isdataat.c
src/detect-itype.c
src/detect-krb5-errcode.c
src/detect-krb5-msgtype.c
src/detect-krb5-ticket-encryption.c
src/detect-lua.c
src/detect-mark.c
src/detect-modbus.c
src/detect-nfs-procedure.c
src/detect-nfs-version.c
src/detect-parse.c
src/detect-parse.h
src/detect-pcre.c
src/detect-pktvar.c
src/detect-replace.c
src/detect-rpc.c
src/detect-sameip.c
src/detect-smb-version.c
src/detect-ssl-state.c
src/detect-ssl-version.c
src/detect-stream_size.c
src/detect-tag.c
src/detect-tcp-ack.c
src/detect-tcp-flags.c
src/detect-tcp-seq.c
src/detect-tcp-window.c
src/detect-tcpmss.c
src/detect-template.c
src/detect-template2.c
src/detect-threshold.c
src/detect-tls-cert-validity.c
src/detect-tls-certs.c
src/detect-tls-version.c
src/detect-tls.c
src/detect-tos.c
src/detect-ttl.c
src/detect-urilen.c
src/detect-vlan.c
src/detect-xbits.c
src/util-threshold-config.c

index df558ab4ec1c0ff2687f3fe046d10c086d8c2626..2a6024061abe449aad01db2c8d6d153fcdc5faf4 100644 (file)
@@ -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;
     }
index 2bfcbd678f30dd5f7a0835230da6b3cd674d56c7..fe5f14ff46cc322d30ed7ab9e5346169dd426e19 100644 (file)
@@ -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 && ...) {
 ...
index 48460d8b47c2cd4d9bf51e9bf1872c37d17ce369..2c5888c942587b24ea21a5b3e2df50c4c01573a6 100644 (file)
@@ -35,7 +35,7 @@ pub mod tojson;
 pub mod vlan;
 pub mod datasets;
 
-use std::os::raw::{c_int, c_void};
+use std::os::raw::c_int;
 use std::ffi::CString;
 
 use suricata_sys::sys::{
@@ -75,7 +75,7 @@ pub struct SigTableElmtStickyBuffer {
     ) -> c_int,
 }
 
-pub fn helper_keyword_register_sticky_buffer(kw: &SigTableElmtStickyBuffer) -> c_int {
+pub fn helper_keyword_register_sticky_buffer(kw: &SigTableElmtStickyBuffer) -> u16 {
     let name = CString::new(kw.name.as_bytes()).unwrap().into_raw();
     let desc = CString::new(kw.desc.as_bytes()).unwrap().into_raw();
     let url = CString::new(kw.url.as_bytes()).unwrap().into_raw();
@@ -118,13 +118,6 @@ pub const SIGMATCH_NOOPT: u16 = 1; // BIT_U16(0) in detect.h
 pub(crate) const SIGMATCH_QUOTES_MANDATORY: u16 = 0x40; // BIT_U16(6) in detect.h
 pub const SIGMATCH_INFO_STICKY_BUFFER: u16 = 0x200; // BIT_U16(9)
 
-/// cbindgen:ignore
-extern "C" {
-    // from detect-parse.h
-    pub fn SigMatchAppendSMToList(
-        de: *mut DetectEngineCtx, s: *mut Signature, kwid: c_int, ctx: *const c_void, bufid: c_int,
-    ) -> *mut c_void;
-}
 #[repr(u8)]
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
 // endian <big|little|dce>
index 70501e2304dbd0859ce0484bdc4d9fe370cc59b6..9507e1c74794ccd7ceb27f6b3c8e65b072f6197e 100644 (file)
@@ -22,12 +22,11 @@ use super::dhcp::{
 use super::parser::DHCPOptionWrapper;
 use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER};
 use crate::detect::uint::{DetectUintData, SCDetectU64Free, SCDetectU64Match, SCDetectU64Parse};
-use crate::detect::SigMatchAppendSMToList;
 use std::os::raw::{c_int, c_void};
 use suricata_sys::sys::{
     DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectHelperBufferRegister,
-    SCDetectHelperKeywordRegister, SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt,
-    SigMatchCtx, Signature,
+    SCDetectHelperKeywordRegister, SCDetectSignatureSetAppProto, SCSigMatchAppendSMToList,
+    SCSigTableAppLiteElmt, SigMatchCtx, Signature,
 };
 
 fn dhcp_tx_get_time(tx: &DHCPTransaction, code: u8) -> Option<u64> {
@@ -41,11 +40,11 @@ fn dhcp_tx_get_time(tx: &DHCPTransaction, code: u8) -> Option<u64> {
     return None;
 }
 
-static mut G_DHCP_LEASE_TIME_KW_ID: c_int = 0;
+static mut G_DHCP_LEASE_TIME_KW_ID: u16 = 0;
 static mut G_DHCP_LEASE_TIME_BUFFER_ID: c_int = 0;
-static mut G_DHCP_REBINDING_TIME_KW_ID: c_int = 0;
+static mut G_DHCP_REBINDING_TIME_KW_ID: u16 = 0;
 static mut G_DHCP_REBINDING_TIME_BUFFER_ID: c_int = 0;
-static mut G_DHCP_RENEWAL_TIME_KW_ID: c_int = 0;
+static mut G_DHCP_RENEWAL_TIME_KW_ID: u16 = 0;
 static mut G_DHCP_RENEWAL_TIME_BUFFER_ID: c_int = 0;
 
 unsafe extern "C" fn dhcp_detect_leasetime_setup(
@@ -58,11 +57,11 @@ unsafe extern "C" fn dhcp_detect_leasetime_setup(
     if ctx.is_null() {
         return -1;
     }
-    if SigMatchAppendSMToList(
+    if SCSigMatchAppendSMToList(
         de,
         s,
         G_DHCP_LEASE_TIME_KW_ID,
-        ctx,
+        ctx as *mut SigMatchCtx,
         G_DHCP_LEASE_TIME_BUFFER_ID,
     )
     .is_null()
@@ -101,11 +100,11 @@ unsafe extern "C" fn dhcp_detect_rebindingtime_setup(
     if ctx.is_null() {
         return -1;
     }
-    if SigMatchAppendSMToList(
+    if SCSigMatchAppendSMToList(
         de,
         s,
         G_DHCP_REBINDING_TIME_KW_ID,
-        ctx,
+        ctx as *mut SigMatchCtx,
         G_DHCP_REBINDING_TIME_BUFFER_ID,
     )
     .is_null()
@@ -138,11 +137,11 @@ unsafe extern "C" fn dhcp_detect_renewaltime_setup(
     if ctx.is_null() {
         return -1;
     }
-    if SigMatchAppendSMToList(
+    if SCSigMatchAppendSMToList(
         de,
         s,
         G_DHCP_RENEWAL_TIME_KW_ID,
-        ctx,
+        ctx as *mut SigMatchCtx,
         G_DHCP_RENEWAL_TIME_BUFFER_ID,
     )
     .is_null()
index 4359bb44ade8fc052276979e953095f5c345a1c5..64959317040bdbee908395dfea85acbc49b1cefa 100644 (file)
@@ -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;
     }
index 838d95217a61029a8aa0889671027fbd5c56de93..bac624b5ff988d330bb66a593af446a60e5dac82 100644 (file)
@@ -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()
index 99cef0bbd6526e91c67459c849b34bdbaa21e2eb..8942e573f247179e988c635fef3909f02eb73741 100644 (file)
@@ -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()
index 143815bbc43c4103e64c29836dd42ef225172479..97d75cc4c09f475a9ac24478df20658f23d1cd7b 100644 (file)
@@ -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()
index 09264afe972da307e609bd5f201d38638781e074..087ddca3335b9240e9175c46f5bd122192c1ac63 100644 (file)
@@ -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()
index 11ddb02f5357953beec627ba23dbcc500d9efae7..15012d6551950c87e2e7ba4a4f1f2b3d4c7278a2 100644 (file)
 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;
index 124b80424bfc1926b6c1e4a1614321481fa49c2f..1c607df8fe90673cd6403237626ecb81474606c4 100644 (file)
@@ -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()
index 4b637f8e4e17e0b346a438317e399c486518e34d..74a29339e86fd291656c24ea7029c09e9ba992ac 100644 (file)
@@ -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,
index 9ec7c004d1ae69c1d615b3a435988c67434aabd3..88db53fa50c66c6ab142efe38b7593c233599b60 100644 (file)
@@ -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;
         }
index 071a3ee9397958eb0b019c15900bd4c401686243..46c825496075997b96c69ce001b0007d57e95b51 100644 (file)
@@ -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;
     }
index fc3c73e715ca4a59c58d380c1dad33e0580e3208..6ec8d013cdb8324551ec09f03dd7b3f03a3f41bd 100644 (file)
@@ -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;
index 63d40d6219fcad89e9c38440bbfaa12763a34f70..f0f160748c8a64084afee3ac290710736971f127 100644 (file)
@@ -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;
     }
index 35d79c90047b1543d4d6c99ed014cd3fd66ec945..6381babeb2267ec876227f94ed8097896f9e5c9a 100644 (file)
@@ -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;
     }
index fba8c896e7725997411d7fd58f2741f54cdae31d..0c61034528f7d5bdb4087755d794ce387084d779 100644 (file)
@@ -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;
     }
 
index 4dbff3ab281173bdb45a9c6839a4142c2ca2a59a..44af06cd6388d909ff2ae5caee26ab9f6d2e29f7 100644 (file)
@@ -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;
     }
 
index 5e10b4cbb466f5c27b7fe018370d5f4e1fd96728..82f79f2556b5d3c23e3018359badc9b7d9ec7415 100644 (file)
@@ -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;
     }
index 75342dde393f8b54c94615ff6293f19901a3122a..0efdc44999b05cd9a9b014d1bc931c8513f466a6 100644 (file)
@@ -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;
     }
 
index 686448b66b21f4488d76651532949c4013768149..140cbb85107901d329041c84b6a6ba083c5736c2 100644 (file)
@@ -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;
     }
 
index dbc3ed1a591199d862b7e128df59d80106679e64..faf4804373b241ffb38b98fc622e037cba4b859a 100644 (file)
@@ -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;
     }
 
index c1f0e103409cc734316aadb94e57323af3d7382b..64be0ae456b511e3f95d4c3594848447545d0a1a 100644 (file)
@@ -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;
     }
index 43529a3cb6da25c333c560aa539114dd0e8c655c..7073a640f110610c013c2e9488a56a4d19959289 100644 (file)
@@ -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;
     }
 
index 3a2c3726410d2bf1db6c7a965e261aba9d6fb41f..0ec38af06b180361facc8d702678e25cf1459d56 100644 (file)
@@ -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;
     }
index a5e354070178ef34383b6380a724e584cb9ab738..8dd05fd5742ab124b875d03a5ee77bc6b1e2838b 100644 (file)
@@ -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;
index 4efa2dce74dd0a79c666c805518f00c6bba2034a..5d9a932bda92871a41e6dde05ae1c7df52265a83 100644 (file)
@@ -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;
index 9c97d76d6f00188256ac789099ab772d5aafa17d..4639f9f5d4ad3bf23b5ac52fff89e66a176a5d26 100644 (file)
@@ -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;
     }
index d5e69c7babcae11a630d0ed0f6dbace8be590326..1e73c9de7cba6de22e27063fb218b04f136e57bf 100644 (file)
@@ -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;
index dbc73dd59aee33338afcce854f481e62d606c0c6..47cbfeb95f17f704f958871331cda51314d90ff7 100644 (file)
@@ -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;
     }
index ab48a762b15011f3524de94e0f57e9a5024f4be6..ca481dc75f125d5f6d9367e72669bb5fae683fb9 100644 (file)
@@ -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;
     }
index 1462ccc05bd785bd53870f0f1e4664e91a197448..ec6cf1c01a7c6390250961a3aaefac814074d663 100644 (file)
@@ -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);
index 1144d7a3cc8a6a36443297192081bf29492cb99d..a50a6790a81c6daacc4f6975e1dfe1f8a2936ea1 100644 (file)
@@ -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;
index 025aeba04f05c6c518017818d35c8fe2d43664f0..29b3b86a38306cd6016544bb33e819a3f3bd4c13 100644 (file)
@@ -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;
 }
index 30abe6e22c02710536a91e2ce7ffb9ef2255e4fd..72034fd7b831f22cab9783a9fdecdf96862b8b42 100644 (file)
@@ -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,
index 58370a6dfa0a8712b957c6a7eb0adf66e6e2e1d0..741baffdc42652d38b3f3d3470a2cdcd1cd65df2 100644 (file)
@@ -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;
 }
index d2f459f9460743d4a1099980b795112a0ac9ae72..bd37e46eca6ac8c4ca2283b5a70dfdfb1ce85dc3 100644 (file)
@@ -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 */
index 34a7e8b80b9f843e33f198d5eb1d3b36ea833de2..4b21a7ac0b5f364c334ae10a0016edccf25141ed 100644 (file)
@@ -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);
     }
 
index f81ce4be29eaaaa0d1767da0f933f1b97d68adc1..15f94ee6bd64c79d8c0ed44a456bc39c1da13766 100644 (file)
@@ -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;
     }
 
index 8128b2f634782d23f826d0e49a4dd9a53117fc9f..1d866bbb2339d2228fbd06d8f55e7aac70532235 100644 (file)
@@ -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);
index d281bbf2a151e9babf069862e8e26c8d0b64246e..fcfa19fb717719b2c10a18805ebd80612c113634 100644 (file)
@@ -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;
     }
index 665b081a3bf07034f4acb27dce98262ee1bf233f..255364f1d75160c0a6ff3dd78469ba34074b5775 100644 (file)
@@ -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;
index d223c1c5b30b1b0c6dff339b5e8c5413a1480e9d..b7cf3ae34df3360cf8d9c1bd405e42dde3255c9c 100644 (file)
@@ -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;
index 1e5fdb0ca4d6509d62117865d1543782d6838c71..2a0ef1c9c2fe33c4de73654e98d80b9e085fd344 100644 (file)
@@ -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;
         }
index 9b1152d88611a4e5d9552d3d92da331bc6552f2b..49b7d13735299db8ce0bc0b1508c9b3ecb9d2bfb 100644 (file)
@@ -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;
             }
index bba378adbf088704cd40f30679fd47092bc2e503..758f79f0d8eed2f26b0820fc8c6f3e1d5ecf6d3f 100644 (file)
@@ -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;
             }
index f8af531d062e164a0646c09ba43ca5c58c56d001..a3e8279cf0f9d88e32e45e704d5c0ddb68431197 100644 (file)
@@ -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;
     }
index 50112224c6595db3ab83f76570d1c2b76e275f0b..60c82a1d0aa454d0bd15ee0a9670352dacaf8c3f 100644 (file)
@@ -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;
     }
index ac2482cd75fc2d254d37fef3d646062b3c1ffc7b..f8c9e4dc2893c7875c33f1f738b8d1b9276f2ce5 100644 (file)
@@ -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;
     }
index f033351374d4180f9ff1cc41e98ffdcd40cf01e6..e13a36ccada63079c6f3e0908d0756e9afd631b7 100644 (file)
@@ -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;
index 9e7eab67e70cdd7f571b7bade5631147fe63f531..1359c9482dc33e59d640032c3a966856b357e9ad 100644 (file)
@@ -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;
index 5f4738eeeb0d565161fad3c320a9b0ee5c051f4e..145f82439bdfb9456afb8e8d6716e4728d0d09ef 100644 (file)
@@ -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;
index 515953cf2cd22f013b87dc3a63cd515f07f4a294..63eb9b41404ee6c48bcfb17215c54d6e87113b24 100644 (file)
@@ -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);
index d68db7c1737e9dd055e2c5aa2107851b7f6d3726..1fc4944eb1676839ae4d9bb60957322c1c634980 100644 (file)
@@ -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;
index 63593fde3a9f68d82884a1b11716e8b30fbd37f6..a48b5055272e49f8aad5e5574bd7ee9560e2a2ca 100644 (file)
@@ -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;
     }
index 5fb050f3016123050f30f176b8ba614f2b89e335..b43d519f0cc2b801ed7226cba3e3c34ff16b73ef 100644 (file)
@@ -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;
             }
index 04dcc016d8216008788531a4b6b4be0f19ef3575..ea65d9131c47afbcb155bf67ba9d72272a80ee29 100644 (file)
@@ -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;
index f29cc0f747656b30f27406a5d1ec170e6eaef876..3b9aa755bfb2cf7f5b9444fbc47850025249a294 100644 (file)
@@ -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;
     }
index bb0831c65064cbc9278da702c7237012c20c70ef..c4ee2f1a9ade3ed0e42e9a9e8b42e40af83a4935 100644 (file)
@@ -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;
     }
index 864efee515a16bc62e6d69104eaabf105c174d17..34beb50b509c0eb46b708aa1987ee11f31f68297 100644 (file)
@@ -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;
index 494bec4fa7da0a0f9e0069984a59c148d7f284d2..0149e546c2e45ef32396fa6a66129dc2d3318d8b 100644 (file)
@@ -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;
     }
index 8a10195727e0a9af420b09a63da8b6482a12de84..bd2525901b9a8d8514ea361311220e8db8d1519f 100644 (file)
@@ -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;
index 6c426cc8dc6f596ade2ba136baaa683deb570d37..40e6a798ed013b6b27d1e26bb7fcb2533f28ba04 100644 (file)
@@ -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;
     }
index 0dc5973cd4d16ab8a26640cf4a40bed8f33d5b40..de53414ea1e4d2acb14efd7f4f86cc03ade2ce31 100644 (file)
@@ -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;
     }
index 96922e390aed95442839a34bdbeb6705fb643ad6..e918cd3bdb7226194118e2c0dc3b5d7762fe57d2 100644 (file)
@@ -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;
index b86b47e9e0fc659d9e3333dd8009baa850aba164..09a5f7b3dddaf73ad3ef7c0a41317b9a18dec586 100644 (file)
@@ -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;
index 5e807d3933132b0456a3061e6670bbe1f19b822a..27e2ddf612508952cec6853ee7a1357f7986c886 100644 (file)
@@ -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;
index 08f3b405f2ee6b8ae5e4787b30a8688a36be9181..8c30c17b23cf10a68cc688d4a0353746fae22a88 100644 (file)
@@ -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;
     }
index d4ba6ced55af34bc4bfe4c7d8d91718c27716894..ff4ca771d6e17cafbb3a2c0983effc59c3db6893 100644 (file)
@@ -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;
     }
 
index b12d055df3a63d9b84b91f36ce219c19df2bb761..03516ec6f741d535e13cf0b685d9c773a7e658ca 100644 (file)
@@ -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;
     }
 
index 201c36ca6c37bdc1f540ffb36996bf6ba930ca9d..b7372cbcb8bdc36317c91b8ec973ef71d1265b74 100644 (file)
@@ -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;
     }
index 08dc01880f5b8def3cdd4c795317e9fded6ac04b..613746da4e0e5e8ca788322e151ade3002b0f440 100644 (file)
@@ -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;
     }
index 5e317d6571809f368d5c51b0405f366f964e0112..ab83a6b5be26935957bc1368c35246824f320944 100644 (file)
@@ -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;
     }
index c65826bdcd4cd5d899b50c21416bcd3dc04d7812..b4514a04837006b21618101d433e3b63cf4f1286 100644 (file)
@@ -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;
     }
index 2c5ae176fe9272b15974455c30fd462e4a2e3e38..ac2b6dc3f3265b15fbff65086732d8b370de05f2 100644 (file)
@@ -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;
     }
 
index cccdefe8fd5de8bcd5a7598538be63b8440bb61d..985865cedd8bda2f64ff1003c7165a7596d0604c 100644 (file)
@@ -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;
index d11437eab5bf66bab558ab8247e2cf5bb03e8b40..866428537b61fc8c367f81a10e7bcd91c9d64aec 100644 (file)
@@ -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;
     }
index f0688c03d109e7375b0f7b2918f4248ba68db91e..2d82523f0c49982a04b6fc41c2721da33c7133d7 100644 (file)
@@ -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;
index f46c6ad7dc48b71c1dec1ad59565c3731e145b5d..c2946f5fee2f7ba8d994375fcc882e0e35805ef8 100644 (file)
@@ -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;
     }
index bdc678a6fe97ab87c89c560c6228f5fed08e942b..c78e5fcd47285a8687797d9f69f7d133868bea1f 100644 (file)
@@ -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();
index f7392776371bcedee8ca06dc07003c77e9c737dd..5406972994e2d5cd0b8a7e19ab796d1c196fbbe6 100644 (file)
@@ -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 *);
 
index da0eb125e4fffab1068d4f187002aa513de654ef..ab6fe42c407dfe0eccb7ec4781236a452a680f58 100644 (file)
@@ -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;
     }
index 7166188eb2560806e3e67eb44ed4c201d893faa5..7b3eb477578a6d3b3ed20503a224b57b2a14b7c1 100644 (file)
@@ -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;
     }
 
index 620e9ed9355f1c4f36b015347eddfe0b56b371ef..3f8086c1b526d0c0fbe52bdd88701adda7d1c97c 100644 (file)
@@ -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;
index e604e2c99a9c5b30d61d48da326911e8311e681c..c6b01b4fc628ebb8b580a67cd5edd6b6781e76cd 100644 (file)
@@ -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;
     }
index 2ed72cf00e3ac66190f8236fe9f4f60e1dd4d80d..c1a7c0d9323d76e3ab5d91d17bacc5b6a2b785be 100644 (file)
@@ -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;
index 3909359d89c9ef05e294e5c3f87de9e826f956f3..b014ea7b26f155a3cce4035559160273e1636f5e 100644 (file)
@@ -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;
index 715cbd70bf20c0bdd5f1548f3be2e139812bacfd..bdad809511ed7fbdc3f1b846d1571f2e7a171528 100644 (file)
@@ -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;
     }
index 31eb272e23a13bad3009c36cac6a190118ba4125..e9dd93bf9371a83824426ca0a57a765e47b175a3 100644 (file)
@@ -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;
     }
index 3343f7b719b8ec74ce6157ac83c84de695dd3a66..cce50c0c08a857d050bf0453281ddc41d18a9aad 100644 (file)
@@ -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;
index 1828b1b7018076de519cebb6b9fb12eae31b0bc0..f49a08aac2f7c410c0bfccc241c62dd4091f7153 100644 (file)
@@ -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;
index d58ac4008add205f014eee4ec58539b13c6aaf57..e702253e773e39ad9741c5cf84a27454122fa440 100644 (file)
@@ -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;
index 9c3a2260a59e78dd8e71850ac75efd20299b6bf4..83e12b9a9af2357ea8eb96104c35ba9f3ef71d5f 100644 (file)
@@ -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;
index 660e2717c8f5d8344b920f4aed4db99669b02f35..ac120bd8616d54ae115b6db49c4d2fba1b900a2d 100644 (file)
@@ -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;
index 6adfe487be29fe74cd615b5e38e316750191a983..2571842ce96e42b8140024267e3a72694b811a5c 100644 (file)
@@ -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;
index b1b504960d1358f9f7d74262bbd9e25be2180f09..632f04d2a032a3ed32e07ad16de2673850226d28 100644 (file)
@@ -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;
index 980607f0c3a2a3b77c4d099e5d4563f0e681dc34..c8c32bdaf36ce2c73e8ee6cc0f4feb51c1bf6416 100644 (file)
@@ -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;
index 2dbe684f186306a51cf7322f6ea47b73270285ab..746ad0be7a0db577b85b18338e13d083531e17c2 100644 (file)
@@ -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;
index bc590d87ce0e8fc45e23921bf721a9dae9f1ad74..f4b381bf2ae52bf0487f13791fe79203013bf9e2 100644 (file)
@@ -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;
     }
index 5132e463e9dabac51606df5958e71168c2cbdc23..7b271638620ab1ad16a91425672f239b136681e8 100644 (file)
@@ -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;
     }
index e1ba5dd9bf4941da5d8701f65ad656992b4f5afb..8e71a985b0d14f54c0caa65b4a5aea81e9783803 100644 (file)
@@ -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;
index 9985722e20b12dcab320d829292d11a2b47182d4..7a11249a7ae279209ca05f15ad81bf4d1fd05297 100644 (file)
@@ -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;
     }
 
index 1a5322dd801852022cd8f3a1a3fdfa096aa5bd2d..d08833e5a08426f4613627befd55c484c4009c9d 100644 (file)
@@ -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;
     }
index dc43a0e34ffdbbabb3acf7024f5ae8a341286110..ff920be6d98e5c343b2faf8663e16d83c829a5bf 100644 (file)
@@ -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;
     }
index 3190179ee809c5390748724b91f9e6e89e40c20d..f96f3b93d13aa076423e22605cadcbaad3ac304a 100644 (file)
@@ -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;
     }
index 5374db7ee779ead5f246dbdb11e2a4b153bb43ad..5305d35015cf25254dff950742eab001a045781e 100644 (file)
@@ -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;
         }
index d938030eb945193891d709366209dec123c612bf..1fba3480593ab3654a99204b8d55eed63ef718e4 100644 (file)
@@ -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;
index 6bf5e5134b827fcb54463f2e0cc9f619a9739f52..e1762aed0735294ee1015ead6f534bb550463b87 100644 (file)
@@ -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;
index 105496b7da1920fd1bea3a62532ac522a2f1c7eb..e665d1ca9107e26554fdd80c18e9fa9d23616ad7 100644 (file)
@@ -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;
             }