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-cpu.h"
37 #include "util-affinity.h"
38 #include "util-runmodes.h"
39 #include "util-device-private.h"
40 
41 const char *RunModeIpsNFQGetDefaultMode(void)
42 {
43  return "autofp";
44 }
45 
47 {
49  "Multi threaded NFQ IPS mode with respect to flow", RunModeIpsNFQAutoFp, NULL);
50 
52  "Multi queue NFQ IPS mode with one thread per queue", RunModeIpsNFQWorker, NULL);
53 }
54 
56 {
57  SCEnter();
58  int ret = 0;
59 #ifdef NFQ
60 
62 
64 
66  "ReceiveNFQ",
67  "VerdictNFQ",
68  "DecodeNFQ");
69 #endif /* NFQ */
70  return ret;
71 }
72 
74 {
75  SCEnter();
76  int ret = 0;
77 #ifdef NFQ
78 
80 
82 
84  "ReceiveNFQ",
85  "VerdictNFQ",
86  "DecodeNFQ");
87 #endif /* NFQ */
88  return ret;
89 }
util-device-private.h
tm-threads.h
NFQGetThread
void * NFQGetThread(int number)
Get a pointer to the NFQ thread at index.
Definition: source-nfq.c:965
RunModeSetIPSAutoFp
int RunModeSetIPSAutoFp(ConfigIPSParserFunc ConfigParser, const char *recv_mod_name, const char *verdict_mod_name, const char *decode_mod_name)
Definition: util-runmodes.c:382
RunModeSetIPSWorker
int RunModeSetIPSWorker(ConfigIPSParserFunc ConfigParser, const char *recv_mod_name, const char *verdict_mod_name, const char *decode_mod_name)
Definition: util-runmodes.c:501
RUNMODE_NFQ
@ RUNMODE_NFQ
Definition: runmodes.h:31
RunModeIpsNFQAutoFp
int RunModeIpsNFQAutoFp(void)
Definition: runmode-nfq.c:55
util-runmodes.h
LiveDeviceHasNoStats
void LiveDeviceHasNoStats(void)
Definition: util-device.c:330
RunModeIpsNFQRegister
void RunModeIpsNFQRegister(void)
Definition: runmode-nfq.c:46
util-debug.h
RunModeIpsNFQWorker
int RunModeIpsNFQWorker(void)
Definition: runmode-nfq.c:73
util-cpu.h
SCEnter
#define SCEnter(...)
Definition: util-debug.h:284
util-affinity.h
conf.h
RunModeRegisterNewRunMode
void RunModeRegisterNewRunMode(enum SCRunModes runmode, const char *name, const char *description, int(*RunModeFunc)(void), int(*RunModeIsIPSEnabled)(void))
Registers a new runmode.
Definition: runmodes.c:481
runmodes.h
TimeModeSetLive
void TimeModeSetLive(void)
Definition: util-time.c:99
runmode-nfq.h
suricata-common.h
RunModeIpsNFQGetDefaultMode
const char * RunModeIpsNFQGetDefaultMode(void)
Definition: runmode-nfq.c:41
output.h