suricata
detect-engine-loader.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DetectLoaderTask_
 
struct  DetectLoaderControl_
 

Typedefs

typedef int(* LoaderFunc) (void *ctx, int loader_id)
 
typedef void(* LoaderFreeFunc) (void *ctx)
 
typedef struct DetectLoaderTask_ DetectLoaderTask
 
typedef struct DetectLoaderControl_ DetectLoaderControl
 

Functions

int DetectLoaderQueueTask (int loader_id, LoaderFunc Func, void *func_ctx, LoaderFreeFunc FreeFunc)
 
int DetectLoadersSync (void)
 wait for loader tasks to complete
 
void DetectLoadersInit (void)
 
void TmThreadContinueDetectLoaderThreads (void)
 Unpauses all threads present in tv_root.
 
void DetectLoaderThreadSpawn (void)
 spawn the detect loader manager thread
 
void TmModuleDetectLoaderRegister (void)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Detect loader API, for using multiple 'loader' threads that can load multiple detection engines in parallel.

Definition in file detect-engine-loader.h.

Typedef Documentation

◆ DetectLoaderControl

◆ DetectLoaderTask

◆ LoaderFreeFunc

typedef void(* LoaderFreeFunc) (void *ctx)

Definition at line 35 of file detect-engine-loader.h.

◆ LoaderFunc

typedef int(* LoaderFunc) (void *ctx, int loader_id)
Parameters
ctxfunction specific data
loader_idid of the loader that executed the task

Definition at line 34 of file detect-engine-loader.h.

Function Documentation

◆ DetectLoaderQueueTask()

int DetectLoaderQueueTask ( int  loader_id,
LoaderFunc  Func,
void *  func_ctx,
LoaderFreeFunc  FreeFunc 
)
Parameters
loader-1 for auto select
Return values
loader_idor negative in case of error

Definition at line 527 of file detect-engine-loader.c.

References DetectLoaderTask_::ctx, DetectLoaderTask_::FreeFunc, DetectLoaderTask_::Func, DetectLoaderControl_::m, next, SCCalloc, SCLogDebug, SCMutexLock, SCMutexUnlock, and TAILQ_INSERT_TAIL.

◆ DetectLoadersInit()

void DetectLoadersInit ( void  )

Definition at line 604 of file detect-engine-loader.c.

References BUG_ON, FatalError, NLOADERS, SCCalloc, SCConfGetInt(), and SCLogInfo.

Referenced by DetectEngineMultiTenantSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetectLoadersSync()

int DetectLoadersSync ( void  )

◆ DetectLoaderThreadSpawn()

void DetectLoaderThreadSpawn ( void  )

spawn the detect loader manager thread

Definition at line 749 of file detect-engine-loader.c.

References FatalError, name, thread_name_detect_loader, TM_ECODE_OK, TM_THREAD_NAME_MAX, TmThreadCreateCmdThreadByName(), and TmThreadSpawn().

Referenced by DetectEngineMultiTenantSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TmModuleDetectLoaderRegister()

void TmModuleDetectLoaderRegister ( void  )

◆ TmThreadContinueDetectLoaderThreads()

void TmThreadContinueDetectLoaderThreads ( void  )

Unpauses all threads present in tv_root.

Definition at line 649 of file detect-engine-loader.c.

References ThreadVars_::name, ThreadVars_::next, SCMutexLock, SCMutexUnlock, TmThreadContinue(), tv, tv_root, tv_root_lock, and TVT_MAX.

Referenced by DetectEngineMultiTenantSetup().

Here is the call graph for this function:
Here is the caller graph for this function: