suricata
detect-engine-loader.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "conf.h"
#include "debug.h"
#include "detect.h"
#include "detect-parse.h"
#include "runmodes.h"
#include "threads.h"
#include "threadvars.h"
#include "tm-threads.h"
#include "queue.h"
#include "util-signal.h"
#include "detect-engine-loader.h"
#include "detect-engine-analyzer.h"
#include "detect-engine-mpm.h"
#include "detect-engine-sigorder.h"
#include "util-detect.h"
#include "util-threshold-config.h"
Include dependency graph for detect-engine-loader.c:

Go to the source code of this file.

Data Structures

struct  DetectLoaderThreadData_
 

Macros

#define NLOADERS   4
 

Typedefs

typedef struct DetectLoaderThreadData_ DetectLoaderThreadData
 

Functions

char * DetectLoadCompleteSigPath (const DetectEngineCtx *de_ctx, const char *sig_file)
 Create the path if default-rule-path was specified. More...
 
int SigLoadSignatures (DetectEngineCtx *de_ctx, char *sig_file, int sig_file_exclusive)
 Load signatures. More...
 
void TmThreadWakeupDetectLoaderThreads ()
 Unpauses all threads present in tv_root. More...
 
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 ()
 Unpauses all threads present in tv_root. More...
 
 SC_ATOMIC_DECLARE (int, detect_loader_cnt)
 
void DetectLoaderThreadSpawn (void)
 spawn the detect loader manager thread More...
 
void TmModuleDetectLoaderRegister (void)
 

Variables

int rule_reload
 
int engine_analysis
 
int rule_engine_analysis_set = 0
 

Detailed Description

Macro Definition Documentation

#define NLOADERS   4

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

Referenced by DetectLoadersInit().

Typedef Documentation

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 396 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 467 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 429 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 613 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:

SC_ATOMIC_DECLARE ( int  ,
detect_loader_cnt   
)

Referenced by TmThreadContinueDetectLoaderThreads().

Here is the caller graph for this function:

void TmModuleDetectLoaderRegister ( void  )
void TmThreadContinueDetectLoaderThreads ( void  )

Unpauses all threads present in tv_root.

Definition at line 518 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:

void TmThreadWakeupDetectLoaderThreads ( void  )

Unpauses all threads present in tv_root.

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

References BUG_ON, ThreadVars_::ctrl_cond, ThreadVars_::name, ThreadVars_::next, SCMutexLock, SCMutexUnlock, tv_root, tv_root_lock, and TVT_MAX.

Referenced by DetectLoaderQueueTask().

Here is the caller graph for this function:

Variable Documentation

int engine_analysis

Referenced by GetProgramVersion().

int rule_engine_analysis_set = 0
int rule_reload