At least on 2.4 kernels, need to include <linux/types.h> for <linux/filter.h>

Otherwise, the compile fails as types such as _u32 aren't defined.
Update to handle pcap.h being in /usr/include/pcap.
Don't just treat anything that contains "can" or "vcan" as a CANbus device.

Instead, require that it *start* with "can" or "vcan", and be followed
by at least one digit.

This means that if you, for example, rename a regular interface as, for
example, "canopy", it will no longer be mistakenly treated as a CANbus
device (yes, this really happened, and a bug was filed against it).
Fix tpo.
Have non-interface modules take responsibility for identifying their devices.

Have a table of routines to do pcap_create() for devices that aren't
regular network interfaces.  Try each of those in succession until one
says "it's mine" (whether it succeeds or fails); if none do, do a
pcap_create() for a regular interface.

Have those routines do more stringent tests of the name - don't just
accept any name that has a particular substring anywhere in it.  That
reduces the likelihood of a false match (as happened with the CANbus
module when somebody renamed their Ethernet interface "canopy").

Have the table also include routines for pcap_findalldevs().
Constify some variables.
And un-constify some others.
Clean up indentation.

Also get rid of some in-block declarations.
More whitespace cleanup etc..
Fix --disable-canusb.

Reviewed-By: Guy Harris <guy@alum.mit.edu>
Oops, didn't run autoreconf, so some hacks of my own got checked in.

Some stuff I was doing got checked in because I didn't run autoreconf
after backing that stuff out.  Re-run autoreconf and check in the
results.
The leading comma looked weird; remove it.

That might be how the --disable-canusb bug got in.  Hopefully this will
make the code look a little clearer and possibly avoid future bugs of
that sort.
Fix compilation of pcap-netfilter.
canusb: needs -lpthread

canusb uses pthreads, but -lpthread is never added to LIBS hence missing
from pcap-config, causing build failures. Fix this.
Update to reflect bug fix for 1.3.1.
Add netfilter/nfqueue interface.

It's almost like nflog but with different structures/constants.
Work around people who use --without-flex and --without-bison.

For some mysterious reason, some people insist on configuring libpcap
using --without-flex and --without-bison when they're running on systems
that come with Flex and Bison, *don't* offer Real Lex or Real YACC, and
thus have "lex" and "yacc" as wrappers around Flex and Bison.  At least
some versions of Bison define YYBISON regardless of whether they're run
with -y (as is done by at least some "yacc" wrappers around Bison) or
not, but the configure script only passes the -p flag to a tool named
"bison", not a tool named "yacc", so the parser ends up being built
without a #define to give the parser the name pcap_parse() and with a
YYBISON #define to suppress the pcap_parse() wrapper around yyparse(),
so you don't get a pcap_parse() defined by libpcap.

Instead, explicitly define NEED_YYPARSE_WRAPPER if we're not passing -p
to the parser generator, and use *that* to determine whether to build
the wrapper or not.

Hopefully this will put all those "ZOMG I tried to link tcpdump and it
didn't find pcap_parse()!!!!!!111!!!ONE!!!!1111" complaints to rest.
Note the attempt to fix the "pcap_parse not defined" problem.
Fix documentation of return values.

Note that pcap_loop() can return 0 if you're reading from a savefile and
you hit the EOF.

Fix a typo while we're at it.
Note that we fixed some issues with the pcap_loop man page.