rust/transforms: remove no_mangle from non-pub functions

Ticket: 7498
pull/12445/head
Jason Ish 7 months ago committed by Victor Julien
parent f370afb5bd
commit c93bba8e2c

@ -27,7 +27,6 @@ use std::ptr;
static mut G_TRANSFORM_TOLOWER_ID: c_int = 0;
static mut G_TRANSFORM_TOUPPER_ID: c_int = 0;
#[no_mangle]
unsafe extern "C" fn tolower_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -40,7 +39,6 @@ fn tolower_transform_do(input: &[u8], output: &mut [u8]) {
}
}
#[no_mangle]
unsafe extern "C" fn tolower_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);
@ -61,7 +59,6 @@ unsafe extern "C" fn tolower_transform(buffer: *mut c_void, _ctx: *mut c_void) {
InspectionBufferTruncate(buffer, input_len);
}
#[no_mangle]
unsafe extern "C" fn tolower_validate(content: *const u8, len: u16, _ctx: *mut c_void) -> bool {
let input = build_slice!(content, len as usize);
for &c in input {
@ -90,7 +87,6 @@ pub unsafe extern "C" fn DetectTransformToLowerRegister() {
}
}
#[no_mangle]
unsafe extern "C" fn toupper_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -103,7 +99,6 @@ fn toupper_transform_do(input: &[u8], output: &mut [u8]) {
}
}
#[no_mangle]
unsafe extern "C" fn toupper_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);
@ -124,7 +119,6 @@ unsafe extern "C" fn toupper_transform(buffer: *mut c_void, _ctx: *mut c_void) {
InspectionBufferTruncate(buffer, input_len);
}
#[no_mangle]
unsafe extern "C" fn toupper_validate(content: *const u8, len: u16, _ctx: *mut c_void) -> bool {
let input = build_slice!(content, len as usize);
for &c in input {

@ -26,7 +26,6 @@ use std::ptr;
static mut G_TRANSFORM_COMPRESS_WHITESPACE_ID: c_int = 0;
#[no_mangle]
unsafe extern "C" fn compress_whitespace_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -50,7 +49,6 @@ fn compress_whitespace_transform_do(input: &[u8], output: &mut [u8]) -> u32 {
return nb as u32;
}
#[no_mangle]
unsafe extern "C" fn compress_whitespace_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);
@ -86,7 +84,6 @@ fn compress_whitespace_validate_do(input: &[u8]) -> bool {
return true;
}
#[no_mangle]
unsafe extern "C" fn compress_whitespace_validate(
content: *const u8, len: u16, _ctx: *mut c_void,
) -> bool {

@ -26,7 +26,6 @@ use std::ptr;
static mut G_TRANSFORM_DOT_PREFIX_ID: c_int = 0;
#[no_mangle]
unsafe extern "C" fn dot_prefix_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -42,7 +41,6 @@ fn dot_prefix_transform_do(input: &[u8], output: &mut [u8]) {
output[0] = b'.';
}
#[no_mangle]
unsafe extern "C" fn dot_prefix_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input_len = InspectionBufferLength(buffer);
if input_len == 0 {

@ -35,7 +35,6 @@ static mut G_TRANSFORM_SHA256_ID: c_int = 0;
const SC_MD5_LEN: usize = 16;
#[no_mangle]
unsafe extern "C" fn md5_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -50,7 +49,6 @@ fn md5_transform_do(input: &[u8], output: &mut [u8]) {
Md5::new().chain(input).finalize_into(output.into());
}
#[no_mangle]
unsafe extern "C" fn md5_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);
@ -89,7 +87,6 @@ pub unsafe extern "C" fn DetectTransformMd5Register() {
}
}
#[no_mangle]
unsafe extern "C" fn sha1_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -104,7 +101,6 @@ fn sha1_transform_do(input: &[u8], output: &mut [u8]) {
Sha1::new().chain(input).finalize_into(output.into());
}
#[no_mangle]
unsafe extern "C" fn sha1_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);
@ -143,7 +139,6 @@ pub unsafe extern "C" fn DetectTransformSha1Register() {
}
}
#[no_mangle]
unsafe extern "C" fn sha256_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -158,7 +153,6 @@ fn sha256_transform_do(input: &[u8], output: &mut [u8]) {
Sha256::new().chain(input).finalize_into(output.into());
}
#[no_mangle]
unsafe extern "C" fn sha256_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);

@ -27,7 +27,6 @@ use std::ptr;
static mut G_TRANSFORM_HEADER_LOWER_ID: c_int = 0;
static mut G_TRANSFORM_STRIP_PSEUDO_ID: c_int = 0;
#[no_mangle]
unsafe extern "C" fn header_lowersetup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -53,7 +52,6 @@ fn header_lowertransform_do(input: &[u8], output: &mut [u8]) {
}
}
#[no_mangle]
unsafe extern "C" fn header_lowertransform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);
@ -92,7 +90,6 @@ pub unsafe extern "C" fn DetectTransformHeaderLowercaseRegister() {
}
}
#[no_mangle]
unsafe extern "C" fn strip_pseudo_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -117,7 +114,6 @@ fn strip_pseudo_transform_do(input: &[u8], output: &mut [u8]) -> u32 {
return nb as u32;
}
#[no_mangle]
unsafe extern "C" fn strip_pseudo_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);

@ -26,7 +26,6 @@ use std::ptr;
static mut G_TRANSFORM_STRIP_WHITESPACE_ID: c_int = 0;
#[no_mangle]
unsafe extern "C" fn strip_whitespace_setup(
_de: *mut c_void, s: *mut c_void, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -47,7 +46,6 @@ fn strip_whitespace_transform_do(input: &[u8], output: &mut [u8]) -> u32 {
return nb as u32;
}
#[no_mangle]
unsafe extern "C" fn strip_whitespace_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);
@ -68,7 +66,6 @@ unsafe extern "C" fn strip_whitespace_transform(buffer: *mut c_void, _ctx: *mut
InspectionBufferTruncate(buffer, output_len);
}
#[no_mangle]
unsafe extern "C" fn strip_whitespace_validate(
content: *const u8, len: u16, _ctx: *mut c_void,
) -> bool {

@ -26,7 +26,6 @@ use std::ptr;
static mut G_TRANSFORM_URL_DECODE_ID: c_int = 0;
#[no_mangle]
unsafe extern "C" fn url_decode_setup(
_de: *mut c_void, s: *mut c_void, _opt: *const std::os::raw::c_char,
) -> c_int {
@ -87,7 +86,6 @@ fn url_decode_transform_do(input: &[u8], output: &mut [u8]) -> u32 {
return nb as u32;
}
#[no_mangle]
unsafe extern "C" fn url_decode_transform(buffer: *mut c_void, _ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);

@ -58,7 +58,6 @@ unsafe fn xor_parse(raw: *const std::os::raw::c_char) -> *mut c_void {
return std::ptr::null_mut();
}
#[no_mangle]
unsafe extern "C" fn xor_setup(
de: *mut c_void, s: *mut c_void, opt_str: *const std::os::raw::c_char,
) -> c_int {
@ -81,7 +80,6 @@ fn xor_transform_do(input: &[u8], output: &mut [u8], ctx: &DetectTransformXorDat
}
}
#[no_mangle]
unsafe extern "C" fn xor_transform(buffer: *mut c_void, ctx: *mut c_void) {
let input = InspectionBufferPtr(buffer);
let input_len = InspectionBufferLength(buffer);

Loading…
Cancel
Save