11 #define OUI_ERICSSON 0x0001EC /* Ericsson Group */ |
11 #define OUI_ERICSSON 0x0001EC /* Ericsson Group */ |
12 #define OUI_CATENA 0x00025A /* Catena Networks */ |
12 #define OUI_CATENA 0x00025A /* Catena Networks */ |
13 #define OUI_ATHEROS 0x00037F /* Atheros Communications */ |
13 #define OUI_ATHEROS 0x00037F /* Atheros Communications */ |
14 +#define OUI_ORACLE 0x0003BA /* Oracle */ |
14 +#define OUI_ORACLE 0x0003BA /* Oracle */ |
15 #define OUI_SONY_ERICSSON 0x000AD9 /* Sony Ericsson Mobile Communications AB */ |
15 #define OUI_SONY_ERICSSON 0x000AD9 /* Sony Ericsson Mobile Communications AB */ |
|
16 #define OUI_ARUBA 0x000B86 /* Aruba Networks */ |
16 #define OUI_SONY_ERICSSON_2 0x000E07 /* Sony Ericsson Mobile Communications AB */ |
17 #define OUI_SONY_ERICSSON_2 0x000E07 /* Sony Ericsson Mobile Communications AB */ |
17 #define OUI_PROFINET 0x000ECF /* PROFIBUS Nutzerorganisation e.V. */ |
|
18 Index: epan/etypes.h |
18 Index: epan/etypes.h |
19 =================================================================== |
19 =================================================================== |
20 --- epan/etypes.h (revision 41973) |
20 --- epan/etypes.h (revision 41973) |
21 +++ epan/etypes.h (working copy) |
21 +++ epan/etypes.h (working copy) |
22 @@ -526,6 +526,10 @@ |
22 @@ -538,6 +538,10 @@ |
23 #define ETHERTYPE_HSR 0x892F /* High-availability Seamless Redundancy (IEC62439 Part 3) */ |
23 #define ETHERTYPE_HSR 0x892F /* High-availability Seamless Redundancy (IEC62439 Part 3) */ |
24 #endif |
24 #endif |
25 |
25 |
26 +#ifndef ETHERTYPE_ECP |
26 +#ifndef ETHERTYPE_ECP |
27 +#define ETHERTYPE_ECP 0x8940 /* Edge Control Protocol */ |
27 +#define ETHERTYPE_ECP 0x8940 /* Edge Control Protocol */ |
32 #endif |
32 #endif |
33 Index: epan/dissectors/packet-ecp.c |
33 Index: epan/dissectors/packet-ecp.c |
34 =================================================================== |
34 =================================================================== |
35 --- epan/dissectors/packet-ecp.c (revision 0) |
35 --- epan/dissectors/packet-ecp.c (revision 0) |
36 +++ epan/dissectors/packet-ecp.c (revision 0) |
36 +++ epan/dissectors/packet-ecp.c (revision 0) |
37 @@ -0,0 +1,619 @@ |
37 @@ -0,0 +1,624 @@ |
38 +/* packet-ecp.c |
38 +/* packet-ecp.c |
39 + * 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 |
40 + * |
40 + * |
41 + * Wireshark - Network traffic analyzer |
41 + * Wireshark - Network traffic analyzer |
42 + * By Gerald Combs <[email protected]> |
42 + * By Gerald Combs <[email protected]> |
62 +#endif |
62 +#endif |
63 + |
63 + |
64 +#include <stdio.h> |
64 +#include <stdio.h> |
65 +#include <epan/packet.h> |
65 +#include <epan/packet.h> |
66 +#include <epan/etypes.h> |
66 +#include <epan/etypes.h> |
|
67 +#include <epan/to_str.h> |
67 +#include <epan/oui.h> |
68 +#include <epan/oui.h> |
68 + |
69 + |
69 +static int proto_ecp = -1; |
70 +static int proto_ecp = -1; |
70 +static int hf_ecp_version = -1; |
71 +static int hf_ecp_version = -1; |
71 +static int hf_ecp_op = -1; |
72 +static int hf_ecp_op = -1; |
76 +static int hf_vdp_tlv_type = -1; |
77 +static int hf_vdp_tlv_type = -1; |
77 +static int hf_vdp_tlv_len = -1; |
78 +static int hf_vdp_tlv_len = -1; |
78 +static int hf_vdp_tlv_len_invalid = -1; |
79 +static int hf_vdp_tlv_len_invalid = -1; |
79 +static int hf_vdp_tlv_assoc_reason = -1; |
80 +static int hf_vdp_tlv_assoc_reason = -1; |
80 +static int hf_vdp_tlv_org_oui = -1; |
81 +static int hf_vdp_tlv_org_oui = -1; |
|
82 +static int hf_vdp_vidstr = -1; |
81 +static int hf_vdp_vsitypeid = -1; |
83 +static int hf_vdp_vsitypeid = -1; |
82 +static int hf_vdp_vsiversion = -1; |
84 +static int hf_vdp_vsiversion = -1; |
83 +static int hf_vdp_vsiid_format = -1; |
85 +static int hf_vdp_vsiid_format = -1; |
|
86 +static int hf_vdp_vsiid = -1; |
84 +static int hf_vdp_filter_format = -1; |
87 +static int hf_vdp_filter_format = -1; |
85 + |
88 + |
86 +static int hf_oui_oracle_subtype = -1; |
89 +static int hf_oui_oracle_subtype = -1; |
87 +static int hf_oui_oracle_encoding = -1; |
90 +static int hf_oui_oracle_encoding = -1; |
88 + |
91 + |
225 + ps = (val >> 12) & 0x8; |
228 + ps = (val >> 12) & 0x8; |
226 + pcp = (val >> 12) & 0x7; |
229 + pcp = (val >> 12) & 0x7; |
227 + vid = val & 0x0FFF; |
230 + vid = val & 0x0FFF; |
228 + if (tree) { |
231 + if (tree) { |
229 + if (ti == NULL) |
232 + if (ti == NULL) |
230 + proto_tree_add_text(tree, tvb, offset, 2, |
233 + proto_tree_add_bytes_format_value(tree, hf_vdp_vidstr, tvb, offset, 2, NULL, |
231 + "PS %u, PCP %u, VID %u", ps, pcp, vid); |
234 + "PS %u, PCP %u, VID %u", ps, pcp, vid); |
232 + else |
235 + else |
233 + proto_item_append_text(ti, |
236 + proto_item_append_text(ti, |
234 + "PS %u, PCP %u, VID %u", ps, pcp, vid); |
237 + "PS %u, PCP %u, VID %u", ps, pcp, vid); |
235 + } |
238 + } |
245 + guint8 reason, flags; |
248 + guint8 reason, flags; |
246 + gboolean request; |
249 + gboolean request; |
247 + |
250 + |
248 + if (tree) { |
251 + if (tree) { |
249 + if (tlvtype == VDP_TLV_ASSOC) |
252 + if (tlvtype == VDP_TLV_ASSOC) |
250 + ti = proto_tree_add_text(tree, tvb, offset, 2, |
253 + vdp_tlv_assoc_tree = proto_tree_add_subtree(tree, tvb, offset, 2, |
251 + "VDP Associate"); |
254 + ett_vdp_tlv_assoc, &ti, "VDP Associate"); |
252 + else |
255 + else |
253 + ti = proto_tree_add_text(tree, tvb, offset, 2, |
256 + vdp_tlv_assoc_tree = proto_tree_add_subtree(tree, tvb, offset, 2, |
254 + "VDP DeAssociate"); |
257 + ett_vdp_tlv_assoc, &ti, "VDP DeAssociate"); |
255 + vdp_tlv_assoc_tree = proto_item_add_subtree(ti, |
|
256 + ett_vdp_tlv_assoc); |
|
257 + } |
258 + } |
258 + |
259 + |
259 + tlvhdr = tvb_get_ntohs(tvb, offset); |
260 + tlvhdr = tvb_get_ntohs(tvb, offset); |
260 + tlvlen = TLV_INFO_LEN(tlvhdr); |
261 + tlvlen = TLV_INFO_LEN(tlvhdr); |
261 + offset += 2; |
262 + offset += 2; |
314 + proto_tree_add_item(vdp_tlv_assoc_tree, |
315 + proto_tree_add_item(vdp_tlv_assoc_tree, |
315 + hf_vdp_vsiid_format, tvb, offset, 1, ENC_BIG_ENDIAN); |
316 + hf_vdp_vsiid_format, tvb, offset, 1, ENC_BIG_ENDIAN); |
316 + offset++; |
317 + offset++; |
317 + |
318 + |
318 + /* VSIID */ |
319 + /* VSIID */ |
319 + str = tvb_bytes_to_ep_str_punct(tvb, offset, 16, ':'); |
320 + str = tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, 16, ':'); |
320 + proto_tree_add_text(vdp_tlv_assoc_tree, tvb, offset, 16, |
321 + proto_tree_add_string(vdp_tlv_assoc_tree, hf_vdp_vsiid, tvb, offset, 16, |
321 + "VSIID: %s", str); |
322 + str); |
322 + offset += 16; |
323 + offset += 16; |
323 + |
324 + |
324 + /* Filter Format */ |
325 + /* Filter Format */ |
325 + proto_tree_add_item(vdp_tlv_assoc_tree, |
326 + proto_tree_add_item(vdp_tlv_assoc_tree, |
326 + hf_vdp_filter_format, tvb, offset, 1, ENC_BIG_ENDIAN); |
327 + hf_vdp_filter_format, tvb, offset, 1, ENC_BIG_ENDIAN); |
332 + vdp_add_vidstr(tvb, vdp_tlv_assoc_tree, offset, NULL); |
333 + vdp_add_vidstr(tvb, vdp_tlv_assoc_tree, offset, NULL); |
333 + offset += 2; |
334 + offset += 2; |
334 + break; |
335 + break; |
335 + case VDP_FILTER_MACVID: |
336 + case VDP_FILTER_MACVID: |
336 + str = tvb_ether_to_str(tvb, offset); |
337 + str = tvb_ether_to_str(tvb, offset); |
337 + ti = proto_tree_add_text(vdp_tlv_assoc_tree, tvb, |
338 + proto_tree_add_subtree_format(vdp_tlv_assoc_tree, tvb, |
338 + offset, 6, "MAC %s. ", str); |
339 + offset, 6, ett_vdp_tlv_assoc, &ti, "MAC %s. ", str); |
339 + offset += 6; |
340 + offset += 6; |
340 + vdp_add_vidstr(tvb, vdp_tlv_assoc_tree, offset, ti); |
341 + vdp_add_vidstr(tvb, vdp_tlv_assoc_tree, offset, ti); |
341 + offset += 2; |
342 + offset += 2; |
342 + break; |
343 + break; |
343 + } |
344 + } |
356 + guint16 tlvhdr; |
357 + guint16 tlvhdr; |
357 + guint32 tlvlen = 0; |
358 + guint32 tlvlen = 0; |
358 + const char *str; |
359 + const char *str; |
359 + |
360 + |
360 + if (tree) { |
361 + if (tree) { |
361 + ti = proto_tree_add_text(tree, tvb, offset, 2, |
362 + vdp_tlv_mgrid_tree = proto_tree_add_subtree(tree, tvb, offset, 2, |
362 + "%s", "VDP Manager ID"); |
363 + ett_vdp_tlv_mgrid, &ti, "VDP Manager ID"); |
363 + vdp_tlv_mgrid_tree = proto_item_add_subtree(ti, |
|
364 + ett_vdp_tlv_mgrid); |
|
365 + } |
364 + } |
366 + |
365 + |
367 + tlvhdr = tvb_get_ntohs(tvb, offset); |
366 + tlvhdr = tvb_get_ntohs(tvb, offset); |
368 + tlvlen = TLV_INFO_LEN(tlvhdr); |
367 + tlvlen = TLV_INFO_LEN(tlvhdr); |
369 + if (tlvlen != 16) { |
368 + if (tlvlen != 16) { |
426 + subtypestr = val_to_str(subtype, oui_oracle_subtype_vals, |
425 + subtypestr = val_to_str(subtype, oui_oracle_subtype_vals, |
427 + "Unknown subtype 0x%x"); |
426 + "Unknown subtype 0x%x"); |
428 + offset++; |
427 + offset++; |
429 + |
428 + |
430 + if (tree) { |
429 + if (tree) { |
431 + proto_tree_add_text(tree, tvb, offset, 0, "%s - %s", |
430 + proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_vdp_tlv_org, NULL, "%s - %s", |
432 + ouistr, subtypestr); |
431 + ouistr, subtypestr); |
433 + /* XXX create a org tlv tree if neccessary */ |
432 + /* XXX create a org tlv tree if neccessary */ |
434 + } |
433 + } |
435 + switch (subtype) { |
434 + switch (subtype) { |
436 + case OUI_ORACLE_VSIMGR_SUBTYPE: |
435 + case OUI_ORACLE_VSIMGR_SUBTYPE: |
457 + tlvlen = TLV_INFO_LEN(tlvhdr); |
456 + tlvlen = TLV_INFO_LEN(tlvhdr); |
458 + |
457 + |
459 + if (tlvtype == 0) /* XXX most likely it's padding */ |
458 + if (tlvtype == 0) /* XXX most likely it's padding */ |
460 + break; |
459 + break; |
461 + if (tree) { |
460 + if (tree) { |
462 + ti = proto_tree_add_text(tree, tvb, offset, tlvlen + 2, |
461 + vdp_tlv_tree = proto_tree_add_subtree(tree, tvb, offset, |
463 + "VDP TLV"); |
462 + tlvlen + 2, ett_vdp_tlv, &ti, "VDP TLV"); |
464 + vdp_tlv_tree = proto_item_add_subtree(ti, ett_vdp_tlv); |
|
465 + proto_tree_add_item(vdp_tlv_tree, hf_vdp_tlv_type, tvb, |
463 + proto_tree_add_item(vdp_tlv_tree, hf_vdp_tlv_type, tvb, |
466 + offset, 2, ENC_BIG_ENDIAN); |
464 + offset, 2, ENC_BIG_ENDIAN); |
467 + proto_tree_add_item(vdp_tlv_tree, hf_vdp_tlv_len, tvb, |
465 + proto_tree_add_item(vdp_tlv_tree, hf_vdp_tlv_len, tvb, |
468 + offset, 2, ENC_BIG_ENDIAN); |
466 + offset, 2, ENC_BIG_ENDIAN); |
469 + } |
467 + } |
606 + NULL, HFILL}}, |
604 + NULL, HFILL}}, |
607 + { &hf_vdp_filter_format, |
605 + { &hf_vdp_filter_format, |
608 + { "VDP Filter Format ", "vdp.filterformat", FT_UINT8, |
606 + { "VDP Filter Format ", "vdp.filterformat", FT_UINT8, |
609 + BASE_HEX, VALS(vdp_filter_format_vals), 0x0, |
607 + BASE_HEX, VALS(vdp_filter_format_vals), 0x0, |
610 + NULL, HFILL}}, |
608 + NULL, HFILL}}, |
|
609 + { &hf_vdp_vsiid, |
|
610 + { "VSIID", "vdp.VSIID", FT_STRING, BASE_NONE, |
|
611 + NULL, 0x0, NULL, HFILL }}, |
|
612 + { &hf_vdp_vidstr, |
|
613 + { "VIDSTR", "vdp.vidstr", FT_BYTES, BASE_NONE, |
|
614 + NULL, 0x0, NULL, HFILL }}, |
|
615 + |
611 + |
616 + |
612 + }; |
617 + }; |
613 + |
618 + |
614 + static gint *ett[] = { |
619 + static gint *ett[] = { |
615 + &ett_ecp, |
620 + &ett_ecp, |
656 +} |
661 +} |
657 Index: epan/dissectors/Makefile.common |
662 Index: epan/dissectors/Makefile.common |
658 =================================================================== |
663 =================================================================== |
659 --- epan/dissectors/Makefile.common (revision 41973) |
664 --- epan/dissectors/Makefile.common (revision 41973) |
660 +++ epan/dissectors/Makefile.common (working copy) |
665 +++ epan/dissectors/Makefile.common (working copy) |
661 @@ -118,6 +118,7 @@ |
666 @@ -114,6 +114,7 @@ |
662 packet-dop.c \ |
667 packet-dop.c \ |
663 packet-dsp.c \ |
668 packet-dsp.c \ |
664 packet-ess.c \ |
669 packet-ess.c \ |
665 + packet-ecp.c \ |
670 + packet-ecp.c \ |
666 packet-ftam.c \ |
671 packet-ftam.c \ |
667 packet-goose.c \ |
672 packet-goose.c \ |
668 packet-HI2Operations.c \ |
673 packet-gsm_map.c \ |