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 */
60  char iface_name[NETMAP_IFACE_NAME_LENGTH];
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__ */
#define SC_ATOMIC_DECLARE(type, name)
wrapper to declare an atomic variable including a (spin) lock to protect it.
Definition: util-atomic.h:56
const char * bpf_filter
Definition: source-netmap.h:54
struct NetmapIfaceSettings_ NetmapIfaceSettings
NetmapIfaceSettings in
Definition: source-netmap.h:63
void TmModuleReceiveNetmapRegister(void)
Definition: source-netmap.c:90
int NetmapGetRSSCount(const char *ifname)
void TmModuleDecodeNetmapRegister(void)
Registration Function for DecodeNetmap.
NetmapIfaceSettings out
Definition: source-netmap.h:66
char iface[NETMAP_IFACE_NAME_LENGTH]
Definition: source-netmap.h:42
ChecksumValidationMode checksum_mode
Definition: source-netmap.h:53
struct NetmapIfaceConfig_ NetmapIfaceConfig
ChecksumValidationMode
Definition: decode.h:40
struct NetmapPacketVars_ NetmapPacketVars
#define NETMAP_IFACE_NAME_LENGTH
Definition: source-netmap.h:37