suricata
runmode-netmap.c
Go to the documentation of this file.
1 /* Copyright (C) 2014-2022 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 * \ingroup netmap
20 *
21 * @{
22 */
23 
24 /**
25  * \file
26  *
27  * \author Aleksey Katargin <gureedo@gmail.com>
28  * \author Bill Meeks <billmeeks8@gmail.com>
29  *
30  * Netmap runmode
31  *
32  */
33 
34 #include "suricata-common.h"
35 #include "decode.h"
36 #include "runmodes.h"
37 #include "runmode-netmap.h"
38 #include "util-runmodes.h"
39 #include "util-ioctl.h"
40 #include "util-byte.h"
41 #include "util-time.h"
42 
43 #ifdef HAVE_NETMAP
44 #define NETMAP_WITH_LIBS
45 #include <net/netmap_user.h>
46 #endif /* HAVE_NETMAP */
47 
48 #include "source-netmap.h"
49 #include "util-conf.h"
50 #include "suricata.h"
51 #include "util-bpf.h"
52 
53 extern uint16_t max_pending_packets;
54 
55 const char *RunModeNetmapGetDefaultMode(void)
56 {
57  return "workers";
58 }
59 
60 static int NetmapRunModeIsIPS(void)
61 {
62  int nlive = LiveGetDeviceCount();
63  int ldev;
64  ConfNode *if_root;
65  ConfNode *if_default = NULL;
66  ConfNode *netmap_node;
67  int has_ips = 0;
68  int has_ids = 0;
69 
70  /* Find initial node */
71  netmap_node = ConfGetNode("netmap");
72  if (netmap_node == NULL) {
73  return 0;
74  }
75 
76  if_default = ConfNodeLookupKeyValue(netmap_node, "interface", "default");
77 
78  for (ldev = 0; ldev < nlive; ldev++) {
79  const char *live_dev = LiveGetDeviceName(ldev);
80  if (live_dev == NULL) {
81  SCLogError("Problem with config file");
82  return -1;
83  }
84  if_root = ConfNodeLookupKeyValue(netmap_node, "interface", live_dev);
85 
86  if (if_root == NULL) {
87  if (if_default == NULL) {
88  SCLogError("Problem with config file");
89  return -1;
90  }
91  if_root = if_default;
92  }
93 
94  const char *copymodestr = NULL;
95  const char *copyifacestr = NULL;
96  if (ConfGetChildValueWithDefault(if_root, if_default, "copy-mode", &copymodestr) == 1 &&
97  ConfGetChildValue(if_root, "copy-iface", &copyifacestr) == 1) {
98  if (strcmp(copymodestr, "ips") == 0) {
99  has_ips = 1;
100  } else {
101  has_ids = 1;
102  }
103  } else {
104  has_ids = 1;
105  }
106  }
107 
108  if (has_ids && has_ips) {
109  SCLogError("using both IPS and TAP/IDS mode is not allowed due to undefined behavior. See "
110  "ticket #5588.");
111  return -1;
112  }
113 
114  return has_ips;
115 }
116 
117 static int NetmapRunModeEnableIPS(void)
118 {
119  int r = NetmapRunModeIsIPS();
120  if (r == 1) {
121  SCLogInfo("Netmap: Setting IPS mode");
123  }
124  return r;
125 }
126 
128 {
129  RunModeRegisterNewRunMode(RUNMODE_NETMAP, "single", "Single threaded netmap mode",
130  RunModeIdsNetmapSingle, NetmapRunModeEnableIPS);
132  "Workers netmap mode, each thread does all"
133  " tasks from acquisition to logging",
134  RunModeIdsNetmapWorkers, NetmapRunModeEnableIPS);
136  "Multi-threaded netmap mode. Packets from "
137  "each flow are assigned to a single detect "
138  "thread.",
139  RunModeIdsNetmapAutoFp, NetmapRunModeEnableIPS);
140  return;
141 }
142 
143 #ifdef HAVE_NETMAP
144 
145 static void NetmapDerefConfig(void *conf)
146 {
147  NetmapIfaceConfig *pfp = (NetmapIfaceConfig *)conf;
148  /* config is used only once but cost of this low. */
149  if (SC_ATOMIC_SUB(pfp->ref, 1) == 1) {
150  SCFree(pfp);
151  }
152 }
153 
154 static int ParseNetmapSettings(NetmapIfaceSettings *ns, const char *iface,
155  ConfNode *if_root, ConfNode *if_default)
156 {
157  ns->threads = 0;
158  ns->promisc = true;
161  strlcpy(ns->iface, iface, sizeof(ns->iface));
162 
163  if (ns->iface[0]) {
164  size_t len = strlen(ns->iface);
165  if (ns->iface[len-1] == '+') {
166  SCLogWarning("%s: interface uses obsolete '+' notation. Using '^' instead", ns->iface);
167  ns->iface[len-1] = '^';
168  ns->sw_ring = true;
169  } else if (ns->iface[len-1] == '^') {
170  ns->sw_ring = true;
171  }
172  }
173 
174  /* we will need the base interface name for later */
175  char base_name[IFNAMSIZ];
176  strlcpy(base_name, ns->iface, sizeof(base_name));
177  if (strlen(base_name) > 0 &&
178  (base_name[strlen(base_name) - 1] == '^' || base_name[strlen(base_name) - 1] == '*')) {
179  base_name[strlen(base_name) - 1] = '\0';
180  }
181 
182  /* prefixed with netmap or vale means it's not a real interface
183  * and we don't check offloading. */
184  if (strncmp(ns->iface, "netmap:", 7) != 0 &&
185  strncmp(ns->iface, "vale", 4) != 0) {
186  ns->real = true;
187  }
188 
189  if (if_root == NULL && if_default == NULL) {
190  SCLogInfo("%s: unable to find netmap config for interface \"%s\" or \"default\", using "
191  "default values",
192  iface, iface);
193  goto finalize;
194 
195  /* If there is no setting for current interface use default one as main iface */
196  } else if (if_root == NULL) {
197  if_root = if_default;
198  if_default = NULL;
199  }
200 
201  const char *threadsstr = NULL;
202  if (ConfGetChildValueWithDefault(if_root, if_default, "threads", &threadsstr) != 1) {
203  ns->threads = 0;
204  ns->threads_auto = true;
205  } else {
206  if (strcmp(threadsstr, "auto") == 0) {
207  ns->threads = 0;
208  ns->threads_auto = true;
209  } else {
210  if (StringParseUint16(&ns->threads, 10, 0, threadsstr) < 0) {
211  SCLogWarning("%s: invalid config value for threads: %s, resetting to 0", iface,
212  threadsstr);
213  ns->threads = 0;
214  }
215  }
216  }
217 
218  ConfSetBPFFilter(if_root, if_default, iface, &ns->bpf_filter);
219 
220  int boolval = 0;
221  (void)ConfGetChildValueBoolWithDefault(if_root, if_default, "disable-promisc", (int *)&boolval);
222  if (boolval) {
223  SCLogInfo("%s: disabling promiscuous mode", ns->iface);
224  ns->promisc = false;
225  }
226 
227  const char *tmpctype;
228  if (ConfGetChildValueWithDefault(if_root, if_default,
229  "checksum-checks", &tmpctype) == 1)
230  {
231  if (strcmp(tmpctype, "auto") == 0) {
233  } else if (ConfValIsTrue(tmpctype)) {
235  } else if (ConfValIsFalse(tmpctype)) {
237  } else {
238  SCLogWarning("%s: invalid value for checksum-checks '%s'", iface, tmpctype);
239  }
240  }
241 
242  const char *copymodestr;
243  if (ConfGetChildValueWithDefault(if_root, if_default,
244  "copy-mode", &copymodestr) == 1)
245  {
246  if (strcmp(copymodestr, "ips") == 0) {
248  } else if (strcmp(copymodestr, "tap") == 0) {
250  } else {
251  SCLogWarning("%s: invalid copy-mode %s (valid are tap, ips)", iface, copymodestr);
252  }
253  }
254 
255 finalize:
256 
257  ns->ips = (ns->copy_mode != NETMAP_COPY_MODE_NONE);
258 
259  if (ns->threads_auto) {
260  /* As NetmapGetRSSCount used to be broken on Linux,
261  * fall back to GetIfaceRSSQueuesNum if needed. */
262  ns->threads = NetmapGetRSSCount(base_name);
263  if (ns->threads == 0) {
264  /* need to use base_name of interface here */
265  ns->threads = GetIfaceRSSQueuesNum(base_name);
266  }
267  }
268  if (ns->threads <= 0) {
269  ns->threads = 1;
270  }
271 
272  return 0;
273 }
274 
275 /**
276  * \brief extract information from config file
277  *
278  * The returned structure will be freed by the thread init function.
279  * This is thus necessary to copy the structure before giving it
280  * to thread or to reparse the file for each thread (and thus have
281  * new structure.
282  *
283  * \return a NetmapIfaceConfig corresponding to the interface name
284  */
285 static void *ParseNetmapConfig(const char *iface_name)
286 {
287  ConfNode *if_root = NULL;
288  ConfNode *if_default = NULL;
289  const char *out_iface = NULL;
290 
291  if (iface_name == NULL) {
292  return NULL;
293  }
294 
295  NetmapIfaceConfig *aconf = SCCalloc(1, sizeof(*aconf));
296  if (unlikely(aconf == NULL)) {
297  return NULL;
298  }
299 
300  aconf->DerefFunc = NetmapDerefConfig;
301  strlcpy(aconf->iface_name, iface_name, sizeof(aconf->iface_name));
302  SC_ATOMIC_INIT(aconf->ref);
303  (void) SC_ATOMIC_ADD(aconf->ref, 1);
304 
305  /* Find initial node */
306  ConfNode *netmap_node = ConfGetNode("netmap");
307  if (netmap_node == NULL) {
308  SCLogInfo("%s: unable to find netmap config using default value", iface_name);
309  } else {
310  if_root = ConfFindDeviceConfig(netmap_node, aconf->iface_name);
311  if_default = ConfFindDeviceConfig(netmap_node, "default");
312  }
313 
314  /* parse settings for capture iface */
315  ParseNetmapSettings(&aconf->in, aconf->iface_name, if_root, if_default);
316 
317  /* if we have a copy iface, parse that as well */
318  if (netmap_node != NULL &&
319  ConfGetChildValueWithDefault(if_root, if_default, "copy-iface", &out_iface) == 1)
320  {
321  if (strlen(out_iface) > 0) {
322  if_root = ConfFindDeviceConfig(netmap_node, out_iface);
323  ParseNetmapSettings(&aconf->out, out_iface, if_root, if_default);
324  }
325  }
326 
327  int ring_count = 0;
328  if (aconf->in.real)
329  ring_count = NetmapGetRSSCount(aconf->iface_name);
330  if (strlen(aconf->iface_name) > 0 &&
331  (aconf->iface_name[strlen(aconf->iface_name) - 1] == '^' ||
332  aconf->iface_name[strlen(aconf->iface_name) - 1] == '*')) {
333  SCLogDebug("%s -- using %d netmap host ring pair%s", aconf->iface_name, ring_count,
334  ring_count == 1 ? "" : "s");
335  } else {
336  SCLogDebug("%s -- using %d netmap ring pair%s", aconf->iface_name, ring_count,
337  ring_count == 1 ? "" : "s");
338  }
339 
340  for (int i = 0; i < ring_count; i++) {
341  char live_buf[32] = { 0 };
342  snprintf(live_buf, sizeof(live_buf), "netmap%d", i);
343  LiveRegisterDevice(live_buf);
344  }
345 
346  /* we need the base interface name with any trailing software
347  * ring marker stripped for HW offloading checks */
348  char base_name[sizeof(aconf->in.iface)];
349  strlcpy(base_name, aconf->in.iface, sizeof(base_name));
350  /* for a sw_ring enabled device name, strip the trailing char */
351  if (aconf->in.sw_ring) {
352  base_name[strlen(base_name) - 1] = '\0';
353  }
354 
355  /* netmap needs all offloading to be disabled */
356  if (aconf->in.real) {
357  if (LiveGetOffload() == 0) {
358  (void)GetIfaceOffloading(base_name, 1, 1);
359  } else {
360  DisableIfaceOffloading(LiveGetDevice(base_name), 1, 1);
361  }
362  }
363 
364  SC_ATOMIC_RESET(aconf->ref);
365  (void) SC_ATOMIC_ADD(aconf->ref, aconf->in.threads);
366  SCLogPerf("%s: using %d threads", aconf->iface_name, aconf->in.threads);
367 
369  return aconf;
370 }
371 
372 static int NetmapConfigGeThreadsCount(void *conf)
373 {
374  NetmapIfaceConfig *aconf = (NetmapIfaceConfig *)conf;
375  return aconf->in.threads;
376 }
377 
378 typedef enum { NETMAP_AUTOFP, NETMAP_WORKERS, NETMAP_SINGLE } NetmapRunMode_t;
379 
380 static int NetmapRunModeInit(NetmapRunMode_t runmode)
381 {
382  SCEnter();
383 
384  TimeModeSetLive();
385 
386  const char *live_dev = NULL;
387  (void)ConfGet("netmap.live-interface", &live_dev);
388 
389  const char *runmode_str = "unknown";
390  int ret;
391  switch (runmode) {
392  case NETMAP_AUTOFP:
393  runmode_str = "autofp";
394  ret = RunModeSetLiveCaptureAutoFp(ParseNetmapConfig, NetmapConfigGeThreadsCount,
395  "ReceiveNetmap", "DecodeNetmap", thread_name_autofp, live_dev);
396  break;
397  case NETMAP_WORKERS:
398  runmode_str = "workers";
399  ret = RunModeSetLiveCaptureWorkers(ParseNetmapConfig, NetmapConfigGeThreadsCount,
400  "ReceiveNetmap", "DecodeNetmap", thread_name_workers, live_dev);
401  break;
402  case NETMAP_SINGLE:
403  runmode_str = "single";
404  ret = RunModeSetLiveCaptureSingle(ParseNetmapConfig, NetmapConfigGeThreadsCount,
405  "ReceiveNetmap", "DecodeNetmap", thread_name_single, live_dev);
406  break;
407  }
408  if (ret != 0) {
409  FatalError("Unable to start runmode %s", runmode_str);
410  }
411 
412  SCLogDebug("%s initialized", runmode_str);
413 
414  SCReturnInt(0);
415 }
416 
417 int RunModeIdsNetmapAutoFp(void)
418 {
419  return NetmapRunModeInit(NETMAP_AUTOFP);
420 }
421 
422 /**
423 * \brief Single thread version of the netmap processing.
424 */
425 int RunModeIdsNetmapSingle(void)
426 {
427  return NetmapRunModeInit(NETMAP_SINGLE);
428 }
429 
430 /**
431  * \brief Workers version of the netmap processing.
432  *
433  * Start N threads with each thread doing all the work.
434  *
435  */
436 int RunModeIdsNetmapWorkers(void)
437 {
438  return NetmapRunModeInit(NETMAP_WORKERS);
439 }
440 #else
442 {
443  SCEnter();
444  FatalError("Netmap not configured");
445  SCReturnInt(0);
446 }
447 
448 /**
449  * \brief Single thread version of the netmap processing.
450  */
452 {
453  SCEnter();
454  FatalError("Netmap not configured");
455  SCReturnInt(0);
456 }
457 
458 /**
459 * \brief Workers version of the netmap processing.
460 *
461 * Start N threads with each thread doing all the work.
462 *
463 */
465 {
466  SCEnter();
467  FatalError("Netmap not configured");
468  SCReturnInt(0);
469 }
470 #endif // #ifdef HAVE_NETMAP
471 
472 /**
473 * @}
474 */
thread_name_workers
const char * thread_name_workers
Definition: runmodes.c:70
RunModeIdsNetmapSingle
int RunModeIdsNetmapSingle(void)
Single thread version of the netmap processing.
Definition: runmode-netmap.c:451
util-byte.h
len
uint8_t len
Definition: app-layer-dnp3.h:2
LiveRegisterDevice
int LiveRegisterDevice(const char *dev)
Add a pcap device for monitoring and create structure.
Definition: util-device.c:126
RunModeSetLiveCaptureWorkers
int RunModeSetLiveCaptureWorkers(ConfigIfaceParserFunc ConfigParser, ConfigIfaceThreadsCountFunc ModThreadsCount, const char *recv_mod_name, const char *decode_mod_name, const char *thread_name, const char *live_dev)
Definition: util-runmodes.c:321
SC_ATOMIC_INIT
#define SC_ATOMIC_INIT(name)
wrapper for initializing an atomic variable.
Definition: util-atomic.h:314
util-bpf.h
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
NetmapIfaceSettings_::checksum_mode
ChecksumValidationMode checksum_mode
Definition: source-netmap.h:51
ConfGetChildValueBoolWithDefault
int ConfGetChildValueBoolWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, int *val)
Definition: conf.c:514
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:269
LiveGetOffload
int LiveGetOffload(void)
Definition: util-device.c:81
ConfGetNode
ConfNode * ConfGetNode(const char *name)
Get a ConfNode by name.
Definition: conf.c:181
SC_ATOMIC_ADD
#define SC_ATOMIC_ADD(name, val)
add a value to our atomic variable
Definition: util-atomic.h:332
StringParseUint16
int StringParseUint16(uint16_t *res, int base, size_t len, const char *str)
Definition: util-byte.c:337
util-runmodes.h
thread_name_autofp
const char * thread_name_autofp
Definition: runmodes.c:68
NETMAP_COPY_MODE_IPS
@ NETMAP_COPY_MODE_IPS
Definition: source-netmap.h:32
NetmapIfaceConfig_::out
NetmapIfaceSettings out
Definition: source-netmap.h:64
ConfNodeLookupKeyValue
ConfNode * ConfNodeLookupKeyValue(const ConfNode *base, const char *key, const char *value)
Lookup for a key value under a specific node.
Definition: conf.c:831
LiveDeviceHasNoStats
void LiveDeviceHasNoStats(void)
Definition: util-device.c:309
CHECKSUM_VALIDATION_DISABLE
@ CHECKSUM_VALIDATION_DISABLE
Definition: decode.h:46
NetmapIfaceSettings_::iface
char iface[NETMAP_IFACE_NAME_LENGTH]
Definition: source-netmap.h:40
thread_name_single
const char * thread_name_single
Definition: runmodes.c:69
NetmapIfaceSettings_::ips
bool ips
Definition: source-netmap.h:46
RUNMODE_NETMAP
@ RUNMODE_NETMAP
Definition: runmodes.h:39
ConfValIsTrue
int ConfValIsTrue(const char *val)
Check if a value is true.
Definition: conf.c:537
RunModeIdsNetmapWorkers
int RunModeIdsNetmapWorkers(void)
Workers version of the netmap processing.
Definition: runmode-netmap.c:464
strlcpy
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: util-strlcpyu.c:43
RunModeSetLiveCaptureAutoFp
int RunModeSetLiveCaptureAutoFp(ConfigIfaceParserFunc ConfigParser, ConfigIfaceThreadsCountFunc ModThreadsCount, const char *recv_mod_name, const char *decode_mod_name, const char *thread_name, const char *live_dev)
Definition: util-runmodes.c:85
NetmapGetRSSCount
int NetmapGetRSSCount(const char *ifname)
CHECKSUM_VALIDATION_ENABLE
@ CHECKSUM_VALIDATION_ENABLE
Definition: decode.h:47
ConfGet
int ConfGet(const char *name, const char **vptr)
Retrieve the value of a configuration node.
Definition: conf.c:335
CHECKSUM_VALIDATION_AUTO
@ CHECKSUM_VALIDATION_AUTO
Definition: decode.h:48
decode.h
NetmapIfaceConfig_::DerefFunc
void(* DerefFunc)(void *)
Definition: source-netmap.h:67
NetmapIfaceSettings_::real
bool real
Definition: source-netmap.h:45
RunModeRegisterNewRunMode
void RunModeRegisterNewRunMode(enum RunModes runmode, const char *name, const char *description, int(*RunModeFunc)(void), int(*RunModeIsIPSEnabled)(void))
Registers a new runmode.
Definition: runmodes.c:490
NetmapIfaceSettings_::sw_ring
bool sw_ring
Definition: source-netmap.h:43
LiveGetDevice
LiveDevice * LiveGetDevice(const char *name)
Get a pointer to the device at idx.
Definition: util-device.c:248
GetIfaceRSSQueuesNum
int GetIfaceRSSQueuesNum(const char *dev)
Definition: util-ioctl.c:709
ConfFindDeviceConfig
ConfNode * ConfFindDeviceConfig(ConfNode *node, const char *iface)
Find the configuration node for a specific device.
Definition: util-conf.c:121
SCEnter
#define SCEnter(...)
Definition: util-debug.h:271
EngineModeSetIPS
void EngineModeSetIPS(void)
Definition: suricata.c:243
ConfGetChildValueWithDefault
int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, const char **vptr)
Definition: conf.c:378
util-time.h
SCLogWarning
#define SCLogWarning(...)
Macro used to log WARNING messages.
Definition: util-debug.h:249
NetmapIfaceSettings_
Definition: source-netmap.h:38
runmode-netmap.h
NetmapIfaceSettings_::threads
uint16_t threads
Definition: source-netmap.h:49
NETMAP_COPY_MODE_NONE
@ NETMAP_COPY_MODE_NONE
Definition: source-netmap.h:30
SC_ATOMIC_SUB
#define SC_ATOMIC_SUB(name, val)
sub a value from our atomic variable
Definition: util-atomic.h:341
source-netmap.h
NetmapIfaceSettings_::promisc
bool promisc
Definition: source-netmap.h:44
max_pending_packets
uint16_t max_pending_packets
Definition: suricata.c:183
GetIfaceOffloading
int GetIfaceOffloading(const char *dev, int csum, int other)
output offloading status of the link
Definition: util-ioctl.c:666
DisableIfaceOffloading
int DisableIfaceOffloading(LiveDevice *dev, int csum, int other)
Definition: util-ioctl.c:679
NetmapIfaceSettings_::threads_auto
bool threads_auto
Definition: source-netmap.h:47
runmodes.h
SCLogInfo
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
Definition: util-debug.h:224
ConfGetChildValue
int ConfGetChildValue(const ConfNode *base, const char *name, const char **vptr)
Definition: conf.c:348
TimeModeSetLive
void TimeModeSetLive(void)
Definition: util-time.c:99
util-conf.h
NetmapIfaceSettings_::bpf_filter
const char * bpf_filter
Definition: source-netmap.h:52
NetmapIfaceConfig_
Definition: source-netmap.h:56
suricata-common.h
ConfSetBPFFilter
void ConfSetBPFFilter(ConfNode *if_root, ConfNode *if_default, const char *iface, const char **bpf_filter)
Definition: util-bpf.c:30
LiveGetDeviceName
const char * LiveGetDeviceName(int number)
Get a pointer to the device name at idx.
Definition: util-device.c:184
SCLogPerf
#define SCLogPerf(...)
Definition: util-debug.h:230
FatalError
#define FatalError(...)
Definition: util-debug.h:502
SC_ATOMIC_RESET
#define SC_ATOMIC_RESET(name)
wrapper for reinitializing an atomic variable.
Definition: util-atomic.h:323
RunModeNetmapGetDefaultMode
const char * RunModeNetmapGetDefaultMode(void)
Definition: runmode-netmap.c:55
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:261
SCFree
#define SCFree(p)
Definition: util-mem.h:61
RunModeIdsNetmapRegister
void RunModeIdsNetmapRegister(void)
Definition: runmode-netmap.c:127
NetmapIfaceConfig_::iface_name
char iface_name[NETMAP_IFACE_NAME_LENGTH]
Definition: source-netmap.h:58
ConfNode_
Definition: conf.h:32
NetmapIfaceSettings_::copy_mode
int copy_mode
Definition: source-netmap.h:50
util-ioctl.h
ConfValIsFalse
int ConfValIsFalse(const char *val)
Check if a value is false.
Definition: conf.c:562
RunModeSetLiveCaptureSingle
int RunModeSetLiveCaptureSingle(ConfigIfaceParserFunc ConfigParser, ConfigIfaceThreadsCountFunc ModThreadsCount, const char *recv_mod_name, const char *decode_mod_name, const char *thread_name, const char *live_dev)
Definition: util-runmodes.c:350
NetmapIfaceConfig_::in
NetmapIfaceSettings in
Definition: source-netmap.h:61
suricata.h
NETMAP_COPY_MODE_TAP
@ NETMAP_COPY_MODE_TAP
Definition: source-netmap.h:31
RunModeIdsNetmapAutoFp
int RunModeIdsNetmapAutoFp(void)
Definition: runmode-netmap.c:441
LiveGetDeviceCount
int LiveGetDeviceCount(void)
Get the number of registered devices.
Definition: util-device.c:164
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:275