the wire; the definitions in many systems use u_long, which is 64 bits
long on many platforms - that's OK for in-memory structures, but it
doesn't match what's on the wire. Use headers based on the Sun ones,
but use u_int32_t for fields, and otherwise make the structures match
what's on the wire, and change some names to avoid collision with
<rpc/rpc.h>, which print-sunrpc.c includes to declare "getrpcbynumber()"
and the structure it returns.
Record whether "getrpcbynumber()" is found, and use it only if it's
found, rather than basing the decisison on whether we're building for
Win32 or not.
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".
Fix numerous bugs in my AODV submission, red faces all round,
mainly due to misunderstanding of EXTRACT_STRING() macro
arguments (because these are macros, type checking didn't
happen).
AODV HELLO extensions are now correctly printed.
The code is closer to FreeBSD's style guidelines.
Don't use "u_char" and "u_long", use "u_int8_t" and "u_int32_t".
"u_long" is definitely wrong as it's 64 bits on some platforms; "u_char"
is safe, but the official tcpdump style uses "u_int8_t".
At least according to the (long-since-expired) draft-perkins-aodv6-01,
the V6 AODV messages have different message type values from the V4 ones
in draft-ietf-manet-aodv-13. However, draft-ietf-manet-aodv-13 says
that the only differences are in the addresses; we support both.
Clean up the way we tell the AODV6 dissector that we're running atop
IPv6 a bit.
Use "udpipaddr_print()" if we're printing AODV packets as a result of
saying "anything that matches this filter is AODV", rather than doing it
ourselves under the assumption that it's running over IPv4.
an out-of-range flag value.
Seperate out the truncation checks into two: are the ports available,
then do all the other checks, then check to see if the full UDP header
is available.
This is a slightly modified version of Alexander's original patch to
instead use udpipaddr_print() to print the addresses if the ports are not
available.
Submitted-by: Alexander Dupuy
Sourceforge bug #579811
values. Use that rather than private definitions in various files.
Add "gmpls.h" to the list of files in FILES, and add it and "ipfc.h" to
the list of files in INSTALL.
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".
redefinitions" stuff from files that include "nameser.h" to "nameser.h"
itself (we used to include <arpa/nameser.h>, over which we had no
control so we couldn't do that, but we now have our own "nameser.h").
Add T_OPT to the list of things we undefine, and undefine T_UNSPEC iff
T_UNSPEC is defined, not iff NOERROR is defined.
Replace the include of <arpa/nameser.h> in "print-rx.c" with an include
of "nameser.h", and "#if 0" it out pending a determination of whether
it's necessary (why would AFS's RX care about the internals of DNS
packets?) or not.
Finish converting over to having the caller print the IP address
(except for UDP, TCP and SCTP). This consists mostly of removing
places where the IP address is printed, both in the big "case"
in ip_print() and in the individual printers.
Also fix a couple of spacing bugs.