suricata
source-netmap.h
Go to the documentation of this file.
1 /* Copyright (C) 2014-2018 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 Aleksey Katargin <gureedo@gmail.com>
22 * \author Victor Julien <victor@inliniac.net>
23 */
24 
25 #ifndef __SOURCE_NETMAP_H__
26 #define __SOURCE_NETMAP_H__
27 
28 #include "queue.h"
29 
30 /* copy modes */
31 enum {
35 };
36 
37 #define NETMAP_IFACE_NAME_LENGTH 48
38 
39 typedef struct NetmapIfaceSettings_
40 {
41  /* real inner interface name */
43 
44  /* sw ring flag for out_iface */
45  bool sw_ring;
46  bool promisc;
47  bool real; /**< real iface or not. Not in case of vale, pipe */
48  bool ips; /**< set to true if checksum_mode != NETMAP_COPY_MODE_NONE */
50 
51  int threads;
52  int copy_mode;
54  const char *bpf_filter;
56 
57 typedef struct NetmapIfaceConfig_
58 {
59  /* semantic interface name */
61 
62  /* settings for out capture device*/
64 
65  /* settings for outgoing iface for IPS/TAP */
67 
68  SC_ATOMIC_DECLARE(unsigned int, ref);
69  void (*DerefFunc)(void *);
71 
72 typedef struct NetmapPacketVars_
73 {
74  /* NetmapThreadVars */
75  void *ntv;
77 
78 int NetmapGetRSSCount(const char *ifname);
79 
82 
83 #endif /* __SOURCE_NETMAP_H__ */
NETMAP_IFACE_NAME_LENGTH
#define NETMAP_IFACE_NAME_LENGTH
Definition: source-netmap.h:37
NetmapIfaceSettings_::checksum_mode
ChecksumValidationMode checksum_mode
Definition: source-netmap.h:53
NetmapPacketVars
struct NetmapPacketVars_ NetmapPacketVars
NetmapIfaceConfig_::out
NetmapIfaceSettings out
Definition: source-netmap.h:66
TmModuleReceiveNetmapRegister
void TmModuleReceiveNetmapRegister(void)
Definition: source-netmap.c:90
NetmapIfaceSettings_::iface
char iface[NETMAP_IFACE_NAME_LENGTH]
Definition: source-netmap.h:42
NetmapIfaceSettings_::ips
bool ips
Definition: source-netmap.h:48
NETMAP_COPY_MODE_NONE
@ NETMAP_COPY_MODE_NONE
Definition: source-netmap.h:32
NetmapIfaceConfig_::SC_ATOMIC_DECLARE
SC_ATOMIC_DECLARE(unsigned int, ref)
NetmapGetRSSCount
int NetmapGetRSSCount(const char *ifname)
NetmapPacketVars_::ntv
void * ntv
Definition: source-netmap.h:75
NetmapIfaceSettings_::threads
int threads
Definition: source-netmap.h:51
NETMAP_COPY_MODE_TAP
@ NETMAP_COPY_MODE_TAP
Definition: source-netmap.h:33
TmModuleDecodeNetmapRegister
void TmModuleDecodeNetmapRegister(void)
Registration Function for DecodeNetmap.
Definition: source-netmap.c:100
NetmapIfaceConfig_::DerefFunc
void(* DerefFunc)(void *)
Definition: source-netmap.h:69
NetmapIfaceSettings_::real
bool real
Definition: source-netmap.h:47
NetmapIfaceSettings_::sw_ring
bool sw_ring
Definition: source-netmap.h:45
NetmapIfaceSettings_
Definition: source-netmap.h:39
NetmapIfaceSettings_::promisc
bool promisc
Definition: source-netmap.h:46
queue.h
NetmapIfaceSettings_::threads_auto
bool threads_auto
Definition: source-netmap.h:49
NetmapIfaceConfig
struct NetmapIfaceConfig_ NetmapIfaceConfig
NetmapIfaceSettings_::bpf_filter
const char * bpf_filter
Definition: source-netmap.h:54
NetmapIfaceConfig_
Definition: source-netmap.h:57
ChecksumValidationMode
ChecksumValidationMode
Definition: decode.h:40
NetmapPacketVars_
Definition: source-netmap.h:72
NETMAP_COPY_MODE_IPS
@ NETMAP_COPY_MODE_IPS
Definition: source-netmap.h:34
NetmapIfaceConfig_::iface_name
char iface_name[NETMAP_IFACE_NAME_LENGTH]
Definition: source-netmap.h:60
NetmapIfaceSettings_::copy_mode
int copy_mode
Definition: source-netmap.h:52
NetmapIfaceConfig_::in
NetmapIfaceSettings in
Definition: source-netmap.h:63
NetmapIfaceSettings
struct NetmapIfaceSettings_ NetmapIfaceSettings