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.
with a maximum length, where a string shorter than that length is padded
with NULs), as "fn_print()" won't handle the maximum length *and* the
snapshot length and "fn_printn()" won't stop on a null string. Use it
where appropriate.
Always pass "snapend" to "fn_print()" and "fn_printn()" if they're
passed a pointer into the packet data; only pass NULL if they're being
handed a pointer into a buffer that's not part of the packet data.
Always check the return value of "fn_print()", "fn_printn()", and
"fn_printzp()" if they're passed "snapend", and do the appropriate
string termination and "packet truncated" indication if they return 1.
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".