HACK: 2nd try to match RowsetProperties
[wireshark-wip.git] / epan / dissectors / packet-retix-bpdu.c
blobad6e44a0c7073fcfad9301dda34ca66dc93fa3eb
1 /* packet-retix-bpdu.c
2 * Routines for BPDU (Retix Spanning Tree Protocol) disassembly
4 * $Id$
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include "config.h"
29 #if 0
30 #endif
31 #include <glib.h>
32 #include <epan/packet.h>
33 #if 0
34 #include <epan/llcsaps.h>
35 #include <epan/ppptypes.h>
36 #include <epan/chdlctypes.h>
37 #endif
38 #include <epan/addr_resolv.h>
40 static gint ett_retix_bpdu = -1;
41 static int proto_retix_bpdu = -1;
43 static int hf_retix_bpdu_root_mac = -1;
44 static int hf_retix_bpdu_bridge_mac = -1;
45 static int hf_retix_bpdu_max_age = -1;
46 static int hf_retix_bpdu_hello_time = -1;
47 static int hf_retix_bpdu_forward_delay = -1;
49 /* I don't have the spec's for this protcol so it's been reverse engineered
50 * It seems quite like 802.1D
51 * It looks like the protocol version is specified in the ethernet trailer
52 * In the single packet I have the trailer is
53 * "RevC CBPDU"
54 * There are several fields I've not dissected as I'm not exactly sure what they are
55 * What ever happened to Retix anyway?
57 static void
58 dissect_retix_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
60 proto_tree *retix_bpdu_tree;
61 proto_tree *ti;
63 col_set_str(pinfo->cinfo, COL_PROTOCOL, "R-STP");
64 col_add_fstr(pinfo->cinfo, COL_INFO, "Bridge MAC %s", tvb_ether_to_str(tvb, 10));
66 retix_bpdu_tree = NULL;
68 if (tree) {
69 ti = proto_tree_add_item(tree, proto_retix_bpdu, tvb, 0, -1, ENC_NA);
70 retix_bpdu_tree = proto_item_add_subtree(ti, ett_retix_bpdu);
73 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_root_mac, tvb, 0, 6, ENC_NA);
75 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_bridge_mac, tvb, 10, 6, ENC_NA);
77 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_max_age, tvb, 20, 2, ENC_BIG_ENDIAN);
78 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_hello_time, tvb, 22, 2, ENC_BIG_ENDIAN);
79 proto_tree_add_item(retix_bpdu_tree, hf_retix_bpdu_forward_delay, tvb, 24, 2, ENC_BIG_ENDIAN);
84 void
85 proto_register_retix_bpdu(void)
87 static hf_register_info hf[] = {
88 { &hf_retix_bpdu_root_mac,
89 { "Root MAC", "r-stp.root.hw", FT_ETHER, BASE_NONE, NULL, 0x0,
90 NULL, HFILL}},
92 { &hf_retix_bpdu_bridge_mac,
93 { "Bridge MAC", "r-stp.bridge.hw", FT_ETHER, BASE_NONE, NULL, 0x0,
94 NULL, HFILL}},
96 { &hf_retix_bpdu_max_age,
97 { "Max Age", "r-stp.maxage", FT_UINT16, BASE_DEC, NULL, 0x0,
98 NULL, HFILL}},
100 { &hf_retix_bpdu_hello_time,
101 { "Hello Time", "r-stp.hello", FT_UINT16, BASE_DEC, NULL, 0x0,
102 NULL, HFILL}},
104 { &hf_retix_bpdu_forward_delay,
105 { "Forward Delay", "r-stp.forward", FT_UINT16, BASE_DEC, NULL, 0x0,
106 NULL, HFILL}},
109 static gint *ett[] ={
110 &ett_retix_bpdu,
113 proto_retix_bpdu = proto_register_protocol("Retix Spanning Tree Protocol", "R-STP", "r-stp");
114 proto_register_field_array(proto_retix_bpdu, hf, array_length(hf));
115 proto_register_subtree_array(ett, array_length(ett));
116 register_dissector("rbpdu", dissect_retix_bpdu, proto_retix_bpdu);
119 void
120 proto_reg_handoff_retix_bpdu(void)