2005-02-15 21:01:51 +00:00
|
|
|
/* packet-retix-bpdu.c
|
|
|
|
* Routines for BPDU (Retix Spanning Tree Protocol) disassembly
|
|
|
|
*
|
2005-03-01 21:47:54 +00:00
|
|
|
* $Id$
|
2005-02-15 21:01:51 +00:00
|
|
|
*
|
2011-05-20 03:12:56 +00:00
|
|
|
* Copyright 2005 Giles Scott (gscott <AT> arubanetworks dot com>
|
2005-02-15 21:01:51 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-02-15 21:01:51 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2005-02-15 21:01:51 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2005-02-15 21:01:51 +00:00
|
|
|
|
2005-03-03 08:34:48 +00:00
|
|
|
#if 0
|
|
|
|
#endif
|
2005-02-15 21:01:51 +00:00
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
2005-03-03 08:34:48 +00:00
|
|
|
#if 0
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/llcsaps.h>
|
|
|
|
#include <epan/ppptypes.h>
|
|
|
|
#include <epan/chdlctypes.h>
|
2005-03-03 08:34:48 +00:00
|
|
|
#endif
|
2005-02-15 21:01:51 +00:00
|
|
|
#include <epan/addr_resolv.h>
|
|
|
|
|
2013-12-12 17:45:22 +00:00
|
|
|
void proto_register_retix_bpdu(void);
|
|
|
|
void proto_reg_handoff_retix_bpdu(void);
|
|
|
|
|
2005-02-15 21:01:51 +00:00
|
|
|
static gint ett_retix_bpdu = -1;
|
|
|
|
static int proto_retix_bpdu = -1;
|
|
|
|
|
|
|
|
static int hf_retix_bpdu_root_mac = -1;
|
|
|
|
static int hf_retix_bpdu_bridge_mac = -1;
|
|
|
|
static int hf_retix_bpdu_max_age = -1;
|
|
|
|
static int hf_retix_bpdu_hello_time = -1;
|
|
|
|
static int hf_retix_bpdu_forward_delay = -1;
|
|
|
|
|
2013-02-26 01:06:19 +00:00
|
|
|
/* I don't have the spec's for this protcol so it's been reverse engineered
|
2005-05-05 17:07:58 +00:00
|
|
|
* It seems quite like 802.1D
|
2005-02-15 21:01:51 +00:00
|
|
|
* It looks like the protocol version is specified in the ethernet trailer
|
|
|
|
* In the single packet I have the trailer is
|
|
|
|
* "RevC CBPDU"
|
|
|
|
* There are several fields I've not dissected as I'm not exactly sure what they are
|
|
|
|
* What ever happened to Retix anyway?
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_retix_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_tree *retix_bpdu_tree;
|
|
|
|
proto_tree *ti;
|
|
|
|
|
2009-08-09 07:59:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "R-STP");
|
2013-06-14 01:56:28 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Bridge MAC %s", tvb_ether_to_str(tvb, 10));
|
2011-05-20 03:12:56 +00:00
|
|
|
|
2005-02-15 21:01:51 +00:00
|
|
|
retix_bpdu_tree = NULL;
|
|
|
|
|
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_retix_bpdu, tvb, 0, -1, ENC_NA);
|
2005-02-15 21:01:51 +00:00
|
|
|
retix_bpdu_tree = proto_item_add_subtree(ti, ett_retix_bpdu);
|
|
|
|
}
|
|
|
|
|
2011-10-20 14:07:54 +00:00
|
|
|
proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_root_mac, tvb, 0, 6, ENC_NA);
|
2005-02-15 21:01:51 +00:00
|
|
|
|
2011-10-20 14:07:54 +00:00
|
|
|
proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_bridge_mac, tvb, 10, 6, ENC_NA);
|
2005-02-15 21:01:51 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_max_age, tvb, 20, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_hello_time, tvb, 22, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_forward_delay, tvb, 24, 2, ENC_BIG_ENDIAN);
|
2005-02-15 21:01:51 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_retix_bpdu(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_retix_bpdu_root_mac,
|
2012-08-01 01:57:18 +00:00
|
|
|
{ "Root MAC", "r-stp.root.hw", FT_ETHER, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL}},
|
2005-02-15 21:01:51 +00:00
|
|
|
|
|
|
|
{ &hf_retix_bpdu_bridge_mac,
|
2012-08-01 01:57:18 +00:00
|
|
|
{ "Bridge MAC", "r-stp.bridge.hw", FT_ETHER, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL}},
|
2005-02-15 21:01:51 +00:00
|
|
|
|
|
|
|
{ &hf_retix_bpdu_max_age,
|
2012-08-01 01:57:18 +00:00
|
|
|
{ "Max Age", "r-stp.maxage", FT_UINT16, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL}},
|
2005-02-15 21:01:51 +00:00
|
|
|
|
|
|
|
{ &hf_retix_bpdu_hello_time,
|
2012-08-01 01:57:18 +00:00
|
|
|
{ "Hello Time", "r-stp.hello", FT_UINT16, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL}},
|
2005-02-15 21:01:51 +00:00
|
|
|
|
|
|
|
{ &hf_retix_bpdu_forward_delay,
|
2012-08-01 01:57:18 +00:00
|
|
|
{ "Forward Delay", "r-stp.forward", FT_UINT16, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL}},
|
2005-02-15 21:01:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] ={
|
|
|
|
&ett_retix_bpdu,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_retix_bpdu = proto_register_protocol("Retix Spanning Tree Protocol", "R-STP", "r-stp");
|
2011-05-20 03:12:56 +00:00
|
|
|
proto_register_field_array(proto_retix_bpdu, hf, array_length(hf));
|
2005-02-15 21:01:51 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
register_dissector("rbpdu", dissect_retix_bpdu, proto_retix_bpdu);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_retix_bpdu(void)
|
|
|
|
{
|
|
|
|
}
|