Commit Graph

33 Commits

Author SHA1 Message Date
guy
edb0e92cdc Add a few more GCC warnings on GCC >= 2 for ".devel" builds.
From Neil T. Spring: fixes for many of those warnings:

	addrtoname.c, configure.in: Linux needs netinet/ether.h for
	ether_ntohost

	print-*.c: change char *foo = "bar" to const char *foo = "bar"
	to appease -Wwrite-strings; should affect no run-time behavior.

	print-*.c: make some variables unsigned.

	print-bgp.c: plen ('prefix len') is unsigned, no reason to
	validate by comparing to zero.

	print-cnfp.c, print-rx.c: use intoa, provided by addrtoname,
	instead of inet_ntoa.

	print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to
	be false, so check for (u_int)-1, which represents failure,
	explicitly.

	print-isakmp.c: complete initialization of attrmap objects.

	print-lwres.c: "if(x); print foo;" seemed much more likely to be
	intended to be "if(x) { print foo; }".

	print-smb.c: complete initialization of some structures.

In addition, add some fixes for the signed vs. unsigned comparison
warnings:

	extract.h: cast the result of the byte-extraction-and-combining,
	as, at least for the 16-bit version, C's integral promotions
	will turn "u_int16_t" into "int" if there are other "int"s
	nearby.

	print-*.c: make some more variables unsigned, or add casts to an
	unsigned type of signed values known not to be negative, or add
	casts to "int" of unsigned values known to fit in an "int", and
	make other changes needed to handle the aforementioned variables
	now being unsigned.

	print-isakmp.c: clean up the handling of error/status indicators
	in notify messages.

	print-ppp.c: get rid of a check that an unsigned quantity is >=
	0.

	print-radius.c: clean up some of the bounds checking.

	print-smb.c: extract the word count into a "u_int" to avoid the
	aforementioned problems with C's integral promotions.

	print-snmp.c: change a check that an unsigned variable is >= 0
	to a check that it's != 0.

Also, fix some formats to use "%u" rather than "%d" for unsigned
quantities.
2002-09-05 00:00:07 +00:00
guy
3a93c1943b Fixes for:
parsefattr misuses nfsv2 version members for v3.
	print_int64 prints at least 9 digits unnecessarily.
	-u flag doesn't always suppress decoding handles.

from Takashi Yamamoto <yamt@mwd.biglobe.ne.jp>.
2002-08-26 09:36:19 +00:00
risso
3d932490b8 Added support for Win32, based on WinPcap. 2002-08-01 08:52:55 +00:00
itojun
111ff8a61d whitespace cleanup 2002-06-11 17:08:37 +00:00
guy
4c6bada758 Get rid of unneeded incomplete definitions of "struct mbuf" and "struct
rtentry", and unneded includes of <sys/uio.h>, <sys/file.h>, and
<sys/ioctl.h>.
2002-06-01 23:50:30 +00:00
guy
2faf41eb28 V3 FSINFO and PATHCONF requests take a file handle as an argument; parse
the request header and the file handle.

"parsestatus()" should only return NULL if the packet was truncated, so
that its callers can distinguish "packet truncated" from "NFS reply
status reports an error".

NFS-request-or-reply parsing routines that call "parsestatus()" should
not return 0 if "parsestatus()" returns a non-zero NFS reply status, so
that non-truncated packets with a non-zero NFS reply status aren't
printed as truncated NFS packets.

Fix some "TCHECK2()" calls to pass an object, not a pointer to an
object, as the first argument (the TCHECK/TTEST macros take objects, not
addresses, as the test argument).

NFS-request-or-reply parsing routines should return 0 for truncated
packets and 1 for non-truncated packets, not *vice versa*.
2002-05-31 09:47:23 +00:00
guy
2fd1118636 Get rid of casts of pointers-to-const to pointers-to-nonconst. 2002-04-24 06:27:05 +00:00
itojun
ccb7f4f3c1 constness 2002-02-18 08:56:45 +00:00
itojun
873cf37e74 NULL is not 0 2001-07-08 08:01:43 +00:00
fenner
467c341cc8 Check for parse failure in ACCESS replies.
Submitted by:	nathanw@MIT.EDU (Nathan J. Williams)
2001-07-04 19:24:10 +00:00
itojun
ce132b307b put stripped-down version of ip6.h and icmp6.h into tcpdump tree.
ip6.h is almost normal RFC2292 header.
icmp6.h has couple of extensions (not covered by RFC2292),
like MLD, ICMPv6 nodeinfo, and router renumber.

