diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-11-30 09:31:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-11-30 09:31:52 +0000 |
commit | 60b1bed605cb830e55ff23ed9bbc902ffc6991f6 (patch) | |
tree | 66c953f1944df3f06a23f7f50b973c807799b9e3 /packet-bpdu.c | |
parent | 8af1fc65502c65f5c060b2234b2d1efd16492b05 (diff) | |
download | wireshark-60b1bed605cb830e55ff23ed9bbc902ffc6991f6.tar.gz wireshark-60b1bed605cb830e55ff23ed9bbc902ffc6991f6.tar.bz2 wireshark-60b1bed605cb830e55ff23ed9bbc902ffc6991f6.zip |
GVRP dissector, from Kevin Shi.
svn path=/trunk/; revision=2721
Diffstat (limited to 'packet-bpdu.c')
-rw-r--r-- | packet-bpdu.c | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/packet-bpdu.c b/packet-bpdu.c index 730b658f85..cc05498365 100644 --- a/packet-bpdu.c +++ b/packet-bpdu.c @@ -1,7 +1,7 @@ /* packet-bpdu.c * Routines for BPDU (Spanning Tree Protocol) disassembly * - * $Id: packet-bpdu.c,v 1.15 2000/11/19 08:53:55 guy Exp $ + * $Id: packet-bpdu.c,v 1.16 2000/11/30 09:31:50 guy Exp $ * * Copyright 1999 Christophe Tronche <ch.tronche@computer.org> * @@ -44,6 +44,9 @@ #include "llcsaps.h" #include "resolv.h" +/* Include this for GVRP dissector */ +#include "packet-gvrp.h" + /* Offsets of fields within a BPDU */ #define BPDU_IDENTIFIER 0 @@ -99,6 +102,46 @@ dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { CHECK_DISPLAY_AS_DATA(proto_bpdu, tvb, pinfo, tree); + /* GARP application frames require special interpretation of the + destination address field; otherwise, they will be mistaken as + BPDU frames. + Fortunately, they can be recognized by checking the first 6 octets + of the destination address, which are in the range from + 01-80-C2-00-00-20 to 01-80-C2-00-00-2F. */ + if (pinfo->dl_dst.data[0] == 0x01 && pinfo->dl_dst.data[1] == 0x80 && + pinfo->dl_dst.data[2] == 0xC2 && pinfo->dl_dst.data[3] == 0x00 && + pinfo->dl_dst.data[4] == 0x00 && ((pinfo->dl_dst.data[5] & 0x20) == 0x20)) { + + protocol_identifier = tvb_get_ntohs(tvb, BPDU_IDENTIFIER); + + switch (pinfo->dl_dst.data[5]) { + + case 0x20: + /* Future expansion for GMRP */ + break; + + case 0x21: + /* for GVRP */ + dissect_gvrp(tvb, pinfo, tree); + return; + } + + pinfo->current_proto = "GARP"; + + if (check_col(pinfo->fd, COL_PROTOCOL)) { + col_set_str(pinfo->fd, COL_PROTOCOL, "GARP"); + /* Generic Attribute Registration Protocol */ + } + + if (check_col(pinfo->fd, COL_INFO)) { + col_add_fstr(pinfo->fd, COL_INFO, + "Unknown GARP application (0x%02X)", + pinfo->dl_dst.data[5]); + } + + return; + } + pinfo->current_proto = "STP"; bpdu_type = tvb_get_guint8(tvb, BPDU_TYPE); @@ -142,7 +185,8 @@ dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { BPDU_VERSION_IDENTIFIER, 1, protocol_version_identifier); if (protocol_version_identifier != 0) - proto_tree_add_text(bpdu_tree, tvb, BPDU_VERSION_IDENTIFIER, 1, " (Warning: this version of packet-bpdu only knows about version = 0)"); + proto_tree_add_text(bpdu_tree, tvb, BPDU_VERSION_IDENTIFIER, 1, + " (Warning: this version of Ethereal only knows about version = 0)"); proto_tree_add_uint_format(bpdu_tree, hf_bpdu_type, tvb, BPDU_TYPE, 1, bpdu_type, |