suricata
thread-callbacks.h File Reference
#include "suricata-common.h"
#include "threadvars.h"
Include dependency graph for thread-callbacks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* SCThreadInitCallbackFn) (ThreadVars *tv, void *user)
 Function type for thread intialization callbacks. More...
 

Functions

bool SCThreadRegisterInitCallback (SCThreadInitCallbackFn fn, void *user)
 Register a thread init callback. More...
 
void SCThreadRunInitCallbacks (ThreadVars *tv)
 

Typedef Documentation

◆ SCThreadInitCallbackFn

typedef void(* SCThreadInitCallbackFn) (ThreadVars *tv, void *user)

Function type for thread intialization callbacks.

Once registered by SCThreadRegisterInitCallback, this function will be called for every thread being initialized during Suricata startup.

Parameters
tvThe ThreadVars struct that has just been initialized.
userThe user data provided when registering the callback.

Definition at line 33 of file thread-callbacks.h.

Function Documentation

◆ SCThreadRegisterInitCallback()

bool SCThreadRegisterInitCallback ( SCThreadInitCallbackFn  fn,
void *  user 
)

Register a thread init callback.

Register a user provided function to be called every time a thread is initialized for use.

Parameters
fnPointer to function to be called
userAdditional user data to be passed to callback
Returns
true if callback was registered, otherwise false if the callback could not be registered due to memory allocation error.

Definition at line 28 of file thread-callbacks.c.

References ThreadInitCallback_::Callback, SCCalloc, and ThreadInitCallback_::user.

◆ SCThreadRunInitCallbacks()

void SCThreadRunInitCallbacks ( ThreadVars tv)

Definition at line 48 of file thread-callbacks.c.