option (RFC 3442).
Just modify the "len" variable as we parse an option - no need for a
separate variable representing the amount of data left (I suspect that's
why the wrong variable appears to have been used in the "trailing data
length" message; I'd expect that message to indicate how much *extra*
data there was in the option, not how much *total* data there was in the
option).
Add checks for too-short options in some cases where they were missing.
In the check for the Client FQDN option, skip past what data there is in
the option if it's too short, so it doesn't show up as extra data in the
option.
For the Agent Circuit option, for each suboption:
check to make sure the suboption length doesn't go past what's
left in the option;
don't reject options with an option type or length of 0 (neither
are forbidden by RFC 3046, and, in fact, RFC 3046 says "a
sub-option length may be zero");
use fn_printn() to print the Agent Circuit ID suboption, rather
than doing the equivalent ourselves with a safeputchar() loop.
0) use TTEST/TCHECK macros vs. snapend comparisons
1) when -vvv display PAD and END options
(multiple PAD options are summarized)
2) change a trunc string from bootp to rfc1048 because I think that is
what is intended (matches trunc label)
-print option/tag numbers and len
-change the tokenstring such that the most common options are human-readable
-add support for option 82 (Agent-ID) suboptions
-make more use ok tok2str() rather thane private lookalives
appropriately, and that GNUmakefile and the MSVC++ project file define
it apppriately, as we do with libpcap, rather than defining it in
"interface.h".
Undo the rcsid-shuffling and addition of extra #includes, as we no
longer need to arrange that "interface.h" be included before using _U_
in an RCS ID or copyright.
use "_U_" in the definitions of "rcsid[]", to eliminate
complaints about those variables being unused;
move the definitions after the include of "interface.h", or add
an include of "interface.h", so that "_U_" is defined.
Include "config.h" before including "tcpdump-stdinc.h" in
"missing/datalinks.c".
out of "bootp.h" into "print-bootp.c", so we don't get unused copies of
them in files other than "print-bootp.c" that include "bootp.h", and so
we don't get warnings from GCC 3.3 about those unused copies.
Fix the CID parser for type=0 (ASCII text) client IDs.
Make the overall parser a little more robust to buggy parsers like
the CID one by incrementing bp when there are bytes left over.
dissector really needs source and destination MAC addresses, we should
make global pointers to them - which would be null for packets lacking
MAC addresses, so dissectors that need them will need to do something
sensible if those pointers are null.)
Don't fake up an Ethernet header if there aren't any MAC addresses to
use when faking it up.
"bp_chaddr" in "print-bootp.c" is an array, so "bp->bp_chaddr" cannot be
null, and there's no need to test for it not being null.
compile with Sun C, as "interface.h" isn't being included before the
structures are being declared.
Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun
C to generate code that's safe with unaligned accesses, as
"__attribute__" is defined as a do-nothing macro with compilers that
don't support it.
Therefore, we get rid of that tag on the structures to which it was
added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch
16-bit and 32-bit big-endian quantities from packets. We also fix some
other references to multi-byte quantities to get rid of code that tries
to do unaligned loads on platforms that don't support them.
We also throw in a hack that makes those macros use
"__attribute__((packed))" on structures containing only one 16-bit or
32-bit integer to get the compiler to generate unaligned-safe code
rather than doing it by hand. (GCC on SPARC produces the same code that
doing it by hand does; I don't know if GCC on any other big-endian
strict-alignment processor generates better code for that case. On
little-endian processors, as "ntohs()" and "ntohl()" might be functions,
that might actually produce worse code.)
Fix some places to use "%u" rather than "%d" to print unsigned
quantities.
unused-parameter problems reported by GCC. Add an _U_ tag to label
parameters as unused if the function is called through a pointer (so
that you can't change its signature by removing parameters) or if there
are unused parameters only because the function isn't complete.
Add some additional bounds checks the necessity for which was revealed
while cleaning up unused-parameter problems.
Make some routines static.
"lcp_print()", defined in "print-lcp.c", isn't called anywhere -
"print-ppp.c" has the code to dissect LCP. Get rid of "print-lcp.c".
quantities are stuffed into it.
Add an unsigned 8-bit variable as well, for 8-bit unsigned quantities.
Stuff unsigned 16-bit quantities into 16-bit variables.
Print unsigned values with "%u".
Use const more.
Use EXTRACT_* macros more.
Use TCHECK* more.
Use tok2str() to replace some home-grown workalikes.
smb:
- Get rid of private types, use tcpdump-defined types
- Rename fdata and fdata1 to smb_fdata and smb_fdata1 to avoid conflict
with IRIX library function.
"linux-includes/netinet/if_ether.h" to "ethertype.h".
Move other stuff used by dissectors from <netinet/if_ether.h> to
"ether.h", along the lines of "fddi.h" and "token.h".
Move ARP declarations from BSD include files to "print-arp.c".
Remove from dissectors includes of <netinet/if_ether.h>, and add
includes of "ethertype.h" and/or "ether.h" as necessary.
Get rid of configuration options that test declarations now made in
"ether.h" or "print-arp.c", as those declarations are now under our
control, not the OS's control.