2 * Routines for VMware Lab Manager Frame Dis-assembly
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 * Apr 4, 2010 - David Aggeler
30 * - Initial version based on packet-vlan.c
32 * VMware Lab Manager is using this encapsulation directly as Ethernet Frames
33 * or inside VLANs. The Ethernet type was originally registered to Akimbi, but VMware
34 * acquired this company in 2006. No public information found, so the decoding here
35 * is an educated guess. Since one of the features of Lab Manager is to separate
36 * VMs with equal host name, IP and MAC Address, I expect the upper layer dissectors
37 * (namely ARP, ICMP, IP, TCP) to create false alerts, since identical configurations
38 * may communicate at the same time. The main goal of this dissector is to be able
39 * to troubleshoot connectivity, preferably pings. It's also a little to understand
40 * as to how host spanning fenced configurations actually talk.
49 #include <epan/addr_resolv.h>
50 #include <epan/packet.h>
51 #include <epan/etypes.h>
53 static int proto_vmlab = -1;
55 static int hf_vmlab_flags_part1 = -1; /* Unknown so far */
56 static int hf_vmlab_flags_fragment = -1;
57 static int hf_vmlab_flags_part2 = -1; /* Unknown so far */
59 static int hf_vmlab_portgroup = -1;
60 static int hf_vmlab_eth_src = -1;
61 static int hf_vmlab_eth_dst = -1;
62 static int hf_vmlab_eth_addr = -1;
63 static int hf_vmlab_etype = -1;
64 static int hf_vmlab_trailer = -1;
66 static gint ett_vmlab = -1;
68 static const value_string fragment_vals[] = {
75 dissect_vmlab(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
78 proto_tree* volatile vmlab_tree;
83 const guint8* src_addr;
84 const guint8* dst_addr;
88 volatile guint16 encap_proto;
90 col_set_str(pinfo->cinfo, COL_PROTOCOL, "VMLAB");
91 col_clear(pinfo->cinfo, COL_INFO);
93 ti = proto_tree_add_item(tree, proto_vmlab, tvb, 0, 24, ENC_NA);
94 vmlab_tree = proto_item_add_subtree(ti, ett_vmlab);
97 attributes = tvb_get_guint8(tvb, offset);
98 proto_tree_add_item(vmlab_tree, hf_vmlab_flags_part1, tvb, offset, 1, ENC_BIG_ENDIAN);
99 proto_tree_add_item(vmlab_tree, hf_vmlab_flags_fragment, tvb, offset, 1, ENC_BIG_ENDIAN);
100 proto_tree_add_item(vmlab_tree, hf_vmlab_flags_part2, tvb, offset, 1, ENC_BIG_ENDIAN);
101 if (attributes & 0x04) {
102 proto_item_append_text(ti, ", Fragment");
107 portgroup = tvb_get_guint8(tvb, offset);
108 proto_tree_add_uint(vmlab_tree, hf_vmlab_portgroup, tvb, offset, 1, portgroup);
109 proto_item_append_text(ti, ", Portgroup: %d", portgroup);
112 /* The next two bytes were always 0x0000 as far as I could tell*/
115 /* Not really clear, what the difference between this and the next MAC address is
116 Both are usually equal*/
117 proto_tree_add_item(vmlab_tree, hf_vmlab_eth_addr, tvb, offset, 6, ENC_NA);
120 dst_addr=tvb_get_ptr(tvb, offset, 6);
121 proto_tree_add_item(vmlab_tree, hf_vmlab_eth_dst, tvb, offset, 6, ENC_NA);
125 src_addr=tvb_get_ptr(tvb, offset, 6);
126 proto_tree_add_item(vmlab_tree, hf_vmlab_eth_src, tvb, offset, 6, ENC_NA);
129 proto_item_append_text(ti, ", Src: %s (%s), Dst: %s (%s)",
130 get_ether_name(src_addr), ether_to_str(src_addr), get_ether_name(dst_addr), ether_to_str(dst_addr));
132 /* Encapsulated Ethertype is also part of the block*/
133 encap_proto = tvb_get_ntohs(tvb, offset);
136 /* Now call whatever was encapsulated*/
137 ethertype(encap_proto, tvb, offset, pinfo, tree, vmlab_tree, hf_vmlab_etype, hf_vmlab_trailer, 0);
142 proto_register_vmlab(void)
144 static hf_register_info hf[] = {
146 { &hf_vmlab_flags_part1, { "Unknown", "vmlab.unknown1",
147 FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL }},
148 { &hf_vmlab_flags_fragment, { "More Fragments", "vmlab.fragment",
149 FT_UINT8, BASE_NONE, VALS(fragment_vals), 0x04, NULL, HFILL }},
150 { &hf_vmlab_flags_part2, { "Unknown", "vmlab.unknown2",
151 FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }},
153 { &hf_vmlab_portgroup, { "Portgroup", "vmlab.pgrp",
154 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
155 { &hf_vmlab_eth_src, { "Source", "vmlab.src",
156 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
157 { &hf_vmlab_eth_dst, { "Destination", "vmlab.dst",
158 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
159 { &hf_vmlab_eth_addr, { "Address", "vmlab.addr",
160 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
161 { &hf_vmlab_etype, { "Encapsulated Type", "vmlab.subtype",
162 FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0, NULL, HFILL }},
163 { &hf_vmlab_trailer, { "Trailer", "vmlab.trailer",
164 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}
166 static gint *ett[] = {
170 proto_vmlab = proto_register_protocol("VMware Lab Manager", "VMLAB", "vmlab");
171 proto_register_field_array(proto_vmlab, hf, array_length(hf));
172 proto_register_subtree_array(ett, array_length(ett));
176 proto_reg_handoff_vmlab(void)
178 dissector_handle_t vmlab_handle;
180 vmlab_handle = create_dissector_handle(dissect_vmlab, proto_vmlab);
182 dissector_add_uint("ethertype", ETHERTYPE_VMLAB, vmlab_handle);