rust: bindgen SCDetectHelperKeywordSetCleanCString

Ticket: 7667
pull/13230/head
Philippe Antoine 6 months ago committed by Victor Julien
parent 13449344e8
commit 4af3bd9c91

@ -38,7 +38,10 @@ pub mod datasets;
use std::os::raw::{c_int, c_void};
use std::ffi::CString;
use suricata_sys::sys::{AppProto, DetectEngineCtx, Signature, SCDetectHelperKeywordRegister, SCSigTableAppLiteElmt};
use suricata_sys::sys::{
AppProto, DetectEngineCtx, SCDetectHelperKeywordRegister, SCDetectHelperKeywordSetCleanCString,
SCSigTableAppLiteElmt, Signature,
};
/// EnumString trait that will be implemented on enums that
/// derive StringEnum.
@ -87,7 +90,7 @@ pub fn helper_keyword_register_sticky_buffer(kw: &SigTableElmtStickyBuffer) -> c
};
unsafe {
let r = SCDetectHelperKeywordRegister(&st);
DetectHelperKeywordSetCleanCString(r);
SCDetectHelperKeywordSetCleanCString(r);
return r;
}
}
@ -117,7 +120,6 @@ pub const SIGMATCH_INFO_STICKY_BUFFER: u16 = 0x200; // BIT_U16(9)
/// cbindgen:ignore
extern "C" {
pub fn DetectHelperKeywordSetCleanCString(id: c_int);
pub fn DetectHelperGetData(
de: *mut c_void, transforms: *const c_void, flow: *const c_void, flow_flags: u8,
tx: *const c_void, list_id: c_int,

@ -176,6 +176,9 @@ extern "C" {
KeywordsRegister: ::std::option::Option<unsafe extern "C" fn()>,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SCDetectHelperKeywordSetCleanCString(id: ::std::os::raw::c_int);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct DetectEngineCtx_ {

@ -458,7 +458,7 @@ static void SigCleanCString(SigTableElmt *base)
SCDetectSigMatchNamesFree(&kw);
}
void DetectHelperKeywordSetCleanCString(int id)
void SCDetectHelperKeywordSetCleanCString(int id)
{
sigmatch_table[id].Cleanup = SigCleanCString;
}

@ -350,6 +350,6 @@ void SigTableSetup(void);
int SCSigTablePreRegister(void (*KeywordsRegister)(void));
void SigTableRegisterTests(void);
bool SigTableHasKeyword(const char *keyword);
void DetectHelperKeywordSetCleanCString(int id);
void SCDetectHelperKeywordSetCleanCString(int id);
#endif /* SURICATA_DETECT_ENGINE_REGISTER_H */

Loading…
Cancel
Save