Commit Graph

28 Commits

Author SHA1 Message Date
hannes
7c2ffdbf06 added processing of LLC_SAPIP 2002-11-13 16:08:39 +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
guy
c2b35f3e46 Make "snap_print()" take an argument specifying the padding for bridged
LAN frames; it's 0 bytes for Frame Relay and 2 bytes for ATM.
2002-07-11 08:27:03 +00:00
guy
6d6270c6b4 From Paul S. Traina: FreeBSD's Frame Relay printer.
Make the code to print a SNAP-encapsulated packet a separate routine,
for use by the Frame Relay code.
2002-07-11 08:09:45 +00:00
guy
a57421867f Support RFC 2684 bridging of Ethernet, 802.5 Token Ring, and FDDI, and
RFC 2684 encapsulation of BPDUs.
2002-04-07 09:50:30 +00:00
guy
13ccad293f From Heinz-Ado Arnolds <Ado.Arnolds@dhm-systems.de>: mark IPX packets
according to whether they're Ethernet II, 802.3, or 802.2.
2001-11-25 02:01:47 +00:00
fenner
a5562fdcfe Add --enable-smb to make it easier to re-enable the SMB printer. 2001-10-08 21:25:15 +00:00
itojun
459451d636 disable smb printing until we have boundary checks in *smb*.c (there's almost
no boundary check).
2001-10-04 09:18:45 +00:00
guy
c23f7b7dcf There's no link-layer header on Linux ARPHRD_ATM packets; there's
apparently (as per the previous version of this code) either an 802.2
LLC header (as per RFC 1483 and RFC 2225), or there's no header at all,
and just an IP packet.

As such, no link-layer header should be printed.

In addition, for packets with an LLC header, we should call the LLC
printer, rather than assuming that it's SNAP-encapsulated (RFC 1483
says they're not always SNAP-encapsulated) and printing the header
ourselves.  For packets without an LLC header, we should just call the
IP print routine.

This means that the LLC print routine may be called with null source and
destination MAC addresses; make it handle them.
2001-09-23 21:52:38 +00:00
guy
73dc4193e4 Note that Ethernet_802.3 IPX frames can appear on network other than
Ethernet/802.3 networks, due to, e.g., bridging of broadcast frames.
2001-07-21 23:14:23 +00:00
itojun
17e614c50d style 2001-06-15 07:59:14 +00:00
guy
8161113aa2 Add a #define for the OUI for LLC+SNAP-encapsulated Ethernet.
Treat LLC+SNAP packets with an OUI of 0x0000f8 the same way we treat
encapsulated Ethernet packets - that OUI is used by Cisco for some forms
of bridging.
2001-06-04 05:47:13 +00:00
fenner
a624498029 Demux SNAP packets all in one place, unifying CDP, SNAP-encapsulated
ethernet, and Appletalk dispatching.
2001-05-10 02:57:57 +00:00
guy
8cba55d692 Document the "netbeui" filter expression keyword.
Add a #define LLCSAP_NETBEUI for the NetBEUI LLC SAP, and use that
rather than "0xf0" in the LLC dissector.
2001-01-28 09:46:42 +00:00
guy
0056894f4e Do some additional bounds checking when dissecting SMB packets. 2001-01-15 03:59:13 +00:00
guy
64e81f2917 Handle IPX socket 0x553, which is some kind of NetBIOS-over-IPX socket.
(We call it "nwlink-dgm" for now; Ethereal calls it a NWLink SMB
datagram.)

Don't throw every LLC frame with unknown SAPs at the NetBIOS-over-IPX
dissector; just throw the frames for IPX sockets 0x455 and 0x553 at it,
as those appear to be the sockets used (if there are any others, please
add them to the IPX dissector - putting it back in the LLC dissector
won't help, as all IPX frames, including LLC frames, should now be
handed to the IPX dissector).

Do better bounds checking in "ipx_netbios_print()" and
"netbeui_print()", i.e. don't go past the end of the captured data in
the packet when looking for the 0xFF S M B signature.
2001-01-15 03:23:58 +00:00
guy
e8b1f5e760 LLC frames with a DSAP and LSAP of 0xe0 are IPX frames, and so are Linux
cooked frames with a type value of LINUX_SLL_P_802_3; dissect them as
such.
2001-01-15 00:33:59 +00:00
guy
d7254f081d Pass only I frames and UI frames to the NetBEUI printer; thanks and a
tip of the Hatlo hat to Pascal Hennequin <pascal.hennequin@int-evry.fr>
for catching this one.

Also, the control field in an S or I frame is little-endian; treat it as
such, fixing various #defines in "llc.h" to match.
2000-12-18 07:55:36 +00:00
guy
7c4458eb6a Making "extracted_ethertype" static to "print-ether.c" broke other
dissectors that expected calls to "llc_print()" to set it.  (Thanks and
a tip of the hat to Olaf Kirch <okir@caldera.de> for noticing this.)

Make "ether_encap_print()" and "llc_print()" take a pointer to an
extracted-Ethertype variable as an argument, have "llc_print()" pass it
to "ether_encap_print()", and have "ether_encap_print()" set what it
points to rather than setting a static "extracted_ethertype" variable.

Get rid of said static "extracted_ethertype" variable in favor of one
local to "ether_if_print()", just as other link-layer dissectors have
local "extracted_ethertype" variables.
2000-12-18 05:41:58 +00:00
guy
393ce0607f The control field of an LLC frame is 1 byte for a U frame and 2 bytes
for an S or I frame; have the LLC dissector pass the control field value
as an argument to the NetBEUI dissector, rather than having the NetBEUI
dissector extract the control field value itself, and have it pass a
pointer to the beginning of the LLC *payload* rather than to the control
field.

Keep the NetBEUI dissector from running past the end of the buffer.

Add support for the NetBEUI SESSION ALIVE frame.
2000-12-05 06:42:47 +00:00
assar
954bc7f13e add IEEE8021.d printer contributed by Lennert Buytenhek <buytenh@gnu.org> 2000-06-10 20:57:55 +00:00
assar
10eaf5f59d call cdp_print for CDP packets 2000-05-15 00:40:04 +00:00
itojun
c4521bbf47 * print-rt6.c: make IPv6 routing header printing work with new 2292bis
API.
* print-bgp.c: improve options printing.  ugly code exists for
  unaligned option parsing (need some fix).
* const poisoning in SMB decoder.
* make dump format back to original.  someone may want to add an
  option to do ascii printing, but keep the default behavior as is
  for scripts used in many places.
* -Wall -Werror clean checks.
1999-12-22 06:27:19 +00:00
assar
48345fa3a4 patches from Andrew Tridgell <tridge@linuxcare.com> to add decoding of SMB packets 1999-11-21 15:57:50 +00:00
fenner
b9ac23ce92 Switch to config.h instead of passing defines in DEFS. 1999-11-21 09:36:43 +00:00
mcr
f555c163f9 Initial revision 1999-10-07 23:47:09 +00:00