suricata
detect-engine-loader.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "conf.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 "detect-engine.h"
#include "detect-engine-loader.h"
#include "detect-engine-build.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 "util-path.h"
#include "rust.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.
 
int SigLoadSignatures (DetectEngineCtx *de_ctx, char *sig_file, bool sig_file_exclusive)
 Load signatures.
 
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.
 
 SC_ATOMIC_DECLARE (int, detect_loader_cnt)
 
void DetectLoaderThreadSpawn (void)
 spawn the detect loader manager thread
 
void TmModuleDetectLoaderRegister (void)
 

Variables

int rule_reload
 
int engine_analysis
 
bool rule_engine_analysis_set = false
 

Detailed Description

Macro Definition Documentation

◆ NLOADERS

#define NLOADERS   4

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

Typedef Documentation

◆ DetectLoaderThreadData

Function Documentation

◆ DetectLoadCompleteSigPath()

char * DetectLoadCompleteSigPath ( const DetectEngineCtx de_ctx,
const char *  sig_file 
)

Create the path if default-rule-path was specified.

Parameters
sig_fileThe name of the file
Return values
strPointer to the string path + sig_file

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

References de_ctx.

Referenced by SigLoadSignatures().

Here is the caller graph for this function:

◆ 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:

◆ SC_ATOMIC_DECLARE()

SC_ATOMIC_DECLARE ( int  ,
detect_loader_cnt   
)

◆ SigLoadSignatures()

int SigLoadSignatures ( DetectEngineCtx de_ctx,
char *  sig_file,
bool  sig_file_exclusive 
)

◆ 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:

Variable Documentation

◆ engine_analysis

int engine_analysis
extern

Referenced by SCParseCommandLine().

◆ rule_engine_analysis_set

bool rule_engine_analysis_set = false

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

Referenced by DetectFlowbitsAnalyze(), and SigLoadSignatures().

◆ rule_reload

int rule_reload
extern