|
|
|
@ -1538,6 +1538,44 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
|
|
|
|
return TM_ECODE_FAILED;
|
|
|
|
return TM_ECODE_FAILED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* warn user if af-packet, netmap or pf-ring are available */
|
|
|
|
|
|
|
|
#if defined HAVE_AF_PACKET || HAVE_PFRING || HAVE_NETMAP
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
#ifdef HAVE_AF_PACKET
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_PFRING
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETMAP
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SCLogWarning(SC_WARN_FASTER_CAPTURE_AVAILABLE, "faster capture "
|
|
|
|
|
|
|
|
"option%s %s available:"
|
|
|
|
|
|
|
|
#ifdef HAVE_AF_PACKET
|
|
|
|
|
|
|
|
" AF_PACKET (--af-packet=%s)"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_PFRING
|
|
|
|
|
|
|
|
" PF_RING (--pfring-int=%s)"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETMAP
|
|
|
|
|
|
|
|
" NETMAP (--netmap=%s)"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
". Use --pcap=%s to suppress this warning",
|
|
|
|
|
|
|
|
i == 1 ? "" : "s", i == 1 ? "is" : "are"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_AF_PACKET
|
|
|
|
|
|
|
|
, optarg
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_PFRING
|
|
|
|
|
|
|
|
, optarg
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETMAP
|
|
|
|
|
|
|
|
, optarg
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
, optarg
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
/* some windows shells require escaping of the \ in \Device. Otherwise
|
|
|
|
/* some windows shells require escaping of the \ in \Device. Otherwise
|
|
|
|
* the backslashes are stripped. We put them back here. */
|
|
|
|
* the backslashes are stripped. We put them back here. */
|
|
|
|
if (strlen(optarg) > 9 && strncmp(optarg, "DeviceNPF", 9) == 0) {
|
|
|
|
if (strlen(optarg) > 9 && strncmp(optarg, "DeviceNPF", 9) == 0) {
|
|
|
|
|