That means less duplication of functionality - and less chance that
XXX-over-IPv4 will be handled but XXX-over-IPv6 won't be handled, or
*vice versa*. (CARP and VRRP were being handled over IPv4 but not over
IPv6; this fixes that.)
This adds support for decoding the Broadcom Ethernet switches tags which
are are 4byte in length and are located between the Ethernet MAC SA and
the Type/Length field (DSA_TAG_BRCM) as well as the pre-pended Broadcom
tag (DSA_TAG_BRCM_PREPEND) which are located in front of the standard
Ethernet header.
This makes use of the recently introduced ether_print_hdr_len() to allow
specifying the non-standard Ethernet header length of 12 + 4 + 2 bytes.
My PC-BSD 9.1 VM, at least, has sys/capability.h but not sys/capsicum.h;
we now use sys/capsicum.h, so require it to be present (which it is in
FreeBSD 10 and later).
Index is displayed always, name only if available.
Warn about possible wrong interfaces when in reading mode
(pcap file can be displayed on a different host then where
was captured) [1].
See: GH the-tcpdump-group/libpcap#127
[1] https://lists.sandelman.ca/pipermail/tcpdump-workers/2018-July/001019.html
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Suggested-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Denis Ovsienko <denis@ovsienko.info>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
It's not specified by a libpcap header that might have a different
layout in different pcap releases, it's specified on the list of
link-layer header types and must remain the same forever (except for
getting additional bits defined), so we don't need to pick it up from
libpcap.
This means we get to use tcpdump's nd_ types; do so.
It's not specified by a libpcap header that might have a different
layout in different pcap releases, it's specified on the list of
link-layer header types and must remain the same forever (except for
getting additional bits defined), so we don't need to pick it up from
libpcap.
This means we get to use tcpdump's nd_ types; do so.
It doesn't work at all prior to CMake 3.1 and, even in newer versions of
CMake, it doesn't support all the vendor compilers out there for various
UNIXes.
This assumes you can run tests/TESTrun.sh as a script, which means it
assumes your command interpreter will either recognize it as a shell
script and run it in a Bourne-compatible shell or will just try and
execute it and the #! header will cause it to be run by /bin/sh.
This probably won't work on Windows.
Some versions of the MSVC runtime library have a non-C99-compliant
vsnprintf(), which we want to avoid. On Windows, use snprintf() and
vsnprintf() for VS 2015 and later, where they both exist in
C99-compliant forms, and wrap _{v}snprintf_s() otherwise (they're
guaranteed to do the null termination that we want).
With MSVC 2015, stdio.h defines snprintf() and vsnprintf() as inline
functions, so you need to include stdio.h when testing for them -
check_function_exists() won't do it, you need check_symbol_exists().
We don't need it for tcpdump; libpcap will pick it up if necessary if
it's dynamically-linked, we'll link with it ourselves if it's
statically-linked, and libpcap will bind to the libxnet version of
recvmsg() even if we link with libsocket (as it's compiled to refer to
it with a decorated name).
Also, we don't check for it with autotools.
Include the directory in which the pcap find module found the main pcap
header file in the list of directories in which to search for other pcap
header files; otherwise, it won't find them unless they're system header
files.
CMake *hates* that. -L considered harmful, I guess (and I don't know
how that's done with tools other than UN*X linkers - do all of them
support an equivalent to -L?).
This should fix the checks for pcap functions to look in the library we
found.
Also, use ${PCAP_INCLUDE_DIRS} rather than ${PCAP_INCLUDE_DIR} for the
list of directories with header files (it should be a one-element list,
but do this for consistency), and search for pcap headers *after* we've
found libpcap, so we look in the appropriate directory.
Do the checks for -lnsl/-lxnet in the same way that we do them for
libpcap, before checking for functions that might require those
libraries. Include the results of those checks when checking for
routines that require them.
For getservent(), check for -lsocket as well.
Clean up ${XXX_LIBRARY} vs. ${XXX_LIBRARIES} usage while we're at it.
Multiple checks for a function, in different libraries, need different
variables, as, if only one variable is used, the first test checks, and
subsequent tests are skipped because the variable is already set.