2 * Routines for BPDU (Retix Spanning Tree Protocol) disassembly
6 * Copyright 2005 Giles Scott (gscott <AT> arubanetworks dot com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
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.
34 #include <epan/packet.h>
36 #include <epan/llcsaps.h>
37 #include <epan/ppptypes.h>
38 #include <epan/chdlctypes.h>
40 #include <epan/addr_resolv.h>
42 static gint ett_retix_bpdu = -1;
43 static int proto_retix_bpdu = -1;
45 static int hf_retix_bpdu_root_mac = -1;
46 static int hf_retix_bpdu_bridge_mac = -1;
47 static int hf_retix_bpdu_max_age = -1;
48 static int hf_retix_bpdu_hello_time = -1;
49 static int hf_retix_bpdu_forward_delay = -1;
51 /* I don't have the spec's for this protcol so its been reverse engineered
52 * It seems quite like 802.1D
53 * It looks like the protocol version is specified in the ethernet trailer
54 * In the single packet I have the trailer is
56 * There are several fields I've not dissected as I'm not exactly sure what they are
57 * What ever happened to Retix anyway?
60 dissect_retix_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
62 proto_tree *retix_bpdu_tree;
65 col_set_str(pinfo->cinfo, COL_PROTOCOL, "R-STP");
66 col_clear(pinfo->cinfo, COL_INFO);
67 if (check_col(pinfo->cinfo, COL_INFO)){
68 col_add_fstr(pinfo->cinfo, COL_INFO, "Bridge MAC %s", tvb_ether_to_str(tvb, 10));
72 retix_bpdu_tree = NULL;
75 ti = proto_tree_add_item(tree, proto_retix_bpdu, tvb, 0, -1, FALSE);
76 retix_bpdu_tree = proto_item_add_subtree(ti, ett_retix_bpdu);
79 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_root_mac, tvb, 0, 6, ENC_NA);
81 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_bridge_mac, tvb, 10, 6, ENC_NA);
83 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_max_age, tvb, 20, 2, ENC_BIG_ENDIAN);
84 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_hello_time, tvb, 22, 2, ENC_BIG_ENDIAN);
85 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_forward_delay, tvb, 24, 2, ENC_BIG_ENDIAN);
91 proto_register_retix_bpdu(void)
93 static hf_register_info hf[] = {
94 { &hf_retix_bpdu_root_mac,
95 { "Root MAC", "rstp.root.hw", FT_ETHER, BASE_NONE, NULL, 0x0,
98 { &hf_retix_bpdu_bridge_mac,
99 { "Bridge MAC", "rstp.bridge.hw", FT_ETHER, BASE_NONE, NULL, 0x0,
102 { &hf_retix_bpdu_max_age,
103 { "Max Age", "rstp.maxage", FT_UINT16, BASE_DEC, NULL, 0x0,
106 { &hf_retix_bpdu_hello_time,
107 { "Hello Time", "rstp.hello", FT_UINT16, BASE_DEC, NULL, 0x0,
110 { &hf_retix_bpdu_forward_delay,
111 { "Forward Delay", "rstp.forward", FT_UINT16, BASE_DEC, NULL, 0x0,
115 static gint *ett[] ={
119 proto_retix_bpdu = proto_register_protocol("Retix Spanning Tree Protocol", "R-STP", "r-stp");
120 proto_register_field_array(proto_retix_bpdu, hf, array_length(hf));
121 proto_register_subtree_array(ett, array_length(ett));
122 register_dissector("rbpdu", dissect_retix_bpdu, proto_retix_bpdu);
126 proto_reg_handoff_retix_bpdu(void)