sure that all values from 100 to the current maximum value are in use;
put in comments to indicate for what purpose the reserved ones are
reserved.
Note in the "don't just grab a value and use it yourself" comment why
you shouldn't use values below 100 or above the maximum value you see in
the file.
might be supplied by the OS, and the OS might supply a version that
doesn't check); instead, check for null pointers before doing anything
with the address at all. This also means we don't supply a netmask if
the address is null; that makes sense, as a netmask makes no sense
without an address.
DLT_IEEE802_11_RADIO (rather than supporting nothing, which keeps most
capture programs from working at all, as they set an empty filter if no
filter was explicitly supplied).
DLT_IEEE802_11_RADIO_AVS for future use with the AVS radio header.
Fix a comment.
Put in reserved LINKTYPE_USERn values corresponding to the reserved
DLT_USERn values.
- don't auto-detect HDLC DLT on serial links, use
"pcap_set_datalink()" to choose the link-layer header
- for ATM, allow selecting SUNATM rather than the default
RFC1483 with "pcap_set_datalink()"
- reformat and otherwise clean up the code.
In the Linux kernel the packet statistics are zeroed during each retrieval.
In contrast, on FreeBSD, the packet statistics are retrived using
ioctl(BIOCGSTATS):
The patch adds a static variable to pcap_stats_linux() which
holds a running total of the packet statistics so that the behaviour
of pcap_stats() on Linux matches the behaviour of FreeBSD.
devices, offer DLT_DOCSIS as one of the choices of link-layer type, and
support setting that type as meaning just "set libpcap's notion of the
link-layer type to DLT_DOCSIS" without telling the driver to use
DLT_DOCSIS.
file that defines MASK, so when compiling the lexical analyzer, if INET6
is defined you get a redefinition warning. Use NETMASK rather than MASK
for the token "mask".
"snprintf()", include one in libpcap with the name "pcap_snprintf()", so
applications don't have to supply their own "snprintf()" on those
platforms in order to use libpcap.
were read, so we check "p->break_loop"; that way, we can break out of
the loop even if we get no packets (because of a timeout).
Also, check "p->break_loop" before reading packets from the driver.
first check whether BIOCVERSION works;
then, if so, check whether the version is OK for us;
then, if so, try to install the filter - if that succeeds, free
up any userland filter we had installed, if any, and filter in
the kernel, otherwise fail;
otherwise, if we couldn't get the version or the version check
failed, install a userland filter.
That way, we don't install kernel filters unless we know the kernel's
BPF interpreter is OK for us (rather than checking the version *after*
we've already installed the filter), and don't have to worry about that
filter being in the kernel (possibly with an inappropriate interpreter)
if we're filtering in userland.
Clean up the "version isn't OK" message (put in a newline at the end,
and put in "tcpdump:" at the beginning).