Set the length for topology change BPDUs to 4, and leave the length of
[obnox/wireshark/wip.git] / packet-bpdu.c
1 /* packet-bpdu.c
2  * Routines for BPDU (Spanning Tree Protocol) disassembly
3  *
4  * $Id: packet-bpdu.c,v 1.34 2002/03/19 09:17:54 guy Exp $
5  *
6  * Copyright 1999 Christophe Tronche <ch.tronche@computer.org>
7  * 
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@ethereal.com>
10  * Copyright 1998 Gerald Combs
11  * 
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.
16  * 
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.
21  * 
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.
25  */
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #ifdef HAVE_SYS_TYPES_H
32 # include <sys/types.h>
33 #endif
34
35 #ifdef HAVE_NETINET_IN_H
36 # include <netinet/in.h>
37 #endif
38
39 #include <stdio.h>
40 #include <string.h>
41 #include <glib.h>
42 #include <epan/packet.h>
43 #include "llcsaps.h"
44 #include "ppptypes.h"
45 #include <epan/resolv.h>
46
47 /* Offsets of fields within a BPDU */
48
49 #define BPDU_IDENTIFIER          0
50 #define BPDU_VERSION_IDENTIFIER  2
51 #define BPDU_TYPE                3
52 #define BPDU_FLAGS               4
53 #define BPDU_ROOT_IDENTIFIER     5
54 #define BPDU_ROOT_PATH_COST     13
55 #define BPDU_BRIDGE_IDENTIFIER  17
56 #define BPDU_PORT_IDENTIFIER    25
57 #define BPDU_MESSAGE_AGE        27
58 #define BPDU_MAX_AGE            29
59 #define BPDU_HELLO_TIME         31
60 #define BPDU_FORWARD_DELAY      33
61 #define BPDU_VERSION_1_LENGTH   35
62
63 #define CONF_BPDU_SIZE          35
64 #define TC_BPDU_SIZE            4
65 #define RST_BPDU_SIZE           36
66
67 /* Flag bits */
68
69 #define BPDU_FLAGS_TCACK                0x80
70 #define BPDU_FLAGS_AGREEMENT            0x40
71 #define BPDU_FLAGS_FORWARDING           0x20
72 #define BPDU_FLAGS_LEARNING             0x10
73 #define BPDU_FLAGS_PORT_ROLE_MASK       0x0C
74 #define BPDU_FLAGS_PORT_ROLE_SHIFT      2
75 #define BPDU_FLAGS_PROPOSAL             0x02
76 #define BPDU_FLAGS_TC                   0x01
77
78 static int proto_bpdu = -1;
79 static int hf_bpdu_proto_id = -1;
80 static int hf_bpdu_version_id = -1;
81 static int hf_bpdu_type = -1;
82 static int hf_bpdu_flags = -1;
83 static int hf_bpdu_flags_tcack = -1;
84 static int hf_bpdu_flags_agreement = -1;
85 static int hf_bpdu_flags_forwarding = -1;
86 static int hf_bpdu_flags_learning = -1;
87 static int hf_bpdu_flags_port_role = -1;
88 static int hf_bpdu_flags_proposal = -1;
89 static int hf_bpdu_flags_tc = -1;
90 static int hf_bpdu_root_mac = -1;
91 static int hf_bpdu_root_cost = -1;
92 static int hf_bpdu_bridge_mac = -1;
93 static int hf_bpdu_port_id = -1;
94 static int hf_bpdu_msg_age = -1;
95 static int hf_bpdu_max_age = -1;
96 static int hf_bpdu_hello_time = -1;
97 static int hf_bpdu_forward_delay = -1;
98 static int hf_bpdu_version_1_length = -1;
99
100 static gint ett_bpdu = -1;
101 static gint ett_bpdu_flags = -1;
102
103 static dissector_handle_t gvrp_handle;
104 static dissector_handle_t gmrp_handle;
105 static dissector_handle_t data_handle;
106
107 static const value_string protocol_id_vals[] = {
108         { 0, "Spanning Tree Protocol" },
109         { 0, NULL }
110 };
111
112 #define BPDU_TYPE_CONF                  0x00
113 #define BPDU_TYPE_RST                   0x02
114 #define BPDU_TYPE_TOPOLOGY_CHANGE       0x80
115
116 static const value_string bpdu_type_vals[] = {
117         { BPDU_TYPE_CONF,            "Configuration" },
118         { BPDU_TYPE_RST,             "Rapid Spanning Tree" },
119         { BPDU_TYPE_TOPOLOGY_CHANGE, "Topology Change Notification" },
120         { 0,                         NULL }
121 };
122
123 static const value_string role_vals[] = {
124         { 1, "Alternate or Backup" },
125         { 2, "Root" },
126         { 3, "Designated" },
127         { 0, NULL }
128 };
129
130 static const char initial_sep[] = " (";
131 static const char cont_sep[] = ", ";
132
133 #define APPEND_BOOLEAN_FLAG(flag, item, string) \
134         if(flag){                                                       \
135                 if(item)                                                \
136                         proto_item_append_text(item, string, sep);      \
137                 sep = cont_sep;                                         \
138         }
139
140 static void
141 dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
142 {
143       guint16 protocol_identifier;
144       guint8  protocol_version_identifier;
145       guint8  bpdu_type;
146       int bpdu_size;
147       guint8  flags;
148       guint16 root_identifier_bridge_priority;
149       const guint8  *root_identifier_mac;
150       gchar   *root_identifier_mac_str;
151       guint32 root_path_cost;
152       guint16 bridge_identifier_bridge_priority;
153       const guint8  *bridge_identifier_mac;
154       gchar   *bridge_identifier_mac_str;
155       guint16 port_identifier;
156       double message_age;
157       double max_age;
158       double hello_time;
159       double forward_delay;
160       
161       proto_tree *bpdu_tree;
162       proto_item *bpdu_item;
163       proto_tree *flags_tree;
164       proto_item *flags_item;
165       guint8    rstp_bpdu;
166       const char *sep;
167
168       /* GARP application frames require special interpretation of the
169          destination address field; otherwise, they will be mistaken as
170          BPDU frames.  
171          Fortunately, they can be recognized by checking the first 6 octets
172          of the destination address, which are in the range from
173          01-80-C2-00-00-20 to 01-80-C2-00-00-2F.
174
175          Yes - we *do* need to check the destination address type;
176          on Linux cooked captures, there *is* no destination address,
177          so it's AT_NONE. */
178       if (pinfo->dl_dst.type == AT_ETHER &&
179           pinfo->dl_dst.data[0] == 0x01 && pinfo->dl_dst.data[1] == 0x80 &&
180           pinfo->dl_dst.data[2] == 0xC2 && pinfo->dl_dst.data[3] == 0x00 &&
181           pinfo->dl_dst.data[4] == 0x00 && ((pinfo->dl_dst.data[5] & 0x20) == 0x20)) {
182
183             protocol_identifier = tvb_get_ntohs(tvb, BPDU_IDENTIFIER);
184
185             switch (pinfo->dl_dst.data[5]) {
186
187             case 0x20:
188                    /* for GMRP */
189                   call_dissector(gmrp_handle, tvb, pinfo, tree);
190                   return;
191
192             case 0x21:
193                   /* for GVRP */
194                   call_dissector(gvrp_handle, tvb, pinfo, tree);
195                   return;
196             }
197
198             pinfo->current_proto = "GARP";
199
200             if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
201                     col_set_str(pinfo->cinfo, COL_PROTOCOL, "GARP");
202                     /* Generic Attribute Registration Protocol */
203             }
204
205             if (check_col(pinfo->cinfo, COL_INFO)) {
206                     col_add_fstr(pinfo->cinfo, COL_INFO,
207                         "Unknown GARP application (0x%02X)",
208                         pinfo->dl_dst.data[5]);
209             }
210
211             return;
212       }
213
214       if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
215             col_set_str(pinfo->cinfo, COL_PROTOCOL, "STP"); /* Spanning Tree Protocol */
216       }
217       if (check_col(pinfo->cinfo, COL_INFO)) {
218             col_clear(pinfo->cinfo, COL_INFO);
219       }
220
221       bpdu_type = tvb_get_guint8(tvb, BPDU_TYPE);
222       switch (bpdu_type) {
223
224       case BPDU_TYPE_CONF:
225       case BPDU_TYPE_RST:
226             flags = tvb_get_guint8(tvb, BPDU_FLAGS);
227             root_identifier_bridge_priority = tvb_get_ntohs(tvb,
228                 BPDU_ROOT_IDENTIFIER);
229             root_identifier_mac = tvb_get_ptr(tvb, BPDU_ROOT_IDENTIFIER + 2, 6);
230             root_identifier_mac_str = ether_to_str(root_identifier_mac);
231             root_path_cost = tvb_get_ntohl(tvb, BPDU_ROOT_PATH_COST);
232             port_identifier = tvb_get_ntohs(tvb, BPDU_PORT_IDENTIFIER);
233             break;
234
235       default:
236             /* Squelch GCC complaints. */
237             flags = 0;
238             root_identifier_bridge_priority = 0;
239             root_identifier_mac = NULL;
240             root_identifier_mac_str = NULL;
241             root_path_cost = 0;
242             port_identifier = 0;
243             break;
244       }
245
246       if (check_col(pinfo->cinfo, COL_INFO)) {
247             switch (bpdu_type) {
248
249             case BPDU_TYPE_CONF:
250                   col_add_fstr(pinfo->cinfo, COL_INFO, "Conf. %sRoot = %d/%s  Cost = %d  Port = 0x%04x", 
251                                flags & 0x1 ? "TC + " : "",
252                                root_identifier_bridge_priority, root_identifier_mac_str, root_path_cost,
253                                port_identifier);
254                   break;
255
256             case BPDU_TYPE_TOPOLOGY_CHANGE:
257                   col_add_fstr(pinfo->cinfo, COL_INFO, "Topology Change Notification");
258                   break;
259
260             case BPDU_TYPE_RST:
261                   col_add_fstr(pinfo->cinfo, COL_INFO, "RST. %sRoot = %d/%s  Cost = %d  Port = 0x%04x", 
262                                flags & 0x1 ? "TC + " : "",
263                                root_identifier_bridge_priority, root_identifier_mac_str, root_path_cost,
264                                port_identifier);
265                   break;
266
267             default:
268                   col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown BPDU type (%u)",
269                                bpdu_type);
270                   break;
271             }
272       }
273
274       switch (bpdu_type) {
275
276       case BPDU_TYPE_CONF:
277         set_actual_length(tvb, CONF_BPDU_SIZE);
278         break;
279
280       case BPDU_TYPE_TOPOLOGY_CHANGE:
281         set_actual_length(tvb, TC_BPDU_SIZE);
282         break;
283
284       case BPDU_TYPE_RST:
285         set_actual_length(tvb, RST_BPDU_SIZE);
286         break;
287       }
288
289       if (tree) {
290             bpdu_item = proto_tree_add_protocol_format(tree, proto_bpdu, tvb,
291                                 0, -1, "Spanning Tree Protocol");
292             bpdu_tree = proto_item_add_subtree(bpdu_item, ett_bpdu);
293
294             protocol_identifier = tvb_get_ntohs(tvb, BPDU_IDENTIFIER);
295             proto_tree_add_uint(bpdu_tree, hf_bpdu_proto_id, tvb,
296                                 BPDU_IDENTIFIER, 2, protocol_identifier);
297
298             protocol_version_identifier = tvb_get_guint8(tvb, BPDU_VERSION_IDENTIFIER);
299             proto_tree_add_uint(bpdu_tree, hf_bpdu_version_id, tvb, 
300                                 BPDU_VERSION_IDENTIFIER, 1, 
301                                 protocol_version_identifier);
302             switch (protocol_version_identifier) {
303               case 0:
304                 break;
305               case 2:
306                 break;
307               default:
308                   proto_tree_add_text(bpdu_tree, tvb, BPDU_VERSION_IDENTIFIER, 1,
309                   "   (Warning: this version of Ethereal only knows about versions 0 & 2)");
310                 break;
311             }
312             proto_tree_add_uint(bpdu_tree, hf_bpdu_type, tvb,
313                                        BPDU_TYPE, 1, 
314                                        bpdu_type);
315
316             if (bpdu_type != BPDU_TYPE_CONF && bpdu_type != BPDU_TYPE_RST) {
317               call_dissector(data_handle,tvb_new_subset(tvb, BPDU_TYPE + 1,-1,tvb_reported_length_remaining(tvb,BPDU_TYPE + 1)), pinfo, tree);
318               return;
319             }
320
321             rstp_bpdu = (bpdu_type == BPDU_TYPE_RST);
322             bridge_identifier_bridge_priority = tvb_get_ntohs(tvb, BPDU_BRIDGE_IDENTIFIER);
323             bridge_identifier_mac = tvb_get_ptr(tvb, BPDU_BRIDGE_IDENTIFIER + 2, 6);
324             bridge_identifier_mac_str = ether_to_str(bridge_identifier_mac);
325
326             flags_item = proto_tree_add_uint(bpdu_tree, hf_bpdu_flags, tvb, 
327                                 BPDU_FLAGS, 1, flags);
328             flags_tree = proto_item_add_subtree(flags_item, ett_bpdu_flags);
329             sep = initial_sep;
330             APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_TCACK, flags_item,
331                                 "%sTopology Change Acknowledgment");
332             proto_tree_add_boolean(flags_tree, hf_bpdu_flags_tcack, tvb,
333                                 BPDU_FLAGS, 1, flags);
334             if (rstp_bpdu) {
335               APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_AGREEMENT, flags_item,
336                                   "%sAgreement");
337               proto_tree_add_boolean(flags_tree, hf_bpdu_flags_agreement, tvb,
338                                   BPDU_FLAGS, 1, flags);
339               APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_FORWARDING, flags_item,
340                                   "%sForwarding");
341               proto_tree_add_boolean(flags_tree, hf_bpdu_flags_forwarding, tvb,
342                                   BPDU_FLAGS, 1, flags);
343               APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_LEARNING, flags_item,
344                                   "%sLearning");
345               proto_tree_add_boolean(flags_tree, hf_bpdu_flags_learning, tvb,
346                                   BPDU_FLAGS, 1, flags);
347               if (flags_item) {
348                 guint8 port_role;
349
350                 port_role = (flags & BPDU_FLAGS_PORT_ROLE_MASK) >> BPDU_FLAGS_PORT_ROLE_SHIFT;
351                 proto_item_append_text(flags_item, "%sPort Role: %s", sep,
352                                        val_to_str(port_role, role_vals,
353                                                   "Unknown (%u)"));
354               }
355               sep = cont_sep;
356               proto_tree_add_uint(flags_tree, hf_bpdu_flags_port_role, tvb,
357                                   BPDU_FLAGS, 1, flags);
358               APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_PROPOSAL, flags_item,
359                                   "%sProposal");
360               proto_tree_add_boolean(flags_tree, hf_bpdu_flags_proposal, tvb,
361                                   BPDU_FLAGS, 1, flags);
362             }
363             APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_TC, flags_item,
364                                 "%sTopology Change");
365             proto_tree_add_boolean(flags_tree, hf_bpdu_flags_tc, tvb,
366                                 BPDU_FLAGS, 1, flags);
367             if (sep != initial_sep) {
368               /* We put something in; put in the terminating ")" */
369               proto_item_append_text(flags_item, ")");
370             }
371
372             proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_root_mac, tvb,
373                                        BPDU_ROOT_IDENTIFIER + 2, 6,
374                                        root_identifier_mac);
375             proto_tree_add_text(bpdu_tree, tvb, 
376                                 BPDU_ROOT_IDENTIFIER, 8, 
377                                 "Root Identifier: %d / %s", 
378                                 root_identifier_bridge_priority, 
379                                 root_identifier_mac_str);
380             proto_tree_add_uint(bpdu_tree, hf_bpdu_root_cost, tvb, 
381                                 BPDU_ROOT_PATH_COST, 4, 
382                                 root_path_cost);
383             proto_tree_add_text(bpdu_tree, tvb, 
384                                 BPDU_BRIDGE_IDENTIFIER, 8, 
385                                 "Bridge Identifier: %d / %s", 
386                                 bridge_identifier_bridge_priority, 
387                                 bridge_identifier_mac_str);
388             proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_bridge_mac, tvb,
389                                        BPDU_BRIDGE_IDENTIFIER + 2, 6,
390                                        bridge_identifier_mac);
391             proto_tree_add_uint(bpdu_tree, hf_bpdu_port_id, tvb,
392                                 BPDU_PORT_IDENTIFIER, 2, 
393                                 port_identifier);
394             message_age = tvb_get_ntohs(tvb, BPDU_MESSAGE_AGE) / 256.0;
395             proto_tree_add_double(bpdu_tree, hf_bpdu_msg_age, tvb,
396                                 BPDU_MESSAGE_AGE, 2, 
397                                 message_age);
398             max_age = tvb_get_ntohs(tvb, BPDU_MAX_AGE) / 256.0;
399             proto_tree_add_double(bpdu_tree, hf_bpdu_max_age, tvb,
400                                 BPDU_MAX_AGE, 2, 
401                                 max_age);
402             hello_time = tvb_get_ntohs(tvb, BPDU_HELLO_TIME) / 256.0;
403             proto_tree_add_double(bpdu_tree, hf_bpdu_hello_time, tvb,
404                                 BPDU_HELLO_TIME, 2, 
405                                 hello_time);
406             forward_delay = tvb_get_ntohs(tvb, BPDU_FORWARD_DELAY) / 256.0;
407             proto_tree_add_double(bpdu_tree, hf_bpdu_forward_delay, tvb,
408                                 BPDU_FORWARD_DELAY, 2, 
409                                 forward_delay);
410             if (rstp_bpdu) {
411               proto_tree_add_item(bpdu_tree, hf_bpdu_version_1_length, tvb,
412                                 BPDU_VERSION_1_LENGTH, 1, FALSE);
413             }
414       }
415 }
416
417 static const true_false_string yesno = {  
418         "Yes",
419         "No"
420 };
421
422 void
423 proto_register_bpdu(void)
424 {
425
426   static hf_register_info hf[] = {
427     { &hf_bpdu_proto_id,
428       { "Protocol Identifier",          "stp.protocol",
429         FT_UINT16,      BASE_HEX,       VALS(&protocol_id_vals), 0x0,
430         "", HFILL }},
431     { &hf_bpdu_version_id,
432       { "Protocol Version Identifier",  "stp.version",
433         FT_UINT8,       BASE_DEC,       NULL,   0x0,
434         "", HFILL }},
435     { &hf_bpdu_type,
436       { "BPDU Type",                    "stp.type",
437         FT_UINT8,       BASE_HEX,       VALS(&bpdu_type_vals),  0x0,
438         "", HFILL }},
439     { &hf_bpdu_flags,
440       { "BPDU flags",                   "stp.flags",
441         FT_UINT8,       BASE_HEX,       NULL,   0x0,
442         "", HFILL }},
443     { &hf_bpdu_flags_tcack,
444       { "Topology Change Acknowledgment",  "stp.flags.tcack",
445         FT_BOOLEAN,     8,              TFS(&yesno),    BPDU_FLAGS_TCACK,
446         "", HFILL }},
447     { &hf_bpdu_flags_agreement,
448       { "Agreement",                    "stp.flags.agreement",
449         FT_BOOLEAN,     8,              TFS(&yesno),    BPDU_FLAGS_AGREEMENT,
450         "", HFILL }},
451     { &hf_bpdu_flags_forwarding,
452       { "Forwarding",                   "stp.flags.forwarding",
453         FT_BOOLEAN,     8,              TFS(&yesno),    BPDU_FLAGS_FORWARDING,
454         "", HFILL }},
455     { &hf_bpdu_flags_learning,
456       { "Learning",                     "stp.flags.learning",
457         FT_BOOLEAN,     8,              TFS(&yesno),    BPDU_FLAGS_LEARNING,
458         "", HFILL }},
459     { &hf_bpdu_flags_port_role,
460       { "Port Role",                    "stp.flags.port_role",
461         FT_UINT8,       BASE_DEC,       VALS(role_vals),        BPDU_FLAGS_PORT_ROLE_MASK,
462         "", HFILL }},
463     { &hf_bpdu_flags_proposal,
464       { "Proposal",                     "stp.flags.proposal",
465         FT_BOOLEAN,     8,              TFS(&yesno),    BPDU_FLAGS_PROPOSAL,
466         "", HFILL }},
467     { &hf_bpdu_flags_tc,
468       { "Topology Change",              "stp.flags.tc",
469         FT_BOOLEAN,     8,              TFS(&yesno),    BPDU_FLAGS_TC,
470         "", HFILL }},
471     { &hf_bpdu_root_mac,
472       { "Root Identifier",              "stp.root.hw",
473         FT_ETHER,       BASE_NONE,      NULL,   0x0,
474         "", HFILL }},
475     { &hf_bpdu_root_cost,
476       { "Root Path Cost",               "stp.root.cost",
477         FT_UINT32,      BASE_DEC,       NULL,   0x0,
478         "", HFILL }},
479     { &hf_bpdu_bridge_mac,
480       { "Bridge Identifier",            "stp.bridge.hw",
481         FT_ETHER,       BASE_NONE,      NULL,   0x0,
482         "", HFILL }},
483     { &hf_bpdu_port_id,
484       { "Port identifier",              "stp.port",
485         FT_UINT16,      BASE_HEX,       NULL,   0x0,
486         "", HFILL }},
487     { &hf_bpdu_msg_age,
488       { "Message Age",                  "stp.msg_age",
489         FT_DOUBLE,      BASE_NONE,      NULL,   0x0,
490         "", HFILL }},
491     { &hf_bpdu_max_age,
492       { "Max Age",                      "stp.max_age",
493         FT_DOUBLE,      BASE_NONE,      NULL,   0x0,
494         "", HFILL }},
495     { &hf_bpdu_hello_time,
496       { "Hello Time",                   "stp.hello",
497         FT_DOUBLE,      BASE_NONE,      NULL,   0x0,
498         "", HFILL }},
499     { &hf_bpdu_forward_delay,
500       { "Forward Delay",                "stp.forward",
501         FT_DOUBLE,      BASE_NONE,      NULL,   0x0,
502         "", HFILL }},
503     { &hf_bpdu_version_1_length,
504       { "Version 1 Length",             "stp.version_1_length",
505         FT_UINT8,       BASE_DEC,       NULL,   0x0,
506         "", HFILL }},
507   };
508   static gint *ett[] = {
509     &ett_bpdu,
510     &ett_bpdu_flags,
511   };
512
513   proto_bpdu = proto_register_protocol("Spanning Tree Protocol", "STP", "stp");
514   proto_register_field_array(proto_bpdu, hf, array_length(hf));
515   proto_register_subtree_array(ett, array_length(ett));
516
517   register_dissector("bpdu", dissect_bpdu, proto_bpdu);
518 }
519
520 void
521 proto_reg_handoff_bpdu(void)
522 {
523   dissector_handle_t bpdu_handle;
524
525   /*
526    * Get handle for the GVRP dissector.
527    */
528   gvrp_handle = find_dissector("gvrp");
529   
530   /*
531    * Get handle for the GMRP dissector.
532    */
533   gmrp_handle = find_dissector("gmrp");
534   data_handle = find_dissector("data");
535
536   bpdu_handle = find_dissector("bpdu");
537   dissector_add("llc.dsap", SAP_BPDU, bpdu_handle);
538   dissector_add("ppp.protocol", PPP_BPDU, bpdu_handle);
539 }