Commit Graph

20 Commits

Author SHA1 Message Date
guy
f72f67a5cf From David Young: print Ack/Poll information for data frames with
contention-free Ack or Poll indications, and print flag bits from the
Frame Control field if "-v" was specified.
2003-02-04 05:53:21 +00:00
guy
4bec97f457 Hoist a bunch of stuff that should be done by all if_print routines into
tcpdump.c.  Have if_print routines return the length of the link-layer
header, so that the common code knows how to skip the link-layer header
when printing the packet in hex/ASCII.
2002-12-19 09:39:10 +00:00
guy
cfabfb053b Add a new routine "default_print_packet()", which takes a pointer to the
beginning of the raw packet data, the captured length of the raw packet
data, and the length of the link-layer header, and:

	if "-e" was specified, prints all the raw packet data;

	if "-e" was not specified, prints all the raw packet data past
	the link-layer header, if there is any.

Use that routine in all the "xxx_if_print()" routines if "-x" was
specified.

Make "arcnet_encap_print()" static - it's not used outside
"print-arcnet.c".

Add missing info printing code to "atm_if_print()".

Print the packet data in "lane_if_print()", not in "lane_print()", as
"lane_print()" can be called from other "xxx_if_print()" routines, and
those routines will also print the packet data if "-x" was specified -
no need to print it twice.
2002-12-18 09:41:13 +00:00
guy
e070cf232f We no longer use "packetp" for anything, so eliminate it. (If any
dissector really needs source and destination MAC addresses, we should
make global pointers to them - which would be null for packets lacking
MAC addresses, so dissectors that need them will need to do something
sensible if those pointers are null.)

Don't fake up an Ethernet header if there aren't any MAC addresses to
use when faking it up.

"bp_chaddr" in "print-bootp.c" is an array, so "bp->bp_chaddr" cannot be
null, and there's no need to test for it not being null.
2002-12-18 08:53:18 +00:00
guy
46c77e78ff Handle DLT_PRISM_HEADER captures that are really DLT_IEEE802_11_RADIO
captures.
2002-12-17 09:13:45 +00:00
guy
f7a91421dd From Atsushi Onoe <onoe@netbsd.org>: NetBSD change to mark basic rate
with '*' in PRINT_RATES().
2002-12-12 07:47:38 +00:00
guy
5585ad8705 Don't hardwire in the length of the AVS capture header - extract it from
the header.

Do the check for the 802.11 header being large enough to include the
frame control byte in common code, not in each interface dissector.
2002-12-12 07:39:19 +00:00
guy
c52bf5af8c Add support for DLT_PRISM and DLT_IEEE802_11_RADIO. 2002-12-12 07:28:35 +00:00
guy
e9df6a787a Get rid of a bogus extra space. 2002-12-11 04:56:44 +00:00
guy
c422d3ab0f Get rid of the "-Wno-unused" flag, and fix up most of the
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".
2002-09-05 21:25:34 +00:00
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
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
6c6b1ac0b2 If we run out of data in the when processing tagged parameters, return
"success", not "failure" - there's no special "end of list" parameter.
Get rid of the check for a parameter tag of 0xff, for the same reason.

Take out an extra space between the "[" and the list of rates in a
"supported rates" tagged parameter, and don't print the "[" or the "
Mbit]", or the leading space if there are no supported rates (or there
is no "supported rates" parameter.

Use "fn_print" to print the SSID, in case there are non-printable
characters in it.

Show the channel number in decimal, not hex, as that's how it's given in
the IEEE 802.11 spec.

Show the supported rates in a probe response, if present.

Get rid of random extra trailing space in tagged parameter output.
2002-05-13 08:30:19 +00:00
fenner
c672f00276 Eliminate some unused parameters.
Use const more.
Use EXTRACT_* macros more.
Use TCHECK* more.
Use tok2str() to replace some home-grown workalikes.
smb:
 - Get rid of private types, use tcpdump-defined types
 - Rename fdata and fdata1 to smb_fdata and smb_fdata1 to avoid conflict
   with IRIX library function.
2001-09-17 21:57:50 +00:00
guy
176a3e4986 Put the infodelay wrapping into the remaining "XXX_if_print()" routines.
Split the Cisco HDLC printer into "chdlc_if_print()", which does the
stuff expected of a low-level print routine (printing the time stamp,
printing the final newline, doing the infodelay stuff) and
"chdlc_print()", which doesn't do that stuff.  This lets us clean up
"ppp_hdlc_if_print()" a bit - it can just print the time stamp at the
beginning, and do the infodelay stuff at the end, without having to
treat Cisco HDLC specially by skipping the time stamp printing.  (This
also ensures that the time stamp is always printed, which wasn't the
case before.)

Print the missing final newline in "pppoe_if_print()".
2001-07-05 18:54:13 +00:00
itojun
7025d4606f style. avoid sprintf 2001-06-15 07:39:43 +00:00
guy
d2642d64c9 Don't use "sizeof" to compute the sizes of various headers - the
structures for the headers might have padding added by the compiler (I
think at least some versions of GCC for ARM, for example, pad structures
to a multiple of 4 bytes in length), use explicit #define values.

The sequence control field of a management frame header is 16 bits long,
not 8 bits long.
2001-06-14 09:50:01 +00:00
guy
884ae4d8c2 Don't make the FCS field of a control frame structure a "u_int32_t", as
that may force it to be aligned on a 4-byte boundary, and it's not
always aligned on a 4-byte boundary in those structures.

Add a bunch of bounds checking.

"ctrl_body_print()" expects its first argument to point to the beginning
of the link-level frame; pass it a pointer to that, not to the stuff
following the link-level frame.
2001-06-13 07:25:57 +00:00
guy
15b5a0ab52 IEEE 802.11 support, from Charlie Lenahan <clenahan@fortresstech.com>. 2001-06-12 05:17:16 +00:00