suricata
|
Go to the source code of this file.
Typedefs | |
typedef enum SCRunModes | SCRunMode |
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 |
Definition in file runmodes.h.
typedef enum SCRunModes SCRunMode |
enum SCRunModes |
Definition at line 27 of file runmodes.h.
bool IsRunModeOffline | ( | SCRunMode | run_mode_to_check | ) |
bool indicating if run mode is offline
bool IsRunModeSystem | ( | SCRunMode | run_mode_to_check | ) |
void RunModeDispatch | ( | int | runmode, |
const char * | custom_mode, | ||
const char * | capture_plugin_name, | ||
const char * | capture_plugin_args | ||
) |
Definition at line 409 of file runmodes.c.
References BypassedFlowManagerThreadSpawn(), FatalError, FlowManagerThreadSpawn(), FlowRecyclerThreadSpawn(), LogFlushThreads(), RUNMODE_UNIX_SOCKET, RunMode_::RunModeFunc, RunModeNeedsBypassManager(), SCFree, SCLogError, SCStrdup, StatsSpawnThreads(), TmqhFlowPrintAutofpHandler(), TmThreadsSealThreads(), TmValidateQueueState(), and unlikely.
Referenced by SuricataInit().
void RunModeEnablesBypassManager | ( | void | ) |
Definition at line 465 of file runmodes.c.
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().
char * RunmodeGetActive | ( | void | ) |
Return the running mode
The returned string must not be freed.
Definition at line 199 of file runmodes.c.
Referenced by RunmodeIsAutofp(), and RunmodeIsWorkers().
const char * RunModeGetMainMode | ( | void | ) |
Return the running mode
The returned string must not be freed.
Definition at line 221 of file runmodes.c.
References SCRunmodeGet().
void RunModeInitializeOutputs | ( | void | ) |
Initialize the output modules.
Definition at line 769 of file runmodes.c.
References AppLayerParserProtocolHasLogger(), AppLayerParserRegisterLoggerBits(), AppLayerParserSupportsFiles(), AppProtoToString(), BIT_U32, OutputModule_::conf_name, OutputInitResult_::ctx, FatalError, FatalErrorOnInit, g_alproto_max, g_file_logger_enabled, g_filedata_logger_enabled, OutputModule_::InitFunc, OutputModule_::InitSubFunc, LOGGER_FILE, LOGGER_FILEDATA, OutputModule_::name, next, OutputInitResult_::ok, output_modules, OutputSetupActiveLoggers(), SCConfGetNode(), SCConfNodeLookupChild(), SCConfNodeLookupChildValue(), SCConfValIsTrue(), SCLogDebug, SCLogInfo, SCLogWarning, TAILQ_FOREACH, and SCConfNode_::val.
Referenced by PreRunPostPrivsDropInit().
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().
bool RunmodeIsAutofp | ( | void | ) |
Definition at line 209 of file runmodes.c.
References RunmodeGetActive().
Referenced by TmThreadSetupOptions().
bool RunmodeIsWorkers | ( | void | ) |
Definition at line 204 of file runmodes.c.
References RunmodeGetActive().
Referenced by TmThreadSetupOptions().
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().
int RunModeNeedsBypassManager | ( | void | ) |
Definition at line 470 of file runmodes.c.
Referenced by RunModeDispatch().
int RunModeOutputFiledataEnabled | ( | void | ) |
Definition at line 543 of file runmodes.c.
void RunModeRegisterNewRunMode | ( | SCRunMode | , |
const char * | , | ||
const char * | , | ||
int(*)(void) | RunModeFunc, | ||
int(*)(void) | RunModeIsIPSEnabled | ||
) |
void RunModeRegisterRunModes | ( | void | ) |
Register all runmodes in the engine.
Definition at line 231 of file runmodes.c.
References RunModeDpdkRegister(), RunModeErfDagRegister(), RunModeErfFileRegister(), RunModeFilePcapRegister(), RunModeIdsAFPRegister(), RunModeIdsAFXDPRegister(), RunModeIdsNetmapRegister(), RunModeIdsNflogRegister(), RunModeIdsPcapRegister(), RunModeIpsIPFWRegister(), RunModeIpsNFQRegister(), RunModeIpsWinDivertRegister(), RunModeUnixSocketRegister(), SCRunModeLibIdsRegister(), and UtRunModeRegister().
Referenced by InitGlobal().
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().
|
extern |
Definition at line 61 of file runmodes.c.
|
extern |
Definition at line 66 of file runmodes.c.
Referenced by RunModeErfFileAutoFp(), RunModeFilePcapAutoFp(), RunModeIdsAFPAutoFp(), RunModeIdsErfDagAutoFp(), RunModeIdsPcapAutoFp(), RunModeSetIPSAutoFp(), and TmThreadWaitOnThreadRunning().
|
extern |
Definition at line 75 of file runmodes.c.
Referenced by StatsSpawnThreads().
|
extern |
Definition at line 76 of file runmodes.c.
Referenced by StatsSpawnThreads().
|
extern |
Definition at line 74 of file runmodes.c.
Referenced by DetectLoaderThreadSpawn().
|
extern |
Definition at line 72 of file runmodes.c.
Referenced by BypassedFlowManagerThreadSpawn().
|
extern |
Definition at line 70 of file runmodes.c.
Referenced by FlowDisableFlowManagerThread(), FlowManagerThreadSpawn(), and TmThreadWaitOnThreadRunning().
|
extern |
Definition at line 71 of file runmodes.c.
Referenced by FlowDisableFlowRecyclerThread(), FlowRecyclerThreadSpawn(), and TmThreadWaitOnThreadRunning().
|
extern |
Definition at line 77 of file runmodes.c.
Referenced by LogFlushThreads().
|
extern |
Definition at line 67 of file runmodes.c.
Referenced by RunModeErfFileSingle(), RunModeFilePcapSingle(), RunModeIdsAFPSingle(), RunModeIdsAFXDPSingle(), RunModeIdsErfDagSingle(), and RunModeIdsPcapSingle().
|
extern |
Definition at line 73 of file runmodes.c.
|
extern |
Definition at line 69 of file runmodes.c.
Referenced by RunModeSetIPSAutoFp(), and TmThreadWaitOnThreadRunning().
|
extern |
Definition at line 68 of file runmodes.c.
Referenced by RunModeErfFileAutoFp(), RunModeFilePcapAutoFp(), RunModeIdsAFPWorkers(), RunModeIdsAFXDPWorkers(), RunModeIdsDpdkWorkers(), RunModeIdsErfDagWorkers(), RunModeIdsPcapWorkers(), RunModeSetIPSAutoFp(), RunModeSetIPSWorker(), RunModeSetLiveCaptureAutoFp(), SCRunModeLibCreateThreadVars(), and TmThreadWaitOnThreadRunning().
|
extern |
Definition at line 949 of file runmodes.c.
Referenced by RunModeErfFileAutoFp(), RunModeFilePcapAutoFp(), RunModeInitializeThreadSettings(), and TmThreadsGetWorkerThreadMax().
|
extern |
Definition at line 62 of file runmodes.c.
Referenced by RunModeErfFileAutoFp(), RunModeInitializeThreadSettings(), and TmThreadSetCPU().
|
extern |
Definition at line 63 of file runmodes.c.
Referenced by RunModeInitializeThreadSettings(), and TmThreadSpawn().