]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
misc: prefix functions with SC not Sc 11275/head
authorJason Ish <jason.ish@oisf.net>
Fri, 7 Jun 2024 23:28:01 +0000 (17:28 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 8 Jun 2024 05:28:39 +0000 (07:28 +0200)
15 files changed:
rust/src/detect/byte_math.rs
rust/src/enip/detect.rs
rust/src/enip/enip.rs
src/detect-bytemath.c
src/detect-enip-capabilities.c
src/detect-enip-command.c
src/detect-enip-device-type.c
src/detect-enip-identity-status.c
src/detect-enip-product-code.c
src/detect-enip-protocol-version.c
src/detect-enip-revision.c
src/detect-enip-serial.c
src/detect-enip-state.c
src/detect-enip-status.c
src/detect-enip-vendor-id.c

index 0586a92e5df8611716b70267a1ee3c6d062636a8..c362e37b48ad1e228b1b5f12f625532aba3f343d 100644 (file)
@@ -420,7 +420,7 @@ fn parse_bytemath(input: &str) -> IResult<&str, DetectByteMathData, RuleParseErr
 
 /// Intermediary function between the C code and the parsing functions.
 #[no_mangle]
-pub unsafe extern "C" fn ScByteMathParse(c_arg: *const c_char) -> *mut DetectByteMathData {
+pub unsafe extern "C" fn SCByteMathParse(c_arg: *const c_char) -> *mut DetectByteMathData {
     if c_arg.is_null() {
         return std::ptr::null_mut();
     }
@@ -438,7 +438,7 @@ pub unsafe extern "C" fn ScByteMathParse(c_arg: *const c_char) -> *mut DetectByt
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScByteMathFree(ptr: *mut DetectByteMathData) {
+pub unsafe extern "C" fn SCByteMathFree(ptr: *mut DetectByteMathData) {
     if !ptr.is_null() {
         let _ = Box::from_raw(ptr);
     }
index 95361adb252342aaebfe62239ed9e8532dce9f5b..2de00ca0143a4552449b068a272dbed28fd46a26 100644 (file)
@@ -64,7 +64,7 @@ pub unsafe extern "C" fn SCEnipParseStatus(
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetCommand(
+pub unsafe extern "C" fn SCEnipTxGetCommand(
     tx: &mut EnipTransaction, direction: u8, value: *mut u16,
 ) -> bool {
     let direction: Direction = direction.into();
@@ -452,7 +452,7 @@ pub unsafe extern "C" fn SCEnipTxHasCipAttribute(
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetStatus(
+pub unsafe extern "C" fn SCEnipTxGetStatus(
     tx: &mut EnipTransaction, direction: u8, value: *mut u32,
 ) -> bool {
     if let Some(x) = enip_get_status(tx, direction.into()) {
@@ -491,7 +491,7 @@ fn enip_tx_get_protocol_version(tx: &mut EnipTransaction, direction: Direction)
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetProtocolVersion(
+pub unsafe extern "C" fn SCEnipTxGetProtocolVersion(
     tx: &mut EnipTransaction, direction: u8, value: *mut u16,
 ) -> bool {
     if let Some(val) = enip_tx_get_protocol_version(tx, direction.into()) {
@@ -502,7 +502,7 @@ pub unsafe extern "C" fn ScEnipTxGetProtocolVersion(
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetCapabilities(
+pub unsafe extern "C" fn SCEnipTxGetCapabilities(
     tx: &mut EnipTransaction, value: *mut u16,
 ) -> bool {
     if let Some(ref response) = tx.response {
@@ -519,7 +519,7 @@ pub unsafe extern "C" fn ScEnipTxGetCapabilities(
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetRevision(tx: &mut EnipTransaction, value: *mut u16) -> bool {
+pub unsafe extern "C" fn SCEnipTxGetRevision(tx: &mut EnipTransaction, value: *mut u16) -> bool {
     if let Some(ref response) = tx.response {
         if let EnipPayload::ListIdentity(lip) = &response.payload {
             if !lip.is_empty() {
@@ -534,7 +534,7 @@ pub unsafe extern "C" fn ScEnipTxGetRevision(tx: &mut EnipTransaction, value: *m
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetIdentityStatus(
+pub unsafe extern "C" fn SCEnipTxGetIdentityStatus(
     tx: &mut EnipTransaction, value: *mut u16,
 ) -> bool {
     if let Some(ref response) = tx.response {
@@ -551,7 +551,7 @@ pub unsafe extern "C" fn ScEnipTxGetIdentityStatus(
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetState(tx: &mut EnipTransaction, value: *mut u8) -> bool {
+pub unsafe extern "C" fn SCEnipTxGetState(tx: &mut EnipTransaction, value: *mut u8) -> bool {
     if let Some(ref response) = tx.response {
         if let EnipPayload::ListIdentity(lip) = &response.payload {
             if !lip.is_empty() {
@@ -566,7 +566,7 @@ pub unsafe extern "C" fn ScEnipTxGetState(tx: &mut EnipTransaction, value: *mut
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetSerial(tx: &mut EnipTransaction, value: *mut u32) -> bool {
+pub unsafe extern "C" fn SCEnipTxGetSerial(tx: &mut EnipTransaction, value: *mut u32) -> bool {
     if let Some(ref response) = tx.response {
         if let EnipPayload::ListIdentity(lip) = &response.payload {
             if !lip.is_empty() {
@@ -581,7 +581,7 @@ pub unsafe extern "C" fn ScEnipTxGetSerial(tx: &mut EnipTransaction, value: *mut
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetProductCode(tx: &mut EnipTransaction, value: *mut u16) -> bool {
+pub unsafe extern "C" fn SCEnipTxGetProductCode(tx: &mut EnipTransaction, value: *mut u16) -> bool {
     if let Some(ref response) = tx.response {
         if let EnipPayload::ListIdentity(lip) = &response.payload {
             if !lip.is_empty() {
@@ -596,7 +596,7 @@ pub unsafe extern "C" fn ScEnipTxGetProductCode(tx: &mut EnipTransaction, value:
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetDeviceType(tx: &mut EnipTransaction, value: *mut u16) -> bool {
+pub unsafe extern "C" fn SCEnipTxGetDeviceType(tx: &mut EnipTransaction, value: *mut u16) -> bool {
     if let Some(ref response) = tx.response {
         if let EnipPayload::ListIdentity(lip) = &response.payload {
             if !lip.is_empty() {
@@ -611,7 +611,7 @@ pub unsafe extern "C" fn ScEnipTxGetDeviceType(tx: &mut EnipTransaction, value:
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn ScEnipTxGetVendorId(tx: &mut EnipTransaction, value: *mut u16) -> bool {
+pub unsafe extern "C" fn SCEnipTxGetVendorId(tx: &mut EnipTransaction, value: *mut u16) -> bool {
     if let Some(ref response) = tx.response {
         if let EnipPayload::ListIdentity(lip) = &response.payload {
             if !lip.is_empty() {
index db6a29a00b33fcfdf43b8d36b4d21ee1d5020794..834e3e2af4f3a70506dca62b71cc179ba2055fa9 100644 (file)
@@ -576,7 +576,7 @@ pub enum EnipFrameType {
 }
 
 export_tx_data_get!(rs_enip_get_tx_data, EnipTransaction);
-export_state_data_get!(ScEnipTxGetState_data, EnipState);
+export_state_data_get!(SCEnipTxGetState_data, EnipState);
 
 // Parser name as a C style string.
 const PARSER_NAME: &[u8] = b"enip\0";
@@ -609,7 +609,7 @@ pub unsafe extern "C" fn SCEnipRegisterParsers() {
         get_tx_files: None,
         get_tx_iterator: Some(applayer::state_get_tx_iterator::<EnipState, EnipTransaction>),
         get_tx_data: rs_enip_get_tx_data,
-        get_state_data: ScEnipTxGetState_data,
+        get_state_data: SCEnipTxGetState_data,
         apply_tx_config: None,
         flags: 0,
         truncate: None,
index a1dfc7e9851450380870a34ec05245e7b3c7c406..42f3aae718f46b9ea92744082169c5697898cf3f 100644 (file)
@@ -219,7 +219,7 @@ static DetectByteMathData *DetectByteMathParse(
         DetectEngineCtx *de_ctx, const char *arg, char **nbytes, char **rvalue)
 {
     DetectByteMathData *bmd;
-    if ((bmd = ScByteMathParse(arg)) == NULL) {
+    if ((bmd = SCByteMathParse(arg)) == NULL) {
         SCLogError("invalid bytemath values");
         return NULL;
     }
@@ -428,7 +428,7 @@ static int DetectByteMathSetup(DetectEngineCtx *de_ctx, Signature *s, const char
  */
 static void DetectByteMathFree(DetectEngineCtx *de_ctx, void *ptr)
 {
-    ScByteMathFree(ptr);
+    SCByteMathFree(ptr);
 }
 
 /**
index 6e2c8b2da776bb59c24615ab5a8775b656f0fe66..13adecb10d07c4c382682bbd17f9cf44141b4c09 100644 (file)
@@ -78,7 +78,7 @@ static int DetectEnipCapabilitiesMatch(DetectEngineThreadCtx *det_ctx, Flow *f,
 
 {
     uint16_t value;
-    if (!ScEnipTxGetCapabilities(txv, &value))
+    if (!SCEnipTxGetCapabilities(txv, &value))
         SCReturnInt(0);
     const DetectU16Data *du16 = (const DetectU16Data *)ctx;
     return DetectU16Match(value, du16);
index 82047405bc56f690ac613505040a3fb2feb296ed..12977ab9589cc09a11a518e9f551b189807f9827 100644 (file)
@@ -84,7 +84,7 @@ static int DetectEnipCommandMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8
 
 {
     uint16_t value;
-    if (!ScEnipTxGetCommand(txv, flags, &value))
+    if (!SCEnipTxGetCommand(txv, flags, &value))
         SCReturnInt(0);
     const DetectU16Data *du16 = (const DetectU16Data *)ctx;
     return DetectU16Match(value, du16);
index fa0c3353b3e22cfbd2cf1778dc536f2614be0550..36bff86a1e1bf838e10576662a3c115a3c98bbf5 100644 (file)
@@ -78,7 +78,7 @@ static int DetectEnipDeviceTypeMatch(DetectEngineThreadCtx *det_ctx, Flow *f, ui
 
 {
     uint16_t value;
-    if (!ScEnipTxGetDeviceType(txv, &value))
+    if (!SCEnipTxGetDeviceType(txv, &value))
         SCReturnInt(0);
     const DetectU16Data *du16 = (const DetectU16Data *)ctx;
     return DetectU16Match(value, du16);
index b1685352f8ebda616a067529a63d9fef4c91d68a..92a065db5edf89dfce727d1a30791f3ec2679565 100644 (file)
@@ -78,7 +78,7 @@ static int DetectEnipIdentityStatusMatch(DetectEngineThreadCtx *det_ctx, Flow *f
 
 {
     uint16_t value;
-    if (!ScEnipTxGetIdentityStatus(txv, &value))
+    if (!SCEnipTxGetIdentityStatus(txv, &value))
         SCReturnInt(0);
     const DetectU16Data *du16 = (const DetectU16Data *)ctx;
     return DetectU16Match(value, du16);
index 3fb83bcd5f52ae24a3eaa4f04a8af25602dfc437..1ed2c915549a333174f1a3d532c8ca3409244018 100644 (file)
@@ -78,7 +78,7 @@ static int DetectEnipProductCodeMatch(DetectEngineThreadCtx *det_ctx, Flow *f, u
 
 {
     uint16_t value;
-    if (!ScEnipTxGetProductCode(txv, &value))
+    if (!SCEnipTxGetProductCode(txv, &value))
         SCReturnInt(0);
     const DetectU16Data *du16 = (const DetectU16Data *)ctx;
     return DetectU16Match(value, du16);
index 53ddb064f2bc4ccc3880db6c6474d35f3968f69c..75290714484caea6248daaeec0606cc3642a78bd 100644 (file)
@@ -79,7 +79,7 @@ static int DetectEnipProtocolVersionMatch(DetectEngineThreadCtx *det_ctx, Flow *
 
 {
     uint16_t value;
-    if (!ScEnipTxGetProtocolVersion(txv, flags, &value))
+    if (!SCEnipTxGetProtocolVersion(txv, flags, &value))
         SCReturnInt(0);
     const DetectU16Data *du16 = (const DetectU16Data *)ctx;
     return DetectU16Match(value, du16);
index 3420f9c35cf4e6f9497a88c9d33a705fddcbf486..70bce0b78e59095a4f7238576fba3ed2a5ee5c7b 100644 (file)
@@ -78,7 +78,7 @@ static int DetectEnipRevisionMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint
 
 {
     uint16_t value;
-    if (!ScEnipTxGetRevision(txv, &value))
+    if (!SCEnipTxGetRevision(txv, &value))
         SCReturnInt(0);
     const DetectU16Data *du16 = (const DetectU16Data *)ctx;
     return DetectU16Match(value, du16);
index 242d120f823648857f212e5e82f330bc7eb77e1a..71e88d99bc0c1b4e93543e62ded2d30579fae265 100644 (file)
@@ -78,7 +78,7 @@ static int DetectEnipSerialMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_
 
 {
     uint32_t value;
-    if (!ScEnipTxGetSerial(txv, &value))
+    if (!SCEnipTxGetSerial(txv, &value))
         SCReturnInt(0);
     const DetectU32Data *du32 = (const DetectU32Data *)ctx;
     return DetectU32Match(value, du32);
index 7c8bca827ea764e43def8da13e7d3b87c8981a2e..2924391dacffd1463a1465f713ee4a4da6e9f9a3 100644 (file)
@@ -78,7 +78,7 @@ static int DetectEnipStateMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t
 
 {
     uint8_t value;
-    if (!ScEnipTxGetState(txv, &value))
+    if (!SCEnipTxGetState(txv, &value))
         SCReturnInt(0);
     const DetectU8Data *du8 = (const DetectU8Data *)ctx;
     return DetectU8Match(value, du8);
index 9673f3375e0446d0550279f59e44ff886813736b..eb9a662c3e813b9279da2bc919c8782f2360295f 100644 (file)
@@ -83,7 +83,7 @@ static int DetectEnipStatusMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_
 
 {
     uint32_t status;
-    if (!ScEnipTxGetStatus(txv, flags, &status))
+    if (!SCEnipTxGetStatus(txv, flags, &status))
         SCReturnInt(0);
     const DetectU32Data *du32 = (const DetectU32Data *)ctx;
     return DetectU32Match(status, du32);
index 267677e41567bf4c7cf41aca0f7191b9f34af780..75966c8a5d077e8406bd21e03c090dc0fd25eb89 100644 (file)
@@ -78,7 +78,7 @@ static int DetectEnipVendorIdMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint
 
 {
     uint16_t value;
-    if (!ScEnipTxGetVendorId(txv, &value))
+    if (!SCEnipTxGetVendorId(txv, &value))
         SCReturnInt(0);
     const DetectU16Data *du16 = (const DetectU16Data *)ctx;
     return DetectU16Match(value, du16);