misc: fix name prefix in detect register functions

pull/12653/head
Alice Akaki 5 months ago committed by Victor Julien
parent 359f736542
commit 7b350e9933

@ -76,7 +76,7 @@ unsafe extern "C" fn template_buffer_get(
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn ScDetectTemplateRegister() { pub unsafe extern "C" fn SCDetectTemplateRegister() {
/* TEMPLATE_START_REMOVE */ /* TEMPLATE_START_REMOVE */
if conf_get_node("app-layer.protocols.template").is_none() { if conf_get_node("app-layer.protocols.template").is_none() {
return; return;

@ -1330,7 +1330,7 @@ unsafe extern "C" fn service_name_get_data(
); );
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn ScDetectEnipRegister() { pub unsafe extern "C" fn SCDetectEnipRegister() {
let kw = SCSigTableElmt { let kw = SCSigTableElmt {
name: b"cip_service\0".as_ptr() as *const libc::c_char, name: b"cip_service\0".as_ptr() as *const libc::c_char,
desc: b"match on CIP Service, and optionnally class and attribute\0".as_ptr() desc: b"match on CIP Service, and optionnally class and attribute\0".as_ptr()

@ -264,7 +264,7 @@ unsafe extern "C" fn ldap_detect_responses_count_free(_de: *mut c_void, ctx: *mu
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn ScDetectLdapRegister() { pub unsafe extern "C" fn SCDetectLdapRegister() {
let kw = SCSigTableElmt { let kw = SCSigTableElmt {
name: b"ldap.request.operation\0".as_ptr() as *const libc::c_char, name: b"ldap.request.operation\0".as_ptr() as *const libc::c_char,
desc: b"match LDAP request operation\0".as_ptr() as *const libc::c_char, desc: b"match LDAP request operation\0".as_ptr() as *const libc::c_char,

@ -1099,7 +1099,7 @@ unsafe extern "C" fn mqtt_conn_clientid_get_data(
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn ScDetectMqttRegister() { pub unsafe extern "C" fn SCDetectMqttRegister() {
let keyword_name = b"mqtt.unsubscribe.topic\0".as_ptr() as *const libc::c_char; let keyword_name = b"mqtt.unsubscribe.topic\0".as_ptr() as *const libc::c_char;
let kw = SCSigTableElmt { let kw = SCSigTableElmt {
name: keyword_name, name: keyword_name,

@ -187,7 +187,7 @@ unsafe extern "C" fn rfb_sec_result_free(_de: *mut c_void, ctx: *mut c_void) {
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn ScDetectRfbRegister() { pub unsafe extern "C" fn SCDetectRfbRegister() {
let kw = SCSigTableElmt { let kw = SCSigTableElmt {
name: b"rfb.name\0".as_ptr() as *const libc::c_char, name: b"rfb.name\0".as_ptr() as *const libc::c_char,
desc: b"sticky buffer to match on the RFB desktop name\0".as_ptr() as *const libc::c_char, desc: b"sticky buffer to match on the RFB desktop name\0".as_ptr() as *const libc::c_char,

@ -578,7 +578,7 @@ unsafe extern "C" fn sip_content_length_hdr_get_data(
return false; return false;
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn ScDetectSipRegister() { pub unsafe extern "C" fn SCDetectSipRegister() {
let kw = SCSigTableElmt { let kw = SCSigTableElmt {
name: b"sip.protocol\0".as_ptr() as *const libc::c_char, name: b"sip.protocol\0".as_ptr() as *const libc::c_char,
desc: b"sticky buffer to match on the SIP protocol\0".as_ptr() as *const libc::c_char, desc: b"sticky buffer to match on the SIP protocol\0".as_ptr() as *const libc::c_char,

@ -183,7 +183,7 @@ pub unsafe extern "C" fn snmp_detect_community_get_data(
); );
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn ScDetectSNMPRegister() { pub unsafe extern "C" fn SCDetectSNMPRegister() {
let kw = SCSigTableElmt { let kw = SCSigTableElmt {
name: b"snmp.version\0".as_ptr() as *const libc::c_char, name: b"snmp.version\0".as_ptr() as *const libc::c_char,
desc: b"match SNMP version\0".as_ptr() as *const libc::c_char, desc: b"match SNMP version\0".as_ptr() as *const libc::c_char,

@ -277,7 +277,7 @@ pub unsafe extern "C" fn websocket_detect_payload_get_data(
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn ScDetectWebsocketRegister() { pub unsafe extern "C" fn SCDetectWebsocketRegister() {
let kw = SCSigTableElmt { let kw = SCSigTableElmt {
name: b"websocket.opcode\0".as_ptr() as *const libc::c_char, name: b"websocket.opcode\0".as_ptr() as *const libc::c_char,
desc: b"match WebSocket opcode\0".as_ptr() as *const libc::c_char, desc: b"match WebSocket opcode\0".as_ptr() as *const libc::c_char,

@ -255,10 +255,10 @@ def detect_patch_detect_engine_register_c(protoname):
output = io.StringIO() output = io.StringIO()
with open(filename) as infile: with open(filename) as infile:
for line in infile: for line in infile:
if line.find("ScDetect%sRegister" % protoname) > -1: if line.find("SCDetect%sRegister" % protoname) > -1:
# patch already applied # patch already applied
return return
if line.find("ScDetectTemplateRegister") > -1: if line.find("SCDetectTemplateRegister") > -1:
new = line.replace("Template", "%s" % protoname) new = line.replace("Template", "%s" % protoname)
output.write(new) output.write(new)
output.write(line) output.write(line)

@ -734,15 +734,15 @@ void SigTableSetup(void)
DetectVlanLayersRegister(); DetectVlanLayersRegister();
SCDetectSMTPRegister(); SCDetectSMTPRegister();
ScDetectSNMPRegister(); SCDetectSNMPRegister();
SCDetectDHCPRegister(); SCDetectDHCPRegister();
ScDetectWebsocketRegister(); SCDetectWebsocketRegister();
ScDetectEnipRegister(); SCDetectEnipRegister();
ScDetectMqttRegister(); SCDetectMqttRegister();
ScDetectRfbRegister(); SCDetectRfbRegister();
ScDetectSipRegister(); SCDetectSipRegister();
ScDetectTemplateRegister(); SCDetectTemplateRegister();
ScDetectLdapRegister(); SCDetectLdapRegister();
for (size_t i = 0; i < preregistered_callbacks_nb; i++) { for (size_t i = 0; i < preregistered_callbacks_nb; i++) {
PreregisteredCallbacks[i](); PreregisteredCallbacks[i]();

Loading…
Cancel
Save