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>
52 #include <epan/prefs.h>
54 void proto_reg_handoff_vmlab(void);
56 static int proto_vmlab = -1;
58 static int hf_vmlab_flags_part1 = -1; /* Unknown so far */
59 static int hf_vmlab_flags_fragment = -1;
60 static int hf_vmlab_flags_part2 = -1; /* Unknown so far */
62 static int hf_vmlab_portgroup = -1;
63 static int hf_vmlab_eth_src = -1;
64 static int hf_vmlab_eth_dst = -1;
65 static int hf_vmlab_eth_addr = -1;
66 static int hf_vmlab_etype = -1;
67 static int hf_vmlab_trailer = -1;
69 static gint ett_vmlab = -1;
71 static const value_string fragment_vals[] = {
78 dissect_vmlab(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
81 proto_tree* volatile vmlab_tree;
86 const guint8* src_addr;
87 const guint8* dst_addr;
88 const guint8* eth_addr;
92 volatile guint16 encap_proto;
94 col_set_str(pinfo->cinfo, COL_PROTOCOL, "VMLAB");
95 col_clear(pinfo->cinfo, COL_INFO);
100 ti = proto_tree_add_item(tree, proto_vmlab, tvb, 0, 24, FALSE);
101 vmlab_tree = proto_item_add_subtree(ti, ett_vmlab);
104 attributes = tvb_get_guint8(tvb, offset);
105 proto_tree_add_item(vmlab_tree, hf_vmlab_flags_part1, tvb, offset, 1, FALSE);
106 proto_tree_add_item(vmlab_tree, hf_vmlab_flags_fragment, tvb, offset, 1, FALSE);
107 proto_tree_add_item(vmlab_tree, hf_vmlab_flags_part2, tvb, offset, 1, FALSE);
108 if (attributes & 0x04) {
109 proto_item_append_text(ti, ", Fragment");
114 portgroup = tvb_get_guint8(tvb, offset);
115 proto_tree_add_uint(vmlab_tree, hf_vmlab_portgroup, tvb, offset, 1, portgroup);
116 proto_item_append_text(ti, ", Portgroup: %d", portgroup);
119 /* The next two bytes were always 0x0000 as far as I could tell*/
122 /* Not really clear, what the difference between this and the next MAC address is
123 Both are usually equal*/
124 eth_addr=tvb_get_ptr(tvb, offset, 6);
125 proto_tree_add_ether(vmlab_tree, hf_vmlab_eth_addr, tvb, offset, 6, eth_addr);
128 dst_addr=tvb_get_ptr(tvb, offset, 6);
129 proto_tree_add_ether(vmlab_tree, hf_vmlab_eth_dst, tvb, offset, 6, dst_addr);
133 src_addr=tvb_get_ptr(tvb, offset, 6);
134 proto_tree_add_ether(vmlab_tree, hf_vmlab_eth_src, tvb, offset, 6, src_addr);
137 proto_item_append_text(ti, ", Src: %s (%s), Dst: %s (%s)",
138 get_ether_name(src_addr), ether_to_str(src_addr), get_ether_name(dst_addr), ether_to_str(dst_addr));
140 /*Encapsulated Ethertype is also part of the block*/
141 encap_proto = tvb_get_ntohs(tvb, offset);
145 /* Now call whatever was encapsulated*/
146 ethertype(encap_proto, tvb, offset, pinfo, tree, vmlab_tree, hf_vmlab_etype, hf_vmlab_trailer, 0);
151 proto_register_vmlab(void)
153 static hf_register_info hf[] = {
155 { &hf_vmlab_flags_part1, { "Unknown ", "vmlab.unknown1",
156 FT_UINT8, FT_BOOLEAN, NULL, 0xF8, NULL, HFILL }},
157 { &hf_vmlab_flags_fragment, { "More Fragments", "vmlab.fragment",
158 FT_UINT8, BASE_NONE, VALS(fragment_vals), 0x04, NULL, HFILL }},
159 { &hf_vmlab_flags_part2, { "Unknown ", "vmlab.unknown2",
160 FT_UINT8, FT_BOOLEAN, NULL, 0x03, NULL, HFILL }},
162 { &hf_vmlab_portgroup, { "Portgroup ", "vmlab.pgrp",
163 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
164 { &hf_vmlab_eth_src, { "Source ", "vmlab.src",
165 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
166 { &hf_vmlab_eth_dst, { "Destination ", "vmlab.dst",
167 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
168 { &hf_vmlab_eth_addr, { "Address ", "vmlab.addr",
169 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
170 { &hf_vmlab_etype, { "Encapsulated Type", "vmlab.subtype",
171 FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0, NULL, HFILL }},
172 { &hf_vmlab_trailer, { "Trailer", "vmlab.trailer",
173 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}
175 static gint *ett[] = {
179 module_t *vmlab_module;
181 proto_vmlab = proto_register_protocol("VMware Lab Manager", "VMLAB", "vmlab");
182 proto_register_field_array(proto_vmlab, hf, array_length(hf));
183 proto_register_subtree_array(ett, array_length(ett));
185 vmlab_module = prefs_register_protocol(proto_vmlab, proto_reg_handoff_vmlab);
190 proto_reg_handoff_vmlab(void)
192 static dissector_handle_t vmlab_handle;
194 vmlab_handle = create_dissector_handle(dissect_vmlab, proto_vmlab);
196 dissector_add("ethertype", ETHERTYPE_VMLAB, vmlab_handle);