suricata
runmodes.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum SCRunModes SCRunMode
 

Enumerations

enum  SCRunModes {
  RUNMODE_UNKNOWN = 0 , RUNMODE_PCAP_DEV , RUNMODE_PCAP_FILE , RUNMODE_NFQ ,
  RUNMODE_NFLOG , RUNMODE_IPFW , RUNMODE_ERF_FILE , RUNMODE_DAG ,
  RUNMODE_AFP_DEV , RUNMODE_AFXDP_DEV , RUNMODE_NETMAP , RUNMODE_DPDK ,
  RUNMODE_LIB , RUNMODE_UNITTEST , RUNMODE_UNIX_SOCKET , RUNMODE_WINDIVERT ,
  RUNMODE_PLUGIN , RUNMODE_USER_MAX , RUNMODE_LIST_KEYWORDS , RUNMODE_LIST_APP_LAYERS ,
  RUNMODE_LIST_APP_LAYER_HOOKS , RUNMODE_LIST_RUNMODES , RUNMODE_PRINT_VERSION , RUNMODE_PRINT_BUILDINFO ,
  RUNMODE_PRINT_USAGE , RUNMODE_DUMP_CONFIG , RUNMODE_CONF_TEST , RUNMODE_LIST_UNITTEST ,
  RUNMODE_ENGINE_ANALYSIS , RUNMODE_DUMP_FEATURES , RUNMODE_MAX
}
 

Functions

char * RunmodeGetActive (void)
 
bool RunmodeIsWorkers (void)
 
bool RunmodeIsAutofp (void)
 
const char * RunModeGetMainMode (void)
 
void RunModeListRunmodes (void)
 Lists all registered runmodes.
 
int RunModeEngineIsIPS (int capture_mode, const char *runmode, const char *capture_plugin_name)
 
void RunModeDispatch (int, const char *, const char *capture_plugin_name, const char *capture_plugin_args)
 
void RunModeRegisterRunModes (void)
 Register all runmodes in the engine.
 
void RunModeRegisterNewRunMode (SCRunMode, const char *, const char *, int(*RunModeFunc)(void), int(*RunModeIsIPSEnabled)(void))
 
void RunModeInitializeThreadSettings (void)
 
void RunModeInitializeOutputs (void)
 
void RunModeShutDown (void)
 
int RunModeOutputFiledataEnabled (void)
 
bool IsRunModeOffline (SCRunMode run_mode_to_check)
 
bool IsRunModeSystem (SCRunMode run_mode_to_check)
 
void RunModeEnablesBypassManager (void)
 
int RunModeNeedsBypassManager (void)
 

Variables

const char * thread_name_autofp
 
const char * thread_name_single
 
const char * thread_name_workers
 
const char * thread_name_verdict
 
const char * thread_name_flow_mgr
 
const char * thread_name_flow_bypass
 
const char * thread_name_flow_rec
 
const char * thread_name_unix_socket
 
const char * thread_name_detect_loader
 
const char * thread_name_counter_stats
 
const char * thread_name_counter_wakeup
 
const char * thread_name_heartbeat
 
bool threading_set_cpu_affinity
 
float threading_detect_ratio
 
uint64_t threading_set_stack_size
 
int debuglog_enabled
 

Detailed Description

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

Definition in file runmodes.h.

Typedef Documentation

◆ SCRunMode

typedef enum SCRunModes SCRunMode

Enumeration Type Documentation

◆ SCRunModes

enum SCRunModes
Enumerator
RUNMODE_UNKNOWN 
RUNMODE_PCAP_DEV 
RUNMODE_PCAP_FILE 
RUNMODE_NFQ 
RUNMODE_NFLOG 
RUNMODE_IPFW 
RUNMODE_ERF_FILE 
RUNMODE_DAG 
RUNMODE_AFP_DEV 
RUNMODE_AFXDP_DEV 
RUNMODE_NETMAP 
RUNMODE_DPDK 
RUNMODE_LIB 
RUNMODE_UNITTEST 
RUNMODE_UNIX_SOCKET 
RUNMODE_WINDIVERT 
RUNMODE_PLUGIN 
RUNMODE_USER_MAX 
RUNMODE_LIST_KEYWORDS 
RUNMODE_LIST_APP_LAYERS 
RUNMODE_LIST_APP_LAYER_HOOKS 
RUNMODE_LIST_RUNMODES 
RUNMODE_PRINT_VERSION 
RUNMODE_PRINT_BUILDINFO 
RUNMODE_PRINT_USAGE 
RUNMODE_DUMP_CONFIG 
RUNMODE_CONF_TEST 
RUNMODE_LIST_UNITTEST 
RUNMODE_ENGINE_ANALYSIS 
RUNMODE_DUMP_FEATURES 
RUNMODE_MAX 

Definition at line 27 of file runmodes.h.

Function Documentation

◆ IsRunModeOffline()

bool IsRunModeOffline ( SCRunMode  run_mode_to_check)

bool indicating if run mode is offline

◆ IsRunModeSystem()

bool IsRunModeSystem ( SCRunMode  run_mode_to_check)

◆ RunModeDispatch()

void RunModeDispatch ( int  runmode,
const char *  custom_mode,
const char *  capture_plugin_name,
const char *  capture_plugin_args 
)

◆ RunModeEnablesBypassManager()

void RunModeEnablesBypassManager ( void  )

Definition at line 465 of file runmodes.c.

◆ RunModeEngineIsIPS()

