2 * Routines for BPDU (Retix Spanning Tree Protocol) disassembly
6 * Copyright 2005 Giles Scott (gscott <AT> arubanetworks dot com>
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@ethereal.com>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 #include <epan/packet.h>
40 #include "chdlctypes.h"
42 #include <epan/addr_resolv.h>
44 static gint ett_retix_bpdu = -1;
45 static int proto_retix_bpdu = -1;
47 static int hf_retix_bpdu_root_mac = -1;
48 static int hf_retix_bpdu_bridge_mac = -1;
49 static int hf_retix_bpdu_max_age = -1;
50 static int hf_retix_bpdu_hello_time = -1;
51 static int hf_retix_bpdu_forward_delay = -1;
53 /* I don't have the spec's for this protcol so its been reverse engineered
54 * It seems quite like 802.1D
55 * It looks like the protocol version is specified in the ethernet trailer
56 * In the single packet I have the trailer is
58 * There are several fields I've not dissected as I'm not exactly sure what they are
59 * What ever happened to Retix anyway?
62 dissect_retix_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
64 proto_tree *retix_bpdu_tree;
66 const guint8 *bridge_mac_str;
68 if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
69 col_set_str(pinfo->cinfo, COL_PROTOCOL, "R-STP");
71 if (check_col(pinfo->cinfo, COL_INFO)) {
72 col_clear(pinfo->cinfo, COL_INFO);
74 bridge_mac_str = tvb_get_ptr(tvb, 10, 6);
75 if (check_col(pinfo->cinfo, COL_INFO)){
76 col_add_fstr(pinfo->cinfo, COL_INFO, "Bridge MAC %s", ether_to_str(bridge_mac_str));
80 retix_bpdu_tree = NULL;
83 ti = proto_tree_add_item(tree, proto_retix_bpdu, tvb, 0, -1, FALSE);
84 retix_bpdu_tree = proto_item_add_subtree(ti, ett_retix_bpdu);
87 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_root_mac, tvb, 0, 6, FALSE);
89 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_bridge_mac, tvb, 10, 6, FALSE);
91 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_max_age, tvb, 20, 2, FALSE);
92 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_hello_time, tvb, 22, 2, FALSE);
93 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_forward_delay, tvb, 24, 2, FALSE);
99 proto_register_retix_bpdu(void)
101 static hf_register_info hf[] = {
102 { &hf_retix_bpdu_root_mac,
103 { "Root MAC", "rstp.root.hw", FT_ETHER, BASE_NONE, NULL, 0x0,
106 { &hf_retix_bpdu_bridge_mac,
107 { "Bridge MAC", "rstp.bridge.hw", FT_ETHER, BASE_NONE, NULL, 0x0,
110 { &hf_retix_bpdu_max_age,
111 { "Max Age", "rstp.maxage", FT_UINT16, BASE_DEC, NULL, 0x0,
114 { &hf_retix_bpdu_hello_time,
115 { "Hello Time", "rstp.hello", FT_UINT16, BASE_DEC, NULL, 0x0,
118 { &hf_retix_bpdu_forward_delay,
119 { "Forward Delay", "rstp.forward", FT_UINT16, BASE_DEC, NULL, 0x0,
123 static gint *ett[] ={
127 proto_retix_bpdu = proto_register_protocol("Retix Spanning Tree Protocol", "R-STP", "r-stp");
128 proto_register_field_array(proto_retix_bpdu, hf, array_length(hf));
129 proto_register_subtree_array(ett, array_length(ett));
130 register_dissector("rbpdu", dissect_retix_bpdu, proto_retix_bpdu);
134 proto_reg_handoff_retix_bpdu(void)