1999-10-08 20:50:39 +00:00
|
|
|
/* packet-bpdu.c
|
|
|
|
* Routines for BPDU (Spanning Tree Protocol) disassembly
|
|
|
|
*
|
2001-07-23 18:21:32 +00:00
|
|
|
* $Id: packet-bpdu.c,v 1.27 2001/07/23 18:21:30 guy Exp $
|
1999-10-08 20:50:39 +00:00
|
|
|
*
|
|
|
|
* Copyright 1999 Christophe Tronche <ch.tronche@computer.org>
|
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-05-27 07:07:34 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
1999-10-08 20:50:39 +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
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
# include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
|
|
|
# include <netinet/in.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <glib.h>
|
|
|
|
#include "packet.h"
|
2000-04-17 00:32:43 +00:00
|
|
|
#include "llcsaps.h"
|
2001-01-14 08:25:14 +00:00
|
|
|
#include "ppptypes.h"
|
1999-10-08 20:50:39 +00:00
|
|
|
#include "resolv.h"
|
|
|
|
|
|
|
|
/* Offsets of fields within a BPDU */
|
|
|
|
|
|
|
|
#define BPDU_IDENTIFIER 0
|
|
|
|
#define BPDU_VERSION_IDENTIFIER 2
|
|
|
|
#define BPDU_TYPE 3
|
|
|
|
#define BPDU_FLAGS 4
|
|
|
|
#define BPDU_ROOT_IDENTIFIER 5
|
|
|
|
#define BPDU_ROOT_PATH_COST 13
|
|
|
|
#define BPDU_BRIDGE_IDENTIFIER 17
|
|
|
|
#define BPDU_PORT_IDENTIFIER 25
|
|
|
|
#define BPDU_MESSAGE_AGE 27
|
|
|
|
#define BPDU_MAX_AGE 29
|
|
|
|
#define BPDU_HELLO_TIME 31
|
|
|
|
#define BPDU_FORWARD_DELAY 33
|
|
|
|
|
|
|
|
static int proto_bpdu = -1;
|
1999-10-09 13:05:55 +00:00
|
|
|
static int hf_bpdu_proto_id = -1;
|
|
|
|
static int hf_bpdu_version_id = -1;
|
|
|
|
static int hf_bpdu_type = -1;
|
|
|
|
static int hf_bpdu_flags = -1;
|
|
|
|
static int hf_bpdu_root_mac = -1;
|
|
|
|
static int hf_bpdu_root_cost = -1;
|
|
|
|
static int hf_bpdu_bridge_mac = -1;
|
|
|
|
static int hf_bpdu_port_id = -1;
|
|
|
|
static int hf_bpdu_msg_age = -1;
|
|
|
|
static int hf_bpdu_max_age = -1;
|
|
|
|
static int hf_bpdu_hello_time = -1;
|
|
|
|
static int hf_bpdu_forward_delay = -1;
|
1999-10-08 20:50:39 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_bpdu = -1;
|
|
|
|
|
2001-05-27 07:07:34 +00:00
|
|
|
static dissector_handle_t gvrp_handle;
|
2001-07-23 18:21:32 +00:00
|
|
|
static dissector_handle_t gmrp_handle;
|
2001-05-27 07:07:34 +00:00
|
|
|
|
2000-11-16 07:35:43 +00:00
|
|
|
static void
|
|
|
|
dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
1999-10-08 20:50:39 +00:00
|
|
|
guint16 protocol_identifier;
|
|
|
|
guint8 protocol_version_identifier;
|
|
|
|
guint8 bpdu_type;
|
|
|
|
guint8 flags;
|
|
|
|
guint16 root_identifier_bridge_priority;
|
2001-03-13 21:34:28 +00:00
|
|
|
const guint8 *root_identifier_mac;
|
2000-11-16 07:35:43 +00:00
|
|
|
gchar *root_identifier_mac_str;
|
1999-10-08 20:50:39 +00:00
|
|
|
guint32 root_path_cost;
|
|
|
|
guint16 bridge_identifier_bridge_priority;
|
2001-03-13 21:34:28 +00:00
|
|
|
const guint8 *bridge_identifier_mac;
|
2000-11-16 07:35:43 +00:00
|
|
|
gchar *bridge_identifier_mac_str;
|
1999-10-08 20:50:39 +00:00
|
|
|
guint16 port_identifier;
|
|
|
|
double message_age;
|
|
|
|
double max_age;
|
|
|
|
double hello_time;
|
|
|
|
double forward_delay;
|
|
|
|
|
|
|
|
proto_tree *bpdu_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
|
2000-11-30 09:31:52 +00:00
|
|
|
/* 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
|
2000-12-23 08:06:16 +00:00
|
|
|
01-80-C2-00-00-20 to 01-80-C2-00-00-2F.
|
|
|
|
|
|
|
|
Yes - we *do* need to check the destination address type;
|
|
|
|
on Linux cooked captures, there *is* no destination address,
|
|
|
|
so it's AT_NONE. */
|
|
|
|
if (pinfo->dl_dst.type == AT_ETHER &&
|
|
|
|
pinfo->dl_dst.data[0] == 0x01 && pinfo->dl_dst.data[1] == 0x80 &&
|
2000-11-30 09:31:52 +00:00
|
|
|
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:
|
2001-07-23 18:21:32 +00:00
|
|
|
/* for GMRP */
|
|
|
|
call_dissector(gmrp_handle, tvb, pinfo, tree);
|
|
|
|
return;
|
2000-11-30 09:31:52 +00:00
|
|
|
|
|
|
|
case 0x21:
|
|
|
|
/* for GVRP */
|
2001-05-27 07:07:34 +00:00
|
|
|
call_dissector(gvrp_handle, tvb, pinfo, tree);
|
2000-11-30 09:31:52 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2001-02-08 03:59:12 +00:00
|
|
|
if (check_col(pinfo->fd, COL_PROTOCOL)) {
|
|
|
|
col_set_str(pinfo->fd, COL_PROTOCOL, "STP"); /* Spanning Tree Protocol */
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->fd, COL_INFO)) {
|
|
|
|
col_clear(pinfo->fd, COL_INFO);
|
|
|
|
}
|
|
|
|
|
2000-11-16 07:35:43 +00:00
|
|
|
bpdu_type = tvb_get_guint8(tvb, BPDU_TYPE);
|
2001-02-08 07:32:11 +00:00
|
|
|
if (bpdu_type == 0) {
|
|
|
|
flags = tvb_get_guint8(tvb, BPDU_FLAGS);
|
|
|
|
root_identifier_bridge_priority = tvb_get_ntohs(tvb,
|
|
|
|
BPDU_ROOT_IDENTIFIER);
|
|
|
|
root_identifier_mac = tvb_get_ptr(tvb, BPDU_ROOT_IDENTIFIER + 2, 6);
|
|
|
|
root_identifier_mac_str = ether_to_str(root_identifier_mac);
|
|
|
|
root_path_cost = tvb_get_ntohl(tvb, BPDU_ROOT_PATH_COST);
|
|
|
|
port_identifier = tvb_get_ntohs(tvb, BPDU_PORT_IDENTIFIER);
|
|
|
|
} else {
|
|
|
|
/* Squelch GCC complaints. */
|
|
|
|
flags = 0;
|
|
|
|
root_identifier_bridge_priority = 0;
|
|
|
|
root_identifier_mac = NULL;
|
|
|
|
root_identifier_mac_str = NULL;
|
|
|
|
root_path_cost = 0;
|
|
|
|
port_identifier = 0;
|
|
|
|
}
|
2000-11-16 07:35:43 +00:00
|
|
|
|
|
|
|
if (check_col(pinfo->fd, COL_INFO)) {
|
1999-10-08 20:50:39 +00:00
|
|
|
if (bpdu_type == 0)
|
2000-11-16 07:35:43 +00:00
|
|
|
col_add_fstr(pinfo->fd, COL_INFO, "Conf. %sRoot = %d/%s Cost = %d Port = 0x%04x",
|
1999-10-08 20:50:39 +00:00
|
|
|
flags & 0x1 ? "TC + " : "",
|
2000-11-16 07:35:43 +00:00
|
|
|
root_identifier_bridge_priority, root_identifier_mac_str, root_path_cost,
|
1999-10-08 20:50:39 +00:00
|
|
|
port_identifier);
|
|
|
|
else if (bpdu_type == 0x80)
|
2000-11-16 07:35:43 +00:00
|
|
|
col_add_fstr(pinfo->fd, COL_INFO, "Topology Change Notification");
|
1999-10-08 20:50:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
2000-11-16 07:35:43 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_bpdu, tvb, 0, 35,
|
2000-03-12 04:48:32 +00:00
|
|
|
"Spanning Tree Protocol");
|
1999-11-16 11:44:20 +00:00
|
|
|
bpdu_tree = proto_item_add_subtree(ti, ett_bpdu);
|
2001-02-08 03:59:12 +00:00
|
|
|
|
|
|
|
protocol_identifier = tvb_get_ntohs(tvb, BPDU_IDENTIFIER);
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_uint_format(bpdu_tree, hf_bpdu_proto_id, tvb,
|
|
|
|
BPDU_IDENTIFIER, 2,
|
1999-10-09 13:05:55 +00:00
|
|
|
protocol_identifier,
|
|
|
|
"Protocol Identifier: 0x%04x (%s)",
|
|
|
|
protocol_identifier,
|
|
|
|
protocol_identifier == 0 ?
|
|
|
|
"Spanning Tree" : "Unknown Protocol");
|
|
|
|
|
2001-02-08 03:59:12 +00:00
|
|
|
protocol_version_identifier = tvb_get_guint8(tvb, BPDU_VERSION_IDENTIFIER);
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_uint(bpdu_tree, hf_bpdu_version_id, tvb,
|
|
|
|
BPDU_VERSION_IDENTIFIER, 1,
|
1999-10-09 13:05:55 +00:00
|
|
|
protocol_version_identifier);
|
1999-10-08 20:50:39 +00:00
|
|
|
if (protocol_version_identifier != 0)
|
2000-11-30 09:31:52 +00:00
|
|
|
proto_tree_add_text(bpdu_tree, tvb, BPDU_VERSION_IDENTIFIER, 1,
|
|
|
|
" (Warning: this version of Ethereal only knows about version = 0)");
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_uint_format(bpdu_tree, hf_bpdu_type, tvb,
|
|
|
|
BPDU_TYPE, 1,
|
1999-10-09 13:05:55 +00:00
|
|
|
bpdu_type,
|
|
|
|
"BPDU Type: 0x%02x (%s)",
|
|
|
|
bpdu_type,
|
|
|
|
bpdu_type == 0 ? "Configuration" :
|
|
|
|
bpdu_type == 0x80 ? "Topology Change Notification" : "Unknown");
|
|
|
|
|
|
|
|
if (bpdu_type != 0) {
|
2000-11-16 07:35:43 +00:00
|
|
|
dissect_data(tvb, BPDU_TYPE + 1, pinfo, tree);
|
1999-10-09 13:05:55 +00:00
|
|
|
return;
|
|
|
|
}
|
1999-10-08 20:50:39 +00:00
|
|
|
|
2000-11-16 07:35:43 +00:00
|
|
|
bridge_identifier_bridge_priority = tvb_get_ntohs(tvb, BPDU_BRIDGE_IDENTIFIER);
|
|
|
|
bridge_identifier_mac = tvb_get_ptr(tvb, BPDU_BRIDGE_IDENTIFIER + 2, 6);
|
|
|
|
bridge_identifier_mac_str = ether_to_str(bridge_identifier_mac);
|
|
|
|
message_age = tvb_get_ntohs(tvb, BPDU_MESSAGE_AGE) / 256.0;
|
|
|
|
max_age = tvb_get_ntohs(tvb, BPDU_MAX_AGE) / 256.0;
|
|
|
|
hello_time = tvb_get_ntohs(tvb, BPDU_HELLO_TIME) / 256.0;
|
|
|
|
forward_delay = tvb_get_ntohs(tvb, BPDU_FORWARD_DELAY) / 256.0;
|
1999-10-08 20:50:39 +00:00
|
|
|
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_uint(bpdu_tree, hf_bpdu_flags, tvb,
|
|
|
|
BPDU_FLAGS, 1, flags);
|
1999-10-08 20:50:39 +00:00
|
|
|
if (flags & 0x80)
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_text(bpdu_tree, tvb, BPDU_FLAGS, 1, " 1... .... Topology Change Acknowledgment");
|
1999-10-08 20:50:39 +00:00
|
|
|
if (flags & 0x01)
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_text(bpdu_tree, tvb, BPDU_FLAGS, 1, " .... ...1 Topology Change");
|
1999-10-08 20:50:39 +00:00
|
|
|
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_root_mac, tvb,
|
|
|
|
BPDU_ROOT_IDENTIFIER + 2, 6,
|
|
|
|
root_identifier_mac);
|
|
|
|
proto_tree_add_text(bpdu_tree, tvb,
|
|
|
|
BPDU_ROOT_IDENTIFIER, 8,
|
1999-10-09 13:05:55 +00:00
|
|
|
"Root Identifier: %d / %s",
|
|
|
|
root_identifier_bridge_priority,
|
2000-11-16 07:35:43 +00:00
|
|
|
root_identifier_mac_str);
|
|
|
|
proto_tree_add_uint(bpdu_tree, hf_bpdu_root_cost, tvb,
|
|
|
|
BPDU_ROOT_PATH_COST, 4,
|
1999-10-09 13:05:55 +00:00
|
|
|
root_path_cost);
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_text(bpdu_tree, tvb,
|
|
|
|
BPDU_BRIDGE_IDENTIFIER, 8,
|
1999-10-09 13:05:55 +00:00
|
|
|
"Bridge Identifier: %d / %s",
|
1999-10-08 20:50:39 +00:00
|
|
|
bridge_identifier_bridge_priority,
|
2000-11-16 07:35:43 +00:00
|
|
|
bridge_identifier_mac_str);
|
|
|
|
proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_bridge_mac, tvb,
|
|
|
|
BPDU_BRIDGE_IDENTIFIER + 2, 6,
|
|
|
|
bridge_identifier_mac);
|
|
|
|
proto_tree_add_uint(bpdu_tree, hf_bpdu_port_id, tvb,
|
|
|
|
BPDU_PORT_IDENTIFIER, 2,
|
1999-10-16 09:31:47 +00:00
|
|
|
port_identifier);
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_double(bpdu_tree, hf_bpdu_msg_age, tvb,
|
|
|
|
BPDU_MESSAGE_AGE, 2,
|
1999-10-09 13:05:55 +00:00
|
|
|
message_age);
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_double(bpdu_tree, hf_bpdu_max_age, tvb,
|
|
|
|
BPDU_MAX_AGE, 2,
|
1999-10-09 13:05:55 +00:00
|
|
|
max_age);
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_double(bpdu_tree, hf_bpdu_hello_time, tvb,
|
|
|
|
BPDU_HELLO_TIME, 2,
|
1999-10-09 13:05:55 +00:00
|
|
|
hello_time);
|
2000-11-16 07:35:43 +00:00
|
|
|
proto_tree_add_double(bpdu_tree, hf_bpdu_forward_delay, tvb,
|
|
|
|
BPDU_FORWARD_DELAY, 2,
|
1999-10-09 13:05:55 +00:00
|
|
|
forward_delay);
|
1999-10-08 20:50:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_bpdu(void)
|
|
|
|
{
|
1999-10-09 13:05:55 +00:00
|
|
|
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_bpdu_proto_id,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Protocol Identifier", "stp.protocol",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_version_id,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Protocol Version Identifier", "stp.version",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_type,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "BPDU type", "stp.type",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_flags,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "BPDU flags", "stp.flags",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_root_mac,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Root Identifier", "stp.root.hw",
|
|
|
|
FT_ETHER, BASE_NONE, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_root_cost,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Root Path Cost", "stp.root.cost",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_bridge_mac,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Bridge Identifier", "stp.bridge.hw",
|
|
|
|
FT_ETHER, BASE_NONE, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_port_id,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Port identifier", "stp.port",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_msg_age,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Message Age", "stp.msg_age",
|
|
|
|
FT_DOUBLE, BASE_NONE, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_max_age,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Max Age", "stp.max_age",
|
|
|
|
FT_DOUBLE, BASE_NONE, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_hello_time,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Hello Time", "stp.hello",
|
|
|
|
FT_DOUBLE, BASE_NONE, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
{ &hf_bpdu_forward_delay,
|
1999-10-16 09:31:47 +00:00
|
|
|
{ "Forward Delay", "stp.forward",
|
|
|
|
FT_DOUBLE, BASE_NONE, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-09 13:05:55 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_bpdu,
|
|
|
|
};
|
1999-10-09 13:05:55 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_bpdu = proto_register_protocol("Spanning Tree Protocol", "STP", "stp");
|
1999-10-09 13:05:55 +00:00
|
|
|
proto_register_field_array(proto_bpdu, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2000-11-16 07:35:43 +00:00
|
|
|
|
2001-01-09 06:32:10 +00:00
|
|
|
register_dissector("bpdu", dissect_bpdu, proto_bpdu);
|
1999-10-08 20:50:39 +00:00
|
|
|
}
|
2000-04-17 00:32:43 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_bpdu(void)
|
|
|
|
{
|
2001-05-27 07:07:34 +00:00
|
|
|
/*
|
|
|
|
* Get handle for the GVRP dissector.
|
|
|
|
*/
|
|
|
|
gvrp_handle = find_dissector("gvrp");
|
2001-07-23 18:21:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get handle for the GMRP dissector.
|
|
|
|
*/
|
|
|
|
gmrp_handle = find_dissector("gmrp");
|
2001-05-27 07:07:34 +00:00
|
|
|
|
2001-01-09 06:32:10 +00:00
|
|
|
dissector_add("llc.dsap", SAP_BPDU, dissect_bpdu, proto_bpdu);
|
2001-01-14 08:25:14 +00:00
|
|
|
dissector_add("ppp.protocol", PPP_BPDU, dissect_bpdu, proto_bpdu);
|
2000-04-17 00:32:43 +00:00
|
|
|
}
|