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_DUMP_FEATURES, 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

◆ RunModes

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_DUMP_FEATURES 
RUNMODE_MAX 

Definition at line 27 of file runmodes.h.

Function Documentation

◆ IsRunModeOffline()

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().

Here is the caller graph for this function:

◆ IsRunModeSystem()

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.

◆ RunModeDispatch()

◆ RunModeEnablesBypassManager()

void RunModeEnablesBypassManager ( void  )

Definition at line 398 of file runmodes.c.

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

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

References RunmodeGetCurrent().

Here is the call graph for this function:

◆ RunModeInitialize()

◆ RunModeInitializeOutputs()

void RunModeInitializeOutputs ( void  )

Initialize the output modules.

Definition at line 716 of file runmodes.c.

References ConfGetNode().

Referenced by PreRunPostPrivsDropInit().

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

References RUNMODE_UNKNOWN, and RUNMODE_USER_MAX.

◆ RunModeNeedsBypassManager()

int RunModeNeedsBypassManager ( void  )

Definition at line 403 of file runmodes.c.

◆ RunModeOutputFiledataEnabled()

int RunModeOutputFiledataEnabled ( void  )

Definition at line 486 of file runmodes.c.

◆ RunModeOutputFileEnabled()

int RunModeOutputFileEnabled ( void  )

Definition at line 481 of file runmodes.c.

◆ RunModeRegisterNewRunMode()

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.

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:

◆ RunModeRegisterRunModes()

void RunModeRegisterRunModes ( void  )

Register all runmodes in the engine.

Definition at line 209 of file runmodes.c.

Referenced by InitGlobal().

Here is the caller graph for this function:

◆ RunModeShutDown()

void RunModeShutDown ( void  )

Cleanup the run mode.

Definition at line 522 of file runmodes.c.

Variable Documentation

◆ debuglog_enabled

int debuglog_enabled

Definition at line 57 of file runmodes.c.

◆ thread_name_autofp

const char* thread_name_autofp

◆ thread_name_counter_stats

const char* thread_name_counter_stats

Definition at line 70 of file runmodes.c.

◆ thread_name_counter_wakeup

const char* thread_name_counter_wakeup

Definition at line 71 of file runmodes.c.

◆ thread_name_detect_loader

const char* thread_name_detect_loader

Definition at line 69 of file runmodes.c.

◆ thread_name_flow_bypass

const char* thread_name_flow_bypass

Definition at line 67 of file runmodes.c.

Referenced by BypassedFlowManagerThreadSpawn().

◆ thread_name_flow_mgr

const char* thread_name_flow_mgr

Definition at line 65 of file runmodes.c.

◆ thread_name_flow_rec

const char* thread_name_flow_rec

Definition at line 66 of file runmodes.c.

◆ thread_name_single

const char* thread_name_single

◆ thread_name_unix_socket

const char* thread_name_unix_socket

Definition at line 68 of file runmodes.c.

◆ thread_name_verdict

const char* thread_name_verdict

Definition at line 64 of file runmodes.c.

Referenced by RunModeSetIPSAutoFp().

◆ thread_name_workers

◆ threading_detect_ratio

float threading_detect_ratio

◆ threading_set_cpu_affinity

int threading_set_cpu_affinity

Definition at line 58 of file runmodes.c.

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