suricata
runmode-nfq.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2011 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 /**
19  * \file
20  *
21  * \author Anoop Saldanha <anoopsaldanha@gmail.com>
22  * \author Eric Leblond <eric@regit.org>
23  *
24  * Handling of NFQ runmodes.
25  */
26 
27 
28 #include "suricata-common.h"
29 #include "tm-threads.h"
30 #include "conf.h"
31 #include "runmodes.h"
32 #include "runmode-nfq.h"
33 #include "output.h"
34 
35 #include "util-debug.h"
36 #include "util-time.h"
37 #include "util-cpu.h"
38 #include "util-affinity.h"
39 #include "util-runmodes.h"
40 #include "util-device.h"
41 
42 static const char *default_mode;
43 
44 const char *RunModeIpsNFQGetDefaultMode(void)
45 {
46  return default_mode;
47 }
48 
50 {
51  default_mode = "autofp";
53  "Multi threaded NFQ IPS mode with respect to flow",
55 
57  "Multi queue NFQ IPS mode with one thread per queue",
59  return;
60 }
61 
63 {
64  SCEnter();
65  int ret = 0;
66 #ifdef NFQ
67 
69 
71 
73 
75  "ReceiveNFQ",
76  "VerdictNFQ",
77  "DecodeNFQ");
78 #endif /* NFQ */
79  return ret;
80 }
81 
83 {
84  SCEnter();
85  int ret = 0;
86 #ifdef NFQ
87 
89 
91 
93 
95  "ReceiveNFQ",
96  "VerdictNFQ",
97  "DecodeNFQ");
98 #endif /* NFQ */
99  return ret;
100 }
void RunModeInitialize(void)
Definition: runmodes.c:912
void RunModeRegisterNewRunMode(int runmode, const char *name, const char *description, int(*RunModeFunc)(void))
Registers a new runmode.
Definition: runmodes.c:426
int RunModeSetIPSAutoFp(ConfigIPSParserFunc ConfigParser, const char *recv_mod_name, const char *verdict_mod_name, const char *decode_mod_name)
void TimeModeSetLive(void)
Definition: util-time.c:82
int RunModeSetIPSWorker(ConfigIPSParserFunc ConfigParser, const char *recv_mod_name, const char *verdict_mod_name, const char *decode_mod_name)
void * NFQGetThread(int number)
Get a pointer to the NFQ thread at index.
Definition: source-nfq.c:978
const char * RunModeIpsNFQGetDefaultMode(void)
Definition: runmode-nfq.c:44
#define SCEnter(...)
Definition: util-debug.h:337
int RunModeIpsNFQWorker(void)
Definition: runmode-nfq.c:82
void RunModeIpsNFQRegister(void)
Definition: runmode-nfq.c:49
int RunModeIpsNFQAutoFp(void)
Definition: runmode-nfq.c:62
void LiveDeviceHasNoStats()
Definition: util-device.c:312