From: Jason Ish Date: Fri, 7 Jun 2024 23:28:01 +0000 (-0600) Subject: misc: prefix functions with SC not Sc X-Git-Tag: suricata-8.0.0-beta1~1175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11275%2Fhead;p=thirdparty%2Fsuricata.git misc: prefix functions with SC not Sc --- diff --git a/rust/src/detect/byte_math.rs b/rust/src/detect/byte_math.rs index 0586a92e5d..c362e37b48 100644 --- a/rust/src/detect/byte_math.rs +++ b/rust/src/detect/byte_math.rs @@ -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); } diff --git a/rust/src/enip/detect.rs b/rust/src/enip/detect.rs index 95361adb25..2de00ca014 100644 --- a/rust/src/enip/detect.rs +++ b/rust/src/enip/detect.rs @@ -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() { diff --git a/rust/src/enip/enip.rs b/rust/src/enip/enip.rs index db6a29a00b..834e3e2af4 100644 --- a/rust/src/enip/enip.rs +++ b/rust/src/enip/enip.rs @@ -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::), 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, diff --git a/src/detect-bytemath.c b/src/detect-bytemath.c index a1dfc7e985..42f3aae718 100644 --- a/src/detect-bytemath.c +++ b/src/detect-bytemath.c @@ -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); } /** diff --git a/src/detect-enip-capabilities.c b/src/detect-enip-capabilities.c index 6e2c8b2da7..13adecb10d 100644 --- a/src/detect-enip-capabilities.c +++ b/src/detect-enip-capabilities.c @@ -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); diff --git a/src/detect-enip-command.c b/src/detect-enip-command.c index 82047405bc..12977ab958 100644 --- a/src/detect-enip-command.c +++ b/src/detect-enip-command.c @@ -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); diff --git a/src/detect-enip-device-type.c b/src/detect-enip-device-type.c index fa0c3353b3..36bff86a1e 100644 --- a/src/detect-enip-device-type.c +++ b/src/detect-enip-device-type.c @@ -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); diff --git a/src/detect-enip-identity-status.c b/src/detect-enip-identity-status.c index b1685352f8..92a065db5e 100644 --- a/src/detect-enip-identity-status.c +++ b/src/detect-enip-identity-status.c @@ -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); diff --git a/src/detect-enip-product-code.c b/src/detect-enip-product-code.c index 3fb83bcd5f..1ed2c91554 100644 --- a/src/detect-enip-product-code.c +++ b/src/detect-enip-product-code.c @@ -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); diff --git a/src/detect-enip-protocol-version.c b/src/detect-enip-protocol-version.c index 53ddb064f2..7529071448 100644 --- a/src/detect-enip-protocol-version.c +++ b/src/detect-enip-protocol-version.c @@ -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); diff --git a/src/detect-enip-revision.c b/src/detect-enip-revision.c index 3420f9c35c..70bce0b78e 100644 --- a/src/detect-enip-revision.c +++ b/src/detect-enip-revision.c @@ -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); diff --git a/src/detect-enip-serial.c b/src/detect-enip-serial.c index 242d120f82..71e88d99bc 100644 --- a/src/detect-enip-serial.c +++ b/src/detect-enip-serial.c @@ -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); diff --git a/src/detect-enip-state.c b/src/detect-enip-state.c index 7c8bca827e..2924391dac 100644 --- a/src/detect-enip-state.c +++ b/src/detect-enip-state.c @@ -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); diff --git a/src/detect-enip-status.c b/src/detect-enip-status.c index 9673f3375e..eb9a662c3e 100644 --- a/src/detect-enip-status.c +++ b/src/detect-enip-status.c @@ -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); diff --git a/src/detect-enip-vendor-id.c b/src/detect-enip-vendor-id.c index 267677e415..75966c8a5d 100644 --- a/src/detect-enip-vendor-id.c +++ b/src/detect-enip-vendor-id.c @@ -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);