Both interface.h and netdissect.h include <pcap.h>, thus most files
should not include it regardless if these need it or not. The only
exceptions so far remain:
* addrtoname.c
* missing/datalinks.c
* missing/dlnames.c
* tcpdump.c
We want to process TLVs until we run out of data, so make the main loop
condition "length > 0". Break out of the loop if we see an
NFULA_PAYLOAD TLV.
Add in a bunch of length checks, and make those and existing length
checks report "[|nflog]".
Use the header file for information about LINKTYPE_NFLOG files.
Don't build the NFLOG printer if we don't have that header file.
Fix some checks for pcap/XXX.h header files to look for
"tcpdump-stdinc.h" rather than <tcpdump-stdinc.h>, so that we don't fail
to find that header.
For headers included in only one source file, put the header contents in
the source file in question, and get rid of a bunch of stuff from the
header not used in the source file.
Make sure all of them are declared const and most of them -- static.
Proper declaration of token arrays is a common review point for new code
that is based on existing decoders. Thus fix the issue at its root.
This change removes detection of linux/netfilter/nfnetlink_log.h, which
was only used to provide two constants. The constants are now defined in
print-nflog.c, making it possible to compile (and test) the NFLOG
decoder on all systems, not only Linux.
There is now a test case for the decoder, it was produced on a Linux
host with:
iptables -A INPUT -p udp --source 74.82.42.42 -j NFLOG --nflog-group 20
dig @74.82.42.42 ...
Clean up white space, just add 104 (the length of the NFLOG header) to
the pointer, and return the length of the NFLOG header from
nflog_if_print(). Mark the caplen argument to nflog_print() as unused.