XXX how to synchronize with future kame changes?
2000-10-07 05:53:09 +00:00
itojun
fb75d3cd5a always use u_intXX_t for protocol format declaration. char/short/int may not
come with exact size.  while at it, correct signedness of ip/udp header field.
nuke most of the use of bitfield.
TODO: bitfield in namser.h
2000-10-03 02:54:54 +00:00
guy
cf53dc05f1 Get rid of includes of <netinet/in_systm.h>, and replace "n_short",
"n_long", and "n_time", defined in that file, with other types.
2000-09-29 04:58:33 +00:00
guy
8b67f77134 Get rid of unneeded includes of <net/if.h>. 2000-09-28 06:42:55 +00:00
guy
536f512583 Add an "ip.h" header, to declare the IP stuff needed by dissectors, and
have dissectors include them rather than <netinet/ip.h> or
<netinet/ip_var.h>, if they actually need that stuff.

Put the declarations of the ICMP stuff directly into "print-icmp.c".

Remove all unnecessary includes of <netinet/ip*.h> files.

Copy the byte-order stuff from "nameser.h" into "tcp.h".
2000-09-23 08:54:24 +00:00
guy
e894092542 Add definitions of Ethernet types from
"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.
2000-09-23 08:03:27 +00:00
guy
4b440ad855 To translate NFS error statuses to strings, use "tok2str()" and a table,
rather than using "pcap_strerror()", as

	1) not all NFS error statuses are UNIX errno values;

	2) even those that are UNIX errno values aren't necessarily
	   errno values for the system on which you're running tcpdump.
2000-08-03 18:52:24 +00:00
assar
d171e52e94 s/nfstype/nfs_type/ to avoid conflict with system header files 2000-07-29 08:05:04 +00:00
itojun
ce26a5daa5 typo in pointer assignment. from netbsd-current. 2000-07-16 14:32:48 +00:00
assar
3cd171317f remove non-STDC code 2000-07-01 03:38:59 +00:00
itojun
459529c99b add fallback definition for INET_ADDRSTRLEN.
From: Kevin Steves <stevesk@sweden.hp.com>
2000-06-12 15:45:05 +00:00
itojun
3c03d589c9 strncpy() does not ensure string termination. 2000-06-10 05:26:42 +00:00
itojun
65d89ae560 s/(unsigned)/(u_int32_t)/ for ntohl results. 2000-06-10 05:23:19 +00:00
itojun
c805ce8944 correct endianness in int64_print(). 2000-06-10 05:21:08 +00:00
itojun
d9c551524d correctly handle NFS-over-IPv6. 2000-06-10 05:12:20 +00:00
assar
eb57b70851 (nfs_printfh): support print the opaque handle.
From Francisco Matias Cuenca-Acuna <mcuenca@george.rutgers.edu>
2000-06-01 01:08:18 +00:00
assar
cf77b46229 (unsigned) casts in printf to make gcc happy 2000-05-15 00:37:34 +00:00
fenner
edb0d2fe08 Fix confusing indentation.
Get rid of T2CHECK() in favor of TCHECK() or TCHECK2().
Use TCHECK() etc. instead of comparing vs. snapend.
Replace strerr() with pcap_strerror(), and don't use errno as a local variable.
Use tok2str() for nfsv3_writemodes to avoid array overrun by corrupt packets.
2000-01-28 00:04:19 +00:00
fenner
3dc6997c5a Use %08x to make sure that the low half of a 64-bit quantity doesn't
get printed incorrectly (i.e. 0x1000000001 could have been printed as 0x11)
1999-12-15 06:57:25 +00:00
fenner
b9ac23ce92 Switch to config.h instead of passing defines in DEFS. 1999-11-21 09:36:43 +00:00
assar
86795f2b92 incorporate NFS parsing code from NetBSD. adds support for nfsv3 1999-11-21 05:43:49 +00:00
mcr
f6fa6a40d4 patches to help build on Linux 2.2 1999-10-17 21:37:10 +00:00
mcr
f555c163f9 Initial revision 1999-10-07 23:47:09 +00:00