Skip to content

Commit

Permalink
detect/iprep: update function naming
Browse files Browse the repository at this point in the history
Bring in line with new Rust code naming for FFI functions.
  • Loading branch information
victorjulien committed Jun 15, 2024
1 parent 83976a4 commit 37be66e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rust/src/detect/iprep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub fn detect_parse_iprep(i: &str) -> IResult<&str, DetectIPRepData, RuleParseEr
}

#[no_mangle]
pub unsafe extern "C" fn rs_detect_iprep_parse(
pub unsafe extern "C" fn SCDetectIPRepParse(
ustr: *const std::os::raw::c_char,
) -> *mut DetectIPRepData {
let ft_name: &CStr = CStr::from_ptr(ustr); //unsafe
Expand All @@ -161,7 +161,7 @@ pub unsafe extern "C" fn rs_detect_iprep_parse(
}

#[no_mangle]
pub unsafe extern "C" fn rs_detect_iprep_free(ctx: &mut DetectIPRepData) {
pub unsafe extern "C" fn SCDetectIPRepFree(ctx: &mut DetectIPRepData) {
// Just unbox...
std::mem::drop(Box::from_raw(ctx));
}
4 changes: 2 additions & 2 deletions src/detect-iprep.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static int DetectIPRepMatch (DetectEngineThreadCtx *det_ctx, Packet *p,

int DetectIPRepSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
{
DetectIPRepData *cd = rs_detect_iprep_parse(rawstr);
DetectIPRepData *cd = SCDetectIPRepParse(rawstr);
if (cd == NULL) {
SCLogError("\"%s\" is not a valid setting for iprep", rawstr);
goto error;
Expand Down Expand Up @@ -287,7 +287,7 @@ void DetectIPRepFree (DetectEngineCtx *de_ctx, void *ptr)
if (fd == NULL)
return;

rs_detect_iprep_free(fd);
SCDetectIPRepFree(fd);
}

#ifdef UNITTESTS
Expand Down

0 comments on commit 37be66e

Please sign in to comment.