From: Philippe Antoine Date: Tue, 20 May 2025 11:20:04 +0000 (+0200) Subject: rust: bindgen SCDetectSignatureSetAppProto X-Git-Tag: suricata-8.0.0-rc1~244 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78034b218d6367310ad7461bb677054012a42eb4;p=thirdparty%2Fsuricata.git rust: bindgen SCDetectSignatureSetAppProto Ticket: 7667 --- diff --git a/examples/plugins/altemplate/src/detect.rs b/examples/plugins/altemplate/src/detect.rs index 7627fd7abf..4cc2e910f9 100644 --- a/examples/plugins/altemplate/src/detect.rs +++ b/examples/plugins/altemplate/src/detect.rs @@ -24,12 +24,11 @@ use super::template::{TemplateTransaction, ALPROTO_TEMPLATE}; use std::os::raw::{c_int, c_void}; use suricata::cast_pointer; use suricata::core::{STREAM_TOCLIENT, STREAM_TOSERVER}; -use suricata::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigTableElmtStickyBuffer, -}; +use suricata::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer}; use suricata::direction::Direction; use suricata_sys::sys::{ - DetectEngineCtx, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, Signature, + DetectEngineCtx, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, + SCDetectSignatureSetAppProto, Signature, }; static mut G_TEMPLATE_BUFFER_BUFFER_ID: c_int = 0; @@ -37,7 +36,7 @@ static mut G_TEMPLATE_BUFFER_BUFFER_ID: c_int = 0; unsafe extern "C" fn template_buffer_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_TEMPLATE) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_TEMPLATE) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_TEMPLATE_BUFFER_BUFFER_ID) < 0 { diff --git a/rust/src/applayertemplate/detect.rs b/rust/src/applayertemplate/detect.rs index 35fb2d2d4e..f8e1f32f4b 100644 --- a/rust/src/applayertemplate/detect.rs +++ b/rust/src/applayertemplate/detect.rs @@ -20,13 +20,12 @@ use super::template::{TemplateTransaction, ALPROTO_TEMPLATE}; use crate::conf::conf_get_node; /* TEMPLATE_END_REMOVE */ use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER}; -use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigTableElmtStickyBuffer, -}; +use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer}; use crate::direction::Direction; use std::os::raw::{c_int, c_void}; use suricata_sys::sys::{ - DetectEngineCtx, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, Signature, + DetectEngineCtx, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, + SCDetectSignatureSetAppProto, Signature, }; static mut G_TEMPLATE_BUFFER_BUFFER_ID: c_int = 0; @@ -34,7 +33,7 @@ static mut G_TEMPLATE_BUFFER_BUFFER_ID: c_int = 0; unsafe extern "C" fn template_buffer_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_TEMPLATE) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_TEMPLATE) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_TEMPLATE_BUFFER_BUFFER_ID) < 0 { diff --git a/rust/src/detect/mod.rs b/rust/src/detect/mod.rs index 614f624c09..48460d8b47 100644 --- a/rust/src/detect/mod.rs +++ b/rust/src/detect/mod.rs @@ -39,7 +39,7 @@ use std::os::raw::{c_int, c_void}; use std::ffi::CString; use suricata_sys::sys::{ - AppProto, DetectEngineCtx, SCDetectHelperKeywordRegister, SCDetectHelperKeywordSetCleanCString, + DetectEngineCtx, SCDetectHelperKeywordRegister, SCDetectHelperKeywordSetCleanCString, SCSigTableAppLiteElmt, Signature, }; @@ -121,7 +121,6 @@ pub const SIGMATCH_INFO_STICKY_BUFFER: u16 = 0x200; // BIT_U16(9) /// cbindgen:ignore extern "C" { // from detect-parse.h - pub fn DetectSignatureSetAppProto(s: *mut Signature, alproto: AppProto) -> c_int; pub fn SigMatchAppendSMToList( de: *mut DetectEngineCtx, s: *mut Signature, kwid: c_int, ctx: *const c_void, bufid: c_int, ) -> *mut c_void; diff --git a/rust/src/dhcp/detect.rs b/rust/src/dhcp/detect.rs index 27bfcda896..70501e2304 100644 --- a/rust/src/dhcp/detect.rs +++ b/rust/src/dhcp/detect.rs @@ -22,11 +22,12 @@ 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::{DetectSignatureSetAppProto, SigMatchAppendSMToList}; +use crate::detect::SigMatchAppendSMToList; use std::os::raw::{c_int, c_void}; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectHelperBufferRegister, - SCDetectHelperKeywordRegister, SCSigTableAppLiteElmt, SigMatchCtx, Signature, + SCDetectHelperKeywordRegister, SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, + SigMatchCtx, Signature, }; fn dhcp_tx_get_time(tx: &DHCPTransaction, code: u8) -> Option { @@ -50,7 +51,7 @@ static mut G_DHCP_RENEWAL_TIME_BUFFER_ID: c_int = 0; unsafe extern "C" fn dhcp_detect_leasetime_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DHCP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DHCP) != 0 { return -1; } let ctx = SCDetectU64Parse(raw) as *mut c_void; @@ -93,7 +94,7 @@ unsafe extern "C" fn dhcp_detect_time_free(_de: *mut DetectEngineCtx, ctx: *mut unsafe extern "C" fn dhcp_detect_rebindingtime_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DHCP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DHCP) != 0 { return -1; } let ctx = SCDetectU64Parse(raw) as *mut c_void; @@ -130,7 +131,7 @@ unsafe extern "C" fn dhcp_detect_rebindingtime_match( unsafe extern "C" fn dhcp_detect_renewaltime_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DHCP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DHCP) != 0 { return -1; } let ctx = SCDetectU64Parse(raw) as *mut c_void; diff --git a/rust/src/dns/detect.rs b/rust/src/dns/detect.rs index f5c2d82866..4359bb44ad 100644 --- a/rust/src/dns/detect.rs +++ b/rust/src/dns/detect.rs @@ -22,8 +22,7 @@ use crate::detect::uint::{ SCDetectU8Parse, }; use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigMatchAppendSMToList, - SigTableElmtStickyBuffer, + helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer, }; use crate::direction::Direction; use std::ffi::CStr; @@ -32,7 +31,7 @@ use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList, SCDetectHelperBufferRegister, SCDetectHelperKeywordAliasRegister, SCDetectHelperKeywordRegister, SCDetectHelperMultiBufferProgressMpmRegister, - SCSigTableAppLiteElmt, SigMatchCtx, Signature, + SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature, }; /// Perform the DNS opcode match. @@ -139,7 +138,7 @@ static mut G_DNS_RRTYPE_BUFFER_ID: c_int = 0; unsafe extern "C" fn dns_opcode_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { return -1; } let ctx = SCDetectU8Parse(raw) as *mut c_void; @@ -173,7 +172,7 @@ unsafe extern "C" fn dns_rcode_parse(ustr: *const std::os::raw::c_char) -> *mut unsafe extern "C" fn dns_rcode_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { return -1; } let ctx = dns_rcode_parse(raw) as *mut c_void; @@ -209,7 +208,7 @@ unsafe extern "C" fn dns_rrtype_parse( unsafe extern "C" fn dns_rrtype_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { return -1; } let ctx = dns_rrtype_parse(raw) as *mut c_void; @@ -232,7 +231,7 @@ unsafe extern "C" fn dns_rrtype_free(_de: *mut DetectEngineCtx, ctx: *mut c_void unsafe extern "C" fn dns_detect_answer_name_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_DNS_ANSWER_NAME_BUFFER_ID) < 0 { @@ -270,7 +269,7 @@ unsafe extern "C" fn dns_tx_get_answer_name( unsafe extern "C" fn dns_detect_query_name_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_DNS_QUERY_NAME_BUFFER_ID) < 0 { @@ -315,7 +314,7 @@ unsafe extern "C" fn dns_tx_get_query( unsafe extern "C" fn dns_detect_query_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_DNS) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_DNS_QUERY_BUFFER_ID) < 0 { diff --git a/rust/src/enip/detect.rs b/rust/src/enip/detect.rs index 8e72156158..838d95217a 100644 --- a/rust/src/enip/detect.rs +++ b/rust/src/enip/detect.rs @@ -36,13 +36,12 @@ use crate::detect::uint::{ SCDetectU8Match, SCDetectU8Parse, }; use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigMatchAppendSMToList, - SigTableElmtStickyBuffer, + helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer, }; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister, - SCSigTableAppLiteElmt, SigMatchCtx, Signature, + SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature, }; use crate::direction::Direction; @@ -454,7 +453,7 @@ unsafe fn parse_cip_service(raw: *const std::os::raw::c_char) -> *mut c_void { unsafe extern "C" fn cipservice_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = parse_cip_service(raw); @@ -492,7 +491,7 @@ unsafe extern "C" fn cipservice_match( unsafe extern "C" fn capabilities_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU16Parse(raw) as *mut c_void; @@ -548,7 +547,7 @@ unsafe extern "C" fn capabilities_free(_de: *mut DetectEngineCtx, ctx: *mut c_vo unsafe extern "C" fn cip_attribute_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -588,7 +587,7 @@ unsafe extern "C" fn cip_attribute_free(_de: *mut DetectEngineCtx, ctx: *mut c_v unsafe extern "C" fn cip_class_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -628,7 +627,7 @@ unsafe extern "C" fn cip_class_free(_de: *mut DetectEngineCtx, ctx: *mut c_void) unsafe extern "C" fn vendor_id_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU16Parse(raw) as *mut c_void; @@ -684,7 +683,7 @@ unsafe extern "C" fn vendor_id_free(_de: *mut DetectEngineCtx, ctx: *mut c_void) unsafe extern "C" fn status_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = parse_status(raw) as *mut c_void; @@ -719,7 +718,7 @@ unsafe extern "C" fn status_free(_de: *mut DetectEngineCtx, ctx: *mut c_void) { unsafe extern "C" fn state_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU8Parse(raw) as *mut c_void; @@ -767,7 +766,7 @@ unsafe extern "C" fn state_free(_de: *mut DetectEngineCtx, ctx: *mut c_void) { unsafe extern "C" fn serial_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -815,7 +814,7 @@ unsafe extern "C" fn serial_free(_de: *mut DetectEngineCtx, ctx: *mut c_void) { unsafe extern "C" fn revision_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU16Parse(raw) as *mut c_void; @@ -865,7 +864,7 @@ unsafe extern "C" fn revision_free(_de: *mut DetectEngineCtx, ctx: *mut c_void) unsafe extern "C" fn protocol_version_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU16Parse(raw) as *mut c_void; @@ -908,7 +907,7 @@ unsafe extern "C" fn protocol_version_free(_de: *mut DetectEngineCtx, ctx: *mut unsafe extern "C" fn product_code_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU16Parse(raw) as *mut c_void; @@ -964,7 +963,7 @@ unsafe extern "C" fn product_code_free(_de: *mut DetectEngineCtx, ctx: *mut c_vo unsafe extern "C" fn identity_status_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU16Parse(raw) as *mut c_void; @@ -1020,7 +1019,7 @@ unsafe extern "C" fn identity_status_free(_de: *mut DetectEngineCtx, ctx: *mut c unsafe extern "C" fn device_type_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU16Parse(raw) as *mut c_void; @@ -1076,7 +1075,7 @@ unsafe extern "C" fn device_type_free(_de: *mut DetectEngineCtx, ctx: *mut c_voi unsafe extern "C" fn command_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = parse_command(raw) as *mut c_void; @@ -1124,7 +1123,7 @@ unsafe extern "C" fn command_free(_de: *mut DetectEngineCtx, ctx: *mut c_void) { unsafe extern "C" fn cip_status_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU8Parse(raw) as *mut c_void; @@ -1164,7 +1163,7 @@ unsafe extern "C" fn cip_status_free(_de: *mut DetectEngineCtx, ctx: *mut c_void unsafe extern "C" fn cip_instance_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -1204,7 +1203,7 @@ unsafe extern "C" fn cip_instance_free(_de: *mut DetectEngineCtx, ctx: *mut c_vo unsafe extern "C" fn cip_extendedstatus_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } let ctx = SCDetectU16Parse(raw) as *mut c_void; @@ -1244,7 +1243,7 @@ unsafe extern "C" fn cip_extendedstatus_free(_de: *mut DetectEngineCtx, ctx: *mu pub unsafe extern "C" fn product_name_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_ENIP_PRODUCT_NAME_BUFFER_ID) < 0 { @@ -1276,7 +1275,7 @@ unsafe extern "C" fn product_name_get_data( pub unsafe extern "C" fn service_name_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_ENIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_ENIP_SERVICE_NAME_BUFFER_ID) < 0 { diff --git a/rust/src/ldap/detect.rs b/rust/src/ldap/detect.rs index cc399c5fbe..99cef0bbd6 100644 --- a/rust/src/ldap/detect.rs +++ b/rust/src/ldap/detect.rs @@ -22,14 +22,14 @@ use crate::detect::uint::{ SCDetectU8Free, }; use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigMatchAppendSMToList, - SigTableElmtStickyBuffer, + helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer, }; use crate::ldap::types::{LdapMessage, LdapResultCode, ProtocolOp, ProtocolOpCode}; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister, - SCDetectHelperMultiBufferMpmRegister, SCSigTableAppLiteElmt, SigMatchCtx, Signature, + SCDetectHelperMultiBufferMpmRegister, SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, + SigMatchCtx, Signature, }; use std::collections::VecDeque; @@ -93,7 +93,7 @@ unsafe extern "C" fn ldap_parse_protocol_req_op( unsafe extern "C" fn ldap_detect_request_operation_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } let ctx = ldap_parse_protocol_req_op(raw) as *mut c_void; @@ -178,7 +178,7 @@ unsafe extern "C" fn ldap_parse_protocol_resp_op( unsafe extern "C" fn ldap_detect_responses_operation_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } let ctx = ldap_parse_protocol_resp_op(raw) as *mut c_void; @@ -268,7 +268,7 @@ unsafe extern "C" fn ldap_detect_responses_free(_de: *mut DetectEngineCtx, ctx: unsafe extern "C" fn ldap_detect_responses_count_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -309,7 +309,7 @@ unsafe extern "C" fn ldap_detect_responses_count_free(_de: *mut DetectEngineCtx, unsafe extern "C" fn ldap_detect_request_dn_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_LDAP_REQUEST_DN_BUFFER_ID) < 0 { @@ -347,7 +347,7 @@ unsafe extern "C" fn ldap_detect_request_dn_get_data( unsafe extern "C" fn ldap_detect_responses_dn_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_LDAP_RESPONSES_DN_BUFFER_ID) < 0 { @@ -418,7 +418,7 @@ unsafe extern "C" fn ldap_parse_responses_result_code( unsafe extern "C" fn ldap_detect_responses_result_code_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } let ctx = ldap_parse_responses_result_code(raw) as *mut c_void; @@ -481,7 +481,7 @@ unsafe extern "C" fn ldap_detect_responses_result_code_free( unsafe extern "C" fn ldap_detect_responses_msg_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_LDAP_RESPONSES_MSG_BUFFER_ID) < 0 { @@ -526,7 +526,7 @@ unsafe extern "C" fn ldap_tx_get_responses_msg( unsafe extern "C" fn ldap_detect_request_attibute_type_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_LDAP_REQUEST_ATTRIBUTE_TYPE_BUFFER_ID) < 0 { @@ -585,7 +585,7 @@ unsafe extern "C" fn ldap_tx_get_req_attribute_type( unsafe extern "C" fn ldap_detect_responses_attibute_type_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_LDAP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_LDAP_RESPONSES_ATTRIBUTE_TYPE_BUFFER_ID) < 0 { diff --git a/rust/src/mqtt/detect.rs b/rust/src/mqtt/detect.rs index d0a53b8620..143815bbc4 100644 --- a/rust/src/mqtt/detect.rs +++ b/rust/src/mqtt/detect.rs @@ -23,13 +23,13 @@ use crate::detect::uint::{ SCDetectU8Free, SCDetectU8Parse, }; use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigMatchAppendSMToList, - SigTableElmtStickyBuffer, + helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer, }; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister, - SCDetectHelperMultiBufferMpmRegister, SCSigTableAppLiteElmt, SigMatchCtx, Signature, + SCDetectHelperMultiBufferMpmRegister, SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, + SigMatchCtx, Signature, }; use nom7::branch::alt; @@ -333,7 +333,7 @@ unsafe extern "C" fn unsub_topic_get_data( unsafe extern "C" fn unsub_topic_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_UNSUB_TOPIC_BUFFER_ID) < 0 { @@ -374,7 +374,7 @@ unsafe extern "C" fn sub_topic_get_data( unsafe extern "C" fn sub_topic_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_SUB_TOPIC_BUFFER_ID) < 0 { @@ -398,7 +398,7 @@ unsafe extern "C" fn mqtt_parse_type(ustr: *const std::os::raw::c_char) -> *mut unsafe extern "C" fn mqtt_type_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } let ctx = mqtt_parse_type(raw) as *mut c_void; @@ -430,7 +430,7 @@ unsafe extern "C" fn mqtt_type_free(_de: *mut DetectEngineCtx, ctx: *mut c_void) unsafe extern "C" fn mqtt_reason_code_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } let ctx = SCDetectU8Parse(raw) as *mut c_void; @@ -488,7 +488,7 @@ unsafe extern "C" fn mqtt_parse_qos(ustr: *const std::os::raw::c_char) -> *mut u unsafe extern "C" fn mqtt_qos_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } let ctx = mqtt_parse_qos(raw) as *mut c_void; @@ -540,7 +540,7 @@ unsafe extern "C" fn mqtt_parse_bool(ustr: *const std::os::raw::c_char) -> *mut unsafe extern "C" fn mqtt_connack_sessionpresent_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } let ctx = mqtt_parse_bool(raw) as *mut c_void; @@ -589,7 +589,7 @@ unsafe extern "C" fn mqtt_connack_sessionpresent_free(_de: *mut DetectEngineCtx, unsafe extern "C" fn mqtt_pub_topic_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_PUB_TOPIC_BUFFER_ID) < 0 { @@ -601,7 +601,7 @@ unsafe extern "C" fn mqtt_pub_topic_setup( unsafe extern "C" fn mqtt_pub_msg_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_PUB_MSG_BUFFER_ID) < 0 { @@ -613,7 +613,7 @@ unsafe extern "C" fn mqtt_pub_msg_setup( unsafe extern "C" fn mqtt_protocol_version_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } let ctx = SCDetectU8Parse(raw) as *mut c_void; @@ -720,7 +720,7 @@ unsafe extern "C" fn mqtt_parse_flags( unsafe extern "C" fn mqtt_flags_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } let ctx = mqtt_parse_flags(raw) as *mut c_void; @@ -833,7 +833,7 @@ unsafe extern "C" fn mqtt_parse_conn_flags( unsafe extern "C" fn mqtt_conn_flags_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } let ctx = mqtt_parse_conn_flags(raw) as *mut c_void; @@ -883,7 +883,7 @@ unsafe extern "C" fn mqtt_conn_flags_free(_de: *mut DetectEngineCtx, ctx: *mut c unsafe extern "C" fn mqtt_conn_willtopic_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_CONN_WILLTOPIC_BUFFER_ID) < 0 { @@ -895,7 +895,7 @@ unsafe extern "C" fn mqtt_conn_willtopic_setup( unsafe extern "C" fn mqtt_conn_willmsg_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_CONN_WILLMSG_BUFFER_ID) < 0 { @@ -907,7 +907,7 @@ unsafe extern "C" fn mqtt_conn_willmsg_setup( unsafe extern "C" fn mqtt_conn_username_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_CONN_USERNAME_BUFFER_ID) < 0 { @@ -919,7 +919,7 @@ unsafe extern "C" fn mqtt_conn_username_setup( unsafe extern "C" fn mqtt_conn_protocolstring_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_CONN_PROTOCOLSTRING_BUFFER_ID) < 0 { @@ -931,7 +931,7 @@ unsafe extern "C" fn mqtt_conn_protocolstring_setup( unsafe extern "C" fn mqtt_conn_password_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_CONN_PASSWORD_BUFFER_ID) < 0 { @@ -943,7 +943,7 @@ unsafe extern "C" fn mqtt_conn_password_setup( unsafe extern "C" fn mqtt_conn_clientid_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_MQTT) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_MQTT_CONN_CLIENTID_BUFFER_ID) < 0 { diff --git a/rust/src/rfb/detect.rs b/rust/src/rfb/detect.rs index cf131c77e1..09264afe97 100644 --- a/rust/src/rfb/detect.rs +++ b/rust/src/rfb/detect.rs @@ -24,8 +24,7 @@ use crate::detect::uint::{ detect_match_uint, detect_parse_uint_enum, DetectUintData, SCDetectU32Free, SCDetectU32Parse, }; use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigMatchAppendSMToList, - SigTableElmtStickyBuffer, + helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer, }; use std::ffi::CStr; use std::os::raw::{c_int, c_void}; @@ -33,7 +32,7 @@ use std::ptr; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister, - SCSigTableAppLiteElmt, SigMatchCtx, Signature, + SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature, }; unsafe extern "C" fn rfb_name_get( @@ -63,7 +62,7 @@ static mut G_RFB_SEC_RESULT_BUFFER_ID: c_int = 0; unsafe extern "C" fn rfb_name_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_RFB) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_RFB) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_RFB_NAME_BUFFER_ID) < 0 { @@ -75,7 +74,7 @@ unsafe extern "C" fn rfb_name_setup( unsafe extern "C" fn rfb_sec_type_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_RFB) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_RFB) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -129,7 +128,7 @@ unsafe extern "C" fn rfb_parse_sec_result( unsafe extern "C" fn rfb_sec_result_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_RFB) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_RFB) != 0 { return -1; } let ctx = rfb_parse_sec_result(raw) as *mut c_void; diff --git a/rust/src/sdp/detect.rs b/rust/src/sdp/detect.rs index 540ef623e0..55159ceb15 100644 --- a/rust/src/sdp/detect.rs +++ b/rust/src/sdp/detect.rs @@ -18,16 +18,15 @@ // written by Giuseppe Longo use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER}; -use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigTableElmtStickyBuffer, -}; +use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer}; use crate::direction::Direction; use crate::sip::sip::{SIPTransaction, ALPROTO_SIP}; use std::os::raw::{c_int, c_void}; use std::ptr; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, SCDetectBufferSetActiveList, - SCDetectHelperBufferMpmRegister, SCDetectHelperMultiBufferMpmRegister, Signature, + SCDetectHelperBufferMpmRegister, SCDetectHelperMultiBufferMpmRegister, + SCDetectSignatureSetAppProto, Signature, }; static mut G_SDP_ORIGIN_BUFFER_ID: c_int = 0; @@ -51,7 +50,7 @@ static mut G_SDP_MEDIA_DESC_ENCRYPTION_KEY_BUFFER_ID: c_int = 0; unsafe extern "C" fn sdp_session_name_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_SESSION_NAME_BUFFER_ID) < 0 { @@ -84,7 +83,7 @@ unsafe extern "C" fn sdp_session_name_get( unsafe extern "C" fn sdp_session_info_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_SESSION_INFO_BUFFER_ID) < 0 { @@ -116,7 +115,7 @@ unsafe extern "C" fn sdp_session_info_get( unsafe extern "C" fn sdp_origin_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_ORIGIN_BUFFER_ID) < 0 { @@ -149,7 +148,7 @@ unsafe extern "C" fn sdp_origin_get( unsafe extern "C" fn sdp_uri_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_URI_BUFFER_ID) < 0 { @@ -181,7 +180,7 @@ unsafe extern "C" fn sdp_uri_get( unsafe extern "C" fn sdp_email_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_EMAIL_BUFFER_ID) < 0 { @@ -213,7 +212,7 @@ unsafe extern "C" fn sdp_email_get( unsafe extern "C" fn sdp_phone_number_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_PHONE_NUMBER_BUFFER_ID) < 0 { @@ -245,7 +244,7 @@ unsafe extern "C" fn sdp_phone_number_get( unsafe extern "C" fn sdp_conn_data_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_CONNECTION_DATA_BUFFER_ID) < 0 { @@ -277,7 +276,7 @@ unsafe extern "C" fn sdp_conn_data_get( unsafe extern "C" fn sdp_bandwidth_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_BANDWIDTH_BUFFER_ID) < 0 { @@ -314,7 +313,7 @@ unsafe extern "C" fn sip_bandwidth_get_data( unsafe extern "C" fn sdp_time_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_TIME_BUFFER_ID) < 0 { @@ -349,7 +348,7 @@ unsafe extern "C" fn sdp_time_get_data( unsafe extern "C" fn sdp_repeat_time_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_REPEAT_TIME_BUFFER_ID) < 0 { @@ -386,7 +385,7 @@ unsafe extern "C" fn sdp_repeat_time_get_data( unsafe extern "C" fn sdp_timezone_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_TIMEZONE_BUFFER_ID) < 0 { @@ -418,7 +417,7 @@ unsafe extern "C" fn sdp_timezone_get( unsafe extern "C" fn sdp_encryption_key_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_ENCRYPTION_KEY_BUFFER_ID) < 0 { @@ -450,7 +449,7 @@ unsafe extern "C" fn sdp_encryption_key_get( unsafe extern "C" fn sdp_attribute_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_ATTRIBUTE_BUFFER_ID) < 0 { @@ -487,7 +486,7 @@ unsafe extern "C" fn sip_attribute_get_data( unsafe extern "C" fn sdp_media_desc_media_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_MEDIA_DESC_MEDIA_BUFFER_ID) < 0 { @@ -524,7 +523,7 @@ unsafe extern "C" fn sip_media_desc_media_get_data( unsafe extern "C" fn sdp_media_desc_session_info_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_MEDIA_DESC_SESSION_INFO_BUFFER_ID) < 0 { @@ -562,7 +561,7 @@ unsafe extern "C" fn sip_media_desc_session_info_get_data( unsafe extern "C" fn sdp_media_desc_connection_data_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_MEDIA_DESC_CONNECTION_DATA_BUFFER_ID) < 0 { @@ -600,7 +599,7 @@ unsafe extern "C" fn sip_media_desc_connection_data_get_data( unsafe extern "C" fn sdp_media_desc_encryption_key_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SDP_MEDIA_DESC_ENCRYPTION_KEY_BUFFER_ID) < 0 { diff --git a/rust/src/sip/detect.rs b/rust/src/sip/detect.rs index bf9edce541..c1ab833848 100644 --- a/rust/src/sip/detect.rs +++ b/rust/src/sip/detect.rs @@ -18,16 +18,15 @@ // written by Giuseppe Longo use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER}; -use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigTableElmtStickyBuffer, -}; +use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer}; use crate::direction::Direction; use crate::sip::sip::{SIPTransaction, ALPROTO_SIP}; use std::os::raw::{c_int, c_void}; use std::ptr; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, SCDetectBufferSetActiveList, - SCDetectHelperBufferMpmRegister, SCDetectHelperMultiBufferMpmRegister, Signature, + SCDetectHelperBufferMpmRegister, SCDetectHelperMultiBufferMpmRegister, + SCDetectSignatureSetAppProto, Signature, }; static mut G_SIP_PROTOCOL_BUFFER_ID: c_int = 0; @@ -83,7 +82,7 @@ pub unsafe extern "C" fn SCSipTxGetUri( unsafe extern "C" fn sip_protocol_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_PROTOCOL_BUFFER_ID) < 0 { @@ -126,7 +125,7 @@ unsafe extern "C" fn sip_protocol_get( unsafe extern "C" fn sip_stat_code_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_STAT_CODE_BUFFER_ID) < 0 { @@ -155,7 +154,7 @@ unsafe extern "C" fn sip_stat_code_get( unsafe extern "C" fn sip_stat_msg_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_STAT_MSG_BUFFER_ID) < 0 { @@ -184,7 +183,7 @@ unsafe extern "C" fn sip_stat_msg_get( unsafe extern "C" fn sip_request_line_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_REQUEST_LINE_BUFFER_ID) < 0 { @@ -212,7 +211,7 @@ unsafe extern "C" fn sip_request_line_get( unsafe extern "C" fn sip_response_line_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_RESPONSE_LINE_BUFFER_ID) < 0 { @@ -258,7 +257,7 @@ fn sip_get_header_value<'a>( unsafe extern "C" fn sip_from_hdr_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_FROM_HDR_BUFFER_ID) < 0 { @@ -285,7 +284,7 @@ unsafe extern "C" fn sip_from_hdr_get_data( unsafe extern "C" fn sip_to_hdr_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_TO_HDR_BUFFER_ID) < 0 { @@ -312,7 +311,7 @@ unsafe extern "C" fn sip_to_hdr_get_data( unsafe extern "C" fn sip_via_hdr_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_VIA_HDR_BUFFER_ID) < 0 { @@ -339,7 +338,7 @@ unsafe extern "C" fn sip_via_hdr_get_data( unsafe extern "C" fn sip_ua_hdr_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_UA_HDR_BUFFER_ID) < 0 { @@ -366,7 +365,7 @@ unsafe extern "C" fn sip_ua_hdr_get_data( unsafe extern "C" fn sip_content_type_hdr_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_CONTENT_TYPE_HDR_BUFFER_ID) < 0 { @@ -393,7 +392,7 @@ unsafe extern "C" fn sip_content_type_hdr_get_data( unsafe extern "C" fn sip_content_length_hdr_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SIP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SIP_CONTENT_LENGTH_HDR_BUFFER_ID) < 0 { diff --git a/rust/src/snmp/detect.rs b/rust/src/snmp/detect.rs index c300213cbe..11ddb02f53 100644 --- a/rust/src/snmp/detect.rs +++ b/rust/src/snmp/detect.rs @@ -21,14 +21,13 @@ 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, DetectSignatureSetAppProto, SigMatchAppendSMToList, - SigTableElmtStickyBuffer, + helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer, }; use std::os::raw::{c_int, c_void}; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister, - SCSigTableAppLiteElmt, SigMatchCtx, Signature, + SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature, }; static mut G_SNMP_VERSION_KW_ID: c_int = 0; @@ -41,7 +40,7 @@ static mut G_SNMP_COMMUNITY_BUFFER_ID: c_int = 0; unsafe extern "C" fn snmp_detect_version_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SNMP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SNMP) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -74,7 +73,7 @@ unsafe extern "C" fn snmp_detect_version_free(_de: *mut DetectEngineCtx, ctx: *m unsafe extern "C" fn snmp_detect_pdutype_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SNMP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SNMP) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -111,7 +110,7 @@ unsafe extern "C" fn snmp_detect_pdutype_free(_de: *mut DetectEngineCtx, ctx: *m unsafe extern "C" fn snmp_detect_usm_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SNMP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SNMP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SNMP_USM_BUFFER_ID) < 0 { @@ -135,7 +134,7 @@ unsafe extern "C" fn snmp_detect_usm_get_data( unsafe extern "C" fn snmp_detect_community_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_SNMP) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_SNMP) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_SNMP_COMMUNITY_BUFFER_ID) < 0 { diff --git a/rust/src/websocket/detect.rs b/rust/src/websocket/detect.rs index 5d6289f072..124b80424b 100644 --- a/rust/src/websocket/detect.rs +++ b/rust/src/websocket/detect.rs @@ -22,14 +22,13 @@ use crate::detect::uint::{ SCDetectU32Match, SCDetectU32Parse, SCDetectU8Free, SCDetectU8Match, }; use crate::detect::{ - helper_keyword_register_sticky_buffer, DetectSignatureSetAppProto, SigMatchAppendSMToList, - SigTableElmtStickyBuffer, + helper_keyword_register_sticky_buffer, SigMatchAppendSMToList, SigTableElmtStickyBuffer, }; use crate::websocket::parser::WebSocketOpcode; use suricata_sys::sys::{ DetectEngineCtx, DetectEngineThreadCtx, Flow, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, SCDetectHelperBufferRegister, SCDetectHelperKeywordRegister, - SCSigTableAppLiteElmt, SigMatchCtx, Signature, + SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchCtx, Signature, }; use nom7::branch::alt; @@ -125,7 +124,7 @@ static mut G_WEBSOCKET_PAYLOAD_BUFFER_ID: c_int = 0; unsafe extern "C" fn websocket_detect_opcode_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_WEBSOCKET) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_WEBSOCKET) != 0 { return -1; } let ctx = websocket_parse_opcode(raw) as *mut c_void; @@ -165,7 +164,7 @@ unsafe extern "C" fn websocket_detect_opcode_free(_de: *mut DetectEngineCtx, ctx unsafe extern "C" fn websocket_detect_mask_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_WEBSOCKET) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_WEBSOCKET) != 0 { return -1; } let ctx = SCDetectU32Parse(raw) as *mut c_void; @@ -208,7 +207,7 @@ unsafe extern "C" fn websocket_detect_mask_free(_de: *mut DetectEngineCtx, ctx: unsafe extern "C" fn websocket_detect_flags_setup( de: *mut DetectEngineCtx, s: *mut Signature, raw: *const libc::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_WEBSOCKET) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_WEBSOCKET) != 0 { return -1; } let ctx = websocket_parse_flags(raw) as *mut c_void; @@ -248,7 +247,7 @@ unsafe extern "C" fn websocket_detect_flags_free(_de: *mut DetectEngineCtx, ctx: pub unsafe extern "C" fn websocket_detect_payload_setup( de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char, ) -> c_int { - if DetectSignatureSetAppProto(s, ALPROTO_WEBSOCKET) != 0 { + if SCDetectSignatureSetAppProto(s, ALPROTO_WEBSOCKET) != 0 { return -1; } if SCDetectBufferSetActiveList(de, s, G_WEBSOCKET_PAYLOAD_BUFFER_ID) < 0 { diff --git a/rust/sys/src/sys.rs b/rust/sys/src/sys.rs index 027fef4e7c..4b637f8e4e 100644 --- a/rust/sys/src/sys.rs +++ b/rust/sys/src/sys.rs @@ -382,6 +382,11 @@ extern "C" { kw: *const SCTransformTableElmt, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn SCDetectSignatureSetAppProto( + s: *mut Signature, alproto: AppProto, + ) -> ::std::os::raw::c_int; +} #[doc = " Structure of a configuration parameter."] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index 8dd9229f07..9ec7c004d1 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -279,7 +279,7 @@ static int DetectAppLayerEventSetup(DetectEngineCtx *de_ctx, Signature *s, const goto error; } } else { - if (DetectSignatureSetAppProto(s, data->alproto) != 0) + if (SCDetectSignatureSetAppProto(s, data->alproto) != 0) goto error; if (SigMatchAppendSMToList(de_ctx, s, DETECT_APP_LAYER_EVENT, (SigMatchCtx *)data, diff --git a/src/detect-byte-extract.c b/src/detect-byte-extract.c index 40e6911c5e..5e10b4cbb4 100644 --- a/src/detect-byte-extract.c +++ b/src/detect-byte-extract.c @@ -286,7 +286,7 @@ static int DetectByteExtractSetup(DetectEngineCtx *de_ctx, Signature *s, const c sm_list = DETECT_SM_LIST_PMATCH; } - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) goto error; } else if (data->flags & DETECT_BYTE_EXTRACT_FLAG_RELATIVE) { @@ -307,7 +307,7 @@ static int DetectByteExtractSetup(DetectEngineCtx *de_ctx, Signature *s, const c } if (data->endian == EndianDCE) { - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) != 0) goto error; if ((DETECT_BYTE_EXTRACT_FLAG_BASE | DETECT_BYTE_EXTRACT_FLAG_STRING) == diff --git a/src/detect-bytejump.c b/src/detect-bytejump.c index 7e9947a041..75342dde39 100644 --- a/src/detect-bytejump.c +++ b/src/detect-bytejump.c @@ -507,7 +507,7 @@ static int DetectBytejumpSetup(DetectEngineCtx *de_ctx, Signature *s, const char sm_list = DETECT_SM_LIST_PMATCH; } - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) != 0) goto error; } else if (data->flags & DETECT_BYTEJUMP_RELATIVE) { @@ -767,7 +767,7 @@ static int DetectBytejumpTestParse09(void) Signature *s = SigAlloc(); FAIL_IF_NULL(s); - FAIL_IF(DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); + FAIL_IF(SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); FAIL_IF_NOT(DetectBytejumpSetup(NULL, s, "4,0, align, multiplier 2, " diff --git a/src/detect-bytemath.c b/src/detect-bytemath.c index 4e38fd1a04..686448b66b 100644 --- a/src/detect-bytemath.c +++ b/src/detect-bytemath.c @@ -325,7 +325,7 @@ static int DetectByteMathSetup(DetectEngineCtx *de_ctx, Signature *s, const char sm_list = DETECT_SM_LIST_PMATCH; } - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) goto error; } else if (data->flags & DETECT_BYTEMATH_FLAG_RELATIVE) { @@ -346,7 +346,7 @@ static int DetectByteMathSetup(DetectEngineCtx *de_ctx, Signature *s, const char } if (data->endian == EndianDCE) { - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) != 0) goto error; if ((data->flags & DETECT_BYTEMATH_FLAG_STRING) || (data->base == BaseDec) || diff --git a/src/detect-bytetest.c b/src/detect-bytetest.c index 95ccf67358..dbc3ed1a59 100644 --- a/src/detect-bytetest.c +++ b/src/detect-bytetest.c @@ -611,7 +611,7 @@ static int DetectBytetestSetup(DetectEngineCtx *de_ctx, Signature *s, const char sm_list = DETECT_SM_LIST_PMATCH; } - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) != 0) goto error; } else if (data->flags & DETECT_BYTETEST_RELATIVE) { @@ -1053,7 +1053,7 @@ static int DetectBytetestTestParse19(void) Signature *s = SigAlloc(); FAIL_IF_NULL(s); - FAIL_IF(DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); + FAIL_IF(SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); FAIL_IF_NOT(DetectBytetestSetup(NULL, s, "1,=,1,6,dce") == 0); FAIL_IF_NOT(DetectBytetestSetup(NULL, s, "1,=,1,6,string,dce") == -1); diff --git a/src/detect-content.c b/src/detect-content.c index 3f7d78f052..43529a3cb6 100644 --- a/src/detect-content.c +++ b/src/detect-content.c @@ -1463,7 +1463,7 @@ static int DetectContentParseTest18(void) Signature *s = SigAlloc(); FAIL_IF_NULL(s); - FAIL_IF(DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); + FAIL_IF(SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); FAIL_IF_NOT(DetectContentSetup(de_ctx, s, "one") == 0); FAIL_IF(DetectBufferIsPresent(s, g_dce_stub_data_buffer_id)); FAIL_IF_NOT(s->init_data->smlists[DETECT_SM_LIST_PMATCH] != NULL); diff --git a/src/detect-dce-iface.c b/src/detect-dce-iface.c index d731aaebdf..9c97d76d6f 100644 --- a/src/detect-dce-iface.c +++ b/src/detect-dce-iface.c @@ -138,7 +138,7 @@ static int DetectDceIfaceSetup(DetectEngineCtx *de_ctx, Signature *s, const char { SCEnter(); - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) return -1; void *did = SCDcerpcIfaceParse(arg); diff --git a/src/detect-dce-opnum.c b/src/detect-dce-opnum.c index 3073672456..d5e69c7bab 100644 --- a/src/detect-dce-opnum.c +++ b/src/detect-dce-opnum.c @@ -132,7 +132,7 @@ static int DetectDceOpnumSetup(DetectEngineCtx *de_ctx, Signature *s, const char return -1; } - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) return -1; void *dod = SCDcerpcOpnumParse(arg); diff --git a/src/detect-dce-stub-data.c b/src/detect-dce-stub-data.c index f1ea7b0e10..0a75a8f67a 100644 --- a/src/detect-dce-stub-data.c +++ b/src/detect-dce-stub-data.c @@ -159,7 +159,7 @@ void DetectDceStubDataRegister(void) static int DetectDceStubDataSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0) return -1; if (SCDetectBufferSetActiveList(de_ctx, s, g_dce_stub_data_buffer_id) < 0) return -1; diff --git a/src/detect-dnp3.c b/src/detect-dnp3.c index f25fa420ac..ab48a762b1 100644 --- a/src/detect-dnp3.c +++ b/src/detect-dnp3.c @@ -208,7 +208,7 @@ static int DetectDNP3FuncSetup(DetectEngineCtx *de_ctx, Signature *s, const char DetectDNP3 *dnp3 = NULL; uint8_t function_code; - if (DetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0) return -1; if (!DetectDNP3FuncParseFunctionCode(str, &function_code)) { @@ -286,7 +286,7 @@ static int DetectDNP3IndSetup(DetectEngineCtx *de_ctx, Signature *s, const char DetectDNP3 *detect = NULL; uint16_t flags; - if (DetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0) return -1; if (!DetectDNP3IndParse(str, &flags)) { @@ -353,7 +353,7 @@ static int DetectDNP3ObjSetup(DetectEngineCtx *de_ctx, Signature *s, const char uint8_t variation; DetectDNP3 *detect = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0) return -1; if (!DetectDNP3ObjParse(str, &group, &variation)) { @@ -509,7 +509,7 @@ static void DetectDNP3ObjRegister(void) static int DetectDNP3DataSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) { SCEnter(); - if (DetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0) return -1; if (SCDetectBufferSetActiveList(de_ctx, s, g_dnp3_data_buffer_id) != 0) diff --git a/src/detect-dns-name.c b/src/detect-dns-name.c index 75f2b53b65..5d06bad0da 100644 --- a/src/detect-dns-name.c +++ b/src/detect-dns-name.c @@ -51,7 +51,7 @@ static int DetectSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str, i if (SCDetectBufferSetActiveList(de_ctx, s, id) < 0) { return -1; } - if (DetectSignatureSetAppProto(s, ALPROTO_DNS) < 0) { + if (SCDetectSignatureSetAppProto(s, ALPROTO_DNS) < 0) { return -1; } diff --git a/src/detect-dns-response.c b/src/detect-dns-response.c index 350b6e11da..0ec2aff416 100644 --- a/src/detect-dns-response.c +++ b/src/detect-dns-response.c @@ -60,7 +60,7 @@ static int DetectSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) if (SCDetectBufferSetActiveList(de_ctx, s, detect_buffer_id) < 0) { return -1; } - if (DetectSignatureSetAppProto(s, ALPROTO_DNS) < 0) { + if (SCDetectSignatureSetAppProto(s, ALPROTO_DNS) < 0) { return -1; } diff --git a/src/detect-email.c b/src/detect-email.c index 7a16bb3006..26bd4974ce 100644 --- a/src/detect-email.c +++ b/src/detect-email.c @@ -39,7 +39,7 @@ static int DetectMimeEmailFromSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_from_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -59,7 +59,7 @@ static int DetectMimeEmailSubjectSetup(DetectEngineCtx *de_ctx, Signature *s, co if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_subject_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -79,7 +79,7 @@ static int DetectMimeEmailToSetup(DetectEngineCtx *de_ctx, Signature *s, const c if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_to_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -99,7 +99,7 @@ static int DetectMimeEmailCcSetup(DetectEngineCtx *de_ctx, Signature *s, const c if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_cc_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -119,7 +119,7 @@ static int DetectMimeEmailDateSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_date_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -139,7 +139,7 @@ static int DetectMimeEmailMessageIdSetup(DetectEngineCtx *de_ctx, Signature *s, if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_message_id_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -159,7 +159,7 @@ static int DetectMimeEmailXMailerSetup(DetectEngineCtx *de_ctx, Signature *s, co if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_x_mailer_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -179,7 +179,7 @@ static int DetectMimeEmailUrlSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_url_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -204,7 +204,7 @@ static int DetectMimeEmailReceivedSetup(DetectEngineCtx *de_ctx, Signature *s, c if (SCDetectBufferSetActiveList(de_ctx, s, g_mime_email_received_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; diff --git a/src/detect-frame.c b/src/detect-frame.c index 749fd02e2c..925762b919 100644 --- a/src/detect-frame.c +++ b/src/detect-frame.c @@ -98,7 +98,7 @@ static int DetectFrameSetup(DetectEngineCtx *de_ctx, Signature *s, const char *s SCLogError("rule protocol unknown, can't use shorthand notation for frame '%s'", str); return -1; } else if (rule_alproto == ALPROTO_UNKNOWN) { - if (DetectSignatureSetAppProto(s, keyword_alproto) < 0) + if (SCDetectSignatureSetAppProto(s, keyword_alproto) < 0) return -1; } else if (!AppProtoEquals(rule_alproto, keyword_alproto)) { SCLogError("frame '%s' protocol '%s' mismatch with rule protocol '%s'", str, diff --git a/src/detect-ftp-command-data.c b/src/detect-ftp-command-data.c index 0c67900c00..8a042ae7ee 100644 --- a/src/detect-ftp-command-data.c +++ b/src/detect-ftp-command-data.c @@ -55,7 +55,7 @@ static int DetectFtpCommandDataSetup(DetectEngineCtx *de_ctx, Signature *s, cons if (SCDetectBufferSetActiveList(de_ctx, s, g_ftp_cmd_data_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) return -1; return 0; diff --git a/src/detect-ftp-command.c b/src/detect-ftp-command.c index 43b7f036af..46681ecc30 100644 --- a/src/detect-ftp-command.c +++ b/src/detect-ftp-command.c @@ -50,7 +50,7 @@ static int DetectFtpCommandSetup(DetectEngineCtx *de_ctx, Signature *s, const ch if (SCDetectBufferSetActiveList(de_ctx, s, g_ftp_cmd_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) return -1; return 0; diff --git a/src/detect-ftp-completion-code.c b/src/detect-ftp-completion-code.c index 682b5a76a6..fe7eeb9636 100644 --- a/src/detect-ftp-completion-code.c +++ b/src/detect-ftp-completion-code.c @@ -51,7 +51,7 @@ static int DetectFtpCompletionCodeSetup(DetectEngineCtx *de_ctx, Signature *s, c if (SCDetectBufferSetActiveList(de_ctx, s, g_ftp_ccode_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) return -1; return 0; diff --git a/src/detect-ftp-dynamic-port.c b/src/detect-ftp-dynamic-port.c index 595ea977ac..f033351374 100644 --- a/src/detect-ftp-dynamic-port.c +++ b/src/detect-ftp-dynamic-port.c @@ -61,7 +61,7 @@ static void DetectFtpDynamicPortFree(DetectEngineCtx *de_ctx, void *ptr) static int DetectFtpDynamicPortSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) { - if (DetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) return -1; DetectU16Data *fdp = DetectFtpDynamicPortParse(str); diff --git a/src/detect-ftp-mode.c b/src/detect-ftp-mode.c index 1f4124e67d..9e7eab67e7 100644 --- a/src/detect-ftp-mode.c +++ b/src/detect-ftp-mode.c @@ -102,7 +102,7 @@ static DetectFtpModeData *DetectFtpModeParse(const char *optstr) static int DetectFtpModeSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) { - if (DetectSignatureSetAppProto(s, ALPROTO_FTP) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTP) != 0) return -1; DetectFtpModeData *ftpmoded = DetectFtpModeParse(str); diff --git a/src/detect-ftp-reply-received.c b/src/detect-ftp-reply-received.c index 8a51730a8a..5f4738eeeb 100644 --- a/src/detect-ftp-reply-received.c +++ b/src/detect-ftp-reply-received.c @@ -87,7 +87,7 @@ static int DetectFtpReplyReceivedSetup(DetectEngineCtx *de_ctx, Signature *s, co if (frrd == NULL) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_FTP) != 0) { + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTP) != 0) { DetectFtpReplyReceivedFree(de_ctx, frrd); return -1; } diff --git a/src/detect-ftp-reply.c b/src/detect-ftp-reply.c index be2e9cfad5..52b3497d27 100644 --- a/src/detect-ftp-reply.c +++ b/src/detect-ftp-reply.c @@ -54,7 +54,7 @@ static int DetectFtpReplySetup(DetectEngineCtx *de_ctx, Signature *s, const char if (SCDetectBufferSetActiveList(de_ctx, s, g_ftp_reply_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTP) < 0) return -1; return 0; diff --git a/src/detect-ftpbounce.c b/src/detect-ftpbounce.c index 90d53182e2..515953cf2c 100644 --- a/src/detect-ftpbounce.c +++ b/src/detect-ftpbounce.c @@ -204,7 +204,7 @@ int DetectFtpbounceSetup(DetectEngineCtx *de_ctx, Signature *s, const char *ftpb { SCEnter(); - if (DetectSignatureSetAppProto(s, ALPROTO_FTP) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTP) != 0) return -1; /* We don't need to allocate any data for ftpbounce here. diff --git a/src/detect-ftpdata.c b/src/detect-ftpdata.c index ef502c3bdd..d68db7c173 100644 --- a/src/detect-ftpdata.c +++ b/src/detect-ftpdata.c @@ -184,7 +184,7 @@ error: */ static int DetectFtpdataSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) { - if (DetectSignatureSetAppProto(s, ALPROTO_FTPDATA) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_FTPDATA) != 0) return -1; DetectFtpdataData *ftpcommandd = DetectFtpdataParse(str); diff --git a/src/detect-http-client-body.c b/src/detect-http-client-body.c index f0d589563d..d1304fbe91 100644 --- a/src/detect-http-client-body.c +++ b/src/detect-http-client-body.c @@ -167,7 +167,7 @@ static int DetectHttpClientBodySetupSticky(DetectEngineCtx *de_ctx, Signature *s { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_client_body_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; // we cannot use a transactional rule with a fast pattern to client and this if (s->init_data->init_flags & SIG_FLAG_INIT_TXDIR_FAST_TOCLIENT) { diff --git a/src/detect-http-cookie.c b/src/detect-http-cookie.c index 05c223897f..ae19ba6639 100644 --- a/src/detect-http-cookie.c +++ b/src/detect-http-cookie.c @@ -165,7 +165,7 @@ static int DetectHttpCookieSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co if (SCDetectBufferSetActiveList(de_ctx, s, g_http_cookie_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; diff --git a/src/detect-http-header-names.c b/src/detect-http-header-names.c index 54c37a71a5..9839d2b079 100644 --- a/src/detect-http-header-names.c +++ b/src/detect-http-header-names.c @@ -199,7 +199,7 @@ static int DetectHttpHeaderNamesSetup(DetectEngineCtx *de_ctx, Signature *s, con if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; diff --git a/src/detect-http-header.c b/src/detect-http-header.c index ff25be91fc..e3e2d00308 100644 --- a/src/detect-http-header.c +++ b/src/detect-http-header.c @@ -392,7 +392,7 @@ static int DetectHttpHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_header_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } @@ -575,7 +575,7 @@ static int DetectHTTPRequestHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, c if (SCDetectBufferSetActiveList(de_ctx, s, g_http_request_header_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) != 0) return -1; return 0; @@ -608,7 +608,7 @@ static int DetectHTTPResponseHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, if (SCDetectBufferSetActiveList(de_ctx, s, g_http_response_header_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) != 0) return -1; return 0; diff --git a/src/detect-http-headers-stub.h b/src/detect-http-headers-stub.h index aeae5409c2..127d8f9ccd 100644 --- a/src/detect-http-headers-stub.h +++ b/src/detect-http-headers-stub.h @@ -165,7 +165,7 @@ static int DetectHttpHeadersSetupSticky(DetectEngineCtx *de_ctx, Signature *s, c if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; diff --git a/src/detect-http-host.c b/src/detect-http-host.c index a26db438da..c96db15ce8 100644 --- a/src/detect-http-host.c +++ b/src/detect-http-host.c @@ -235,7 +235,7 @@ static int DetectHttpHostSetup(DetectEngineCtx *de_ctx, Signature *s, const char { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_host_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } @@ -333,7 +333,7 @@ static int DetectHttpHostRawSetupSticky(DetectEngineCtx *de_ctx, Signature *s, c { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_raw_host_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } diff --git a/src/detect-http-method.c b/src/detect-http-method.c index 1b0e191182..6e6cdf34bd 100644 --- a/src/detect-http-method.c +++ b/src/detect-http-method.c @@ -154,7 +154,7 @@ static int DetectHttpMethodSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co if (SCDetectBufferSetActiveList(de_ctx, s, g_http_method_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; diff --git a/src/detect-http-protocol.c b/src/detect-http-protocol.c index 3c2198c117..16316f6307 100644 --- a/src/detect-http-protocol.c +++ b/src/detect-http-protocol.c @@ -76,7 +76,7 @@ static int DetectHttpProtocolSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; diff --git a/src/detect-http-raw-header.c b/src/detect-http-raw-header.c index 3ce8966d3c..1dd7da04af 100644 --- a/src/detect-http-raw-header.c +++ b/src/detect-http-raw-header.c @@ -163,7 +163,7 @@ static int DetectHttpRawHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s, { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_raw_header_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } diff --git a/src/detect-http-request-line.c b/src/detect-http-request-line.c index 597812a4b9..b68fc6e4bf 100644 --- a/src/detect-http-request-line.c +++ b/src/detect-http-request-line.c @@ -145,7 +145,7 @@ static int DetectHttpRequestLineSetup(DetectEngineCtx *de_ctx, Signature *s, con if (SCDetectBufferSetActiveList(de_ctx, s, g_http_request_line_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; diff --git a/src/detect-http-response-line.c b/src/detect-http-response-line.c index 670a1a421a..0611e4cc75 100644 --- a/src/detect-http-response-line.c +++ b/src/detect-http-response-line.c @@ -144,7 +144,7 @@ static int DetectHttpResponseLineSetup(DetectEngineCtx *de_ctx, Signature *s, co if (SCDetectBufferSetActiveList(de_ctx, s, g_http_response_line_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; diff --git a/src/detect-http-server-body.c b/src/detect-http-server-body.c index decb68f1f6..d8dd386717 100644 --- a/src/detect-http-server-body.c +++ b/src/detect-http-server-body.c @@ -124,7 +124,7 @@ static int DetectHttpServerBodySetupSticky(DetectEngineCtx *de_ctx, Signature *s { if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; // file data is on both directions, but we only take the one to client here s->flags |= SIG_FLAG_TOCLIENT; diff --git a/src/detect-http-start.c b/src/detect-http-start.c index eb36797a3c..68db569eae 100644 --- a/src/detect-http-start.c +++ b/src/detect-http-start.c @@ -171,7 +171,7 @@ static int DetectHttpStartSetup(DetectEngineCtx *de_ctx, Signature *s, const cha if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; diff --git a/src/detect-http-stat-code.c b/src/detect-http-stat-code.c index 60506cbf38..5119a60a20 100644 --- a/src/detect-http-stat-code.c +++ b/src/detect-http-stat-code.c @@ -149,7 +149,7 @@ static int DetectHttpStatCodeSetupSticky(DetectEngineCtx *de_ctx, Signature *s, { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_stat_code_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } diff --git a/src/detect-http-stat-msg.c b/src/detect-http-stat-msg.c index c57917b1fc..d08c412370 100644 --- a/src/detect-http-stat-msg.c +++ b/src/detect-http-stat-msg.c @@ -158,7 +158,7 @@ static int DetectHttpStatMsgSetupSticky(DetectEngineCtx *de_ctx, Signature *s, c { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_stat_msg_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } diff --git a/src/detect-http-ua.c b/src/detect-http-ua.c index efe7d36290..8b81bfc06b 100644 --- a/src/detect-http-ua.c +++ b/src/detect-http-ua.c @@ -150,7 +150,7 @@ static int DetectHttpUserAgentSetup(DetectEngineCtx *de_ctx, Signature *s, const { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_ua_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } diff --git a/src/detect-http-uri.c b/src/detect-http-uri.c index 316a150d35..ef66d933f9 100644 --- a/src/detect-http-uri.c +++ b/src/detect-http-uri.c @@ -203,7 +203,7 @@ static int DetectHttpUriSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_uri_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } @@ -289,7 +289,7 @@ static int DetectHttpRawUriSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co { if (SCDetectBufferSetActiveList(de_ctx, s, g_http_raw_uri_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) return -1; return 0; } diff --git a/src/detect-http2.c b/src/detect-http2.c index f5c0a4d788..04dcc016d8 100644 --- a/src/detect-http2.c +++ b/src/detect-http2.c @@ -239,7 +239,7 @@ static int DetectHTTP2frametypeSetup (DetectEngineCtx *de_ctx, Signature *s, con { uint8_t frame_type; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) return -1; if (!DetectHTTP2FuncParseFrameType(str, &frame_type)) { @@ -319,7 +319,7 @@ static int DetectHTTP2errorcodeSetup (DetectEngineCtx *de_ctx, Signature *s, con { uint32_t error_code; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) return -1; if (!DetectHTTP2FuncParseErrorCode(str, &error_code)) { @@ -387,7 +387,7 @@ static int DetectHTTP2priorityMatch(DetectEngineThreadCtx *det_ctx, */ static int DetectHTTP2prioritySetup (DetectEngineCtx *de_ctx, Signature *s, const char *str) { - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) return -1; DetectU8Data *prio = DetectU8Parse(str); @@ -449,7 +449,7 @@ static int DetectHTTP2windowMatch(DetectEngineThreadCtx *det_ctx, */ static int DetectHTTP2windowSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str) { - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) return -1; DetectU32Data *wu = DetectU32Parse(str); @@ -501,7 +501,7 @@ static int DetectHTTP2sizeUpdateMatch(DetectEngineThreadCtx *det_ctx, */ static int DetectHTTP2sizeUpdateSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str) { - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) return -1; void *su = SCDetectU64Parse(str); @@ -553,7 +553,7 @@ static int DetectHTTP2settingsMatch(DetectEngineThreadCtx *det_ctx, */ static int DetectHTTP2settingsSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str) { - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) return -1; void *http2set = SCHttp2DetectSettingsCtxParse(str); @@ -584,7 +584,7 @@ static int DetectHTTP2headerNameSetup(DetectEngineCtx *de_ctx, Signature *s, con if (SCDetectBufferSetActiveList(de_ctx, s, g_http2_header_name_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0) return -1; return 0; diff --git a/src/detect-ike-chosen-sa.c b/src/detect-ike-chosen-sa.c index 619c8f2f56..6c426cc8dc 100644 --- a/src/detect-ike-chosen-sa.c +++ b/src/detect-ike-chosen-sa.c @@ -199,7 +199,7 @@ error: */ static int DetectIkeChosenSaSetup(DetectEngineCtx *de_ctx, Signature *s, const char *rawstr) { - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) != 0) return -1; DetectIkeChosenSaData *dd = DetectIkeChosenSaParse(rawstr); diff --git a/src/detect-ike-exch-type.c b/src/detect-ike-exch-type.c index 5bad0b2135..0dc5973cd4 100644 --- a/src/detect-ike-exch-type.c +++ b/src/detect-ike-exch-type.c @@ -106,7 +106,7 @@ static int DetectIkeExchTypeMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8 */ static int DetectIkeExchTypeSetup(DetectEngineCtx *de_ctx, Signature *s, const char *rawstr) { - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) != 0) return -1; DetectU8Data *ike_exch_type = DetectU8Parse(rawstr); diff --git a/src/detect-ike-key-exchange-payload-length.c b/src/detect-ike-key-exchange-payload-length.c index f06495787f..96922e390a 100644 --- a/src/detect-ike-key-exchange-payload-length.c +++ b/src/detect-ike-key-exchange-payload-length.c @@ -111,7 +111,7 @@ static int DetectIkeKeyExchangePayloadLengthMatch(DetectEngineThreadCtx *det_ctx static int DetectIkeKeyExchangePayloadLengthSetup( DetectEngineCtx *de_ctx, Signature *s, const char *rawstr) { - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) != 0) return -1; DetectU32Data *key_exchange_payload_length = DetectU32Parse(rawstr); diff --git a/src/detect-ike-key-exchange-payload.c b/src/detect-ike-key-exchange-payload.c index 7d436c29d3..a4745ce60d 100644 --- a/src/detect-ike-key-exchange-payload.c +++ b/src/detect-ike-key-exchange-payload.c @@ -63,7 +63,7 @@ static int DetectKeyExchangeSetup(DetectEngineCtx *de_ctx, Signature *s, const c if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_key_exchange_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) return -1; return 0; diff --git a/src/detect-ike-nonce-payload-length.c b/src/detect-ike-nonce-payload-length.c index 5a201aff8c..b86b47e9e0 100644 --- a/src/detect-ike-nonce-payload-length.c +++ b/src/detect-ike-nonce-payload-length.c @@ -106,7 +106,7 @@ static int DetectIkeNoncePayloadLengthMatch(DetectEngineThreadCtx *det_ctx, Flow static int DetectIkeNoncePayloadLengthSetup( DetectEngineCtx *de_ctx, Signature *s, const char *rawstr) { - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) != 0) return -1; DetectU32Data *nonce_payload_length = DetectU32Parse(rawstr); diff --git a/src/detect-ike-nonce-payload.c b/src/detect-ike-nonce-payload.c index 01a3ed8a4e..a5ecdd2a20 100644 --- a/src/detect-ike-nonce-payload.c +++ b/src/detect-ike-nonce-payload.c @@ -63,7 +63,7 @@ static int DetectNonceSetup(DetectEngineCtx *de_ctx, Signature *s, const char *s if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_nonce_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) return -1; return 0; diff --git a/src/detect-ike-spi.c b/src/detect-ike-spi.c index b21cb5e993..778ef10eaa 100644 --- a/src/detect-ike-spi.c +++ b/src/detect-ike-spi.c @@ -69,7 +69,7 @@ static int DetectSpiInitiatorSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_initiator_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) return -1; return 0; @@ -80,7 +80,7 @@ static int DetectSpiResponderSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_responder_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) return -1; return 0; diff --git a/src/detect-ike-vendor.c b/src/detect-ike-vendor.c index a4cad8ef54..220487f723 100644 --- a/src/detect-ike-vendor.c +++ b/src/detect-ike-vendor.c @@ -75,7 +75,7 @@ static int DetectIkeVendorSetup(DetectEngineCtx *de_ctx, Signature *s, const cha { if (SCDetectBufferSetActiveList(de_ctx, s, g_ike_vendor_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_IKE) < 0) return -1; return 0; } diff --git a/src/detect-isdataat.c b/src/detect-isdataat.c index 8187043308..b12d055df3 100644 --- a/src/detect-isdataat.c +++ b/src/detect-isdataat.c @@ -500,7 +500,7 @@ static int DetectIsdataatTestParse04(void) Signature *s = SigAlloc(); FAIL_IF_NULL(s); - FAIL_IF(DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); + FAIL_IF(SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); FAIL_IF_NOT(DetectIsdataatSetup(NULL, s, "30") == 0); SigMatch *sm = DetectBufferGetFirstSigMatch(s, g_dce_stub_data_buffer_id); @@ -510,7 +510,7 @@ static int DetectIsdataatTestParse04(void) s = SigAlloc(); FAIL_IF_NULL(s); - FAIL_IF(DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); + FAIL_IF(SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); /* relative w/o preceeding match defaults to "pmatch" */ FAIL_IF_NOT(DetectIsdataatSetup(NULL, s, "30,relative") == 0); sm = DetectBufferGetFirstSigMatch(s, g_dce_stub_data_buffer_id); diff --git a/src/detect-krb5-cname.c b/src/detect-krb5-cname.c index e3c5f6bfda..e4ecfc6366 100644 --- a/src/detect-krb5-cname.c +++ b/src/detect-krb5-cname.c @@ -44,7 +44,7 @@ static int DetectKrb5CNameSetup(DetectEngineCtx *de_ctx, Signature *s, const cha if (SCDetectBufferSetActiveList(de_ctx, s, g_krb5_cname_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) return -1; return 0; diff --git a/src/detect-krb5-errcode.c b/src/detect-krb5-errcode.c index bbe71ee556..08dc01880f 100644 --- a/src/detect-krb5-errcode.c +++ b/src/detect-krb5-errcode.c @@ -176,7 +176,7 @@ static int DetectKrb5ErrCodeSetup (DetectEngineCtx *de_ctx, Signature *s, const { DetectKrb5ErrCodeData *krb5d = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) return -1; krb5d = DetectKrb5ErrCodeParse(krb5str); diff --git a/src/detect-krb5-msgtype.c b/src/detect-krb5-msgtype.c index 87d712907d..5e317d6571 100644 --- a/src/detect-krb5-msgtype.c +++ b/src/detect-krb5-msgtype.c @@ -173,7 +173,7 @@ static int DetectKrb5MsgTypeSetup (DetectEngineCtx *de_ctx, Signature *s, const { DetectKrb5MsgTypeData *krb5d = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) return -1; krb5d = DetectKrb5MsgTypeParse(krb5str); diff --git a/src/detect-krb5-sname.c b/src/detect-krb5-sname.c index aa3681dde7..1be7d9615a 100644 --- a/src/detect-krb5-sname.c +++ b/src/detect-krb5-sname.c @@ -44,7 +44,7 @@ static int DetectKrb5SNameSetup(DetectEngineCtx *de_ctx, Signature *s, const cha if (SCDetectBufferSetActiveList(de_ctx, s, g_krb5_sname_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) return -1; return 0; diff --git a/src/detect-krb5-ticket-encryption.c b/src/detect-krb5-ticket-encryption.c index 99e3a149c8..c65826bdcd 100644 --- a/src/detect-krb5-ticket-encryption.c +++ b/src/detect-krb5-ticket-encryption.c @@ -45,7 +45,7 @@ static int DetectKrb5TicketEncryptionSetup( { DetectKrb5TicketEncryptionData *krb5d = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_KRB5) != 0) return -1; krb5d = SCKrb5DetectEncryptionParse(krb5str); diff --git a/src/detect-modbus.c b/src/detect-modbus.c index ee77ab0c07..d11437eab5 100644 --- a/src/detect-modbus.c +++ b/src/detect-modbus.c @@ -86,7 +86,7 @@ static int DetectModbusSetup(DetectEngineCtx *de_ctx, Signature *s, const char * SCEnter(); DetectModbusRust *modbus = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_MODBUS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_MODBUS) != 0) return -1; if ((modbus = SCModbusParse(str)) == NULL) { diff --git a/src/detect-nfs-procedure.c b/src/detect-nfs-procedure.c index f4a8056c28..f0688c03d1 100644 --- a/src/detect-nfs-procedure.c +++ b/src/detect-nfs-procedure.c @@ -156,7 +156,7 @@ static int DetectNfsProcedureSetup (DetectEngineCtx *de_ctx, Signature *s, SCLogDebug("\'%s\'", rawstr); - if (DetectSignatureSetAppProto(s, ALPROTO_NFS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_NFS) != 0) return -1; dd = DetectNfsProcedureParse(rawstr); diff --git a/src/detect-nfs-version.c b/src/detect-nfs-version.c index 7f64ec21cf..f46c6ad7dc 100644 --- a/src/detect-nfs-version.c +++ b/src/detect-nfs-version.c @@ -139,7 +139,7 @@ static int DetectNfsVersionSetup (DetectEngineCtx *de_ctx, Signature *s, { SCLogDebug("\'%s\'", rawstr); - if (DetectSignatureSetAppProto(s, ALPROTO_NFS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_NFS) != 0) return -1; DetectU32Data *dd = DetectNfsVersionParse(rawstr); diff --git a/src/detect-parse.c b/src/detect-parse.c index b332492ea9..bdc678a6fe 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -2183,7 +2183,7 @@ int DetectSignatureSetMultiAppProto(Signature *s, const AppProto *alprotos) // intersection is singleton, set it as usual AppProto alproto = s->init_data->alprotos[0]; s->init_data->alprotos[0] = ALPROTO_UNKNOWN; - return DetectSignatureSetAppProto(s, alproto); + return SCDetectSignatureSetAppProto(s, alproto); } break; } @@ -2196,7 +2196,7 @@ int DetectSignatureSetMultiAppProto(Signature *s, const AppProto *alprotos) } if (alprotos[1] == ALPROTO_UNKNOWN) { // allow singleton, but call traditional setter - return DetectSignatureSetAppProto(s, alprotos[0]); + return SCDetectSignatureSetAppProto(s, alprotos[0]); } // first time we enforce alprotos for (AppProto i = 0; i < SIG_ALPROTO_MAX; i++) { @@ -2209,7 +2209,7 @@ int DetectSignatureSetMultiAppProto(Signature *s, const AppProto *alprotos) return 0; } -int DetectSignatureSetAppProto(Signature *s, AppProto alproto) +int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto) { if (!AppProtoIsValid(alproto)) { SCLogError("invalid alproto %u", alproto); @@ -5203,7 +5203,7 @@ static int SigSetMultiAppProto(void) FAIL_IF(s->init_data->alprotos[2] != ALPROTO_UNKNOWN); // check single after multiple - FAIL_IF(DetectSignatureSetAppProto(s, 3) < 0); + FAIL_IF(SCDetectSignatureSetAppProto(s, 3) < 0); FAIL_IF(s->init_data->alprotos[0] != ALPROTO_UNKNOWN); FAIL_IF(s->alproto != 3); alprotos[0] = 4; @@ -5221,7 +5221,7 @@ static int SigSetMultiAppProto(void) alprotos[3] = ALPROTO_UNKNOWN; FAIL_IF(DetectSignatureSetMultiAppProto(s, alprotos) < 0); // fail if set single not in multiple - FAIL_IF(DetectSignatureSetAppProto(s, 4) >= 0); + FAIL_IF(SCDetectSignatureSetAppProto(s, 4) >= 0); s->init_data->alprotos[0] = ALPROTO_UNKNOWN; s->alproto = ALPROTO_UNKNOWN; diff --git a/src/detect-parse.h b/src/detect-parse.h index 2b450b3032..f739277637 100644 --- a/src/detect-parse.h +++ b/src/detect-parse.h @@ -84,7 +84,7 @@ SigMatch *DetectGetLastSMFromLists(const Signature *s, ...); SigMatch *DetectGetLastSMByListPtr(const Signature *s, SigMatch *sm_list, ...); SigMatch *DetectGetLastSMByListId(const Signature *s, int list_id, ...); -int WARN_UNUSED DetectSignatureSetAppProto(Signature *s, AppProto alproto); +int WARN_UNUSED SCDetectSignatureSetAppProto(Signature *s, AppProto alproto); int WARN_UNUSED DetectSignatureSetMultiAppProto(Signature *s, const AppProto *alprotos); /* parse regex setup and free util funcs */ diff --git a/src/detect-pcre.c b/src/detect-pcre.c index a4585c703e..da0eb125e4 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -904,7 +904,7 @@ static int DetectPcreSetup (DetectEngineCtx *de_ctx, Signature *s, const char *r if (s->alproto != ALPROTO_UNKNOWN && !AppProtoEquals(s->alproto, alproto)) { goto error; } - if (DetectSignatureSetAppProto(s, alproto) < 0) + if (SCDetectSignatureSetAppProto(s, alproto) < 0) goto error; } sm_list = parsed_sm_list; @@ -1178,7 +1178,7 @@ static int DetectPcreParseTest10(void) DetectEngineCtx *de_ctx = DetectEngineCtxInit(); FAIL_IF_NULL(de_ctx); - FAIL_IF(DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); + FAIL_IF(SCDetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); FAIL_IF_NOT(DetectPcreSetup(de_ctx, s, "/bamboo/") == 0); FAIL_IF_NOT(DetectBufferGetFirstSigMatch(s, g_dce_stub_data_buffer_id) == NULL); diff --git a/src/detect-quic-cyu-hash.c b/src/detect-quic-cyu-hash.c index 86dcb4531f..fcff77d3b7 100644 --- a/src/detect-quic-cyu-hash.c +++ b/src/detect-quic-cyu-hash.c @@ -50,7 +50,7 @@ static int DetectQuicCyuHashSetup(DetectEngineCtx *de_ctx, Signature *s, const c if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) return -1; return 0; diff --git a/src/detect-quic-cyu-string.c b/src/detect-quic-cyu-string.c index c9154988d1..5a36457f04 100644 --- a/src/detect-quic-cyu-string.c +++ b/src/detect-quic-cyu-string.c @@ -48,7 +48,7 @@ static int DetectQuicCyuStringSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) return -1; return 0; diff --git a/src/detect-quic-sni.c b/src/detect-quic-sni.c index 8bd8dc3b94..d61d89e2fb 100644 --- a/src/detect-quic-sni.c +++ b/src/detect-quic-sni.c @@ -104,7 +104,7 @@ static int DetectQuicSniSetup(DetectEngineCtx *de_ctx, Signature *s, const char if (SCDetectBufferSetActiveList(de_ctx, s, quic_sni_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) return -1; return 0; diff --git a/src/detect-quic-ua.c b/src/detect-quic-ua.c index 868b5ec382..4ca8d3ddf8 100644 --- a/src/detect-quic-ua.c +++ b/src/detect-quic-ua.c @@ -104,7 +104,7 @@ static int DetectQuicUaSetup(DetectEngineCtx *de_ctx, Signature *s, const char * if (SCDetectBufferSetActiveList(de_ctx, s, quic_ua_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) return -1; return 0; diff --git a/src/detect-quic-version.c b/src/detect-quic-version.c index 983db9dbdc..43a527b61d 100644 --- a/src/detect-quic-version.c +++ b/src/detect-quic-version.c @@ -108,7 +108,7 @@ static int DetectQuicVersionSetup(DetectEngineCtx *de_ctx, Signature *s, const c if (SCDetectBufferSetActiveList(de_ctx, s, quic_version_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_QUIC) < 0) return -1; return 0; diff --git a/src/detect-sip-method.c b/src/detect-sip-method.c index a07e4cb40d..383fbcad41 100644 --- a/src/detect-sip-method.c +++ b/src/detect-sip-method.c @@ -64,7 +64,7 @@ static int DetectSipMethodSetup(DetectEngineCtx *de_ctx, Signature *s, const cha if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SIP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SIP) < 0) return -1; return 0; diff --git a/src/detect-sip-uri.c b/src/detect-sip-uri.c index 1b1221a991..1ab7bee9cb 100644 --- a/src/detect-sip-uri.c +++ b/src/detect-sip-uri.c @@ -72,7 +72,7 @@ static int DetectSipUriSetup(DetectEngineCtx *de_ctx, Signature *s, const char * if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SIP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SIP) < 0) return -1; return 0; diff --git a/src/detect-smb-ntlmssp.c b/src/detect-smb-ntlmssp.c index a066c4e3f0..8df2225b03 100644 --- a/src/detect-smb-ntlmssp.c +++ b/src/detect-smb-ntlmssp.c @@ -49,7 +49,7 @@ static int DetectSmbNtlmsspUserSetup(DetectEngineCtx *de_ctx, Signature *s, cons if (SCDetectBufferSetActiveList(de_ctx, s, g_smb_nltmssp_user_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) return -1; return 0; @@ -105,7 +105,7 @@ static int DetectSmbNtlmsspDomainSetup(DetectEngineCtx *de_ctx, Signature *s, co if (SCDetectBufferSetActiveList(de_ctx, s, g_smb_nltmssp_domain_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) return -1; return 0; diff --git a/src/detect-smb-share.c b/src/detect-smb-share.c index 924876cb6b..67fc064857 100644 --- a/src/detect-smb-share.c +++ b/src/detect-smb-share.c @@ -49,7 +49,7 @@ static int DetectSmbNamedPipeSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_smb_named_pipe_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) return -1; return 0; @@ -109,7 +109,7 @@ static int DetectSmbShareSetup(DetectEngineCtx *de_ctx, Signature *s, const char if (SCDetectBufferSetActiveList(de_ctx, s, g_smb_share_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) return -1; return 0; diff --git a/src/detect-smb-version.c b/src/detect-smb-version.c index 5b9545e6e2..3909359d89 100644 --- a/src/detect-smb-version.c +++ b/src/detect-smb-version.c @@ -66,7 +66,7 @@ static int DetectSmbVersionSetup(DetectEngineCtx *de_ctx, Signature *s, const ch { SCLogDebug("smb_version: DetectSmbVersionSetup"); - if (DetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMB) < 0) return -1; if (arg == NULL) { diff --git a/src/detect-smtp.c b/src/detect-smtp.c index 7bcd2f51d6..68f24e3d43 100644 --- a/src/detect-smtp.c +++ b/src/detect-smtp.c @@ -43,7 +43,7 @@ static int DetectSmtpHeloSetup(DetectEngineCtx *de_ctx, Signature *s, const char if (SCDetectBufferSetActiveList(de_ctx, s, g_smtp_helo_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -71,7 +71,7 @@ static int DetectSmtpMailFromSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_smtp_mail_from_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; @@ -93,7 +93,7 @@ static int DetectSmtpRcptToSetup(DetectEngineCtx *de_ctx, Signature *s, const ch if (SCDetectBufferSetActiveList(de_ctx, s, g_smtp_rcpt_to_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SMTP) < 0) return -1; return 0; diff --git a/src/detect-ssh-hassh-server-string.c b/src/detect-ssh-hassh-server-string.c index 98486b9519..c4f4cedc38 100644 --- a/src/detect-ssh-hassh-server-string.c +++ b/src/detect-ssh-hassh-server-string.c @@ -99,7 +99,7 @@ static int DetectSshHasshServerStringSetup(DetectEngineCtx *de_ctx, Signature *s if (SCDetectBufferSetActiveList(de_ctx, s, g_ssh_hassh_server_string_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) return -1; /* try to enable Hassh */ diff --git a/src/detect-ssh-hassh-server.c b/src/detect-ssh-hassh-server.c index 1ba45fac55..e1896a208d 100644 --- a/src/detect-ssh-hassh-server.c +++ b/src/detect-ssh-hassh-server.c @@ -101,7 +101,7 @@ static int DetectSshHasshServerSetup(DetectEngineCtx *de_ctx, Signature *s, cons if (SCDetectBufferSetActiveList(de_ctx, s, g_ssh_hassh_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) return -1; /* try to enable Hassh */ diff --git a/src/detect-ssh-hassh-string.c b/src/detect-ssh-hassh-string.c index 21ffd90ce0..aee309ce38 100644 --- a/src/detect-ssh-hassh-string.c +++ b/src/detect-ssh-hassh-string.c @@ -99,7 +99,7 @@ static int DetectSshHasshStringSetup(DetectEngineCtx *de_ctx, Signature *s, cons if (SCDetectBufferSetActiveList(de_ctx, s, g_ssh_hassh_string_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) return -1; /* try to enable Hassh */ diff --git a/src/detect-ssh-hassh.c b/src/detect-ssh-hassh.c index 4516e1ced1..36400dba80 100644 --- a/src/detect-ssh-hassh.c +++ b/src/detect-ssh-hassh.c @@ -100,7 +100,7 @@ static int DetectSshHasshSetup(DetectEngineCtx *de_ctx, Signature *s, const char if (SCDetectBufferSetActiveList(de_ctx, s, g_ssh_hassh_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) return -1; /* try to enable Hassh */ diff --git a/src/detect-ssh-proto.c b/src/detect-ssh-proto.c index 43247f8fed..e7f80c1dce 100644 --- a/src/detect-ssh-proto.c +++ b/src/detect-ssh-proto.c @@ -87,7 +87,7 @@ static int DetectSshProtocolSetup(DetectEngineCtx *de_ctx, Signature *s, const c if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) return -1; return 0; diff --git a/src/detect-ssh-software.c b/src/detect-ssh-software.c index a3b53b0bf7..da73b85b8e 100644 --- a/src/detect-ssh-software.c +++ b/src/detect-ssh-software.c @@ -87,7 +87,7 @@ static int DetectSshSoftwareSetup(DetectEngineCtx *de_ctx, Signature *s, const c if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_SSH) < 0) return -1; return 0; diff --git a/src/detect-ssl-state.c b/src/detect-ssl-state.c index 72123ea285..715cbd70bf 100644 --- a/src/detect-ssl-state.c +++ b/src/detect-ssl-state.c @@ -304,7 +304,7 @@ static int DetectSslStateSetup(DetectEngineCtx *de_ctx, Signature *s, const char { DetectSslStateData *ssd = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; ssd = DetectSslStateParse(arg); diff --git a/src/detect-ssl-version.c b/src/detect-ssl-version.c index febe8f6389..31eb272e23 100644 --- a/src/detect-ssl-version.c +++ b/src/detect-ssl-version.c @@ -291,7 +291,7 @@ static int DetectSslVersionSetup (DetectEngineCtx *de_ctx, Signature *s, const c { DetectSslVersionData *ssl = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; ssl = DetectSslVersionParse(de_ctx, str); diff --git a/src/detect-tls-alpn.c b/src/detect-tls-alpn.c index e2f5c6d7f3..fc78288ee6 100644 --- a/src/detect-tls-alpn.c +++ b/src/detect-tls-alpn.c @@ -118,7 +118,7 @@ static int DetectTlsAlpnSetup(DetectEngineCtx *de_ctx, Signature *s, const char if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_alpn_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; diff --git a/src/detect-tls-cert-fingerprint.c b/src/detect-tls-cert-fingerprint.c index ebd43668a7..26eced0334 100644 --- a/src/detect-tls-cert-fingerprint.c +++ b/src/detect-tls-cert-fingerprint.c @@ -125,7 +125,7 @@ static int DetectTlsFingerprintSetup(DetectEngineCtx *de_ctx, Signature *s, if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_cert_fingerprint_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; diff --git a/src/detect-tls-cert-issuer.c b/src/detect-tls-cert-issuer.c index 3f47a89a30..a270ed51fc 100644 --- a/src/detect-tls-cert-issuer.c +++ b/src/detect-tls-cert-issuer.c @@ -114,7 +114,7 @@ static int DetectTlsIssuerSetup(DetectEngineCtx *de_ctx, Signature *s, const cha if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_cert_issuer_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; diff --git a/src/detect-tls-cert-serial.c b/src/detect-tls-cert-serial.c index ceb8f1d4a8..766490e74b 100644 --- a/src/detect-tls-cert-serial.c +++ b/src/detect-tls-cert-serial.c @@ -123,7 +123,7 @@ static int DetectTlsSerialSetup(DetectEngineCtx *de_ctx, Signature *s, const cha if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_cert_serial_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; diff --git a/src/detect-tls-cert-subject.c b/src/detect-tls-cert-subject.c index 0e925f7392..ff34f61837 100644 --- a/src/detect-tls-cert-subject.c +++ b/src/detect-tls-cert-subject.c @@ -115,7 +115,7 @@ static int DetectTlsSubjectSetup(DetectEngineCtx *de_ctx, Signature *s, const ch if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_cert_subject_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; diff --git a/src/detect-tls-cert-validity.c b/src/detect-tls-cert-validity.c index 0af00a56a6..5132e463e9 100644 --- a/src/detect-tls-cert-validity.c +++ b/src/detect-tls-cert-validity.c @@ -414,7 +414,7 @@ static int DetectTlsExpiredSetup (DetectEngineCtx *de_ctx, Signature *s, SCLogDebug("\'%s\'", rawstr); - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; dd = SCCalloc(1, sizeof(DetectTlsValidityData)); @@ -459,7 +459,7 @@ static int DetectTlsValidSetup (DetectEngineCtx *de_ctx, Signature *s, SCLogDebug("\'%s\'", rawstr); - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; dd = SCCalloc(1, sizeof(DetectTlsValidityData)); @@ -543,7 +543,7 @@ static int DetectTlsValiditySetup (DetectEngineCtx *de_ctx, Signature *s, SCLogDebug("\'%s\'", rawstr); - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; dd = DetectTlsValidityParse(rawstr); diff --git a/src/detect-tls-certs.c b/src/detect-tls-certs.c index cd29b7852a..e1ba5dd9bf 100644 --- a/src/detect-tls-certs.c +++ b/src/detect-tls-certs.c @@ -141,7 +141,7 @@ static int DetectTlsCertsSetup(DetectEngineCtx *de_ctx, Signature *s, if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_certs_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; @@ -217,7 +217,7 @@ static void DetectTLSCertChainLenFree(DetectEngineCtx *de_ctx, void *ptr) */ static int DetectTLSCertChainLenSetup(DetectEngineCtx *de_ctx, Signature *s, const char *rawstr) { - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; DetectU32Data *dd = DetectU32Parse(rawstr); diff --git a/src/detect-tls-random.c b/src/detect-tls-random.c index 9655c0fbc7..f8894ffd71 100644 --- a/src/detect-tls-random.c +++ b/src/detect-tls-random.c @@ -153,7 +153,7 @@ static int DetectTlsRandomTimeSetup(DetectEngineCtx *de_ctx, Signature *s, const if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_random_time_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; @@ -174,7 +174,7 @@ static int DetectTlsRandomBytesSetup(DetectEngineCtx *de_ctx, Signature *s, cons if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_random_bytes_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; @@ -195,7 +195,7 @@ static int DetectTlsRandomSetup(DetectEngineCtx *de_ctx, Signature *s, const cha if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_random_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; diff --git a/src/detect-tls-sni.c b/src/detect-tls-sni.c index 4afd5daffb..c9a228c1f2 100644 --- a/src/detect-tls-sni.c +++ b/src/detect-tls-sni.c @@ -102,7 +102,7 @@ static int DetectTlsSniSetup(DetectEngineCtx *de_ctx, Signature *s, const char * if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_sni_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; diff --git a/src/detect-tls-subjectaltname.c b/src/detect-tls-subjectaltname.c index 06231d14f7..8ddb68f1b1 100644 --- a/src/detect-tls-subjectaltname.c +++ b/src/detect-tls-subjectaltname.c @@ -110,7 +110,7 @@ static int DetectTlsSubjectAltNameSetup(DetectEngineCtx *de_ctx, Signature *s, c if (SCDetectBufferSetActiveList(de_ctx, s, g_tls_subjectaltname_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; return 0; diff --git a/src/detect-tls-version.c b/src/detect-tls-version.c index 1de6d3b9a4..9985722e20 100644 --- a/src/detect-tls-version.c +++ b/src/detect-tls-version.c @@ -234,7 +234,7 @@ static int DetectTlsVersionSetup (DetectEngineCtx *de_ctx, Signature *s, const c { DetectTlsVersionData *tls = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; tls = DetectTlsVersionParse(de_ctx, str); diff --git a/src/detect-tls.c b/src/detect-tls.c index b16c3db303..1a5322dd80 100644 --- a/src/detect-tls.c +++ b/src/detect-tls.c @@ -301,7 +301,7 @@ static int DetectTlsSubjectSetup (DetectEngineCtx *de_ctx, Signature *s, const c { DetectTlsData *tls = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; tls = DetectTlsSubjectParse(de_ctx, str, s->init_data->negated); @@ -491,7 +491,7 @@ static int DetectTlsIssuerDNSetup (DetectEngineCtx *de_ctx, Signature *s, const { DetectTlsData *tls = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; tls = DetectTlsIssuerDNParse(de_ctx, str, s->init_data->negated); @@ -585,7 +585,7 @@ static void DetectTlsFingerprintFree(DetectEngineCtx *de_ctx, void *ptr) static int DetectTlsStoreSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str) { - if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_TLS) != 0) return -1; s->flags |= SIG_FLAG_TLSSTORE; diff --git a/src/detect-urilen.c b/src/detect-urilen.c index f14f766aff..5374db7ee7 100644 --- a/src/detect-urilen.c +++ b/src/detect-urilen.c @@ -103,7 +103,7 @@ static int DetectUrilenSetup (DetectEngineCtx *de_ctx, Signature *s, const char SCEnter(); DetectUrilenData *urilend = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) != 0) + if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) != 0) return -1; urilend = DetectUrilenParse(urilenstr);