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