rust/ffi: bindgen thread lifecycle callbacks

Ticket: #8605
pull/15475/head
Jason Ish 2 months ago committed by Victor Julien
parent f269e22b67
commit c689af0bbb

@ -1846,6 +1846,20 @@ extern "C" {
#[doc = " \\internal\n\n Run all registered flow init callbacks."]
pub fn SCFlowRunFinishCallbacks(tv: *mut ThreadVars, f: *mut Flow);
}
#[doc = " \\brief Function type for thread intialization callbacks.\n\n Once registered by SCThreadRegisterInitCallback, this function will\n be called for every thread being initialized during Suricata\n startup.\n\n \\param tv The ThreadVars struct that has just been initialized.\n \\param user The user data provided when registering the callback."]
pub type SCThreadInitCallbackFn = ::std::option::Option<
unsafe extern "C" fn(tv: *mut ThreadVars, user: *mut ::std::os::raw::c_void),
>;
extern "C" {
#[doc = " \\brief Register a thread init callback.\n\n Register a user provided function to be called every time a thread is\n initialized for use.\n\n \\param fn Pointer to function to be called\n \\param user Additional user data to be passed to callback\n\n \\returns true if callback was registered, otherwise false if the\n callback could not be registered due to memory allocation error."]
pub fn SCThreadRegisterInitCallback(
fn_: SCThreadInitCallbackFn, user: *mut ::std::os::raw::c_void,
) -> bool;
}
extern "C" {
#[doc = " \\internal\n\n Run all registered flow init callbacks."]
pub fn SCThreadRunInitCallbacks(tv: *mut ThreadVars);
}
extern "C" {
pub fn SCSRepCatGetByShortname(shortname: *const ::std::os::raw::c_char) -> u8;
}

@ -64,6 +64,8 @@
#include "flow-bindgen.h"
#include "flow-callbacks.h"
#include "thread-callbacks.h"
#include "reputation.h"
#include "feature.h"
#include "datasets.h"

@ -18,8 +18,9 @@
#ifndef SURICATA_THREAD_CALLBACKS_H
#define SURICATA_THREAD_CALLBACKS_H
#include "suricata-common.h"
#ifndef SURICATA_BINDGEN_H
#include "threadvars.h"
#endif
/** \brief Function type for thread intialization callbacks.
*

Loading…
Cancel
Save