|
1 Patch origin: in-house |
|
2 Patch status: Will be sent to upstream. |
|
3 |
|
4 Oracle Solaris ECP/VDP dissection based on IEEE 802.1Qbg Draft 2.1. |
|
5 |
1 Index: epan/oui.h |
6 Index: epan/oui.h |
2 =================================================================== |
7 =================================================================== |
3 --- epan/oui.h (revision 41973) |
8 --- epan/oui.h (revision 41973) |
4 +++ epan/oui.h (working copy) |
9 +++ epan/oui.h (working copy) |
5 @@ -47,6 +47,7 @@ |
10 @@ -45,6 +45,7 @@ |
6 #define OUI_ERICSSON 0x0001EC /* Ericsson Group */ |
11 #define OUI_ERICSSON 0x0001EC /* Ericsson Group */ |
7 #define OUI_CATENA 0x00025A /* Catena Networks */ |
12 #define OUI_CATENA 0x00025A /* Catena Networks */ |
8 #define OUI_ATHEROS 0x00037F /* Atheros Communications */ |
13 #define OUI_ATHEROS 0x00037F /* Atheros Communications */ |
9 +#define OUI_ORACLE 0x0003BA /* Oracle */ |
14 +#define OUI_ORACLE 0x0003BA /* Oracle */ |
10 #define OUI_SONY_ERICSSON 0x000AD9 /* Sony Ericsson Mobile Communications AB */ |
15 #define OUI_SONY_ERICSSON 0x000AD9 /* Sony Ericsson Mobile Communications AB */ |
12 #define OUI_PROFINET 0x000ECF /* PROFIBUS Nutzerorganisation e.V. */ |
17 #define OUI_PROFINET 0x000ECF /* PROFIBUS Nutzerorganisation e.V. */ |
13 Index: epan/etypes.h |
18 Index: epan/etypes.h |
14 =================================================================== |
19 =================================================================== |
15 --- epan/etypes.h (revision 41973) |
20 --- epan/etypes.h (revision 41973) |
16 +++ epan/etypes.h (working copy) |
21 +++ epan/etypes.h (working copy) |
17 @@ -514,6 +514,10 @@ |
22 @@ -526,6 +526,10 @@ |
18 #define ETHERTYPE_HSR 0x892F /* High-availability Seamless Redundancy (IEC62439 Part 3) */ |
23 #define ETHERTYPE_HSR 0x892F /* High-availability Seamless Redundancy (IEC62439 Part 3) */ |
19 #endif |
24 #endif |
20 |
25 |
21 +#ifndef ETHERTYPE_ECP |
26 +#ifndef ETHERTYPE_ECP |
22 +#define ETHERTYPE_ECP 0x8940 /* Edge Control Protocol */ |
27 +#define ETHERTYPE_ECP 0x8940 /* Edge Control Protocol */ |
27 #endif |
32 #endif |
28 Index: epan/dissectors/packet-ecp.c |
33 Index: epan/dissectors/packet-ecp.c |
29 =================================================================== |
34 =================================================================== |
30 --- epan/dissectors/packet-ecp.c (revision 0) |
35 --- epan/dissectors/packet-ecp.c (revision 0) |
31 +++ epan/dissectors/packet-ecp.c (revision 0) |
36 +++ epan/dissectors/packet-ecp.c (revision 0) |
32 @@ -0,0 +1,616 @@ |
37 @@ -0,0 +1,619 @@ |
33 +/* packet-ecp.c |
38 +/* packet-ecp.c |
34 + * Routines for Solaris ECP/VDP dissection based on IEEE 802.1Qbg Draft 2.1 |
39 + * Routines for Solaris ECP/VDP dissection based on IEEE 802.1Qbg Draft 2.1 |
35 + * |
40 + * |
36 + * Wireshark - Network traffic analyzer |
41 + * Wireshark - Network traffic analyzer |
37 + * By Gerald Combs <[email protected]> |
42 + * By Gerald Combs <[email protected]> |
68 +static int hf_ecp_seqno = -1; |
73 +static int hf_ecp_seqno = -1; |
69 + |
74 + |
70 +static int proto_vdp = -1; |
75 +static int proto_vdp = -1; |
71 +static int hf_vdp_tlv_type = -1; |
76 +static int hf_vdp_tlv_type = -1; |
72 +static int hf_vdp_tlv_len = -1; |
77 +static int hf_vdp_tlv_len = -1; |
|
78 +static int hf_vdp_tlv_len_invalid = -1; |
73 +static int hf_vdp_tlv_assoc_reason = -1; |
79 +static int hf_vdp_tlv_assoc_reason = -1; |
74 +static int hf_vdp_tlv_org_oui = -1; |
80 +static int hf_vdp_tlv_org_oui = -1; |
75 +static int hf_vdp_vsitypeid = -1; |
81 +static int hf_vdp_vsitypeid = -1; |
76 +static int hf_vdp_vsiversion = -1; |
82 +static int hf_vdp_vsiversion = -1; |
77 +static int hf_vdp_vsiid_format = -1; |
83 +static int hf_vdp_vsiid_format = -1; |
200 + { VDP_FILTER_MACVID, "MAC/VID" }, |
206 + { VDP_FILTER_MACVID, "MAC/VID" }, |
201 + { VDP_FILTER_GRPVID, "GroupID/VID" }, |
207 + { VDP_FILTER_GRPVID, "GroupID/VID" }, |
202 + { VDP_FILTER_GRPMACVID, "GroupID/MAC/VID" }, |
208 + { VDP_FILTER_GRPMACVID, "GroupID/MAC/VID" }, |
203 + { 0x0, NULL } |
209 + { 0x0, NULL } |
204 +}; |
210 +}; |
|
211 + |
|
212 +static const true_false_string tfs_tlv_len_invalid = { |
|
213 + "", |
|
214 + "" |
|
215 +}; |
|
216 + |
205 + |
217 + |
206 +static void |
218 +static void |
207 +vdp_add_vidstr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, proto_item *ti) |
219 +vdp_add_vidstr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, proto_item *ti) |
208 +{ |
220 +{ |
209 + guint16 val; |
221 + guint16 val; |
302 + proto_tree_add_item(vdp_tlv_assoc_tree, |
314 + proto_tree_add_item(vdp_tlv_assoc_tree, |
303 + hf_vdp_vsiid_format, tvb, offset, 1, ENC_BIG_ENDIAN); |
315 + hf_vdp_vsiid_format, tvb, offset, 1, ENC_BIG_ENDIAN); |
304 + offset++; |
316 + offset++; |
305 + |
317 + |
306 + /* VSIID */ |
318 + /* VSIID */ |
307 + str = tvb_bytes_to_str_punct(tvb, offset, 16, ':'); |
319 + str = tvb_bytes_to_ep_str_punct(tvb, offset, 16, ':'); |
308 + proto_tree_add_text(vdp_tlv_assoc_tree, tvb, offset, 16, |
320 + proto_tree_add_text(vdp_tlv_assoc_tree, tvb, offset, 16, |
309 + "VSIID: %s", str); |
321 + "VSIID: %s", str); |
310 + offset += 16; |
322 + offset += 16; |
311 + |
323 + |
312 + /* Filter Format */ |
324 + /* Filter Format */ |
354 + |
366 + |
355 + tlvhdr = tvb_get_ntohs(tvb, offset); |
367 + tlvhdr = tvb_get_ntohs(tvb, offset); |
356 + tlvlen = TLV_INFO_LEN(tlvhdr); |
368 + tlvlen = TLV_INFO_LEN(tlvhdr); |
357 + if (tlvlen != 16) { |
369 + if (tlvlen != 16) { |
358 + if (tree) { |
370 + if (tree) { |
359 + proto_tree_add_text(vdp_tlv_mgrid_tree, tvb, offset, 2, |
371 + proto_tree_add_boolean(vdp_tlv_mgrid_tree, hf_vdp_tlv_len_invalid, tvb, offset, 2, tlvlen); |
360 + "%s Invalid Length: %u", |
|
361 + decode_boolean_bitfield(tlvlen, TLV_INFO_LEN_MASK, |
|
362 + 16, "", ""), tlvlen); |
|
363 + } |
372 + } |
364 + return -1; |
373 + return -1; |
365 + } |
374 + } |
366 + offset += 2; |
375 + offset += 2; |
367 + |
376 + |
397 + /* TLV header */ |
406 + /* TLV header */ |
398 + tlvhdr = tvb_get_ntohs(tvb, offset); |
407 + tlvhdr = tvb_get_ntohs(tvb, offset); |
399 + tlvlen = TLV_INFO_LEN(tlvhdr); |
408 + tlvlen = TLV_INFO_LEN(tlvhdr); |
400 + if (tlvlen < 3) { |
409 + if (tlvlen < 3) { |
401 + if (tree) { |
410 + if (tree) { |
402 + proto_tree_add_text(tree, tvb, offset, 2, |
411 + proto_tree_add_boolean(tree, hf_vdp_tlv_len_invalid, tvb, offset, 2, tlvlen); |
403 + "%s Invalid Length: %u", |
|
404 + decode_boolean_bitfield(tlvlen, TLV_INFO_LEN_MASK, |
|
405 + 16, "", ""), tlvlen); |
|
406 + } |
412 + } |
407 + return -1; |
413 + return -1; |
408 + } |
414 + } |
409 + offset += 2; |
415 + offset += 2; |
410 + |
416 + |
502 + /* Version/OP/Subtype */ |
508 + /* Version/OP/Subtype */ |
503 + hdr = tvb_get_ntohs(tvb, offset); |
509 + hdr = tvb_get_ntohs(tvb, offset); |
504 + ver = ECP_VERSION(hdr); |
510 + ver = ECP_VERSION(hdr); |
505 + op = ECP_OP(hdr); |
511 + op = ECP_OP(hdr); |
506 + subtype = ECP_SUBTYPE(hdr); |
512 + subtype = ECP_SUBTYPE(hdr); |
507 + if (check_col(pinfo->cinfo, COL_INFO)) { |
513 + col_append_fstr(pinfo->cinfo, COL_INFO, |
508 + col_append_fstr(pinfo->cinfo, COL_INFO, |
514 + "PDU Version = %x OP = %x" |
509 + "PDU Version = %x OP = %x" |
515 + " Subtype = %x", ver, op, subtype); |
510 + " Subtype = %x", ver, op, subtype); |
516 + |
511 + } |
|
512 + if (tree) { |
517 + if (tree) { |
513 + /* details */ |
518 + /* details */ |
514 + ti = proto_tree_add_item(tree, proto_ecp, tvb, 0, -1, ENC_NA); |
519 + ti = proto_tree_add_item(tree, proto_ecp, tvb, 0, -1, ENC_NA); |
515 + ecp_tree = proto_item_add_subtree(ti, ett_ecp); |
520 + ecp_tree = proto_item_add_subtree(ti, ett_ecp); |
516 + |
521 + |
570 + { "VDP TLV Type", "vdp.tlvtype", FT_UINT16, BASE_DEC, |
575 + { "VDP TLV Type", "vdp.tlvtype", FT_UINT16, BASE_DEC, |
571 + VALS(vdp_tlv_type_vals), TLV_TYPE_MASK, NULL, HFILL }}, |
576 + VALS(vdp_tlv_type_vals), TLV_TYPE_MASK, NULL, HFILL }}, |
572 + { &hf_vdp_tlv_len, |
577 + { &hf_vdp_tlv_len, |
573 + { "VDP TLV Length", "vdp.tlvlen", FT_UINT16, BASE_DEC, |
578 + { "VDP TLV Length", "vdp.tlvlen", FT_UINT16, BASE_DEC, |
574 + NULL, TLV_INFO_LEN_MASK, NULL, HFILL }}, |
579 + NULL, TLV_INFO_LEN_MASK, NULL, HFILL }}, |
575 + |
580 + { &hf_vdp_tlv_len_invalid, |
|
581 + { "VDP TLV Invalid Length", "vdp.tlvlen_invalid", FT_BOOLEAN, |
|
582 + 16, TFS(&tfs_tlv_len_invalid), TLV_INFO_LEN_MASK, |
|
583 + NULL, HFILL}}, |
576 + { &hf_vdp_tlv_assoc_reason, |
584 + { &hf_vdp_tlv_assoc_reason, |
577 + { "Reason/Status", "vdp.assoc.reason", FT_UINT8, BASE_HEX, |
585 + { "Reason/Status", "vdp.assoc.reason", FT_UINT8, BASE_HEX, |
578 + NULL, 0x0, NULL, HFILL }}, |
586 + NULL, 0x0, NULL, HFILL }}, |
579 + { &hf_vdp_tlv_org_oui, |
587 + { &hf_vdp_tlv_org_oui, |
580 + { "Org OUI", "vdp.org.oui", FT_UINT24, BASE_HEX, |
588 + { "Org OUI", "vdp.org.oui", FT_UINT24, BASE_HEX, |
648 +} |
656 +} |
649 Index: epan/dissectors/Makefile.common |
657 Index: epan/dissectors/Makefile.common |
650 =================================================================== |
658 =================================================================== |
651 --- epan/dissectors/Makefile.common (revision 41973) |
659 --- epan/dissectors/Makefile.common (revision 41973) |
652 +++ epan/dissectors/Makefile.common (working copy) |
660 +++ epan/dissectors/Makefile.common (working copy) |
653 @@ -114,6 +114,7 @@ |
661 @@ -118,6 +118,7 @@ |
654 packet-dop.c \ |
662 packet-dop.c \ |
655 packet-dsp.c \ |
663 packet-dsp.c \ |
656 packet-ess.c \ |
664 packet-ess.c \ |
657 + packet-ecp.c \ |
665 + packet-ecp.c \ |
658 packet-ftam.c \ |
666 packet-ftam.c \ |
659 packet-goose.c \ |
667 packet-goose.c \ |
660 packet-HI2Operations.c \ |
668 packet-HI2Operations.c \ |