suricata
runmodes.h File Reference
#include "runmode-pcap.h"
#include "runmode-pcap-file.h"
#include "runmode-pfring.h"
#include "runmode-nfq.h"
#include "runmode-ipfw.h"
#include "runmode-erf-file.h"
#include "runmode-erf-dag.h"
#include "runmode-napatech.h"
#include "runmode-af-packet.h"
#include "runmode-nflog.h"
#include "runmode-unix-socket.h"
#include "runmode-netmap.h"
#include "runmode-windivert.h"
Include dependency graph for runmodes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  RunModes {
  RUNMODE_UNKNOWN = 0, RUNMODE_PCAP_DEV, RUNMODE_PCAP_FILE, RUNMODE_PFRING,
  RUNMODE_NFQ, RUNMODE_NFLOG, RUNMODE_IPFW, RUNMODE_ERF_FILE,
  RUNMODE_DAG, RUNMODE_AFP_DEV, RUNMODE_NETMAP, RUNMODE_UNITTEST,
  RUNMODE_NAPATECH, RUNMODE_UNIX_SOCKET, RUNMODE_WINDIVERT, RUNMODE_USER_MAX,
  RUNMODE_LIST_KEYWORDS, RUNMODE_LIST_APP_LAYERS, 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_MAX
}
 

Functions

char * RunmodeGetActive (void)
 
const char * RunModeGetMainMode (void)
 
void RunModeListRunmodes (void)
 Lists all registered runmodes. More...
 
void RunModeDispatch (int, const char *)
 
void RunModeRegisterRunModes (void)
 Register all runmodes in the engine. More...
 
void RunModeRegisterNewRunMode (enum RunModes, const char *, const char *, int(*RunModeFunc)(void))
 Registers a new runmode. More...
 
void RunModeInitialize (void)
 
void RunModeInitializeOutputs (void)
 
void RunModeShutDown (void)
 
int RunModeOutputFileEnabled (void)
 
int RunModeOutputFiledataEnabled (void)
 
bool IsRunModeOffline (enum RunModes run_mode_to_check)
 
