Commit Graph

55 Commits

Author SHA1 Message Date
Guy Harris
b2d1b8586b There's another Cisco-private encapsulation of BPDUs.
At least according to the Wireshark STP dissector, SNAP frames with the
Cisco OUI and a PID of 0x010c contain BPDUs, for "VLAN Bridge".
2013-04-14 18:20:26 -04:00
Michael Richardson
1cead823ec reworked print-ether to use netdissect 2010-10-07 14:40:50 -04:00
Guy Harris
ea5736c8c6 Process VLAN frames and Alteon jumbo frames in the Ethernet printer.
Instead of having the Ethernet-type handler process the VLAN and Alteon
jumbo frame Ethernet type values, process them in the Ethernet (and
Linux cooked-mode) dissectors.  This makes it easier for the right MAC
addresses to be printed for those packets.

As part of that, rename ether_encap_print() to ethertype_print() - it
doesn't print encapsulated Ethernet frames, it prints payloads whose
packet type is indicated by an Ethernet type field value - and remove
the no-longer-needed "extracted Ethernet type" argument.  That also lets
us eliminate it from the SNAP print routine.

Make ether_print() take a function, and an argument to pass to that
function, as parameters, so that, for example, the ATM LANE printer can
use it and put the LEC ID into the link-layer headeer printout.
2010-02-21 12:44:53 -08:00
hannes
74603d42c7 From From Carles Kishimoto <carles.kishimoto@gmail.com>:
add support for per-VLAN spanning tree and
                  per-VLAN rapid spanning tree
2007-04-13 09:43:11 +00:00
hannes
9f2e33e713 From From Carles Kishimoto <carles.kishimoto@gmail.com>:
add support for the cisco propriatry 'dynamic trunking protocol'
2007-03-23 08:12:00 +00:00
hannes
61fb61ab08 From Carles Kishimoto <carles.kishimoto@gmail.com>:
add support for the cisco proprietary VTP protocol
2007-03-21 07:35:00 +00:00
hannes
83dc1abf9c From Carles Kishimoto <carles.kishimoto@gmail.com>:
add support for unidirectional link detection as per
http://www.ietf.org/internet-drafts/draft-foschiano-udld-02.txt
2007-03-19 15:14:14 +00:00
guy
f677f39059 From Steinar Haug: print basic info about a few more Cisco LAN
protocols.
2007-02-08 07:06:54 +00:00
hannes
4ee5f75b6c bugfix: pre-init OUI tokentable to an empty tokentable to prevent a NULL ref and subsequent segfault 2006-01-17 17:43:55 +00:00
hannes
2ec03e26db display I/G bit 2005-12-01 18:05:12 +00:00
hannes
46b52e5133 bugfix: bogus SS codepoints, display ctrl field correct, added 'Poll' token for I/S frames 2005-12-01 17:45:45 +00:00
guy
dd928cfb35 Have print_llc() clear out the extracted_ethertype argument, rather than
having its callers do so - some of its callers *weren't* doing so,
leaving random junk in that argument in some cases.

When checking for "802.3-encapsulated" IPX, check the raw values of the
SSAP and DSAP for 0xFF, don't check them after the low-order bit has
been masked off.

The "flag" values in the LLC header aren't bits, they're combinations of
bits, including the combination "no bits"; don't use "bittok2str()" on
them.  Also, combine the proper bits, namely the C/R bit (which we
weren't combining) and the P/F bit (which we were).
2005-11-13 12:12:41 +00:00
hannes
f6e484ef40 rework the LLC printer:
-remove tok2str() and bittok2str() lookalikes
  -print length field
  -print more self-describing tokensstring
    e.g. "Receiver not ready" instead of "rnr"
  -add codepoint for SNA
2005-09-29 07:37:08 +00:00
guy
fead98c71d Make "snap_print()" handle fetching and printing the OUI.
Don't copy the LLC header to a "struct llc", just construct the
individual fields.

Fetch the control field early in the dissection process, and check to
make sure we have at least 4 bytes of LLC header if it's not a U frame.
Fetch both bytes of the control field for I and S frames, and display
all 4 hex digits of it.

Only dissect UI frames as BPDUs, and pass the BPDU dissector a pointer
to the beginning of the BPDU, not the beginning of the LLC header - not
all BPDUs are encapsulated in LLC headers.

Only dissect UI frames as IP packets.

Do bounds checking in "snap_print()".
2005-04-26 07:26:33 +00:00
guy
259983f43d Don't print the LLC header stuff if it's an 802.3 IPX frame - there
isn't an LLC header on those frames.
2005-04-26 03:51:38 +00:00
guy
76919d52d0 Properly terminate a "struct tok" list.
Add more "struct tok" tables for SNAP PIDs.

Don't print the source and/or destination addresses and SAPs for
undecoded packets if we printed them already with the "-e" flag.
2005-04-26 03:38:09 +00:00
guy
a43b7b109e Have separate "struct tok" PID-to-name tables for different OUIs; don't 2005-04-25 17:56:43 +00:00
mcr
4189fb7df6 refactored ip_print() so that chained header parser (ESP/AH) can
more easily call the inner parts.
2005-04-06 21:32:38 +00:00
hannes
9c2d2a42b5 move the SNAP OUI values out of the llc printer into
the global oui.c file and make all SNAP printers use it

make the display output of the frame-relay SNAP printer consistent
  to the LLC SNAP printer (= print oui{id,name}, proto-id)
2005-04-06 20:09:07 +00:00
hannes
36ff8749d3 -resolve (print the name) the OUI field in the SNAP printer
-add the rfc 2684 PIDs as pseudo ethertypes
-display cosmetics:
 place a ":" after the LLC printer to indicate that
 a new proto layer starts
2005-01-25 16:22:56 +00:00
hannes
99211ae473 hide the IPX 802.3 indication under the eflag 2004-05-01 10:06:00 +00:00
hannes
a43d36c6f2 tell the oid and ethertype during SNAP header processing 2004-05-01 09:38:24 +00:00
hannes
c797cde056 add tokentable llc_values[], remove SNAP printing beyond vflag 2003-12-29 19:57:30 +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
2f4839a682 print LLC header [dsap,ssap, and cmd] if eflag is set 2003-05-28 12:53:00 +00:00
hannes
8f94d68a09 don't pass on src & dst MAC adresses to the isoclns decoder as MAC adresses
should be really printed in ether_print() using the eflag
2003-05-22 16:52:36 +00:00
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