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 __SOURCE_NETMAP_H__
26 #define __SOURCE_NETMAP_H__
27 
28 /* copy modes */
29 enum {
33 };
34 
35 #define NETMAP_IFACE_NAME_LENGTH 48
36 
37 typedef struct NetmapIfaceSettings_
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;
50  int copy_mode;
52  const char *bpf_filter;
54 
55 typedef 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 
70 typedef struct NetmapPacketVars_
71 {
72  /* NetmapThreadVars */
73  void *ntv;
75 
76 int NetmapGetRSSCount(const char *ifname);
77 
80 
81 #endif /* __SOURCE_NETMAP_H__ */
NETMAP_IFACE_NAME_LENGTH
#define NETMAP_IFACE_NAME_LENGTH
Definition: source-netmap.h:35
NETMAP_COPY_MODE_NONE
@ NETMAP_COPY_MODE_NONE
Definition: source-netmap.h:30
NetmapIfaceSettings_::checksum_mode
ChecksumValidationMode checksum_mode
Definition: source-netmap.h:51
NetmapPacketVars
struct NetmapPacketVars_ NetmapPacketVars
NetmapIfaceConfig_::out
NetmapIfaceSettings out
Definition: source-netmap.h:64
TmModuleReceiveNetmapRegister
void TmModuleReceiveNetmapRegister(void)
Definition: source-netmap.c:73
NetmapIfaceSettings_::iface
char iface[NETMAP_IFACE_NAME_LENGTH]
Definition: source-netmap.h:40
NetmapIfaceSettings_::ips
bool ips
Definition: source-netmap.h:46
NetmapIfaceConfig_::SC_ATOMIC_DECLARE
SC_ATOMIC_DECLARE(unsigned int, ref)
NetmapGetRSSCount
int NetmapGetRSSCount(const char *ifname)
NetmapPacketVars_::ntv
void * ntv
Definition: source-netmap.h:73
TmModuleDecodeNetmapRegister
void TmModuleDecodeNetmapRegister(void)
Registration Function for DecodeNetmap.
Definition: source-netmap.c:83
NetmapIfaceConfig_::DerefFunc
void(* DerefFunc)(void *)
Definition: source-netmap.h:67
NetmapIfaceSettings_::real
bool real
Definition: source-netmap.h:45
NETMAP_COPY_MODE_IPS
@ NETMAP_COPY_MODE_IPS
Definition: source-netmap.h:32
NetmapIfaceSettings_::sw_ring
bool sw_ring
Definition: source-netmap.h:43
NetmapIfaceSettings_
Definition: source-netmap.h:38
NetmapIfaceSettings_::threads
uint16_t threads
Definition: source-netmap.h:49
NetmapIfaceSettings_::promisc
bool promisc
Definition: source-netmap.h:44
NetmapIfaceSettings_::threads_auto
bool threads_auto
Definition: source-netmap.h:47
NetmapIfaceConfig
struct NetmapIfaceConfig_ NetmapIfaceConfig
NetmapIfaceSettings_::bpf_filter
const char * bpf_filter
Definition: source-netmap.h:52
NetmapIfaceConfig_
Definition: source-netmap.h:56
ChecksumValidationMode
ChecksumValidationMode
Definition: decode.h:42
NetmapPacketVars_
Definition: source-netmap.h:71
NetmapIfaceConfig_::iface_name
char iface_name[NETMAP_IFACE_NAME_LENGTH]
Definition: source-netmap.h:58
NetmapIfaceSettings_::copy_mode
int copy_mode
Definition: source-netmap.h:50
NETMAP_COPY_MODE_TAP
@ NETMAP_COPY_MODE_TAP
Definition: source-netmap.h:31
NetmapIfaceConfig_::in
NetmapIfaceSettings in
Definition: source-netmap.h:61
NetmapIfaceSettings
struct NetmapIfaceSettings_ NetmapIfaceSettings