Commit Graph

11 Commits

Author SHA1 Message Date
Guy Harris
94a4b46080 Go with Wireshark's Internet checksum routine.
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.
2011-06-13 14:08:51 -07:00
guy
6191f36146 Add an "fn_printzp()" routine for printing null-padded strings (strings
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.
2005-05-06 07:56:51 +00:00
guy
bbc1cfa669 Have the configure script arrange that the Makefile define _U_
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.
2003-11-16 09:36:07 +00:00
guy
3824a6c041 From Neil Spring:
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".
2003-11-15 00:39:12 +00:00
hannes
cc77dd3860 minor display cosmetics to get to an consistent output style 2003-09-05 17:42:41 +00:00
risso
3d932490b8 Added support for Win32, based on WinPcap. 2002-08-01 08:52:55 +00:00
fenner
4dba2d1283 Pass the length of the authentication data to print_fn, instead of
an arbitrary value taken from the packet (which can trivially
become negative, perhaps enabling buffer overruns).
2001-07-23 22:27:30 +00:00
guy
7c20d41d9d Changes from Klaus Klein <kleink@reziprozitaet.de> to improve the output
and to avoid control characters in the auth-simple output.
2001-07-20 03:16:22 +00:00
guy
1869f416f3 Remove some includes of <sys/socket.h>, and add includes of
<netinet/in.h> to declare "ntoh[sl]" and "hton[sl]".
2000-10-10 05:05:07 +00:00
assar
d38c366e0b print more data with `-v'. From Kevin Steves <stevesk@sweden.hp.com> 2000-07-29 06:22:17 +00:00
fenner
7fd1be1520 Initial VRRP printer (ip proto 112, RFC 2338). 2000-05-01 17:35:44 +00:00