suricata
runmodes.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2013 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 __RUNMODES_H__
24 #define __RUNMODES_H__
25 
26 /* Run mode */
27 enum RunModes {
43  RUNMODE_USER_MAX, /* Last standard running mode */
54 #ifdef OS_WIN32
55  RUNMODE_INSTALL_SERVICE,
56  RUNMODE_REMOVE_SERVICE,
57  RUNMODE_CHANGE_SERVICE_PARAMS,
58 #endif
60 };
61 
62 /* Run Mode Global Thread Names */
63 extern const char *thread_name_autofp;
64 extern const char *thread_name_single;
65 extern const char *thread_name_workers;
66 extern const char *thread_name_verdict;
67 extern const char *thread_name_flow_mgr;
68 extern const char *thread_name_flow_bypass;
69 extern const char *thread_name_flow_rec;
70 extern const char *thread_name_unix_socket;
71 extern const char *thread_name_detect_loader;
72 extern const char *thread_name_counter_stats;
73 extern const char *thread_name_counter_wakeup;
74 
75 char *RunmodeGetActive(void);
76 const char *RunModeGetMainMode(void);
77 
78 void RunModeListRunmodes(void);
79 void RunModeDispatch(int, const char *);
80 void RunModeRegisterRunModes(void);
81 void RunModeRegisterNewRunMode(enum RunModes, const char *, const char *,
82  int (*RunModeFunc)(void));
83 void RunModeInitialize(void);
84 void RunModeInitializeOutputs(void);
85 void RunModeShutDown(void);
86 
87 /* bool indicating if file logger is enabled */
88 int RunModeOutputFileEnabled(void);
89 /* bool indicating if filedata logger is enabled */
91 /** bool indicating if run mode is offline */
92 bool IsRunModeOffline(enum RunModes run_mode_to_check);
93 bool IsRunModeSystem(enum RunModes run_mode_to_check);
94 
97 
98 #include "runmode-pcap.h"
99 #include "runmode-pcap-file.h"
100 #include "runmode-pfring.h"
101 #include "runmode-nfq.h"
102 #include "runmode-ipfw.h"
103 #include "runmode-erf-file.h"
104 #include "runmode-erf-dag.h"
105 #include "runmode-napatech.h"
106 #include "runmode-af-packet.h"
107 #include "runmode-nflog.h"
108 #include "runmode-unix-socket.h"
109 #include "runmode-netmap.h"
110 #include "runmode-windivert.h"
111 
113 extern float threading_detect_ratio;
114 
115 extern int debuglog_enabled;
116 
117 #endif /* __RUNMODES_H__ */
const char * thread_name_unix_socket
Definition: runmodes.c:68
const char * thread_name_workers
Definition: runmodes.c:63
const char * RunModeGetMainMode(void)
Definition: runmodes.c:199
const char * thread_name_counter_wakeup
Definition: runmodes.c:71
float threading_detect_ratio
Definition: runmodes.c:903
void RunModeDispatch(int, const char *)
Definition: runmodes.c:278
void RunModeRegisterNewRunMode(enum RunModes, const char *, const char *, int(*RunModeFunc)(void))
Registers a new runmode.
Definition: runmodes.c:419
bool IsRunModeOffline(enum RunModes run_mode_to_check)
Definition: runmodes.c:504
void RunModeListRunmodes(void)
Lists all registered runmodes.
Definition: runmodes.c:235
const char * thread_name_counter_stats
Definition: runmodes.c:70
const char * thread_name_flow_bypass
Definition: runmodes.c:67
RunModes
Definition: runmodes.h:27
void RunModeRegisterRunModes(void)
Register all runmodes in the engine.
Definition: runmodes.c:209
void RunModeInitializeOutputs(void)
Definition: runmodes.c:714
char * RunmodeGetActive(void)
Definition: runmodes.c:187
const char * thread_name_flow_mgr
Definition: runmodes.c:65
int debuglog_enabled
Definition: runmodes.c:58
void RunModeShutDown(void)
Definition: runmodes.c:522
const char * thread_name_detect_loader
Definition: runmodes.c:69
void RunModeInitialize(void)
Definition: runmodes.c:908
const char * thread_name_autofp
Definition: runmodes.c:61
void RunModeEnablesBypassManager(void)
Definition: runmodes.c:398
int RunModeOutputFileEnabled(void)
Definition: runmodes.c:481
const char * thread_name_verdict
Definition: runmodes.c:64
bool IsRunModeSystem(enum RunModes run_mode_to_check)
Definition: runmodes.c:491
const char * thread_name_single
Definition: runmodes.c:62
int RunModeOutputFiledataEnabled(void)
Definition: runmodes.c:486
int RunModeNeedsBypassManager(void)
Definition: runmodes.c:403
int threading_set_cpu_affinity
Definition: runmodes.h:112
const char * thread_name_flow_rec
Definition: runmodes.c:66