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 struct DetectLoaderTask_ DetectLoaderTask
 
typedef struct DetectLoaderControl_ DetectLoaderControl
 

Functions

int DetectLoaderQueueTask (int loader_id, LoaderFunc Func, void *func_ctx)
 
int DetectLoadersSync (void)
 wait for loader tasks to complete More...
 
void DetectLoadersInit (void)
 
void TmThreadContinueDetectLoaderThreads (void)
 Unpauses all threads present in tv_root. More...
 
void DetectLoaderThreadSpawn (void)
 spawn the detect loader manager thread More...
 
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

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

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

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

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

Here is the call graph for this function:

void DetectLoadersInit ( void  )

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

References BUG_ON, ConfGetInt(), NLOADERS, SC_ERR_INVALID_ARGUMENTS, SCCalloc, SCLogError, and SCLogInfo.

Referenced by DetectEngineMultiTenantSetup().

Here is the call graph for this function:

Here is the caller graph for this function:

int DetectLoadersSync ( void  )

wait for loader tasks to complete

Return values
result0 for ok, -1 for errors

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

References DetectLoaderControl_::m, DetectLoaderControl_::result, SC_ERR_INITIALIZATION, SCLogDebug, SCLogError, SCMutexInit, SCMutexLock, SCMutexUnlock, TAILQ_EMPTY, and TAILQ_INIT.

Referenced by DetectEngineLoadTenantBlocking(), DetectEngineMultiTenantSetup(), and DetectEngineReloadTenantBlocking().

Here is the caller graph for this function:

void DetectLoaderThreadSpawn ( void  )

spawn the detect loader manager thread

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

References BUG_ON, 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:

void TmModuleDetectLoaderRegister ( void  )
void TmThreadContinueDetectLoaderThreads ( void  )

Unpauses all threads present in tv_root.

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

References ThreadVars_::name, ThreadVars_::next, SC_ATOMIC_DECLARE(), SCMutexLock, SCMutexUnlock, TmThreadContinue(), 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: