]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: bindgen AppLayerParserConfParserEnabled
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 10 Jun 2025 08:08:57 +0000 (10:08 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 10 Jun 2025 20:13:53 +0000 (22:13 +0200)
Ticket: 7667

38 files changed:
examples/plugins/altemplate/src/template.rs
rust/src/applayer.rs
rust/src/applayertemplate/template.rs
rust/src/bittorrent_dht/bittorrent_dht.rs
rust/src/dcerpc/dcerpc.rs
rust/src/dcerpc/dcerpc_udp.rs
rust/src/dhcp/dhcp.rs
rust/src/dns/dns.rs
rust/src/enip/enip.rs
rust/src/http2/http2.rs
rust/src/ike/ike.rs
rust/src/krb/krb5.rs
rust/src/ldap/ldap.rs
rust/src/mdns/mdns.rs
rust/src/modbus/modbus.rs
rust/src/mqtt/mqtt.rs
rust/src/nfs/nfs.rs
rust/src/ntp/ntp.rs
rust/src/pgsql/pgsql.rs
rust/src/pop3/pop3.rs
rust/src/quic/quic.rs
rust/src/rdp/rdp.rs
rust/src/rfb/rfb.rs
rust/src/sip/sip.rs
rust/src/smb/smb.rs
rust/src/snmp/snmp.rs
rust/src/ssh/ssh.rs
rust/src/telnet/telnet.rs
rust/src/websocket/websocket.rs
rust/sys/src/sys.rs
src/app-layer-dnp3.c
src/app-layer-ftp.c
src/app-layer-htp.c
src/app-layer-parser.c
src/app-layer-parser.h
src/app-layer-smtp.c
src/app-layer-ssl.c
src/app-layer-tftp.c

index da05a5057bf6d31b1ba9e98addd3efa4c2d27272..de3f16993d217890a3ce1ec73a6ecdb598b7cb16 100644 (file)
@@ -27,7 +27,7 @@ use std::collections::VecDeque;
 use std::ffi::CString;
 use std::os::raw::{c_char, c_int, c_void};
 use suricata::applayer::{
-    state_get_tx_iterator, AppLayerEvent, AppLayerParserConfParserEnabled, AppLayerRegisterParser,
+    state_get_tx_iterator, AppLayerEvent, AppLayerRegisterParser,
     AppLayerRegisterProtocolDetection, AppLayerResult, AppLayerStateData, AppLayerTxData,
     RustParser, State, StreamSlice, Transaction, APP_LAYER_PARSER_EOF_TC, APP_LAYER_PARSER_EOF_TS,
     APP_LAYER_PARSER_OPT_ACCEPT_GAPS,
@@ -38,8 +38,9 @@ use suricata::{
     build_slice, cast_pointer, export_state_data_get, export_tx_data_get, SCLogError, SCLogNotice,
 };
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, Flow, SCAppLayerParserRegisterLogger,
-    SCAppLayerParserStateIssetFlag, SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, Flow, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
 static mut TEMPLATE_MAX_TX: usize = 256;
@@ -413,7 +414,7 @@ pub(super) unsafe extern "C" fn template_register_parser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_TEMPLATE = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if let Some(val) = conf_get("app-layer.protocols.template.max-tx") {
index 1841376306b7dbfbf939f1751eaed2a71121500c..e46c58ee5233261e08400820b0d35e80b7851869 100644 (file)
@@ -535,11 +535,6 @@ pub const _APP_LAYER_TX_INSPECTED_TS: u8 = BIT_U8!(2);
 pub const _APP_LAYER_TX_INSPECTED_TC: u8 = BIT_U8!(3);
 pub const APP_LAYER_TX_ACCEPT: u8 = BIT_U8!(4);
 
-/// cbindgen:ignore
-extern "C" {
-    pub fn AppLayerParserConfParserEnabled(ipproto: *const c_char, proto: *const c_char) -> c_int;
-}
-
 #[repr(C)]
 pub struct AppLayerGetTxIterTuple {
     tx_ptr: *mut std::os::raw::c_void,
index f30f4bae0d22d332314b29c714a50242aa3fed56..022343306a390988c726cbe9c6f49bf7a3f89ae3 100644 (file)
@@ -26,7 +26,8 @@ use std::collections::VecDeque;
 use std::ffi::CString;
 use std::os::raw::{c_char, c_int, c_void};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
     SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
@@ -408,7 +409,7 @@ pub unsafe extern "C" fn SCRegisterTemplateParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_TEMPLATE = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if let Some(val) = conf_get("app-layer.protocols.template.max-tx") {
index 963fe099d872c47ed66db256aae8118ecd97bf94..32fb2274f6bfd6ef49ee1ea1c702d16a274e14fe 100644 (file)
@@ -16,8 +16,9 @@
  */
 
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerProtoDetectPMRegisterPatternCS,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    SCAppLayerProtoDetectPMRegisterPatternCS,
 };
 
 use crate::applayer::{self, *};
@@ -295,7 +296,7 @@ pub unsafe extern "C" fn SCRegisterBittorrentDhtUdpParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_BITTORRENT_DHT = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
 
index 2c970dc347ea7c449b4551a2cf9b4edf8662a8d3..4a5573651fd41aea46616dd9071ad3dbb0b0f06c 100644 (file)
@@ -25,8 +25,8 @@ use nom7::error::{Error, ErrorKind};
 use nom7::number::Endianness;
 use nom7::{Err, IResult, Needed};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerProtoDetectConfProtoDetectionEnabled,
-    SCAppLayerProtoDetectPMRegisterPatternCSwPP,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerProtoDetectPMRegisterPatternCSwPP,
 };
 use std;
 use std::cmp;
@@ -1252,7 +1252,7 @@ pub unsafe extern "C" fn SCRegisterDcerpcParser() {
         if register_pattern_probe() < 0 {
             return;
         }
-        if AppLayerParserConfParserEnabled(
+        if SCAppLayerParserConfParserEnabled(
             ip_proto_str.as_ptr(),
             parser.name,
         ) != 0
index 745f7c1f47c89c3e76f8d237ece94a2b8a11b67b..48cd6a6580f461fa0a29985f61c345e94dc36c84 100644 (file)
@@ -25,8 +25,8 @@ use crate::direction::{Direction, DIR_BOTH};
 use crate::flow::Flow;
 use nom7::Err;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerProtoDetectConfProtoDetectionEnabled,
-    SCAppLayerProtoDetectPMRegisterPatternCSwPP,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerProtoDetectPMRegisterPatternCSwPP,
 };
 use std;
 use std::ffi::CString;
@@ -391,7 +391,7 @@ pub unsafe extern "C" fn SCRegisterDcerpcUdpParser() {
         if register_pattern_probe() < 0 {
             return;
         }
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
     } else {
index 2e5a5fb4e402030aeb29e1bb5507f5c4df264f58..b1303bd83c704bec0c3fcb140e22e6e8dd82a14d 100644 (file)
@@ -16,7 +16,8 @@
  */
 
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
 use crate::applayer::{self, *};
@@ -301,7 +302,7 @@ pub unsafe extern "C" fn SCRegisterDhcpParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_DHCP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
     } else {
index 6da3885abd4606f2d2c48e998b8fe7f7160729f9..8d636d2ef7dab73be07cc5649f1b20b459f54be7 100644 (file)
@@ -32,7 +32,7 @@ use crate::frames::Frame;
 use nom7::number::streaming::be_u16;
 use nom7::{Err, IResult};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, DetectEngineThreadCtx,
+    AppLayerParserState, AppProto, DetectEngineThreadCtx, SCAppLayerParserConfParserEnabled,
     SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
@@ -1314,7 +1314,7 @@ pub unsafe extern "C" fn SCRegisterDnsUdpParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_DNS = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
     }
@@ -1361,7 +1361,7 @@ pub unsafe extern "C" fn SCRegisterDnsTcpParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_DNS = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
     }
index 70a3d97044fd588af1b0a7627176a32ce6b135d9..f6c8f34e7d96745172ff5a0b6f9f88fe1c54c394 100644 (file)
@@ -30,9 +30,9 @@ use std::collections::VecDeque;
 use std::ffi::CString;
 use std::os::raw::{c_char, c_int, c_void};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger,
-    SCAppLayerParserRegisterParserAcceptableDataDirection, SCAppLayerParserStateIssetFlag,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerParserRegisterParserAcceptableDataDirection,
+    SCAppLayerParserStateIssetFlag, SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
 pub(super) static mut ALPROTO_ENIP: AppProto = ALPROTO_UNKNOWN;
@@ -650,7 +650,7 @@ pub unsafe extern "C" fn SCEnipRegisterParsers() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_ENIP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCLogDebug!("Rust enip parser registered for UDP.");
@@ -675,7 +675,7 @@ pub unsafe extern "C" fn SCEnipRegisterParsers() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_ENIP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCLogDebug!("Rust enip parser registered for TCP.");
index bb35a8d1dbf7509b39aa9dd074fc59fab36072d5..5b7797551362f221105bc426375cccaff57d64f8 100644 (file)
@@ -39,7 +39,8 @@ use std::ffi::CString;
 use std::fmt;
 use std::io;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerForceProtocolChange, SCAppLayerParserRegisterLogger,
+    AppLayerParserState, AppProto, SCAppLayerForceProtocolChange,
+    SCAppLayerParserConfParserEnabled, SCAppLayerParserRegisterLogger,
     SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
@@ -1574,7 +1575,7 @@ pub unsafe extern "C" fn SCRegisterHttp2Parser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_HTTP2 = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if let Some(val) = conf_get("app-layer.protocols.http2.max-streams") {
@@ -1611,7 +1612,7 @@ pub unsafe extern "C" fn SCRegisterHttp2Parser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_DOH2 = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         } else {
             SCLogWarning!("DOH2 is not meant to be detection-only.");
index b63cd82d0b18b84ff8dc51a1bf9db25c8caec3a1..6038c9e1677edc3d6f17dd70b97bd21b35bc5722 100644 (file)
@@ -33,7 +33,8 @@ use std;
 use std::collections::HashSet;
 use std::ffi::CString;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
 #[derive(AppLayerEvent)]
@@ -410,7 +411,7 @@ pub unsafe extern "C" fn SCRegisterIkeParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_IKE = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
 
index a778c80353ff05f95713e66b6378f0d9ff8a8ea1..772bb241784ad6cd2f97aed7419dfa8f8533af11 100644 (file)
@@ -33,8 +33,8 @@ use nom7::{Err, IResult};
 use std;
 use std::ffi::CString;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
 #[derive(AppLayerEvent)]
@@ -638,7 +638,7 @@ pub unsafe extern "C" fn SCRegisterKrb5Parser() {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         // store the allocated ID for the probe function
         ALPROTO_KRB5 = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCAppLayerParserRegisterLogger(IPPROTO_UDP, ALPROTO_KRB5);
@@ -656,7 +656,7 @@ pub unsafe extern "C" fn SCRegisterKrb5Parser() {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         // store the allocated ID for the probe function
         ALPROTO_KRB5 = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCAppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_KRB5);
index b81afa8bca36f3e1ceddd4afd3895dee72a55208..0b7e078343098414552385787bc8683dd4f08a6b 100644 (file)
@@ -29,7 +29,8 @@ use std::collections::VecDeque;
 use std::ffi::CString;
 use std::os::raw::{c_char, c_int, c_void};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
     SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerRequestProtocolTLSUpgrade,
 };
 
@@ -706,7 +707,7 @@ pub unsafe extern "C" fn SCRegisterLdapTcpParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_LDAP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if let Some(val) = conf_get("app-layer.protocols.ldap.max-tx") {
@@ -765,7 +766,7 @@ pub unsafe extern "C" fn SCRegisterLdapUdpParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_LDAP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if let Some(val) = conf_get("app-layer.protocols.ldap.max-tx") {
index 0b3256ab3fab5f5f8d0822895d0a9c379543cb61..4c5d596e0766872e0b469860c1d124f4cb4363f7 100644 (file)
@@ -26,7 +26,10 @@ use crate::dns::dns;
 use crate::flow::Flow;
 
 use suricata_sys::sys::DetectEngineThreadCtx;
-use suricata_sys::sys::{AppProto, AppProtoEnum, SCAppLayerProtoDetectConfProtoDetectionEnabled};
+use suricata_sys::sys::{
+    AppProto, AppProtoEnum, SCAppLayerParserConfParserEnabled,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled,
+};
 
 pub(super) static mut ALPROTO_MDNS: AppProto = ALPROTO_UNKNOWN;
 
@@ -124,7 +127,7 @@ pub unsafe extern "C" fn SCRegisterMdnsParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_MDNS = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
     }
index 39bc8638dddbc0188f9c9cbddae2c773709ddc39..9c277bd77c0a85e78a48f2dc7c909d5f8b27966b 100644 (file)
@@ -26,7 +26,8 @@ use sawp::parser::{Direction, Parse};
 use sawp::probe::{Probe, Status};
 use sawp_modbus::{self, AccessType, ErrorFlags, Flags, Message};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
     SCAppLayerProtoDetectConfProtoDetectionEnabledDefault,
 };
 
@@ -450,7 +451,7 @@ pub unsafe extern "C" fn SCRegisterModbusParser() {
     {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_MODBUS = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCAppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_MODBUS);
index f3c72b659b43e061f40cf60c64fb42b6afacb06e..1b688eac064686b407cba124c8e6f7aff88d4fec 100644 (file)
@@ -31,7 +31,8 @@ use std;
 use std::collections::VecDeque;
 use std::ffi::CString;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
 // Used as a special pseudo packet identifier to denote the first CONNECT
@@ -790,7 +791,7 @@ pub unsafe extern "C" fn SCMqttRegisterParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_MQTT = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if let Some(val) = conf_get("app-layer.protocols.mqtt.max-tx") {
index 59ca1c6ff6a5f938233db196099e6dec4ac4d9e5..309d91c0fb902f4c0a2d5bbf045fb1539f69e518 100644 (file)
@@ -24,8 +24,9 @@ use std::ffi::CString;
 
 use nom7::{Err, Needed};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerProtoDetectConfProtoDetectionEnabled,
-    SCAppLayerProtoDetectPPParseConfPorts, SCAppLayerProtoDetectPPRegister,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerProtoDetectPPParseConfPorts,
+    SCAppLayerProtoDetectPPRegister,
 };
 
 use crate::applayer;
@@ -2398,7 +2399,7 @@ pub unsafe extern "C" fn SCRegisterNfsParser() {
                 Some(ffi_nfs_probe),
             );
         }
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCLogDebug!("Rust nfs parser registered.");
@@ -2474,7 +2475,7 @@ pub unsafe extern "C" fn SCRegisterNfsUdpParser() {
                 Some(nfs_probe_udp_tc),
             );
         }
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if let Some(val) = conf_get("app-layer.protocols.nfs.max-tx") {
index 1a5c9ac0ccbad83444e09d033b965251b7159117..a94a4bf65dd4e3562338a639b8e45c8ed6b64049 100644 (file)
@@ -29,7 +29,8 @@ use std::ffi::CString;
 
 use nom7::Err;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
 #[derive(AppLayerEvent)]
@@ -297,7 +298,7 @@ pub unsafe extern "C" fn SCRegisterNtpParser() {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         // store the allocated ID for the probe function
         ALPROTO_NTP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
     } else {
index 42720ca231b15e62e2cbceb6b96c90930ab159ce..903b7df0063510f82653654babcd533199320b45 100644 (file)
@@ -31,7 +31,8 @@ use std;
 use std::collections::VecDeque;
 use std::ffi::CString;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserSetStreamDepth, SCAppLayerParserStateIssetFlag,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserSetStreamDepth, SCAppLayerParserStateIssetFlag,
     SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerRequestProtocolTLSUpgrade,
 };
 
@@ -961,7 +962,7 @@ pub unsafe extern "C" fn SCRegisterPgsqlParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_PGSQL = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCLogDebug!("Rust pgsql parser registered.");
index 4ce9d83aadf7d0aac6b6c2afd506646f571a9b5f..e912711c1ab7d0a5ccb091f080d11aee32ccce5f 100644 (file)
@@ -29,9 +29,9 @@ use std::collections::VecDeque;
 use std::ffi::CString;
 use std::os::raw::{c_char, c_int, c_void};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger, SCAppLayerParserSetStreamDepth,
-    SCAppLayerParserStateIssetFlag, SCAppLayerProtoDetectConfProtoDetectionEnabled,
-    SCAppLayerRequestProtocolTLSUpgrade,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerParserSetStreamDepth, SCAppLayerParserStateIssetFlag,
+    SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerRequestProtocolTLSUpgrade,
 };
 
 use sawp::error::Error as SawpError;
@@ -518,7 +518,7 @@ pub unsafe extern "C" fn SCRegisterPop3Parser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_POP3 = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         let retval = conf_get("app-layer.protocols.pop3.stream-depth");
index 3a2fdf185f3d20986077c3e20bd6e188a6cf9277..9e5fc3824c8c21e6af8043051efb600789c1ef26 100644 (file)
@@ -34,8 +34,8 @@ use crate::{
 use std::collections::VecDeque;
 use std::ffi::CString;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 use tls_parser::TlsExtensionType;
 
@@ -585,7 +585,7 @@ pub unsafe extern "C" fn SCRegisterQuicParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_QUIC = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCLogDebug!("Rust quic parser registered.");
index bae570a032dc69bbe8b34b2b642fde397c057ade..89fb54017e86deda95ea0f7dc845ead10561f86f 100644 (file)
@@ -30,8 +30,8 @@ use nom7::Err;
 use std;
 use std::collections::VecDeque;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 use tls_parser::{parse_tls_plaintext, TlsMessage, TlsMessageHandshake, TlsRecordType};
 
@@ -533,7 +533,7 @@ pub unsafe extern "C" fn SCRegisterRdpParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_RDP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCAppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_RDP);
index 80da7f1c2972a6d28dd145de8ef812a9aab2d944..9c033c5b0d21c443abf53e34b61ee6f7694c33c6 100644 (file)
@@ -32,8 +32,9 @@ use std;
 use std::ffi::CString;
 use std::os::raw::c_char;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerProtoDetectPMRegisterPatternCI,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    SCAppLayerProtoDetectPMRegisterPatternCI,
 };
 
 pub(super) static mut ALPROTO_RFB: AppProto = ALPROTO_UNKNOWN;
@@ -922,7 +923,7 @@ pub unsafe extern "C" fn SCRfbRegisterParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_RFB = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCLogDebug!("Rust rfb parser registered.");
index 77c0f46aa2e3adfb1e2d61cc14ac418b557305c4..5dd512af230e9dc708efec6a45d7f6f9c59cac05 100755 (executable)
@@ -31,7 +31,8 @@ use std;
 use std::collections::VecDeque;
 use std::ffi::CString;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerParserStateIssetFlag,
     SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerProtoDetectPMRegisterPatternCS,
 };
 
@@ -595,7 +596,7 @@ pub unsafe extern "C" fn SCRegisterSipParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_SIP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if register_pattern_probe(core::IPPROTO_UDP) < 0 {
@@ -617,7 +618,7 @@ pub unsafe extern "C" fn SCRegisterSipParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_SIP = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         if register_pattern_probe(core::IPPROTO_TCP) < 0 {
index 3f231ee43674a6f6cd7349a355bd5a542a32ea37..663f54ff59481d85517fdc4bf952c3aa46b17e2f 100644 (file)
@@ -35,9 +35,10 @@ use nom7::error::{make_error, ErrorKind};
 
 use lru::LruCache;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserSetStreamDepth,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled, SCAppLayerProtoDetectPMRegisterPatternCSwPP,
-    SCAppLayerProtoDetectPPParseConfPorts, SCAppLayerProtoDetectPPRegister,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserSetStreamDepth, SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    SCAppLayerProtoDetectPMRegisterPatternCSwPP, SCAppLayerProtoDetectPPParseConfPorts,
+    SCAppLayerProtoDetectPPRegister,
 };
 use std::num::NonZeroUsize;
 
@@ -2390,7 +2391,7 @@ pub unsafe extern "C" fn SCRegisterSmbParser() {
                                           0, MIN_REC_SIZE, Direction::ToServer as u8, Some(c_smb_probe_tcp), Some(c_smb_probe_tcp));
         }
 
-        if AppLayerParserConfParserEnabled(
+        if SCAppLayerParserConfParserEnabled(
             ip_proto_str.as_ptr(),
             parser.name,
         ) != 0
index 5e164d95844aa44f6d160f5af827b060e7e04303..41bbffb7aa918871647eddf049a45561c0ce3176 100644 (file)
@@ -35,7 +35,7 @@ use nom7::error::{ErrorKind, make_error};
 use suricata_sys::sys::{
     AppLayerParserState, AppProto, AppProtoNewProtoFromString, EveJsonTxLoggerRegistrationData,
     SCAppLayerParserRegisterLogger, SCAppLayerProtoDetectConfProtoDetectionEnabled,
-    SCOutputEvePreRegisterLogger, SCOutputJsonLogDirection, SCSigTablePreRegister,
+    SCOutputEvePreRegisterLogger, SCOutputJsonLogDirection, SCSigTablePreRegister, SCAppLayerParserConfParserEnabled,
 };
 
 #[derive(AppLayerEvent)]
@@ -425,14 +425,14 @@ pub unsafe extern "C" fn SCRegisterSnmpParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         // port 161
         _ = AppLayerRegisterProtocolDetection(&parser, 1);
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, ALPROTO_SNMP);
         }
         // port 162
         let default_port_traps = CString::new("162").unwrap();
         parser.default_port = default_port_traps.as_ptr();
         let _ = AppLayerRegisterProtocolDetection(&parser, 1);
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, ALPROTO_SNMP);
         }
         SCAppLayerParserRegisterLogger(IPPROTO_UDP, ALPROTO_SNMP);
index 9c25fe5a19a93f83adebbf6f7931cb85d28a0236..99cb28f485a6e57b6b4bd5e6cc5b434cef6a2aa5 100644 (file)
@@ -25,7 +25,8 @@ use nom7::Err;
 use std::ffi::CString;
 use std::sync::atomic::{AtomicBool, Ordering};
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger, SCAppLayerParserStateSetFlag,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerParserStateSetFlag,
     SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
@@ -578,7 +579,7 @@ pub unsafe extern "C" fn SCRegisterSshParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_SSH = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCAppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_SSH);
index 4d7782cd626862ba96b64a80a85dd08bef14b011..86871eb8cc7d37d3a0a8ea03c7f0dda081c5b8f2 100644 (file)
@@ -23,8 +23,8 @@ use crate::frames::*;
 use std::ffi::CString;
 use nom7::IResult;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserStateIssetFlag,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserStateIssetFlag, SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 use super::parser;
 
@@ -549,7 +549,7 @@ pub unsafe extern "C" fn SCRegisterTelnetParser() {
     {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_TELNET = alproto;
-        if AppLayerParserConfParserEnabled(
+        if SCAppLayerParserConfParserEnabled(
             ip_proto_str.as_ptr(),
             parser.name,
         ) != 0
index 6d4e6175687943861852a2902b240ad03a524fb3..343e69c1a0ca1eac5feb64f312f7a44ac05b680c 100644 (file)
@@ -31,8 +31,8 @@ use nom7::Needed;
 use flate2::Decompress;
 use flate2::FlushDecompress;
 use suricata_sys::sys::{
-    AppLayerParserState, AppProto, SCAppLayerParserRegisterLogger,
-    SCAppLayerProtoDetectConfProtoDetectionEnabled,
+    AppLayerParserState, AppProto, SCAppLayerParserConfParserEnabled,
+    SCAppLayerParserRegisterLogger, SCAppLayerProtoDetectConfProtoDetectionEnabled,
 };
 
 use std;
@@ -432,7 +432,7 @@ pub unsafe extern "C" fn SCRegisterWebSocketParser() {
     if SCAppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
         let alproto = AppLayerRegisterProtocolDetection(&parser, 1);
         ALPROTO_WEBSOCKET = alproto;
-        if AppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
+        if SCAppLayerParserConfParserEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
             let _ = AppLayerRegisterParser(&parser, alproto);
         }
         SCLogDebug!("Rust websocket parser registered.");
index 5e555a4d4cd6297f8e41a6a71018ee12598d93b2..60e3ece42403d95133a0dcf91ce93719a448ec78 100644 (file)
@@ -695,6 +695,12 @@ pub struct AppLayerParserState_ {
     _unused: [u8; 0],
 }
 pub type AppLayerParserState = AppLayerParserState_;
+extern "C" {
+    #[doc = " \\brief Given a protocol name, checks if the parser is enabled in\n        the conf file.\n\n \\param alproto_name Name of the app layer protocol.\n\n \\retval 1 If enabled.\n \\retval 0 If disabled."]
+    pub fn SCAppLayerParserConfParserEnabled(
+        ipproto: *const ::std::os::raw::c_char, alproto_name: *const ::std::os::raw::c_char,
+    ) -> ::std::os::raw::c_int;
+}
 extern "C" {
     pub fn SCAppLayerParserRegisterParserAcceptableDataDirection(
         ipproto: u8, alproto: AppProto, direction: u8,
index 4fe796d58a8a0840703a028085b15d8f7ab34380..cfeb3051e48208c001f7d214349e22091ccc01b4 100644 (file)
@@ -1556,8 +1556,7 @@ void RegisterDNP3Parsers(void)
         SCReturn;
     }
 
-    if (AppLayerParserConfParserEnabled("tcp", proto_name))
-    {
+    if (SCAppLayerParserConfParserEnabled("tcp", proto_name)) {
         SCLogConfig("Registering DNP3/tcp parsers.");
 
         AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_DNP3, STREAM_TOSERVER,
@@ -1586,8 +1585,7 @@ void RegisterDNP3Parsers(void)
         AppLayerParserRegisterTxDataFunc(IPPROTO_TCP, ALPROTO_DNP3,
             DNP3GetTxData);
         AppLayerParserRegisterStateDataFunc(IPPROTO_TCP, ALPROTO_DNP3, DNP3GetStateData);
-    }
-    else {
+    } else {
         SCLogConfig("Parser disabled for protocol %s. "
             "Protocol detection still on.", proto_name);
     }
index 6ca2b3fc0ebd745521a5722020fd56f64850a892..c5f3bf48d182791248c85827c4b7f96bce87ac7e 100644 (file)
@@ -1281,7 +1281,7 @@ void RegisterFTPParsers(void)
         AppLayerProtoDetectRegisterProtocol(ALPROTO_FTPDATA, proto_data_name);
     }
 
-    if (AppLayerParserConfParserEnabled("tcp", proto_name)) {
+    if (SCAppLayerParserConfParserEnabled("tcp", proto_name)) {
         AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_FTP, STREAM_TOSERVER,
                                      FTPParseRequest);
         AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_FTP, STREAM_TOCLIENT,
index f19e1df631e2fd4b631a2a6d33cdecec2eeb27a2..edc04a78d963f0f5107720434df12ccf0254c433 100644 (file)
@@ -1593,7 +1593,7 @@ void HTPFreeConfig(void)
     SCEnter();
 
     if (!SCAppLayerProtoDetectConfProtoDetectionEnabled("tcp", "http") ||
-            !AppLayerParserConfParserEnabled("tcp", "http")) {
+            !SCAppLayerParserConfParserEnabled("tcp", "http")) {
         SCReturn;
     }
 
@@ -2630,7 +2630,7 @@ void RegisterHTPParsers(void)
         return;
     }
 
-    if (AppLayerParserConfParserEnabled("tcp", proto_name)) {
+    if (SCAppLayerParserConfParserEnabled("tcp", proto_name)) {
         AppLayerParserRegisterStateFuncs(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateAlloc, HTPStateFree);
         AppLayerParserRegisterTxFreeFunc(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateTransactionFree);
         AppLayerParserRegisterGetTxFilesFunc(IPPROTO_TCP, ALPROTO_HTTP1, HTPGetTxFiles);
index 43ba87242c6c20c52e6db0066321467453d117b6..d8f58b1a83c5b89578a8724f320725bda34641d9 100644 (file)
@@ -342,8 +342,7 @@ void AppLayerParserThreadCtxFree(AppLayerParserThreadCtx *tctx)
 /** \brief check if a parser is enabled in the config
  *  Returns enabled always if: were running unittests
  */
-int AppLayerParserConfParserEnabled(const char *ipproto,
-                                    const char *alproto_name)
+int SCAppLayerParserConfParserEnabled(const char *ipproto, const char *alproto_name)
 {
     SCEnter();
 
index 80b59a715abe1b6f47d25e47ae64c7c5235b7349..d1a6bbdcbf73e66e7e4c4d341f03aa538809a9ea 100644 (file)
@@ -123,8 +123,7 @@ void AppLayerParserThreadCtxFree(AppLayerParserThreadCtx *tctx);
  * \retval 1 If enabled.
  * \retval 0 If disabled.
  */
-int AppLayerParserConfParserEnabled(const char *ipproto,
-                                    const char *alproto_name);
+int SCAppLayerParserConfParserEnabled(const char *ipproto, const char *alproto_name);
 
 enum ExceptionPolicy AppLayerErrorGetExceptionPolicy(void);
 
index f25b076130ddf146741f2f46537a00d2f0832ede..bf94d71c5a1fe80ea302c54d54194d45085e0b19 100644 (file)
@@ -1873,7 +1873,7 @@ void RegisterSMTPParsers(void)
         return;
     }
 
-    if (AppLayerParserConfParserEnabled("tcp", proto_name)) {
+    if (SCAppLayerParserConfParserEnabled("tcp", proto_name)) {
         AppLayerParserRegisterStateFuncs(IPPROTO_TCP, ALPROTO_SMTP, SMTPStateAlloc, SMTPStateFree);
 
         AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_SMTP, STREAM_TOSERVER,
index 9ca4b10a2fdfd4e564b88a258573402df180f462..ba755b44bf7ff391996490bf380a9ed06ba6c162 100644 (file)
@@ -3216,7 +3216,7 @@ void RegisterSSLParsers(void)
         return;
     }
 
-    if (AppLayerParserConfParserEnabled("tcp", proto_name)) {
+    if (SCAppLayerParserConfParserEnabled("tcp", proto_name)) {
         AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_TLS, STREAM_TOSERVER,
                                      SSLParseClientRecord);
 
index 618c44cd131abbd958709eb9c4fa33ac521d3811..131906aaaf91e2be16b109a36a2aef22484e245f 100644 (file)
@@ -184,7 +184,7 @@ void RegisterTFTPParsers(void)
         return;
     }
 
-    if (AppLayerParserConfParserEnabled("udp", proto_name)) {
+    if (SCAppLayerParserConfParserEnabled("udp", proto_name)) {
 
         SCLogDebug("Registering TFTP protocol parser.");
 
@@ -223,8 +223,7 @@ void RegisterTFTPParsers(void)
 
         AppLayerParserRegisterTxDataFunc(IPPROTO_UDP, ALPROTO_TFTP, SCTftpGetTxData);
         AppLayerParserRegisterStateDataFunc(IPPROTO_UDP, ALPROTO_TFTP, SCTftpGetStateData);
-    }
-    else {
+    } else {
         SCLogDebug("TFTP protocol parsing disabled.");
     }
 }