2 * Routines for the disassembly of Extreme Networks specific
3 * protocols (EDP/ESRP/EAPS(including ESL)/ELSM)
5 * Copyright 2005 Joerg Mayer (see AUTHORS file)
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
17 EAPS v2 is not supported (no spec)
18 Some stuff in the EDP Info field (no spec)
19 - Things seen in traces
20 Flags in the EDP Vlan field (value 0x01)
21 - TLV type 0x0e (ESL) shared link managemnt
22 TLV type 0x15 (XOS only?) Link bit details (eth autoneg)
28 EAPS v1 is specified in RFC3619
30 The following information is taken from the Extreme knowledge base
31 (login required). Search for ESRP.
32 Note: The information seems to be incorrect in at least one place
33 (position of edp.vlan.id).
35 ================================ snip ================================
41 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F
42 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 0000
43 | SOURCE MAC ADDRESS |
44 +-------------------------------+-------------------------------+ 0004
45 | SOURCE MAC ADDRESS (CONT) | DEST MAC ADDRESS |
46 +-------------------------------+-------------------------------+ 0008
47 | DEST MAC ADDRESS (CONT) |
48 +-------------------------------+---------------+---------------+ 000C
49 | LENGTH | DSAP = AA | SSAP = AA |
50 +---------------+---------------+---------------+---------------+ 0010
51 | LLC TYPE = UI | UID = 00E02B |
52 +---------------+---------------+---------------+---------------+ 0014
53 | SNAP TYPE = 00BB | EDP VERSION | RESERVED |
54 +-------------------------------+---------------+---------------+ 0018
56 +-------------------------------+-------------------------------+ 001C
57 | SEQUENCE NUMBER | MACHINE ID |
58 +-------------------------------+-------------------------------+ 0020
59 | MACHINE ID (CONT.) |
60 +-------------------------------+---------------+---------------+ 0024
61 | MACHINE ID (CONT.) | MARKER=99(EDP)| TYPE=08 (ESRP)|
62 +-------------------------------+---------------+---------------+ 0028
63 | LENGTH = 001C |0=IP 1=IPX 2=L2| GROUP = 0 |
64 +-------------------------------+-------------------------------+ 002C
65 | PRIORITY | STATE: 0=?? 1=MSTR 2=SLAVE |
66 +-------------------------------+-------------------------------+ 0030
67 | NUMBER OF ACTIVE PORTS | VIRTUAL IP ADDRESS |
68 +-------------------------------+-------------------------------+ 0034
69 | VIRTUAL IP ADDRESS (CONT) | SYSTEM MAC ADDRESS |
70 +-------------------------------+-------------------------------+ 0038
71 | SYSTEM MAC ADDRESS (CONT.) |
72 +-------------------------------+-------------------------------+ 003C
73 | HELLO TIMER | RESERVED |
74 +-------------------------------+-------------------------------+ 0040
77 ******************************************************************************
80 EDP is a SNAP encapsulated frame. The top level looks like this:
81 The top level format is like this:
82 [ SNAP header ] [ EDP header] [ TLV 0 ] [ TLV 1 ] ... [ TLV N ]
90 8 octets: device id (currently 2 0 octets followed by system mac address)
92 TLV stands for Type, Length, Value.
93 Format of a TLV entry:
94 marker ( 1 octet): Hex 99
96 The following types are used:
97 Null (used as an end signal): 0
98 Display (Mib II display string): 1
99 Info (Basic system information): 2
102 Length: Length of subsequent data(2 octets)
103 Value: Length octets of data.
106 two octets: originating slot #
107 two octets: originating port #
108 two octets: Virtual Chassis Id (If originating port is connected to a virtual chassis).
110 four octets: software version
111 16 octets: Virtual Chassis Id connections
113 Format for Vlan info:
114 octet 0: Flags (bit 8 = 1 means this vlan has an IP interface)
115 octets 1,2,3: reserved.
116 octets 4,5: vlan Id (0 if untagged)
117 octets 6,7: reserved.
118 octets 8 - 11: Vlan IP address.
119 Rest of value: VLAN name.
121 Display string is merely length octets of the MIBII display string.
123 These are the structures you will see most often in EDP frames.
125 ================================ snap ================================
131 #include <epan/packet.h>
132 #include <epan/expert.h>
133 #include <epan/to_str.h>
134 #include <epan/strutil.h>
135 #include <epan/in_cksum.h>
136 #include <epan/tfs.h>
137 #include "packet-llc.h"
138 #include <epan/oui.h>
140 void proto_register_edp(void);
141 void proto_reg_handoff_edp(void);
143 static int hf_llc_extreme_pid
;
145 static dissector_handle_t edp_handle
;
147 static int proto_edp
;
149 static int hf_edp_version
;
150 static int hf_edp_reserved
;
151 static int hf_edp_length
;
152 static int hf_edp_checksum
;
153 static int hf_edp_checksum_status
;
155 static int hf_edp_seqno
;
156 static int hf_edp_midtype
;
157 static int hf_edp_midmac
;
159 static int hf_edp_tlv_marker
;
160 static int hf_edp_tlv_type
;
161 static int hf_edp_tlv_length
;
163 static int hf_edp_display
;
164 static int hf_edp_display_string
;
166 static int hf_edp_info
;
167 static int hf_edp_info_slot
;
168 static int hf_edp_info_port
;
169 static int hf_edp_info_vchassid
;
170 static int hf_edp_info_reserved
;
171 static int hf_edp_info_version
;
172 static int hf_edp_info_version_major1
;
173 static int hf_edp_info_version_major2
;
174 static int hf_edp_info_version_sustaining
;
175 static int hf_edp_info_version_internal
;
176 static int hf_edp_info_vchassconn
;
178 static int hf_edp_vlan
;
179 static int hf_edp_vlan_flags
;
180 static int hf_edp_vlan_flags_ip
;
181 static int hf_edp_vlan_flags_reserved
;
182 static int hf_edp_vlan_flags_unknown
;
183 static int hf_edp_vlan_reserved1
;
184 static int hf_edp_vlan_id
;
185 static int hf_edp_vlan_reserved2
;
186 static int hf_edp_vlan_ip
;
187 static int hf_edp_vlan_name
;
189 static int hf_edp_esrp
;
190 static int hf_edp_esrp_proto
;
191 static int hf_edp_esrp_group
;
192 static int hf_edp_esrp_prio
;
193 static int hf_edp_esrp_state
;
194 static int hf_edp_esrp_ports
;
195 static int hf_edp_esrp_virtip
;
196 static int hf_edp_esrp_sysmac
;
197 static int hf_edp_esrp_hello
;
198 static int hf_edp_esrp_reserved
;
200 static int hf_edp_eaps
;
201 static int hf_edp_eaps_ver
;
202 static int hf_edp_eaps_type
;
203 static int hf_edp_eaps_ctrlvlanid
;
204 static int hf_edp_eaps_reserved0
;
205 static int hf_edp_eaps_sysmac
;
206 static int hf_edp_eaps_hello
;
207 static int hf_edp_eaps_fail
;
208 static int hf_edp_eaps_state
;
209 static int hf_edp_eaps_reserved1
;
210 static int hf_edp_eaps_helloseq
;
211 static int hf_edp_eaps_reserved2
;
213 static int hf_edp_esl
;
214 static int hf_edp_esl_ver
;
215 static int hf_edp_esl_type
;
216 static int hf_edp_esl_ctrlvlanid
;
217 static int hf_edp_esl_reserved0
;
218 static int hf_edp_esl_sysmac
;
219 static int hf_edp_esl_reserved1
;
220 static int hf_edp_esl_state
;
221 static int hf_edp_esl_linkrole
;
222 static int hf_edp_esl_linkid1
;
223 static int hf_edp_esl_failed1
;
224 static int hf_edp_esl_failed2
;
225 static int hf_edp_esl_reserved4
;
226 static int hf_edp_esl_linkid2
;
227 static int hf_edp_esl_reserved5
;
228 static int hf_edp_esl_numlinks
;
229 static int hf_edp_esl_linklist
;
230 static int hf_edp_esl_rest
;
231 /* ELSM (Extreme Link Status Monitoring) */
232 static int hf_edp_elsm
;
233 static int hf_edp_elsm_type
;
234 static int hf_edp_elsm_subtype
;
235 static int hf_edp_elsm_magic
;
236 /* ELRP (Extreme Loop Recognition Protocol)*/
237 static int hf_edp_elrp
;
238 static int hf_edp_elrp_unknown
;
239 /* Link properties */
240 static int hf_edp_link
;
241 static int hf_edp_link_flags
;
242 static int hf_edp_link_flags_autoneg
;
243 static int hf_edp_link_flags_flowcontrol
;
244 static int hf_edp_link_flags_unknown
;
245 static int hf_edp_link_conf
;
246 static int hf_edp_link_actual
;
247 static int hf_edp_link_zero
;
248 static int hf_edp_link_unknown
;
249 /* Unknown element */
250 static int hf_edp_unknown
;
251 static int hf_edp_unknown_data
;
253 static int hf_edp_null
;
255 static expert_field ei_edp_short_tlv
;
256 static expert_field ei_edp_checksum
;
259 static int ett_edp_tlv_header
;
260 static int ett_edp_display
;
261 static int ett_edp_info
;
262 static int ett_edp_info_version
;
263 static int ett_edp_vlan
;
264 static int ett_edp_vlan_flags
;
265 static int ett_edp_esrp
;
266 static int ett_edp_eaps
;
267 static int ett_edp_esl
;
268 static int ett_edp_elsm
;
269 static int ett_edp_elrp
;
270 static int ett_edp_link
;
271 static int ett_edp_link_flags
;
272 static int ett_edp_unknown
;
273 static int ett_edp_null
;
275 #define PROTO_SHORT_NAME "EDP"
276 #define PROTO_LONG_NAME "Extreme Discovery Protocol"
278 static const value_string extreme_pid_vals
[] = {
284 static const value_string esrp_proto_vals
[] = {
292 static const value_string esrp_state_vals
[] = {
301 EDP_TYPE_NULL
= 0x00,
304 EDP_TYPE_VLAN
= 0x05,
305 EDP_TYPE_ESRP
= 0x08,
306 EDP_TYPE_EAPS
= 0x0b,
307 EDP_TYPE_ELRP
= 0x0d,
313 static const value_string edp_type_vals
[] = {
314 { EDP_TYPE_NULL
, "Null"},
315 { EDP_TYPE_DISPLAY
, "Display"},
316 { EDP_TYPE_INFO
, "Info"},
317 { EDP_TYPE_VLAN
, "VL"},
318 { EDP_TYPE_ESRP
, "ESRP"},
319 { EDP_TYPE_EAPS
, "EAPS"},
320 { EDP_TYPE_ELRP
, "ELRP"},
321 { EDP_TYPE_ESL
, "ESL"},
322 { EDP_TYPE_ELSM
, "ELSM"},
323 { EDP_TYPE_LINK
, "Link"},
328 static const value_string edp_midtype_vals
[] = {
334 static const value_string eaps_type_vals
[] = {
336 { 6, "Ring up flush fdb" },
337 { 7, "Ring down flush fdb" },
343 static const value_string eaps_state_vals
[] = {
349 { 5, "Pre Forwarding" },
354 static const value_string esl_role_vals
[] = {
361 static const value_string esl_state_vals
[] = {
368 static const value_string esl_type_vals
[] = {
369 { 1, "Segment Health" },
374 static const value_string elsm_type_vals
[] = {
380 static const value_string elsm_subtype_vals
[] = {
387 static const value_string link_speed_vals
[] = {
397 dissect_tlv_header(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, int offset
, int length _U_
, proto_tree
*tree
)
399 proto_tree
*tlv_tree
;
404 tlv_marker
= tvb_get_uint8(tvb
, offset
);
405 tlv_type
= tvb_get_uint8(tvb
, offset
+ 1);
406 tlv_length
= tvb_get_ntohs(tvb
, offset
+ 2);
408 tlv_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 4,
409 ett_edp_tlv_header
, NULL
, "Marker 0x%02x, length %d, type %d = %s",
410 tlv_marker
, tlv_length
, tlv_type
,
411 val_to_str(tlv_type
, edp_type_vals
, "Unknown (0x%02x)"));
413 proto_tree_add_item(tlv_tree
, hf_edp_tlv_marker
, tvb
, offset
, 1,
417 proto_tree_add_uint(tlv_tree
, hf_edp_tlv_type
, tvb
, offset
, 1,
421 proto_tree_add_uint(tlv_tree
, hf_edp_tlv_length
, tvb
, offset
, 2,
429 dissect_display_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
431 proto_item
*display_item
;
432 proto_tree
*display_tree
;
433 const uint8_t *display_name
;
435 display_item
= proto_tree_add_item(tree
, hf_edp_display
,
436 tvb
, offset
, length
, ENC_BIG_ENDIAN
);
438 display_tree
= proto_item_add_subtree(display_item
, ett_edp_display
);
440 dissect_tlv_header(tvb
, pinfo
, offset
, 4, display_tree
);
444 proto_tree_add_item_ret_string(display_tree
, hf_edp_display_string
, tvb
, offset
, length
,
445 ENC_ASCII
, pinfo
->pool
, &display_name
);
446 proto_item_append_text(display_item
, ": \"%s\"",
447 format_text(pinfo
->pool
, display_name
, strlen((const char *)display_name
)));
451 dissect_null_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
453 proto_item
*null_item
;
454 proto_tree
*null_tree
;
456 null_item
= proto_tree_add_protocol_format(tree
, hf_edp_null
,
457 tvb
, offset
, length
, "Null");
459 null_tree
= proto_item_add_subtree(null_item
, ett_edp_null
);
461 dissect_tlv_header(tvb
, pinfo
, offset
, 4, null_tree
);
468 dissect_info_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
470 proto_tree
*ver_tree
;
471 uint8_t major1
, major2
, sustaining
, internal
;
473 proto_item
*info_item
;
474 proto_tree
*info_tree
;
476 /* The slot and port numbers printed on the chassis are 1
477 bigger than the transmitted values indicate */
478 slot
= tvb_get_ntohs(tvb
, offset
+ 0 + 4) + 1;
479 port
= tvb_get_ntohs(tvb
, offset
+ 2 + 4) + 1;
482 major1
= tvb_get_uint8(tvb
, offset
+ 12 + 4);
483 major2
= tvb_get_uint8(tvb
, offset
+ 13 + 4);
484 sustaining
= tvb_get_uint8(tvb
, offset
+ 14 + 4);
485 internal
= tvb_get_uint8(tvb
, offset
+ 15 + 4);
487 info_item
= proto_tree_add_protocol_format(tree
, hf_edp_info
,
489 "Info: Slot/Port: %d/%d, Version: %d.%d.%d.%d",
490 slot
, port
, major1
, major2
, sustaining
, internal
);
492 info_tree
= proto_item_add_subtree(info_item
, ett_edp_info
);
494 dissect_tlv_header(tvb
, pinfo
, offset
, 4, info_tree
);
497 proto_tree_add_uint(info_tree
, hf_edp_info_slot
, tvb
, offset
, 2,
501 proto_tree_add_uint(info_tree
, hf_edp_info_port
, tvb
, offset
, 2,
505 proto_tree_add_item(info_tree
, hf_edp_info_vchassid
, tvb
, offset
, 2,
509 proto_tree_add_item(info_tree
, hf_edp_info_reserved
, tvb
, offset
, 6,
513 /* Begin version subtree */
514 ver_tree
= proto_tree_add_subtree_format(info_tree
, tvb
, offset
, 4,
515 ett_edp_info_version
, NULL
, "Version: %u.%u.%u Internal: %u", major1
, major2
,
516 sustaining
, internal
);
518 proto_tree_add_item(ver_tree
, hf_edp_info_version
, tvb
, offset
, 4,
521 proto_tree_add_uint(ver_tree
, hf_edp_info_version_major1
, tvb
, offset
, 1,
525 proto_tree_add_uint(ver_tree
, hf_edp_info_version_major2
, tvb
, offset
, 1,
529 proto_tree_add_uint(ver_tree
, hf_edp_info_version_sustaining
, tvb
, offset
, 1,
533 proto_tree_add_uint(ver_tree
, hf_edp_info_version_internal
, tvb
, offset
, 1,
536 /* End of version subtree */
538 proto_tree_add_item(info_tree
, hf_edp_info_vchassconn
, tvb
, offset
, 16,
546 dissect_vlan_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
548 proto_item
*flags_item
;
549 proto_tree
*flags_tree
;
550 proto_item
*vlan_item
;
551 proto_tree
*vlan_tree
;
553 const uint8_t *vlan_name
;
555 vlan_item
= proto_tree_add_item(tree
, hf_edp_vlan
, tvb
,
556 offset
, length
, ENC_BIG_ENDIAN
);
558 vlan_tree
= proto_item_add_subtree(vlan_item
, ett_edp_vlan
);
560 dissect_tlv_header(tvb
, pinfo
, offset
, 4, vlan_tree
);
564 /* Begin flags subtree */
566 expert_add_info(pinfo
, vlan_item
, &ei_edp_short_tlv
);
569 flags_item
= proto_tree_add_item(vlan_tree
, hf_edp_vlan_flags
, tvb
, offset
, 1,
572 flags_tree
= proto_item_add_subtree(flags_item
, ett_edp_vlan_flags
);
574 proto_tree_add_item(flags_tree
, hf_edp_vlan_flags_ip
, tvb
, offset
, 1,
576 proto_tree_add_item(flags_tree
, hf_edp_vlan_flags_reserved
, tvb
, offset
, 1,
578 proto_tree_add_item(flags_tree
, hf_edp_vlan_flags_unknown
, tvb
, offset
, 1,
582 /* End of flags subtree */
585 expert_add_info(pinfo
, vlan_item
, &ei_edp_short_tlv
);
588 proto_tree_add_item(vlan_tree
, hf_edp_vlan_reserved1
, tvb
, offset
, 1,
594 expert_add_info(pinfo
, vlan_item
, &ei_edp_short_tlv
);
597 vlan_id
= tvb_get_ntohs(tvb
, offset
);
598 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%d", vlan_id
);
599 proto_item_append_text(vlan_item
, ": ID %d", vlan_id
);
600 proto_tree_add_uint(vlan_tree
, hf_edp_vlan_id
, tvb
, offset
, 2,
606 expert_add_info(pinfo
, vlan_item
, &ei_edp_short_tlv
);
609 proto_tree_add_item(vlan_tree
, hf_edp_vlan_reserved2
, tvb
, offset
, 4,
615 expert_add_info(pinfo
, vlan_item
, &ei_edp_short_tlv
);
618 proto_tree_add_item(vlan_tree
, hf_edp_vlan_ip
, tvb
, offset
, 4,
623 proto_tree_add_item_ret_string(vlan_tree
, hf_edp_vlan_name
, tvb
, offset
, length
,
624 ENC_ASCII
, pinfo
->pool
, &vlan_name
);
625 proto_item_append_text(vlan_item
, ", Name \"%s\"",
626 format_text(pinfo
->pool
, vlan_name
, strlen((const char *)vlan_name
)));
634 dissect_esrp_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
636 proto_item
*esrp_item
;
637 proto_tree
*esrp_tree
;
640 group
= tvb_get_uint8(tvb
, offset
+ 1 + 4);
641 esrp_item
= proto_tree_add_protocol_format(tree
, hf_edp_esrp
,
642 tvb
, offset
, length
, "ESRP: Group %d", group
);
644 esrp_tree
= proto_item_add_subtree(esrp_item
, ett_edp_esrp
);
646 dissect_tlv_header(tvb
, pinfo
, offset
, 4, esrp_tree
);
649 proto_tree_add_item(esrp_tree
, hf_edp_esrp_proto
, tvb
, offset
, 1,
653 proto_tree_add_item(esrp_tree
, hf_edp_esrp_group
, tvb
, offset
, 1,
657 proto_tree_add_item(esrp_tree
, hf_edp_esrp_prio
, tvb
, offset
, 2,
661 proto_tree_add_item(esrp_tree
, hf_edp_esrp_state
, tvb
, offset
, 2,
665 proto_tree_add_item(esrp_tree
, hf_edp_esrp_ports
, tvb
, offset
, 2,
669 proto_tree_add_item(esrp_tree
, hf_edp_esrp_virtip
, tvb
, offset
, 4,
673 proto_tree_add_item(esrp_tree
, hf_edp_esrp_sysmac
, tvb
, offset
, 6,
677 proto_tree_add_item(esrp_tree
, hf_edp_esrp_hello
, tvb
, offset
, 2,
681 proto_tree_add_item(esrp_tree
, hf_edp_esrp_reserved
, tvb
, offset
, 2,
685 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "ESRP");
691 dissect_eaps_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
693 proto_item
*eaps_item
;
694 proto_tree
*eaps_tree
;
696 const char *sysmac_str
;
698 ctrlvlanid
= tvb_get_ntohs(tvb
, offset
+ 1 + 1 + 4);
699 sysmac_str
= tvb_ether_to_str(pinfo
->pool
, tvb
, offset
+ 12);
701 eaps_item
= proto_tree_add_protocol_format(tree
, hf_edp_eaps
,
702 tvb
, offset
, length
, "EAPS: Ctrlvlan %d, Sysmac %s",
703 ctrlvlanid
, sysmac_str
);
705 eaps_tree
= proto_item_add_subtree(eaps_item
, ett_edp_eaps
);
707 dissect_tlv_header(tvb
, pinfo
, offset
, 4, eaps_tree
);
710 proto_tree_add_item(eaps_tree
, hf_edp_eaps_ver
, tvb
, offset
, 1,
714 proto_tree_add_item(eaps_tree
, hf_edp_eaps_type
, tvb
, offset
, 1,
718 proto_tree_add_item(eaps_tree
, hf_edp_eaps_ctrlvlanid
, tvb
, offset
, 2,
722 proto_tree_add_item(eaps_tree
, hf_edp_eaps_reserved0
, tvb
, offset
, 4,
726 proto_tree_add_item(eaps_tree
, hf_edp_eaps_sysmac
, tvb
, offset
, 6,
730 proto_tree_add_item(eaps_tree
, hf_edp_eaps_hello
, tvb
, offset
, 2,
734 proto_tree_add_item(eaps_tree
, hf_edp_eaps_fail
, tvb
, offset
, 2,
738 proto_tree_add_item(eaps_tree
, hf_edp_eaps_state
, tvb
, offset
, 1,
742 proto_tree_add_item(eaps_tree
, hf_edp_eaps_reserved1
, tvb
, offset
, 1,
746 proto_tree_add_item(eaps_tree
, hf_edp_eaps_helloseq
, tvb
, offset
, 2,
750 proto_tree_add_item(eaps_tree
, hf_edp_eaps_reserved2
, tvb
, offset
, 38,
754 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "EAPS");
755 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " ID: %d, MAC: %s",
756 ctrlvlanid
, sysmac_str
);
762 dissect_esl_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
764 proto_item
*esl_item
;
765 proto_tree
*esl_tree
;
768 const char *sysmac_str
;
770 ctrlvlanid
= tvb_get_ntohs(tvb
, offset
+ 2 + 4);
771 sysmac_str
= tvb_ether_to_str(pinfo
->pool
, tvb
, offset
+ 12);
773 esl_item
= proto_tree_add_protocol_format(tree
, hf_edp_esl
,
774 tvb
, offset
, length
, "ESL: Ctrlvlan %d, Sysmac %s",
775 ctrlvlanid
, sysmac_str
);
777 esl_tree
= proto_item_add_subtree(esl_item
, ett_edp_esl
);
779 dissect_tlv_header(tvb
, pinfo
, offset
, 4, esl_tree
);
783 proto_tree_add_item(esl_tree
, hf_edp_esl_ver
, tvb
, offset
, 1,
788 proto_tree_add_item(esl_tree
, hf_edp_esl_type
, tvb
, offset
, 1,
793 proto_tree_add_item(esl_tree
, hf_edp_esl_ctrlvlanid
, tvb
, offset
, 2,
798 proto_tree_add_item(esl_tree
, hf_edp_esl_reserved0
, tvb
, offset
, 4,
803 proto_tree_add_item(esl_tree
, hf_edp_esl_sysmac
, tvb
, offset
, 6,
808 proto_tree_add_item(esl_tree
, hf_edp_esl_reserved1
, tvb
, offset
, 4,
813 proto_tree_add_item(esl_tree
, hf_edp_esl_state
, tvb
, offset
, 1,
818 proto_tree_add_item(esl_tree
, hf_edp_esl_linkrole
, tvb
, offset
, 1,
823 proto_tree_add_item(esl_tree
, hf_edp_esl_linkid1
, tvb
, offset
, 2,
828 proto_tree_add_item(esl_tree
, hf_edp_esl_failed1
, tvb
, offset
, 2,
833 proto_tree_add_item(esl_tree
, hf_edp_esl_failed2
, tvb
, offset
, 2,
838 proto_tree_add_item(esl_tree
, hf_edp_esl_reserved4
, tvb
, offset
, 2,
843 proto_tree_add_item(esl_tree
, hf_edp_esl_linkid2
, tvb
, offset
, 2,
848 proto_tree_add_item(esl_tree
, hf_edp_esl_reserved5
, tvb
, offset
, 2,
853 numlinks
= tvb_get_ntohs(tvb
, offset
);
854 proto_tree_add_item(esl_tree
, hf_edp_esl_numlinks
, tvb
, offset
, 2,
859 for (; numlinks
> 0 && length
>= 2; numlinks
--) {
860 proto_tree_add_item(esl_tree
, hf_edp_esl_linklist
, tvb
, offset
, 2,
866 proto_tree_add_item(esl_tree
, hf_edp_esl_rest
, tvb
, offset
, length
,
870 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "ESL");
871 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " ID: %d, MAC: %s",
872 ctrlvlanid
, sysmac_str
);
878 dissect_elsm_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
,
879 proto_tree
*tree
, uint16_t seqno
)
881 proto_item
*elsm_item
;
882 proto_tree
*elsm_tree
;
883 uint8_t type
, subtype
;
885 type
= tvb_get_uint8(tvb
, offset
+ 4);
886 subtype
= tvb_get_uint8(tvb
, offset
+ 4 + 1);
888 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " %s%s (#%d)",
889 val_to_str(type
, elsm_type_vals
, "Unknown (0x%02x)"),
890 val_to_str(subtype
, elsm_subtype_vals
, " Unknown (0x%02x)"),
893 elsm_item
= proto_tree_add_protocol_format(tree
, hf_edp_elsm
,
894 tvb
, offset
, length
, "ELSM %s%s(#%d)",
895 val_to_str(type
, elsm_type_vals
, "Unknown (0x%02x)"),
896 val_to_str(subtype
, elsm_subtype_vals
, " Unknown (0x%02x)"),
899 elsm_tree
= proto_item_add_subtree(elsm_item
, ett_edp_elsm
);
901 dissect_tlv_header(tvb
, pinfo
, offset
, 4, elsm_tree
);
904 /* The rest is actually guesswork */
905 proto_tree_add_item(elsm_tree
, hf_edp_elsm_type
, tvb
, offset
, 1,
909 proto_tree_add_item(elsm_tree
, hf_edp_elsm_subtype
, tvb
, offset
, 1,
913 proto_tree_add_item(elsm_tree
, hf_edp_elsm_magic
, tvb
, offset
, 2,
921 dissect_elrp_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
923 proto_item
*elrp_item
;
924 proto_tree
*elrp_tree
;
926 elrp_item
= proto_tree_add_protocol_format(tree
, hf_edp_elrp
,
927 tvb
, offset
, length
, "ELRP");
929 elrp_tree
= proto_item_add_subtree(elrp_item
, ett_edp_elrp
);
931 dissect_tlv_header(tvb
, pinfo
, offset
, 4, elrp_tree
);
935 proto_tree_add_item(elrp_tree
, hf_edp_elrp_unknown
, tvb
, offset
, length
,
940 dissect_link_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
942 proto_item
*link_item
;
943 proto_tree
*link_tree
;
945 link_item
= proto_tree_add_protocol_format(tree
, hf_edp_link
,
946 tvb
, offset
, length
, "Linkinfo");
948 link_tree
= proto_item_add_subtree(link_item
, ett_edp_link
);
950 dissect_tlv_header(tvb
, pinfo
, offset
, 4, link_tree
);
954 /* TODO: Find out and decode the individual bits */
956 proto_item
*flags_item
;
957 proto_tree
*flags_tree
;
959 /* 0x80: Autonegotiation: 1: on, 0: off */
960 /* 0x40: Other side does EDP ??? */
961 /* 0x08: Flow Control: 1: Symmetric/on, 0: None/off */
962 flags_item
= proto_tree_add_item(link_tree
, hf_edp_link_flags
, tvb
, offset
, 1, ENC_NA
);
963 flags_tree
= proto_item_add_subtree(flags_item
, ett_edp_link_flags
);
964 tree_expanded_set(ett_edp_link_flags
, true);
965 proto_tree_add_item(flags_tree
, hf_edp_link_flags_autoneg
, tvb
, offset
, 1, ENC_NA
);
966 proto_tree_add_item(flags_tree
, hf_edp_link_flags_flowcontrol
, tvb
, offset
, 1, ENC_NA
);
967 proto_tree_add_item(flags_tree
, hf_edp_link_flags_unknown
, tvb
, offset
, 1, ENC_NA
);
969 proto_tree_add_item(link_tree
, hf_edp_link_conf
, tvb
, offset
+1, 1, ENC_NA
);
970 proto_tree_add_item(link_tree
, hf_edp_link_actual
, tvb
, offset
+2, 1, ENC_NA
);
971 proto_tree_add_item(link_tree
, hf_edp_link_zero
, tvb
, offset
+3, 1, ENC_NA
);
973 proto_tree_add_item(link_tree
, hf_edp_link_unknown
, tvb
, offset
, length
, ENC_NA
);
978 dissect_unknown_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
, proto_tree
*tree
)
980 proto_item
*unknown_item
;
981 proto_tree
*unknown_tree
;
984 tlv_type
= tvb_get_uint8(tvb
, offset
+ 1);
986 unknown_item
= proto_tree_add_protocol_format(tree
, hf_edp_unknown
,
987 tvb
, offset
, length
, "Unknown element [0x%02x]", tlv_type
);
989 unknown_tree
= proto_item_add_subtree(unknown_item
, ett_edp_unknown
);
991 dissect_tlv_header(tvb
, pinfo
, offset
, 4, unknown_tree
);
995 proto_tree_add_item(unknown_tree
, hf_edp_unknown_data
, tvb
, offset
, length
,
1000 dissect_edp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1003 proto_tree
*edp_tree
;
1004 uint32_t offset
= 0;
1007 uint16_t tlv_length
;
1008 uint16_t data_length
;
1012 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, PROTO_SHORT_NAME
);
1013 col_set_str(pinfo
->cinfo
, COL_INFO
, PROTO_SHORT_NAME
":");
1015 ti
= proto_tree_add_item(tree
, proto_edp
, tvb
, offset
, -1,
1017 edp_tree
= proto_item_add_subtree(ti
, ett_edp
);
1019 proto_tree_add_item(edp_tree
, hf_edp_version
, tvb
, offset
, 1,
1023 proto_tree_add_item(edp_tree
, hf_edp_reserved
, tvb
, offset
, 1,
1027 data_length
= tvb_get_ntohs(tvb
, offset
);
1028 proto_tree_add_uint(edp_tree
, hf_edp_length
, tvb
, offset
, 2,
1033 * If we have the entire ESP packet available, check the checksum.
1035 if (tvb_captured_length(tvb
) >= data_length
) {
1036 /* Checksum from version to null tlv */
1037 SET_CKSUM_VEC_TVB(cksum_vec
[0], tvb
, 0, data_length
);
1039 proto_tree_add_checksum(edp_tree
, tvb
, offset
, hf_edp_checksum
, hf_edp_checksum_status
, &ei_edp_checksum
, pinfo
, in_cksum(&cksum_vec
[0], 1),
1040 ENC_BIG_ENDIAN
, PROTO_CHECKSUM_VERIFY
|PROTO_CHECKSUM_IN_CKSUM
);
1042 proto_tree_add_checksum(edp_tree
, tvb
, offset
, hf_edp_checksum
, hf_edp_checksum_status
, &ei_edp_checksum
, pinfo
, 0, ENC_BIG_ENDIAN
, PROTO_CHECKSUM_NO_FLAGS
);
1046 seqno
= tvb_get_ntohs(tvb
, offset
);
1047 proto_tree_add_item(edp_tree
, hf_edp_seqno
, tvb
, offset
, 2,
1051 /* Machine ID is 8 bytes, if it starts with 0000, the remaining
1052 6 bytes are a MAC */
1053 proto_tree_add_item(edp_tree
, hf_edp_midtype
, tvb
, offset
, 2,
1057 proto_tree_add_item(edp_tree
, hf_edp_midmac
, tvb
, offset
, 6,
1061 /* Decode the individual TLVs */
1062 while (offset
< data_length
&& !last
) {
1063 if (data_length
- offset
< 4) {
1064 proto_tree_add_expert_format(edp_tree
, pinfo
, &ei_edp_short_tlv
, tvb
, offset
, 4,
1065 "Too few bytes left for TLV: %u (< 4)",
1066 data_length
- offset
);
1069 tlv_type
= tvb_get_uint8(tvb
, offset
+ 1);
1070 tlv_length
= tvb_get_ntohs(tvb
, offset
+ 2);
1072 if ((tlv_length
< 4) || (tlv_length
> (data_length
- offset
))) {
1073 proto_tree_add_expert_format(edp_tree
, pinfo
, &ei_edp_short_tlv
, tvb
, offset
, 0,
1074 "TLV with invalid length: %u", tlv_length
);
1077 if (tlv_type
!= EDP_TYPE_NULL
)
1078 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " %s",
1079 val_to_str(tlv_type
, edp_type_vals
, "[0x%02x]"));
1082 case EDP_TYPE_NULL
: /* Last TLV */
1083 dissect_null_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1086 case EDP_TYPE_DISPLAY
: /* MIB II display string */
1087 dissect_display_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1089 case EDP_TYPE_INFO
: /* Basic system information */
1090 dissect_info_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1092 case EDP_TYPE_VLAN
: /* VLAN info */
1093 dissect_vlan_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1095 case EDP_TYPE_ESRP
: /* Extreme Standby Router Protocol */
1096 dissect_esrp_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1098 case EDP_TYPE_EAPS
: /* Ethernet Automatic Protection Switching */
1099 dissect_eaps_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1101 case EDP_TYPE_ESL
: /* EAPS shared link */
1102 dissect_esl_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1104 case EDP_TYPE_ELSM
: /* Extreme Link Status Monitoring */
1105 dissect_elsm_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
, seqno
);
1107 case EDP_TYPE_ELRP
: /* Extreme Loop Recognition Protocol */
1108 dissect_elrp_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1110 case EDP_TYPE_LINK
: /* Extreme Link Properties */
1111 dissect_link_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1114 dissect_unknown_tlv(tvb
, pinfo
, offset
, tlv_length
, edp_tree
);
1117 offset
+= tlv_length
;
1120 return tvb_captured_length(tvb
);
1124 proto_register_edp(void)
1126 static hf_register_info hf
[] = {
1130 { "Version", "edp.version", FT_UINT8
, BASE_DEC
, NULL
,
1131 0x0, NULL
, HFILL
}},
1134 { "Reserved", "edp.reserved", FT_UINT8
, BASE_DEC
, NULL
,
1135 0x0, NULL
, HFILL
}},
1138 { "Data length", "edp.length", FT_UINT16
, BASE_DEC
, NULL
,
1139 0x0, NULL
, HFILL
}},
1142 { "EDP checksum", "edp.checksum", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1145 { &hf_edp_checksum_status
,
1146 { "EDP checksum status", "edp.checksum.status", FT_UINT8
, BASE_NONE
, VALS(proto_checksum_vals
), 0x0,
1150 { "Sequence number", "edp.seqno", FT_UINT16
, BASE_DEC
, NULL
,
1151 0x0, NULL
, HFILL
}},
1154 { "Machine ID type", "edp.midtype", FT_UINT16
, BASE_DEC
, VALS(edp_midtype_vals
),
1155 0x0, NULL
, HFILL
}},
1158 { "Machine MAC", "edp.midmac", FT_ETHER
, BASE_NONE
, NULL
,
1159 0x0, NULL
, HFILL
}},
1162 { &hf_edp_tlv_marker
,
1163 { "TLV Marker", "edp.tlv.marker", FT_UINT8
, BASE_HEX
, NULL
,
1164 0x0, NULL
, HFILL
}},
1167 { "TLV type", "edp.tlv.type", FT_UINT8
, BASE_DEC
, VALS(edp_type_vals
),
1168 0x0, NULL
, HFILL
}},
1170 { &hf_edp_tlv_length
,
1171 { "TLV length", "edp.tlv.length", FT_UINT16
, BASE_DEC
, NULL
,
1172 0x0, NULL
, HFILL
}},
1174 /* Display element */
1176 { "Display", "edp.display", FT_PROTOCOL
, BASE_NONE
, NULL
,
1177 0x0, "Display element", HFILL
}},
1179 { &hf_edp_display_string
,
1180 { "Name", "edp.display.string", FT_STRING
, BASE_NONE
, NULL
,
1181 0x0, "MIB II display string", HFILL
}},
1185 { "Info", "edp.info", FT_PROTOCOL
, BASE_NONE
, NULL
,
1186 0x0, "Info element", HFILL
}},
1188 { &hf_edp_info_slot
,
1189 { "Slot", "edp.info.slot", FT_UINT16
, BASE_DEC
, NULL
,
1190 0x0, "Originating slot #", HFILL
}},
1192 { &hf_edp_info_port
,
1193 { "Port", "edp.info.port", FT_UINT16
, BASE_DEC
, NULL
,
1194 0x0, "Originating port #", HFILL
}},
1196 { &hf_edp_info_vchassid
,
1197 { "Virt chassis", "edp.info.vchassid", FT_UINT16
, BASE_DEC
, NULL
,
1198 0x0, "Virtual chassis ID", HFILL
}},
1200 { &hf_edp_info_reserved
,
1201 { "Reserved", "edp.info.reserved", FT_BYTES
, BASE_NONE
, NULL
,
1202 0x0, NULL
, HFILL
}},
1204 { &hf_edp_info_version
,
1205 { "Version", "edp.info.version", FT_UINT32
, BASE_HEX
, NULL
,
1206 0x0, "Software version", HFILL
}},
1208 { &hf_edp_info_version_major1
,
1209 { "Version (major1)", "edp.info.version.major1", FT_UINT8
, BASE_DEC
, NULL
,
1210 0x0, "Software version (major1)", HFILL
}},
1212 { &hf_edp_info_version_major2
,
1213 { "Version (major2)", "edp.info.version.major2", FT_UINT8
, BASE_DEC
, NULL
,
1214 0x0, "Software version (major2)", HFILL
}},
1216 { &hf_edp_info_version_sustaining
,
1217 { "Version (sustaining)", "edp.info.version.sustaining", FT_UINT8
, BASE_DEC
, NULL
,
1218 0x0, "Software version (sustaining)", HFILL
}},
1220 { &hf_edp_info_version_internal
,
1221 { "Version (internal)", "edp.info.version.internal", FT_UINT8
, BASE_DEC
, NULL
,
1222 0x0, "Software version (internal)", HFILL
}},
1224 { &hf_edp_info_vchassconn
,
1225 { "Connections", "edp.info.vchassconn", FT_BYTES
, BASE_NONE
, NULL
,
1226 0x0, "Virtual chassis connections", HFILL
}},
1230 { "Vlan", "edp.vlan", FT_PROTOCOL
, BASE_NONE
, NULL
,
1231 0x0, "Vlan element", HFILL
}},
1233 { &hf_edp_vlan_flags
,
1234 { "Flags", "edp.vlan.flags", FT_UINT8
, BASE_HEX
, NULL
,
1235 0x0, NULL
, HFILL
}},
1237 { &hf_edp_vlan_flags_ip
,
1238 { "Flags-IP", "edp.vlan.flags.ip", FT_BOOLEAN
, 8, TFS(&tfs_set_notset
),
1239 0x80, "Vlan has IP address configured", HFILL
}},
1241 { &hf_edp_vlan_flags_reserved
,
1242 { "Flags-reserved", "edp.vlan.flags.reserved", FT_UINT8
, BASE_HEX
, NULL
,
1243 0x7e, NULL
, HFILL
}},
1245 { &hf_edp_vlan_flags_unknown
,
1246 { "Flags-Unknown", "edp.vlan.flags.unknown", FT_BOOLEAN
, 8, TFS(&tfs_set_notset
),
1247 0x01, NULL
, HFILL
}},
1249 { &hf_edp_vlan_reserved1
,
1250 { "Reserved1", "edp.vlan.reserved1", FT_BYTES
, BASE_NONE
, NULL
,
1251 0x0, NULL
, HFILL
}},
1254 { "Vlan ID", "edp.vlan.id", FT_UINT16
, BASE_DEC
, NULL
,
1255 0x0, NULL
, HFILL
}},
1257 { &hf_edp_vlan_reserved2
,
1258 { "Reserved2", "edp.vlan.reserved2", FT_BYTES
, BASE_NONE
, NULL
,
1259 0x0, NULL
, HFILL
}},
1262 { "IP addr", "edp.vlan.ip", FT_IPv4
, BASE_NONE
, NULL
,
1263 0x0, "VLAN IP address", HFILL
}},
1265 { &hf_edp_vlan_name
,
1266 { "Name", "edp.vlan.name", FT_STRING
, BASE_NONE
, NULL
,
1267 0x0, "VLAN name", HFILL
}},
1271 { "ESRP", "edp.esrp", FT_PROTOCOL
, BASE_NONE
, NULL
,
1272 0x0, "Extreme Standby Router Protocol element", HFILL
}},
1274 { &hf_edp_esrp_proto
,
1275 { "Protocol", "edp.esrp.proto", FT_UINT8
, BASE_DEC
, VALS(esrp_proto_vals
),
1276 0x0, NULL
, HFILL
}},
1278 { &hf_edp_esrp_group
,
1279 { "Group", "edp.esrp.group", FT_UINT8
, BASE_DEC
, NULL
,
1280 0x0, NULL
, HFILL
}},
1282 { &hf_edp_esrp_prio
,
1283 { "Prio", "edp.esrp.prio", FT_UINT16
, BASE_DEC
, NULL
,
1284 0x0, NULL
, HFILL
}},
1286 { &hf_edp_esrp_state
,
1287 { "State", "edp.esrp.state", FT_UINT16
, BASE_DEC
, VALS(esrp_state_vals
),
1288 0x0, NULL
, HFILL
}},
1290 { &hf_edp_esrp_ports
,
1291 { "Ports", "edp.esrp.ports", FT_UINT16
, BASE_DEC
, NULL
,
1292 0x0, "Number of active ports", HFILL
}},
1294 { &hf_edp_esrp_virtip
,
1295 { "VirtIP", "edp.esrp.virtip", FT_IPv4
, BASE_NONE
, NULL
,
1296 0x0, "Virtual IP address", HFILL
}},
1298 { &hf_edp_esrp_sysmac
,
1299 { "Sys MAC", "edp.esrp.sysmac", FT_ETHER
, BASE_NONE
, NULL
,
1300 0x0, "System MAC address", HFILL
}},
1302 { &hf_edp_esrp_hello
,
1303 { "Hello", "edp.esrp.hello", FT_UINT16
, BASE_DEC
, NULL
,
1304 0x0, "Hello timer", HFILL
}},
1306 { &hf_edp_esrp_reserved
,
1307 { "Reserved", "edp.esrp.reserved", FT_BYTES
, BASE_NONE
, NULL
,
1308 0x0, NULL
, HFILL
}},
1312 { "EAPS", "edp.eaps", FT_PROTOCOL
, BASE_NONE
, NULL
,
1313 0x0, "Ethernet Automatic Protection Switching element", HFILL
}},
1316 { "Version", "edp.eaps.ver", FT_UINT8
, BASE_DEC
, NULL
,
1317 0x0, NULL
, HFILL
}},
1319 { &hf_edp_eaps_type
,
1320 { "Type", "edp.eaps.type", FT_UINT8
, BASE_DEC
, VALS(eaps_type_vals
),
1321 0x0, NULL
, HFILL
}},
1323 { &hf_edp_eaps_ctrlvlanid
,
1324 { "Vlan ID", "edp.eaps.vlanid", FT_UINT16
, BASE_DEC
, NULL
,
1325 0x0, "Control Vlan ID", HFILL
}},
1327 { &hf_edp_eaps_reserved0
,
1328 { "Reserved0", "edp.eaps.reserved0", FT_BYTES
, BASE_NONE
, NULL
,
1329 0x0, NULL
, HFILL
}},
1331 { &hf_edp_eaps_sysmac
,
1332 { "Sys MAC", "edp.eaps.sysmac", FT_ETHER
, BASE_NONE
, NULL
,
1333 0x0, "System MAC address", HFILL
}},
1335 { &hf_edp_eaps_hello
,
1336 { "Hello", "edp.eaps.hello", FT_UINT16
, BASE_DEC
, NULL
,
1337 0x0, "Hello timer", HFILL
}},
1339 { &hf_edp_eaps_fail
,
1340 { "Fail", "edp.eaps.fail", FT_UINT16
, BASE_DEC
, NULL
,
1341 0x0, "Fail timer", HFILL
}},
1343 { &hf_edp_eaps_state
,
1344 { "State", "edp.eaps.state", FT_UINT8
, BASE_DEC
, VALS(eaps_state_vals
),
1345 0x0, NULL
, HFILL
}},
1347 { &hf_edp_eaps_reserved1
,
1348 { "Reserved1", "edp.eaps.reserved1", FT_BYTES
, BASE_NONE
, NULL
,
1349 0x0, NULL
, HFILL
}},
1351 { &hf_edp_eaps_helloseq
,
1352 { "Helloseq", "edp.eaps.helloseq", FT_UINT16
, BASE_DEC
, NULL
,
1353 0x0, "Hello sequence", HFILL
}},
1355 { &hf_edp_eaps_reserved2
,
1356 { "Reserved2", "edp.eaps.reserved2", FT_BYTES
, BASE_NONE
, NULL
,
1357 0x0, NULL
, HFILL
}},
1359 /* ESL element (EAPS shared link) */
1361 { "ESL", "edp.esl", FT_PROTOCOL
, BASE_NONE
, NULL
,
1362 0x0, "EAPS shared link", HFILL
}},
1365 { "Version", "edp.esl.ver", FT_UINT8
, BASE_DEC
, NULL
,
1366 0x0, NULL
, HFILL
}},
1369 { "Type", "edp.esl.type", FT_UINT8
, BASE_DEC
, VALS(esl_type_vals
),
1370 0x0, NULL
, HFILL
}},
1372 { &hf_edp_esl_ctrlvlanid
,
1373 { "Vlan ID", "edp.esl.vlanid", FT_UINT16
, BASE_DEC
, NULL
,
1374 0x0, "Control Vlan ID", HFILL
}},
1376 { &hf_edp_esl_reserved0
,
1377 { "Reserved0", "edp.esl.reserved0", FT_BYTES
, BASE_NONE
, NULL
,
1378 0x0, NULL
, HFILL
}},
1380 { &hf_edp_esl_sysmac
,
1381 { "Sys MAC", "edp.esl.sysmac", FT_ETHER
, BASE_NONE
, NULL
,
1382 0x0, "System MAC address", HFILL
}},
1384 { &hf_edp_esl_reserved1
,
1385 { "Reserved1", "edp.esl.reserved1", FT_BYTES
, BASE_NONE
, NULL
,
1386 0x0, NULL
, HFILL
}},
1388 { &hf_edp_esl_state
,
1389 { "State", "edp.esl.state", FT_UINT8
, BASE_DEC
, VALS(esl_state_vals
),
1390 0x0, NULL
, HFILL
}},
1392 { &hf_edp_esl_linkrole
,
1393 { "Role", "edp.esl.role", FT_UINT8
, BASE_DEC
, VALS(esl_role_vals
),
1394 0x0, NULL
, HFILL
}},
1396 { &hf_edp_esl_linkid1
,
1397 { "Link ID 1", "edp.esl.linkid1", FT_UINT16
, BASE_DEC
, NULL
,
1398 0x0, "Shared link ID 1", HFILL
}},
1400 { &hf_edp_esl_failed1
,
1401 { "Failed ID 1", "edp.esl.failed1", FT_UINT16
, BASE_DEC
, NULL
,
1402 0x0, "Failed link ID 1", HFILL
}},
1404 { &hf_edp_esl_failed2
,
1405 { "Failed ID 2", "edp.esl.failed2", FT_UINT16
, BASE_DEC
, NULL
,
1406 0x0, "Failed link ID 2", HFILL
}},
1408 { &hf_edp_esl_reserved4
,
1409 { "Reserved4", "edp.esl.reserved4", FT_BYTES
, BASE_NONE
, NULL
,
1410 0x0, NULL
, HFILL
}},
1412 { &hf_edp_esl_linkid2
,
1413 { "Link ID 2", "edp.esl.linkid2", FT_UINT16
, BASE_DEC
, NULL
,
1414 0x0, "Shared link ID 2", HFILL
}},
1416 { &hf_edp_esl_reserved5
,
1417 { "Reserved5", "edp.esl.reserved5", FT_BYTES
, BASE_NONE
, NULL
,
1418 0x0, NULL
, HFILL
}},
1420 { &hf_edp_esl_numlinks
,
1421 { "Num Shared Links", "edp.esl.numlinks", FT_UINT16
, BASE_DEC
, NULL
,
1422 0x0, "Number of shared links in the network", HFILL
}},
1424 { &hf_edp_esl_linklist
,
1425 { "Link List", "edp.esl.linklist", FT_UINT16
, BASE_DEC
, NULL
,
1426 0x0, "List of Shared Link IDs", HFILL
}},
1429 { "Rest", "edp.esl.rest", FT_BYTES
, BASE_NONE
, NULL
,
1430 0x0, NULL
, HFILL
}},
1434 { "ELSM", "edp.elsm", FT_PROTOCOL
, BASE_NONE
, NULL
,
1435 0x0, "Extreme Link Status Monitoring element", HFILL
}},
1437 { &hf_edp_elsm_type
,
1438 { "Type", "edp.elsm.type", FT_UINT8
, BASE_DEC
, VALS(elsm_type_vals
),
1439 0x0, NULL
, HFILL
}},
1441 { &hf_edp_elsm_subtype
,
1442 { "Subtype", "edp.elsm.subtype", FT_UINT8
, BASE_DEC
, VALS(elsm_subtype_vals
),
1443 0x0, NULL
, HFILL
}},
1445 { &hf_edp_elsm_magic
,
1446 { "Magic", "edp.elsm.unknown", FT_BYTES
, BASE_NONE
, NULL
,
1447 0x0, NULL
, HFILL
}},
1451 { "ELRP", "edp.elrp", FT_PROTOCOL
, BASE_NONE
, NULL
,
1452 0x0, "Extreme Loop Recognition Protocol element", HFILL
}},
1454 { &hf_edp_elrp_unknown
,
1455 { "Unknown", "edp.elrp.unknown", FT_BYTES
, BASE_NONE
, NULL
,
1456 0x0, NULL
, HFILL
}},
1460 { "Link", "edp.link", FT_PROTOCOL
, BASE_NONE
, NULL
,
1461 0x0, "Link properties (physical)", HFILL
}},
1463 { &hf_edp_link_flags
,
1464 { "Flags", "edp.link.flags", FT_UINT8
, BASE_HEX
, NULL
,
1465 0x0, NULL
, HFILL
}},
1467 { &hf_edp_link_flags_autoneg
,
1468 { "Autonegotiation", "edp.link.flags.autoneg", FT_BOOLEAN
, 8, TFS(&tfs_set_notset
),
1469 0x80, NULL
, HFILL
}},
1471 { &hf_edp_link_flags_flowcontrol
,
1472 { "Flow Control", "edp.link.flags.flowcontrol", FT_BOOLEAN
, 8, TFS(&tfs_set_notset
),
1473 0x08, NULL
, HFILL
}},
1475 { &hf_edp_link_flags_unknown
,
1476 { "Unknown", "edp.link.flags.unknown", FT_UINT8
, BASE_HEX
, NULL
,
1477 0x77, NULL
, HFILL
}},
1479 { &hf_edp_link_conf
,
1480 { "Configured Speed", "edp.link.conf", FT_UINT8
, BASE_HEX
, VALS(link_speed_vals
),
1481 0x0, NULL
, HFILL
}},
1483 { &hf_edp_link_actual
,
1484 { "Actual Speed", "edp.link.actual", FT_UINT8
, BASE_HEX
, VALS(link_speed_vals
),
1485 0x0, NULL
, HFILL
}},
1487 { &hf_edp_link_zero
,
1488 { "Zero", "edp.link.zero", FT_UINT8
, BASE_DEC
, NULL
,
1489 0x0, NULL
, HFILL
}},
1491 { &hf_edp_link_unknown
,
1492 { "Unknown", "edp.link.unknown", FT_BYTES
, BASE_NONE
, NULL
,
1493 0x0, NULL
, HFILL
}},
1495 /* Unknown element */
1497 { "Unknown", "edp.unknown", FT_PROTOCOL
, BASE_NONE
, NULL
,
1498 0x0, "Element unknown to Wireshark", HFILL
}},
1500 { &hf_edp_unknown_data
,
1501 { "Unknown", "edp.unknown.data", FT_BYTES
, BASE_NONE
, NULL
,
1502 0x0, NULL
, HFILL
}},
1506 { "End", "edp.null", FT_PROTOCOL
, BASE_NONE
, NULL
,
1507 0x0, "Last element", HFILL
}},
1510 static hf_register_info extreme_hf
[] = {
1511 { &hf_llc_extreme_pid
,
1512 { "PID", "llc.extreme_pid", FT_UINT16
, BASE_HEX
,
1513 VALS(extreme_pid_vals
), 0x0, NULL
, HFILL
}
1517 static int *ett
[] = {
1519 &ett_edp_tlv_header
,
1520 &ett_edp_vlan_flags
,
1523 &ett_edp_info_version
,
1531 &ett_edp_link_flags
,
1536 static ei_register_info ei
[] = {
1537 { &ei_edp_short_tlv
, { "edp.short_tlv", PI_MALFORMED
, PI_ERROR
, "TLV is too short", EXPFILL
}},
1538 { &ei_edp_checksum
, { "edp.bad_checksum", PI_CHECKSUM
, PI_ERROR
, "Bad checksum", EXPFILL
}},
1541 expert_module_t
* expert_edp
;
1543 proto_edp
= proto_register_protocol(PROTO_LONG_NAME
, PROTO_SHORT_NAME
, "edp");
1544 edp_handle
= register_dissector("edp", dissect_edp
, proto_edp
);
1545 proto_register_field_array(proto_edp
, hf
, array_length(hf
));
1546 proto_register_subtree_array(ett
, array_length(ett
));
1547 expert_edp
= expert_register_protocol(proto_edp
);
1548 expert_register_field_array(expert_edp
, ei
, array_length(ei
));
1550 llc_add_oui(OUI_EXTREME
, "llc.extreme_pid", "LLC Extreme OUI PID", extreme_hf
, proto_edp
);
1555 proto_reg_handoff_edp(void)
1557 dissector_add_uint("llc.extreme_pid", 0x00bb, edp_handle
);
1561 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1566 * indent-tabs-mode: t
1569 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1570 * :indentSize=8:tabSize=8:noTabs=false: