Have them take a netdissect_options * argument, and get the "no name
resolution" flag from it.
Move the declaration of dnaddr_string to addrtoname.h, along with the
other XXX-to-string routines.
Eliminate a number of fputs(), putchar() and fflush() uses. Justify
preprocessor directives. Don't typecast ND_PRINT() to void and fix some
indentation.
Remove lots of $Header's and a few $Id's that all belong to the former
CVS repository of tcpdump itself. These keywords have been frozen since
the migration to git in late 2008.
The Wireshark routine is based on the BSD in-kernel portable checksum
routine (thus BSD-licensed); it takes a vector of pointers and lengths
and checksums the concatenation of the buffers in question (just as the
BSD in-kernel routine checksums a chain of mbufs).
This simplifies the "with a pseudo-header" checksums; hopefully it'll
fix up the problems being seen on some big-endian platforms, which might
be due to hand-calculating some or all of the checksum and doing so
incorrectly. It also gets rid of some code that might be dereferencing
unaligned pointers.
i.e. including the header - the IP6 payload length field differs
from that ...
highlight the difference by printing 'payload length' rather than 'length'
When a packet contains an IPv6 options header followed by an unknown IPv6
protocol payload, tcpdump displays the proto ID for the known option
header, not for the unknown payload.
For example, this is the output for an IPv6 packet containing a destination
options header, followed by a payload of (unknown) protocol 138:
# tcpdump -s 128 -i eth1
tcpdump: WARNING: addresses not searched
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 128 bytes
11:44:40.862572 I IP6 2007::10:5:2:163 > 2007::10:5:2:164: DSTOPT ip-proto-60 16
The ip-proto-60 refers to the destination option header (DSTOPT), rather
than displaying the unknown option 138, which I think would be more
informative.
The attached patch fixes this problem. With the patch applied, the output
for the packet is:
# tcpdump -s 128 -i eth1
tcpdump: WARNING: addresses not searched
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 128 bytes
11:48:26.160462 I IP6 2007::10:5:2:163 > 2007::10:5:2:164: DSTOPT ip-proto-138 16
- consistent use of length field (not payload-len)
- no message type number given in PIM/OSPF printers
as those changes affect only verbose mode and/or
routing protocols we hope not to break existing scripts;
Check, and use, the supplied packet length in the PPPoE dissector. (It
reflects the actual packet length; snapend reflects the captured packet
length.)
As we're now doing bounds checks with TCHECK, the loop over the tagged
fields doesn't have to check against snapend.
just reflects the payload length, the snapshot length has been trimmed
to correspond to it, so it doesn't need to check it merely to avoid
running past the end of the IPv6 payload); get rid of it.
Pass "icmp6_print()" the IPv6 payload length (i.e., the length of the
ICMPv6 packet), rather than having it compre the length itself.
Make the length argument to "icmp6_cksum()" unsigned, to match the value
passed to it.
Fix the lengths passed to "sctp_print()", "tcp_print()", and
"udp_print()" (we update "len" in the header-processing loop to
correspond to the remaining payload, so we just pass it to those
routines).
return -1 if they run out of data.
Have the IPv4 and IPv6 dissectors check for non-positive return values
from those routines and quit if they see one.
run past the end of that payload.
Check that the IPv4 total length isn't less than the header length.
Use "%u", not "%d", to print unsigned values.
Properly update "len" in the header-processing loop for IPv6.
Doing so means we can trust the length passed to the TCP and UDP
dissectors when constructing the IPv6 pseudo-header; do so (but fix the
length we pass to the UDP-over-IPv6 checksum routine).
That length is unsigned; make the corresponding arguments to the TCP and
UDP checksum routines unsigned.
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".