suricata
runmodes.h
Go to the documentation of this file.
1/* Copyright (C) 2007-2022 Open Information Security Foundation
2 *
3 * You can copy, redistribute or modify this Program under the terms of
4 * the GNU General Public License version 2 as published by the Free
5 * Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * version 2 along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18/** \file
19 *
20 * \author Victor Julien <victor@inliniac.net>
21 */
22
23#ifndef SURICATA_RUNMODES_H
24#define SURICATA_RUNMODES_H
25
26/* Run mode */
65
66/* Run Mode Global Thread Names */
67extern const char *thread_name_autofp;
68extern const char *thread_name_single;
69extern const char *thread_name_workers;
70extern const char *thread_name_verdict;
71extern const char *thread_name_flow_mgr;
72extern const char *thread_name_flow_bypass;
73extern const char *thread_name_flow_rec;
74extern const char *thread_name_unix_socket;
75extern const char *thread_name_detect_loader;
76extern const char *thread_name_counter_stats;
77extern const char *thread_name_counter_wakeup;
78extern const char *thread_name_heartbeat;
79
80char *RunmodeGetActive(void);
81bool RunmodeIsWorkers(void);
82bool RunmodeIsAutofp(void);
83const char *RunModeGetMainMode(void);
84
85void RunModeListRunmodes(void);
86int RunModeEngineIsIPS(int capture_mode, const char *runmode, const char *capture_plugin_name);
87void RunModeDispatch(int, const char *, const char *capture_plugin_name, const char *capture_plugin_args);
89void RunModeRegisterNewRunMode(SCRunMode, const char *, const char *, int (*RunModeFunc)(void),
90 int (*RunModeIsIPSEnabled)(void));
93void RunModeShutDown(void);
94
95/* bool indicating if filedata logger is enabled */
97/** bool indicating if run mode is offline */
98bool IsRunModeOffline(SCRunMode run_mode_to_check);
99bool IsRunModeSystem(SCRunMode run_mode_to_check);
100
103
105extern float threading_detect_ratio;
106extern uint64_t threading_set_stack_size;
107
108extern int debuglog_enabled;
109
110#endif /* SURICATA_RUNMODES_H */
bool threading_set_cpu_affinity
Definition runmodes.c:62
bool RunmodeIsAutofp(void)
Definition runmodes.c:209
const char * thread_name_counter_wakeup
Definition runmodes.c:76
const char * thread_name_heartbeat
Definition runmodes.c:77
char * RunmodeGetActive(void)
Definition runmodes.c:199
const char * thread_name_counter_stats
Definition runmodes.c:75
SCRunModes
Definition runmodes.h:27
@ RUNMODE_NFLOG
Definition runmodes.h:32
@ RUNMODE_UNITTEST
Definition runmodes.h:41
@ RUNMODE_DAG
Definition runmodes.h:35
@ RUNMODE_CONF_TEST
Definition runmodes.h:54
@ RUNMODE_NFQ
Definition runmodes.h:31
@ RUNMODE_PRINT_USAGE
Definition runmodes.h:52
@ RUNMODE_LIB
Definition runmodes.h:40
@ RUNMODE_AFP_DEV
Definition runmodes.h:36
@ RUNMODE_DUMP_CONFIG
Definition runmodes.h:53
@ RUNMODE_PRINT_VERSION
Definition runmodes.h:50
@ RUNMODE_LIST_APP_LAYER_HOOKS
Definition runmodes.h:48
@ RUNMODE_NETMAP
Definition runmodes.h:38
@ RUNMODE_ENGINE_ANALYSIS
Definition runmodes.h:56
@ RUNMODE_DPDK
Definition runmodes.h:39
@ RUNMODE_LIST_UNITTEST
Definition runmodes.h:55
@ RUNMODE_IPFW
Definition runmodes.h:33
@ RUNMODE_UNKNOWN
Definition runmodes.h:28
@ RUNMODE_WINDIVERT
Definition runmodes.h:43
@ RUNMODE_PRINT_BUILDINFO
Definition runmodes.h:51
@ RUNMODE_PLUGIN
Definition runmodes.h:44
@ RUNMODE_LIST_RUNMODES
Definition runmodes.h:49
@ RUNMODE_LIST_KEYWORDS
Definition runmodes.h:46
@ RUNMODE_ERF_FILE
Definition runmodes.h:34
@ RUNMODE_PCAP_FILE
Definition runmodes.h:30
@ RUNMODE_MAX
Definition runmodes.h:63
@ RUNMODE_AFXDP_DEV
Definition runmodes.h:37
@ RUNMODE_PCAP_DEV
Definition runmodes.h:29
@ RUNMODE_USER_MAX
Definition runmodes.h:45
@ RUNMODE_DUMP_FEATURES
Definition runmodes.h:62
@ RUNMODE_LIST_APP_LAYERS
Definition runmodes.h:47
@ RUNMODE_UNIX_SOCKET
Definition runmodes.h:42
const char * RunModeGetMainMode(void)
Definition runmodes.c:221
void RunModeShutDown(void)
Definition runmodes.c:579
void RunModeDispatch(int, const char *, const char *capture_plugin_name, const char *capture_plugin_args)
Definition runmodes.c:409
const char * thread_name_flow_mgr
Definition runmodes.c:70
const char * thread_name_flow_rec
Definition runmodes.c:71
const char * thread_name_flow_bypass
Definition runmodes.c:72
const char * thread_name_single
Definition runmodes.c:67
int RunModeOutputFiledataEnabled(void)
Definition runmodes.c:543
const char * thread_name_verdict
Definition runmodes.c:69
int RunModeEngineIsIPS(int capture_mode, const char *runmode, const char *capture_plugin_name)
Definition runmodes.c:379
uint64_t threading_set_stack_size
Definition runmodes.c:63
void RunModeInitializeThreadSettings(void)
Definition runmodes.c:954
void RunModeEnablesBypassManager(void)
Definition runmodes.c:465
void RunModeRegisterNewRunMode(SCRunMode, const char *, const char *, int(*RunModeFunc)(void), int(*RunModeIsIPSEnabled)(void))
bool IsRunModeOffline(SCRunMode run_mode_to_check)
bool IsRunModeSystem(SCRunMode run_mode_to_check)
enum SCRunModes SCRunMode
void RunModeRegisterRunModes(void)
Register all runmodes in the engine.
Definition runmodes.c:231
void RunModeListRunmodes(void)
Lists all registered runmodes.
Definition runmodes.c:257
void RunModeInitializeOutputs(void)
Definition runmodes.c:769
float threading_detect_ratio
Definition runmodes.c:949
bool RunmodeIsWorkers(void)
Definition runmodes.c:204
int RunModeNeedsBypassManager(void)
Definition runmodes.c:470
const char * thread_name_unix_socket
Definition runmodes.c:73
const char * thread_name_autofp
Definition runmodes.c:66
int debuglog_enabled
Definition runmodes.c:61
const char * thread_name_detect_loader
Definition runmodes.c:74
const char * thread_name_workers
Definition runmodes.c:68