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