bool IsRunModeSystem (enum RunModes 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
 
int threading_set_cpu_affinity
 
float threading_detect_ratio
 
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.

Enumeration Type Documentation

enum RunModes
Enumerator
RUNMODE_UNKNOWN 
RUNMODE_PCAP_DEV 
RUNMODE_PCAP_FILE 
RUNMODE_PFRING 
RUNMODE_NFQ 
RUNMODE_NFLOG 
RUNMODE_IPFW 
RUNMODE_ERF_FILE 
RUNMODE_DAG 
RUNMODE_AFP_DEV 
RUNMODE_NETMAP 
RUNMODE_UNITTEST 
RUNMODE_NAPATECH 
RUNMODE_UNIX_SOCKET 
RUNMODE_WINDIVERT 
RUNMODE_USER_MAX 
RUNMODE_LIST_KEYWORDS 
RUNMODE_LIST_APP_LAYERS 
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_MAX 

Definition at line 27 of file runmodes.h.

Function Documentation

bool IsRunModeOffline ( enum RunModes  run_mode_to_check)

bool indicating if run mode is offline

Definition at line 504 of file runmodes.c.

References RUNMODE_CONF_TEST, RUNMODE_ENGINE_ANALYSIS, RUNMODE_ERF_FILE, RUNMODE_PCAP_FILE, and RUNMODE_UNIX_SOCKET.

Referenced by ConfUnixSocketIsEnable(), RegisterAllModules(), and SCConfLogOpenGeneric().

Here is the caller graph for this function:

bool IsRunModeSystem ( enum RunModes  run_mode_to_check)

Definition at line 491 of file runmodes.c.

References RUNMODE_ENGINE_ANALYSIS, RUNMODE_ERF_FILE, and RUNMODE_PCAP_FILE.

Referenced by RegisterAllModules().

Here is the caller graph for this function:

void RunModeEnablesBypassManager ( void  )

Definition at line 398 of file runmodes.c.

Referenced by RunModeIdsAFPRegister().

Here is the caller graph for this function:

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 187 of file runmodes.c.

Referenced by NFQInitConfig(), NoNFLOGSupportExit(), ReceivePfringThreadInit(), RunModeIdsAFPRegister(), TmModuleDecodeIPFWRegister(), and TmModuleDecodeNetmapRegister().

Here is the caller graph for this function:

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 199 of file runmodes.c.

References RunmodeGetCurrent().

Here is the call graph for this function:

void RunModeListRunmodes ( void  )

Lists all registered runmodes.

Definition at line 235 of file runmodes.c.

References RunMode_::description, RunMode_::name, RunMode_::runmode, RUNMODE_UNKNOWN, and RUNMODE_USER_MAX.

Referenced by PostRunDeinit().

Here is the caller graph for this function:

int RunModeNeedsBypassManager ( void  )

Definition at line 403 of file runmodes.c.

Referenced by RunModeDispatch().

Here is the caller graph for this function:

int RunModeOutputFiledataEnabled ( void  )

Definition at line 486 of file runmodes.c.

Referenced by FileTrackedSize().

Here is the caller graph for this function:

int RunModeOutputFileEnabled ( void  )

Definition at line 481 of file runmodes.c.

Referenced by FileTrackedSize().

Here is the caller graph for this function:

void RunModeRegisterNewRunMode ( enum RunModes  runmode,
const char *  name,
const char *  description,
int(*)(void)  RunModeFunc 
)

Registers a new runmode.

Parameters
runmodeRunmode type.
nameCustom mode for this specific runmode type. Within each runmode type, each custom name is a primary key.
descriptionDescription for this runmode.
RunModeFuncThe function to be run for this runmode.

Definition at line 419 of file runmodes.c.

References ALPROTO_MAX, OutputCtx_::DeInit, RunMode_::description, FatalError, OutputModule_::name, RunMode_::name, OutputFreeList_::output_ctx, OutputFreeList_::output_module, RunMode_::runmode, RunMode_::RunModeFunc, SC_ERR_MEM_ALLOC, SC_ERR_RUNMODE, SCFree, SCLogDebug, SCRealloc, SCStrdup, TAILQ_FIRST, TAILQ_REMOVE, and unlikely.

Referenced by RunModeErfDagRegister(), RunModeErfFileRegister(), RunModeFilePcapRegister(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), RunModeIdsNflogRegister(), RunModeIdsPcapRegister(), RunModeIdsPfringRegister(), RunModeIpsIPFWRegister(), RunModeIpsNFQRegister(), RunModeIpsWinDivertRegister(), RunModeNapatechRegister(), RunModeUnixSocketRegister(), and UtRunModeRegister().

Here is the caller graph for this function:

void RunModeRegisterRunModes ( void  )
void RunModeShutDown ( void  )

Cleanup the run mode.

Definition at line 522 of file runmodes.c.

References OutputModule_::alproto, ALPROTO_UNKNOWN, BUG_ON, OutputModule_::conf_name, ConfNodeLookupChild(), ConfNodeLookupChildValue(), ConfValIsTrue(), OutputInitResult_::ctx, debuglog_enabled, FatalError, FatalErrorOnInit, OutputModule_::FiledataLogFunc, OutputModule_::FileLogFunc, OutputModule_::FlowLogFunc, OutputModule_::InitSubFunc, LOGGER_ALERT_DEBUG, OutputModule_::logger_id, m, OutputModule_::name, next, OutputInitResult_::ok, OutputFreeList_::output_ctx, OutputFreeList_::output_module, output_modules, OutputFiledataShutdown(), OutputFileShutdown(), OutputFlowShutdown(), OutputGetModuleByConfName(), OutputPacketShutdown(), OutputRegisterFiledataLogger(), OutputRegisterFileLogger(), OutputRegisterFlowLogger(), OutputRegisterPacketLogger(), OutputRegisterStatsLogger(), OutputRegisterStreamingLogger(), OutputRegisterTxLogger(), OutputStatsShutdown(), OutputStreamingShutdown(), OutputTxShutdown(), OutputModule_::PacketConditionFunc, OutputModule_::PacketLogFunc, OutputModule_::parent_name, SC_ERR_INVALID_ARGUMENT, SCCalloc, SCLogDebug, SCLogError, OutputModule_::StatsLogFunc, OutputModule_::stream_type, OutputModule_::StreamingLogFunc, TAILQ_FOREACH, TAILQ_INSERT_TAIL, OutputModule_::tc_log_progress, OutputModule_::ThreadDeinit, OutputModule_::ThreadExitPrintStats, OutputModule_::ThreadInit, OutputModule_::ts_log_progress, OutputModule_::TxLogCondition, OutputModule_::TxLogFunc, type, unlikely, and ConfNode_::val.

Referenced by PostRunDeinit().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int debuglog_enabled

Definition at line 58 of file runmodes.c.

Referenced by RunModeShutDown().

const char* thread_name_counter_stats

Definition at line 70 of file runmodes.c.

Referenced by StatsSpawnThreads().

const char* thread_name_counter_wakeup

Definition at line 71 of file runmodes.c.

Referenced by StatsSpawnThreads().

const char* thread_name_detect_loader

Definition at line 69 of file runmodes.c.

Referenced by DetectLoaderThreadSpawn().

const char* thread_name_flow_bypass

Definition at line 67 of file runmodes.c.

Referenced by BypassedFlowManagerThreadSpawn().

const char* thread_name_flow_mgr

Definition at line 65 of file runmodes.c.

Referenced by FlowDisableFlowManagerThread(), and FlowManagerThreadSpawn().

const char* thread_name_flow_rec

Definition at line 66 of file runmodes.c.

Referenced by FlowDisableFlowRecyclerThread(), and FlowRecyclerThreadSpawn().

const char* thread_name_unix_socket

Definition at line 68 of file runmodes.c.

const char* thread_name_verdict

Definition at line 64 of file runmodes.c.

Referenced by RunModeSetIPSAutoFp().

float threading_detect_ratio
int threading_set_cpu_affinity

Definition at line 112 of file runmodes.h.

Referenced by RunModeErfFileAutoFp(), RunModeInitialize(), and TmThreadSetCPU().