int RunModeEngineIsIPS ( int  capture_mode,
const char *  runmode,
const char *  capture_plugin_name 
)

Definition at line 379 of file runmodes.c.

References g_livedev_mask, LiveGetDeviceCount(), RunMode_::RunModeIsIPSEnabled, and SCLogWarning.

Referenced by PostConfLoadedSetup().

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

◆ RunmodeGetActive()

char * RunmodeGetActive ( void  )

Return the running mode

The returned string must not be freed.

Returns
a string containing the current running mode

Definition at line 199 of file runmodes.c.

Referenced by RunmodeIsAutofp(), and RunmodeIsWorkers().

Here is the caller graph for this function:

◆ RunModeGetMainMode()

const char * RunModeGetMainMode ( void  )

Return the running mode

The returned string must not be freed.

Returns
a string containing the current running mode

Definition at line 221 of file runmodes.c.

References SCRunmodeGet().

Here is the call graph for this function:

◆ RunModeInitializeOutputs()

◆ RunModeInitializeThreadSettings()

void RunModeInitializeThreadSettings ( void  )

Initialize multithreading settings.

Definition at line 954 of file runmodes.c.

References AffinitySetupLoadFromConfig(), FatalError, ParseSizeStringU64(), SCConfGet(), SCConfGetBool(), SCConfGetFloat(), SCConfGetNode(), SCLogDebug, SCLogNotice, threading_detect_ratio, threading_set_cpu_affinity, threading_set_stack_size, and WarnInvalidConfEntry.

Referenced by LLVMFuzzerTestOneInput(), and SuricataInit().

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

◆ RunmodeIsAutofp()

bool RunmodeIsAutofp ( void  )

Definition at line 209 of file runmodes.c.

References RunmodeGetActive().

Referenced by TmThreadSetupOptions().

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

◆ RunmodeIsWorkers()

bool RunmodeIsWorkers ( void  )

Definition at line 204 of file runmodes.c.

References RunmodeGetActive().

Referenced by TmThreadSetupOptions().

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

◆ RunModeListRunmodes()

void RunModeListRunmodes ( void  )

Lists all registered runmodes.

Definition at line 257 of file runmodes.c.

References RunModes_::cnt, RunMode_::description, RunMode_::name, RunMode_::runmode, RUNMODE_UNKNOWN, RUNMODE_USER_MAX, and RunModes_::runmodes.

Referenced by SCStartInternalRunMode().

Here is the caller graph for this function:

◆ RunModeNeedsBypassManager()

int RunModeNeedsBypassManager ( void  )

Definition at line 470 of file runmodes.c.

Referenced by RunModeDispatch().

Here is the caller graph for this function:

◆ RunModeOutputFiledataEnabled()

int RunModeOutputFiledataEnabled ( void  )

Definition at line 543 of file runmodes.c.

◆ RunModeRegisterNewRunMode()

void RunModeRegisterNewRunMode ( SCRunMode  ,
const char *  ,
const char *  ,
int(*)(void)  RunModeFunc,
int(*)(void)  RunModeIsIPSEnabled 
)

◆ RunModeRegisterRunModes()

◆ RunModeShutDown()

void RunModeShutDown ( void  )

Cleanup the run mode.

Definition at line 579 of file runmodes.c.

References OutputClearActiveLoggers(), OutputFiledataShutdown(), OutputFileShutdown(), OutputFlowShutdown(), OutputPacketShutdown(), OutputStatsShutdown(), OutputStreamingShutdown(), and OutputTxShutdown().

Referenced by PostRunDeinit().

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

Variable Documentation

◆ debuglog_enabled

int debuglog_enabled
extern

Definition at line 61 of file runmodes.c.

◆ thread_name_autofp

◆ thread_name_counter_stats

const char* thread_name_counter_stats
extern

Definition at line 75 of file runmodes.c.

Referenced by StatsSpawnThreads().

◆ thread_name_counter_wakeup

const char* thread_name_counter_wakeup
extern

Definition at line 76 of file runmodes.c.

Referenced by StatsSpawnThreads().

◆ thread_name_detect_loader

const char* thread_name_detect_loader
extern

Definition at line 74 of file runmodes.c.

Referenced by DetectLoaderThreadSpawn().

◆ thread_name_flow_bypass

const char* thread_name_flow_bypass
extern

Definition at line 72 of file runmodes.c.

Referenced by BypassedFlowManagerThreadSpawn().

◆ thread_name_flow_mgr

const char* thread_name_flow_mgr
extern

◆ thread_name_flow_rec

const char* thread_name_flow_rec
extern

◆ thread_name_heartbeat

const char* thread_name_heartbeat
extern

Definition at line 77 of file runmodes.c.

Referenced by LogFlushThreads().

◆ thread_name_single

const char* thread_name_single
extern

◆ thread_name_unix_socket

const char* thread_name_unix_socket
extern

Definition at line 73 of file runmodes.c.

◆ thread_name_verdict

const char* thread_name_verdict
extern

Definition at line 69 of file runmodes.c.

Referenced by RunModeSetIPSAutoFp(), and TmThreadWaitOnThreadRunning().

◆ thread_name_workers

◆ threading_detect_ratio

float threading_detect_ratio
extern

◆ threading_set_cpu_affinity

bool threading_set_cpu_affinity
extern

◆ threading_set_stack_size

uint64_t threading_set_stack_size
extern

Definition at line 63 of file runmodes.c.

Referenced by RunModeInitializeThreadSettings(), and TmThreadSpawn().