suricata
source-netmap.h
Go to the documentation of this file.
1/* Copyright (C) 2014-2021 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 SURICATA_SOURCE_NETMAP_H
26#define SURICATA_SOURCE_NETMAP_H
27
28/* copy modes */
29enum {
33};
34
35#define NETMAP_IFACE_NAME_LENGTH 48
36
38{
39 /* real inner interface name */
41
42 /* sw ring flag for out_iface */
43 bool sw_ring;
44 bool promisc;
45 bool real; /**< real iface or not. Not in case of vale, pipe */
46 bool ips; /**< set to true if checksum_mode != NETMAP_COPY_MODE_NONE */
48
49 uint16_t threads;
52 const char *bpf_filter;
54
55typedef struct NetmapIfaceConfig_
56{
57 /* semantic interface name */
59
60 /* settings for out capture device*/
62
63 /* settings for outgoing iface for IPS/TAP */
65
66 SC_ATOMIC_DECLARE(unsigned int, ref);
67 void (*DerefFunc)(void *);
69
70typedef struct NetmapPacketVars_
71{
72 /* NetmapThreadVars */
73 void *ntv;
75
76int NetmapGetRSSCount(const char *ifname);
77
80
81#endif /* SURICATA_SOURCE_NETMAP_H */
ChecksumValidationMode
Definition decode.h:42
void TmModuleDecodeNetmapRegister(void)
Registration Function for DecodeNetmap.
void TmModuleReceiveNetmapRegister(void)
struct NetmapIfaceConfig_ NetmapIfaceConfig
#define NETMAP_IFACE_NAME_LENGTH
@ NETMAP_COPY_MODE_NONE
@ NETMAP_COPY_MODE_TAP
@ NETMAP_COPY_MODE_IPS
struct NetmapPacketVars_ NetmapPacketVars
int NetmapGetRSSCount(const char *ifname)
struct NetmapIfaceSettings_ NetmapIfaceSettings
char iface_name[NETMAP_IFACE_NAME_LENGTH]
NetmapIfaceSettings out
SC_ATOMIC_DECLARE(unsigned int, ref)
void(* DerefFunc)(void *)
NetmapIfaceSettings in
ChecksumValidationMode checksum_mode
char iface[NETMAP_IFACE_NAME_LENGTH]
const char * bpf_filter