/src/wireshark/epan/dissectors/packet-msnlb.c
Line | Count | Source |
1 | | /* packet-msnlb.c |
2 | | * Routines for MS NLB dissection |
3 | | * |
4 | | * Wireshark - Network traffic analyzer |
5 | | * By Gerald Combs <gerald@wireshark.org> |
6 | | * Copyright 1998 Gerald Combs |
7 | | * |
8 | | * SPDX-License-Identifier: GPL-2.0-or-later |
9 | | */ |
10 | | |
11 | | #include "config.h" |
12 | | |
13 | | #include <epan/packet.h> |
14 | | #include <epan/etypes.h> |
15 | | #include <epan/to_str.h> |
16 | | #include <epan/tfs.h> |
17 | | #include <wsutil/array.h> |
18 | | #include "packet-smb-common.h" |
19 | | |
20 | | void proto_register_msnlb(void); |
21 | | void proto_reg_handoff_msnlb(void); |
22 | | |
23 | | static dissector_handle_t msnlb_handle; |
24 | | |
25 | | /* Initialize the protocol and registered fields */ |
26 | | static int proto_msnlb; |
27 | | |
28 | | static int hf_msnlb_signature; |
29 | | static int hf_msnlb_version; |
30 | | static int hf_msnlb_uniquehostid; |
31 | | static int hf_msnlb_clusterip; |
32 | | static int hf_msnlb_dedicatedip; |
33 | | static int hf_msnlb_signature_data; |
34 | | |
35 | | static int hf_msnlb_myhostid; |
36 | | static int hf_msnlb_defaulthostid; |
37 | | static int hf_msnlb_convergencestate; |
38 | | static int hf_msnlb_numberofportrules; |
39 | | static int hf_msnlb_uniquehostcode; |
40 | | static int hf_msnlb_packetshandled; |
41 | | static int hf_msnlb_teamingcfg; |
42 | | static int hf_msnlb_teamingcfg_reserved; |
43 | | static int hf_msnlb_teamingcfg_xorclusterip; |
44 | | static int hf_msnlb_teamingcfg_numberofparticipants; |
45 | | static int hf_msnlb_teamingcfg_hashing; |
46 | | static int hf_msnlb_teamingcfg_master; |
47 | | static int hf_msnlb_teamingcfg_active; |
48 | | static int hf_msnlb_reserved; |
49 | | static int hf_msnlb_portruleconfiguration; |
50 | | static int hf_msnlb_portruleconfiguration_data; |
51 | | static int hf_msnlb_currentmap; |
52 | | static int hf_msnlb_currentmap_data; |
53 | | static int hf_msnlb_newmap; |
54 | | static int hf_msnlb_newmap_data; |
55 | | static int hf_msnlb_idlemap; |
56 | | static int hf_msnlb_idlemap_data; |
57 | | static int hf_msnlb_readymap; |
58 | | static int hf_msnlb_readymap_data; |
59 | | static int hf_msnlb_loadweights; |
60 | | static int hf_msnlb_loadweights_data; |
61 | | static int hf_msnlb_reserved2; |
62 | | static int hf_msnlb_reserved2_data; |
63 | | |
64 | | static int hf_msnlb_extended_hb; |
65 | | static int hf_msnlb_extended_hb_type; |
66 | | static int hf_msnlb_length; |
67 | | static int hf_msnlb_address_family; |
68 | | static int hf_msnlb_host_name; |
69 | | static int hf_msnlb_host_ipv4; |
70 | | static int hf_msnlb_host_ipv6; |
71 | | static int hf_msnlb_host_unknown; |
72 | | static int hf_msnlb_padding; |
73 | | static int hf_msnlb_extended_hb_unknown; |
74 | | |
75 | | static int ett_msnlb; |
76 | | static int ett_msnlb_signature; |
77 | | static int ett_msnlb_teamingcfg; |
78 | | static int ett_msnlb_portruleconfiguration; |
79 | | static int ett_msnlb_currentmap; |
80 | | static int ett_msnlb_newmap; |
81 | | static int ett_msnlb_idlemap; |
82 | | static int ett_msnlb_readymap; |
83 | | static int ett_msnlb_loadweights; |
84 | | static int ett_msnlb_reserved; |
85 | | static int ett_msnlb_extended_hb; |
86 | | |
87 | 0 | #define NLB_CLUSTER_MEMBERSHIP_HB 0xC0DE01BF |
88 | 0 | #define NLB_EXTENDED_HB 0xC0DE01C0 |
89 | | #define NLB_RELIABLE_PROTOCOL 0xC0DE01DE |
90 | | |
91 | | static const value_string nlb_signature_vals[] = { |
92 | | { NLB_CLUSTER_MEMBERSHIP_HB, "NLB Cluster Membership HeartBeat" }, |
93 | | { NLB_EXTENDED_HB, "NLB Extended HeartBeat" }, |
94 | | { NLB_RELIABLE_PROTOCOL, "NLB Reliable Protocol" }, |
95 | | { 0, NULL } |
96 | | }; |
97 | | |
98 | | static const value_string nlb_extended_hb_type_vals[] = { |
99 | | { 1, "Host name" }, |
100 | | { 2, "IP Address" }, |
101 | | { 0, NULL } |
102 | | }; |
103 | | |
104 | | static const value_string nlb_address_family_vals[] = { |
105 | | { 0x2, "IPv4" }, |
106 | | { 0x17, "IPv6" }, |
107 | | { 0, NULL } |
108 | | }; |
109 | | |
110 | | static true_false_string tfs_reverse_normal = { "Reverse", "Normal" }; |
111 | | |
112 | | static void |
113 | | version_base_custom(char *result, uint32_t version) |
114 | 0 | { |
115 | 0 | snprintf(result, ITEM_LABEL_LENGTH, "%d.%d", (version >> 8) & 0xFF, (version & 0xFF)); |
116 | 0 | } |
117 | | |
118 | | static int |
119 | | dissect_msnlb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) |
120 | 6 | { |
121 | 6 | proto_item *ti; |
122 | 6 | proto_tree *msnlb_tree = NULL, *msnlb_subtree; |
123 | 6 | uint16_t offset = 0; |
124 | 6 | uint32_t signature; |
125 | | |
126 | 6 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "MS NLB"); |
127 | | |
128 | 6 | col_set_str(pinfo->cinfo, COL_INFO, "MS NLB heartbeat"); |
129 | | |
130 | 6 | if (tree) { |
131 | 6 | ti = proto_tree_add_item(tree, proto_msnlb, tvb, 0, -1, ENC_NA); |
132 | 6 | msnlb_tree = proto_item_add_subtree(ti, ett_msnlb); |
133 | 6 | } |
134 | | |
135 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_signature, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
136 | 6 | signature = tvb_get_letohl(tvb, offset); |
137 | 6 | offset += 4; |
138 | | |
139 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_version, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
140 | 6 | offset += 4; |
141 | | |
142 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_uniquehostid, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
143 | 6 | offset += 4; |
144 | | |
145 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_clusterip, tvb, offset, 4, ENC_BIG_ENDIAN); |
146 | 6 | offset += 4; |
147 | | |
148 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_dedicatedip, tvb, offset, 4, ENC_BIG_ENDIAN); |
149 | 6 | offset += 4; |
150 | | |
151 | 6 | ti = proto_tree_add_item(msnlb_tree, hf_msnlb_signature_data, tvb, offset, -1, ENC_NA); |
152 | 6 | proto_item_append_text(ti, " - %s", val_to_str(pinfo->pool, signature, nlb_signature_vals, "Unknown (%u)")); |
153 | 6 | col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str(pinfo->pool, signature, nlb_signature_vals, "Unknown (%u)")); |
154 | 6 | msnlb_subtree = proto_item_add_subtree(ti, ett_msnlb_signature); |
155 | | |
156 | 6 | switch(signature){ |
157 | 0 | case NLB_CLUSTER_MEMBERSHIP_HB:{ |
158 | 0 | uint32_t i; |
159 | 0 | proto_tree *teamingcfg_tree, *subtree; |
160 | |
|
161 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_myhostid, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
162 | 0 | offset += 2; |
163 | |
|
164 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_defaulthostid, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
165 | 0 | offset += 2; |
166 | |
|
167 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_convergencestate, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
168 | 0 | offset += 2; |
169 | |
|
170 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_numberofportrules, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
171 | 0 | offset += 2; |
172 | |
|
173 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_uniquehostcode, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
174 | 0 | offset += 4; |
175 | |
|
176 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_packetshandled, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
177 | 0 | offset += 4; |
178 | | |
179 | | /* Teaming configuration/state code, which is of the form: |
180 | | |
181 | | ------------------------------------- |
182 | | |XXXXXXXX|PPPPPPPP|PPPPPPPP|NNNNNHMA| |
183 | | ------------------------------------- |
184 | | |
185 | | X: Reserved |
186 | | P: XOR of the least significant 16 bits of each participant's cluster IP address |
187 | | N: Number of participants |
188 | | H: Hashing (Reverse=1, Normal=0) |
189 | | M: Master (Yes=1, No=0) |
190 | | A: Teaming active (Yes=1, No=0) |
191 | | */ |
192 | |
|
193 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_teamingcfg, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
194 | 0 | teamingcfg_tree = proto_item_add_subtree(ti, ett_msnlb_teamingcfg); |
195 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
196 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_xorclusterip, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
197 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_numberofparticipants, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
198 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_hashing, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
199 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_master, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
200 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_active, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
201 | 0 | offset += 4; |
202 | |
|
203 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_reserved, tvb, offset, 4, ENC_NA); |
204 | 0 | offset += 4; |
205 | |
|
206 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_portruleconfiguration, tvb, offset, 4*33, ENC_NA); |
207 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_portruleconfiguration); |
208 | 0 | for(i = 1; i <= 33; i++){ |
209 | 0 | proto_tree_add_item(subtree, hf_msnlb_portruleconfiguration_data, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
210 | 0 | offset += 4; |
211 | 0 | } |
212 | |
|
213 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_currentmap, tvb, offset, 8*33, ENC_NA); |
214 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_currentmap); |
215 | 0 | for(i = 1; i <= 33; i++){ |
216 | 0 | proto_tree_add_item(subtree, hf_msnlb_currentmap_data, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
217 | 0 | offset += 8; |
218 | 0 | } |
219 | |
|
220 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_newmap, tvb, offset, 8*33, ENC_NA); |
221 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_newmap); |
222 | 0 | for(i = 1; i <= 33; i++){ |
223 | 0 | proto_tree_add_item(subtree, hf_msnlb_newmap_data, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
224 | 0 | offset += 8; |
225 | 0 | } |
226 | |
|
227 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_idlemap, tvb, offset, 8*33, ENC_NA); |
228 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_idlemap); |
229 | 0 | for(i = 1; i <= 33; i++){ |
230 | 0 | proto_tree_add_item(subtree, hf_msnlb_idlemap_data, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
231 | 0 | offset += 8; |
232 | 0 | } |
233 | |
|
234 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_readymap, tvb, offset, 8*33, ENC_NA); |
235 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_readymap); |
236 | 0 | for(i = 1; i <= 33; i++){ |
237 | 0 | proto_tree_add_item(subtree, hf_msnlb_readymap_data, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
238 | 0 | offset += 8; |
239 | 0 | } |
240 | |
|
241 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_loadweights, tvb, offset, 4*33, ENC_NA); |
242 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_loadweights); |
243 | 0 | for(i = 1; i <= 33; i++){ |
244 | 0 | proto_tree_add_item(subtree, hf_msnlb_loadweights_data, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
245 | 0 | offset += 4; |
246 | 0 | } |
247 | |
|
248 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_reserved2, tvb, offset, 4*33, ENC_NA); |
249 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_reserved); |
250 | 0 | for(i = 1; i <= 33; i++){ |
251 | 0 | proto_tree_add_item(subtree, hf_msnlb_reserved2_data, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
252 | 0 | offset += 4; |
253 | 0 | } |
254 | 0 | } |
255 | 0 | break; |
256 | 0 | case NLB_EXTENDED_HB:{ |
257 | 0 | uint8_t hb_type; |
258 | 0 | proto_tree *hb_tree; |
259 | 0 | while (tvb_reported_length_remaining(tvb, offset) > 0) { |
260 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_extended_hb, tvb, offset, -1, ENC_NA); |
261 | 0 | hb_tree = proto_item_add_subtree(ti, ett_msnlb_extended_hb); |
262 | |
|
263 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_extended_hb_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
264 | 0 | hb_type = tvb_get_uint8(tvb, offset); |
265 | 0 | proto_item_append_text(ti, " - %s", val_to_str(pinfo->pool, hb_type, nlb_extended_hb_type_vals, "Unknown (%u)")); |
266 | 0 | offset += 1; |
267 | |
|
268 | 0 | switch(hb_type){ |
269 | 0 | case 1:{ /* FQDN */ |
270 | 0 | char *fqdn = NULL; |
271 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
272 | 0 | offset += 1; |
273 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 2, ENC_NA); |
274 | 0 | offset += 2; |
275 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 4, ENC_NA); |
276 | 0 | offset += 4; |
277 | 0 | offset = display_unicode_string(tvb, pinfo, hb_tree, offset, hf_msnlb_host_name, &fqdn); |
278 | 0 | offset += 6; |
279 | 0 | proto_item_append_text(ti, ": %s", fqdn); |
280 | 0 | } |
281 | 0 | break; |
282 | 0 | case 2:{ /* IP */ |
283 | 0 | uint16_t address_family; |
284 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
285 | 0 | offset += 1; |
286 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 2, ENC_NA); |
287 | 0 | offset += 2; |
288 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 4, ENC_NA); |
289 | 0 | offset += 4; |
290 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_address_family, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
291 | 0 | address_family = tvb_get_letohs(tvb, offset); |
292 | 0 | offset += 2; |
293 | 0 | switch(address_family){ |
294 | 0 | case 0x2: /* IPv4 */ |
295 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_host_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); |
296 | 0 | proto_item_append_text(ti, ": %s", tvb_ip_to_str(pinfo->pool, tvb, offset)); |
297 | 0 | offset += 4; |
298 | 0 | break; |
299 | 0 | case 0x17: /* IPv6 */ |
300 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_host_ipv6, tvb, offset, 16, ENC_NA); |
301 | 0 | proto_item_append_text(ti, ": %s", tvb_ip6_to_str(pinfo->pool, tvb, offset)); |
302 | 0 | offset += 16; |
303 | 0 | break; |
304 | 0 | default: /* Unknown */ |
305 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_host_unknown, tvb, offset, -1, ENC_NA); |
306 | 0 | offset += tvb_reported_length_remaining(tvb, offset); |
307 | 0 | break; |
308 | 0 | } |
309 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_padding, tvb, offset, -1, ENC_NA); |
310 | 0 | offset += tvb_reported_length_remaining(tvb, offset); |
311 | 0 | } |
312 | 0 | break; |
313 | 0 | default: /* default ?! */ |
314 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_extended_hb_unknown, tvb, offset, -1, ENC_NA); |
315 | 0 | offset += tvb_reported_length_remaining(tvb, offset); |
316 | 0 | break; |
317 | 0 | } |
318 | 0 | } |
319 | | |
320 | |
|
321 | 0 | } |
322 | 0 | break; |
323 | | |
324 | 2 | default: |
325 | 2 | break; |
326 | 6 | } |
327 | | |
328 | 2 | return tvb_captured_length(tvb); |
329 | 6 | } |
330 | | |
331 | | void |
332 | | proto_register_msnlb(void) |
333 | 14 | { |
334 | 14 | static hf_register_info hf[] = { |
335 | 14 | { &hf_msnlb_signature, |
336 | 14 | { "Signature", "msnlb.signature", |
337 | 14 | FT_UINT32, BASE_HEX, |
338 | 14 | VALS(nlb_signature_vals), 0, |
339 | 14 | NULL, HFILL } |
340 | 14 | }, |
341 | 14 | { &hf_msnlb_version, |
342 | 14 | { "Version", "msnlb.version", |
343 | 14 | FT_UINT32, BASE_CUSTOM, |
344 | 14 | CF_FUNC(version_base_custom), 0, |
345 | 14 | NULL, HFILL } |
346 | 14 | }, |
347 | 14 | { &hf_msnlb_uniquehostid, |
348 | 14 | { "Unique Host ID", "msnlb.unique_host_id", |
349 | 14 | FT_UINT32, BASE_DEC, |
350 | 14 | NULL, 0, |
351 | 14 | NULL, HFILL } |
352 | 14 | }, |
353 | 14 | { &hf_msnlb_clusterip, |
354 | 14 | { "Cluster IP", "msnlb.cluster_ip", |
355 | 14 | FT_IPv4, BASE_NONE, |
356 | 14 | NULL, 0, |
357 | 14 | NULL, HFILL } |
358 | 14 | }, |
359 | 14 | { &hf_msnlb_dedicatedip, |
360 | 14 | { "Host IP", "msnlb.host_ip", |
361 | 14 | FT_IPv4, BASE_NONE, |
362 | 14 | NULL, 0, |
363 | 14 | NULL, HFILL } |
364 | 14 | }, |
365 | 14 | { &hf_msnlb_signature_data, |
366 | 14 | { "Signature Data", "msnlb.signature_data", |
367 | 14 | FT_NONE, BASE_NONE, |
368 | 14 | NULL, 0, |
369 | 14 | NULL, HFILL } |
370 | 14 | }, |
371 | 14 | { &hf_msnlb_myhostid, |
372 | 14 | { "My Host id", "msnlb.my_host_ip", |
373 | 14 | FT_UINT16, BASE_DEC, |
374 | 14 | NULL, 0, |
375 | 14 | NULL, HFILL } |
376 | 14 | }, |
377 | 14 | { &hf_msnlb_defaulthostid, |
378 | 14 | { "Default Host id", "msnlb.default_host_ip", |
379 | 14 | FT_UINT16, BASE_DEC, |
380 | 14 | NULL, 0, |
381 | 14 | NULL, HFILL } |
382 | 14 | }, |
383 | 14 | { &hf_msnlb_convergencestate, |
384 | 14 | { "Convergence State", "msnlb.convergence_state", |
385 | 14 | FT_UINT16, BASE_DEC, |
386 | 14 | NULL, 0, |
387 | 14 | NULL, HFILL } |
388 | 14 | }, |
389 | 14 | { &hf_msnlb_numberofportrules, |
390 | 14 | { "Number of Port Rules", "msnlb.number_of_port_rules", |
391 | 14 | FT_UINT16, BASE_DEC, |
392 | 14 | NULL, 0, |
393 | 14 | NULL, HFILL } |
394 | 14 | }, |
395 | 14 | { &hf_msnlb_uniquehostcode, |
396 | 14 | { "Unique Host Code", "msnlb.unique_host_code", |
397 | 14 | FT_UINT32, BASE_DEC, |
398 | 14 | NULL, 0, |
399 | 14 | NULL, HFILL } |
400 | 14 | }, |
401 | 14 | { &hf_msnlb_packetshandled, |
402 | 14 | { "Packets Handled", "msnlb.packets_handled", |
403 | 14 | FT_UINT32, BASE_DEC, |
404 | 14 | NULL, 0, |
405 | 14 | NULL, HFILL } |
406 | 14 | }, |
407 | 14 | { &hf_msnlb_teamingcfg, |
408 | 14 | { "Teaming Configuration", "msnlb.teamincfg", |
409 | 14 | FT_UINT32, BASE_HEX, |
410 | 14 | NULL, 0, |
411 | 14 | NULL, HFILL } |
412 | 14 | }, |
413 | 14 | { &hf_msnlb_teamingcfg_reserved, |
414 | 14 | { "Reserved", "msnlb.teamincfg.reserved", |
415 | 14 | FT_UINT32, BASE_HEX, |
416 | 14 | NULL, 0xFF000000, |
417 | 14 | "Must be zero", HFILL } |
418 | 14 | }, |
419 | 14 | { &hf_msnlb_teamingcfg_xorclusterip, |
420 | 14 | { "XOR of the least significant 16 bits of each participant's cluster IP address", "msnlb.teamingcfg.xorclusterip", |
421 | 14 | FT_UINT32, BASE_HEX, |
422 | 14 | NULL, 0x00FFFF00, |
423 | 14 | NULL, HFILL } |
424 | 14 | }, |
425 | 14 | { &hf_msnlb_teamingcfg_numberofparticipants, |
426 | 14 | { "Number of Participants", "msnlb.teamingcfg.number_of_participants", |
427 | 14 | FT_UINT32, BASE_HEX, |
428 | 14 | NULL, 0x000000F8, |
429 | 14 | NULL, HFILL } |
430 | 14 | }, |
431 | 14 | { &hf_msnlb_teamingcfg_hashing, |
432 | 14 | { "Hashing", "msnlb.teamingcfg.hashing", |
433 | 14 | FT_BOOLEAN, 32, |
434 | 14 | TFS(&tfs_reverse_normal), 0x00000004, |
435 | 14 | NULL, HFILL } |
436 | 14 | }, |
437 | 14 | { &hf_msnlb_teamingcfg_master, |
438 | 14 | { "Master", "msnlb.teamingcfg.master", |
439 | 14 | FT_BOOLEAN, 32, |
440 | 14 | NULL, 0x00000002, |
441 | 14 | NULL, HFILL } |
442 | 14 | }, |
443 | 14 | { &hf_msnlb_teamingcfg_active, |
444 | 14 | { "Active", "msnlb.teamingcfg.active", |
445 | 14 | FT_BOOLEAN, 32, |
446 | 14 | NULL, 0x00000001, |
447 | 14 | NULL, HFILL } |
448 | 14 | }, |
449 | 14 | { &hf_msnlb_reserved, |
450 | 14 | { "Reserved", "msnlb.reserved", |
451 | 14 | FT_BYTES, BASE_NONE, |
452 | 14 | NULL, 0, |
453 | 14 | NULL, HFILL } |
454 | 14 | }, |
455 | 14 | { &hf_msnlb_portruleconfiguration, |
456 | 14 | { "Port Rule Configuration", "msnlb.portruleconfiguration", |
457 | 14 | FT_NONE, BASE_NONE, |
458 | 14 | NULL, 0, |
459 | 14 | NULL, HFILL } |
460 | 14 | }, |
461 | 14 | { &hf_msnlb_portruleconfiguration_data, |
462 | 14 | { "Port Rule Configuration Data", "msnlb.portruleconfiguration.data", |
463 | 14 | FT_UINT32, BASE_DEC_HEX, |
464 | 14 | NULL, 0, |
465 | 14 | NULL, HFILL } |
466 | 14 | }, |
467 | 14 | { &hf_msnlb_currentmap, |
468 | 14 | { "Current Map", "msnlb.currentmap", |
469 | 14 | FT_NONE, BASE_NONE, |
470 | 14 | NULL, 0, |
471 | 14 | NULL, HFILL } |
472 | 14 | }, |
473 | 14 | { &hf_msnlb_currentmap_data, |
474 | 14 | { "Current Map Data", "msnlb.currentmap.data", |
475 | 14 | FT_UINT64, BASE_DEC_HEX, |
476 | 14 | NULL, 0, |
477 | 14 | NULL, HFILL } |
478 | 14 | }, |
479 | 14 | { &hf_msnlb_newmap, |
480 | 14 | { "New Map", "msnlb.newmap", |
481 | 14 | FT_NONE, BASE_NONE, |
482 | 14 | NULL, 0, |
483 | 14 | NULL, HFILL } |
484 | 14 | }, |
485 | 14 | { &hf_msnlb_newmap_data, |
486 | 14 | { "New Map Data", "msnlb.newmap.data", |
487 | 14 | FT_UINT64, BASE_DEC_HEX, |
488 | 14 | NULL, 0, |
489 | 14 | NULL, HFILL } |
490 | 14 | }, |
491 | 14 | { &hf_msnlb_idlemap, |
492 | 14 | { "Idle Map", "msnlb.idlemap", |
493 | 14 | FT_NONE, BASE_NONE, |
494 | 14 | NULL, 0, |
495 | 14 | NULL, HFILL } |
496 | 14 | }, |
497 | 14 | { &hf_msnlb_idlemap_data, |
498 | 14 | { "Idle Map Data", "msnlb.idlemap.data", |
499 | 14 | FT_UINT64, BASE_DEC_HEX, |
500 | 14 | NULL, 0, |
501 | 14 | NULL, HFILL } |
502 | 14 | }, |
503 | 14 | { &hf_msnlb_readymap, |
504 | 14 | { "Ready Map", "msnlb.readymap", |
505 | 14 | FT_NONE, BASE_NONE, |
506 | 14 | NULL, 0, |
507 | 14 | NULL, HFILL } |
508 | 14 | }, |
509 | 14 | { &hf_msnlb_readymap_data, |
510 | 14 | { "Ready Map Data", "msnlb.readymap.data", |
511 | 14 | FT_UINT64, BASE_DEC_HEX, |
512 | 14 | NULL, 0, |
513 | 14 | NULL, HFILL } |
514 | 14 | }, |
515 | 14 | { &hf_msnlb_loadweights, |
516 | 14 | { "Load Weights", "msnlb.loadweights", |
517 | 14 | FT_NONE, BASE_NONE, |
518 | 14 | NULL, 0, |
519 | 14 | NULL, HFILL } |
520 | 14 | }, |
521 | 14 | { &hf_msnlb_loadweights_data, |
522 | 14 | { "Load Weights Data", "msnlb.loadweights.data", |
523 | 14 | FT_UINT32, BASE_DEC_HEX, |
524 | 14 | NULL, 0, |
525 | 14 | NULL, HFILL } |
526 | 14 | }, |
527 | 14 | { &hf_msnlb_reserved2, |
528 | 14 | { "Reserved", "msnlb.reserved2", |
529 | 14 | FT_NONE, BASE_NONE, |
530 | 14 | NULL, 0, |
531 | 14 | NULL, HFILL } |
532 | 14 | }, |
533 | 14 | { &hf_msnlb_reserved2_data, |
534 | 14 | { "Reserved Data", "msnlb.reserved2.data", |
535 | 14 | FT_UINT32, BASE_DEC_HEX, |
536 | 14 | NULL, 0, |
537 | 14 | NULL, HFILL } |
538 | 14 | }, |
539 | | |
540 | 14 | { &hf_msnlb_extended_hb, |
541 | 14 | { "Extended HB", "msnlb.extended_hb", |
542 | 14 | FT_NONE, BASE_NONE, |
543 | 14 | NULL, 0, |
544 | 14 | NULL, HFILL } |
545 | 14 | }, |
546 | | |
547 | 14 | { &hf_msnlb_extended_hb_type, |
548 | 14 | { "Type", "msnlb.extended_hb.type", |
549 | 14 | FT_UINT8, BASE_DEC, |
550 | 14 | VALS(nlb_extended_hb_type_vals), 0, |
551 | 14 | NULL, HFILL } |
552 | 14 | }, |
553 | 14 | { &hf_msnlb_length, |
554 | 14 | { "Length", "msnlb.length", |
555 | 14 | FT_UINT8, BASE_DEC, |
556 | 14 | NULL, 0, |
557 | 14 | NULL, HFILL } |
558 | 14 | }, |
559 | 14 | { &hf_msnlb_address_family, |
560 | 14 | { "Address Family", "msnlb.address_family", |
561 | 14 | FT_UINT16, BASE_HEX_DEC, |
562 | 14 | VALS(nlb_address_family_vals), 0, |
563 | 14 | NULL, HFILL } |
564 | 14 | }, |
565 | 14 | { &hf_msnlb_host_name, |
566 | 14 | { "Host name", "msnlb.host_name", |
567 | 14 | FT_STRING, BASE_NONE, |
568 | 14 | NULL, 0, |
569 | 14 | NULL, HFILL } |
570 | 14 | }, |
571 | 14 | { &hf_msnlb_host_ipv4, |
572 | 14 | { "Host IPv4", "msnlb.host_ipv4", |
573 | 14 | FT_IPv4, BASE_NONE, |
574 | 14 | NULL, 0, |
575 | 14 | NULL, HFILL } |
576 | 14 | }, |
577 | 14 | { &hf_msnlb_host_ipv6, |
578 | 14 | { "Host IPv6", "msnlb.host_ipv6", |
579 | 14 | FT_IPv6, BASE_NONE, |
580 | 14 | NULL, 0, |
581 | 14 | NULL, HFILL } |
582 | 14 | }, |
583 | 14 | { &hf_msnlb_host_unknown, |
584 | 14 | { "Host Unknown", "msnlb.host_unknown", |
585 | 14 | FT_BYTES, BASE_NONE, |
586 | 14 | NULL, 0, |
587 | 14 | NULL, HFILL } |
588 | 14 | }, |
589 | 14 | { &hf_msnlb_padding, |
590 | 14 | { "Padding", "msnlb.padding", |
591 | 14 | FT_BYTES, BASE_NONE, |
592 | 14 | NULL, 0, |
593 | 14 | NULL, HFILL } |
594 | 14 | }, |
595 | 14 | { &hf_msnlb_extended_hb_unknown, |
596 | 14 | { "Unknown HB Data", "msnlb.extended_hb.unknown", |
597 | 14 | FT_BYTES, BASE_NONE, |
598 | 14 | NULL, 0, |
599 | 14 | NULL, HFILL } |
600 | 14 | } |
601 | 14 | }; |
602 | | |
603 | 14 | static int *ett[] = { |
604 | 14 | &ett_msnlb, |
605 | 14 | &ett_msnlb_signature, |
606 | 14 | &ett_msnlb_teamingcfg, |
607 | 14 | &ett_msnlb_portruleconfiguration, |
608 | 14 | &ett_msnlb_currentmap, |
609 | 14 | &ett_msnlb_newmap, |
610 | 14 | &ett_msnlb_idlemap, |
611 | 14 | &ett_msnlb_readymap, |
612 | 14 | &ett_msnlb_loadweights, |
613 | 14 | &ett_msnlb_reserved, |
614 | 14 | &ett_msnlb_extended_hb |
615 | 14 | }; |
616 | | |
617 | 14 | proto_msnlb = proto_register_protocol("MS Network Load Balancing", "MS NLB", "msnlb"); |
618 | 14 | proto_register_field_array(proto_msnlb, hf, array_length(hf)); |
619 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
620 | | |
621 | 14 | msnlb_handle = register_dissector("msnlb", dissect_msnlb, proto_msnlb); |
622 | 14 | } |
623 | | |
624 | | void |
625 | | proto_reg_handoff_msnlb(void) |
626 | 14 | { |
627 | 14 | dissector_add_uint("ethertype", ETHERTYPE_MS_NLB_HEARTBEAT, msnlb_handle); |
628 | 14 | } |
629 | | |
630 | | /* |
631 | | * Editor modelines |
632 | | * |
633 | | * Local Variables: |
634 | | * c-basic-offset: 2 |
635 | | * tab-width: 8 |
636 | | * indent-tabs-mode: nil |
637 | | * End: |
638 | | * |
639 | | * ex: set shiftwidth=2 tabstop=8 expandtab: |
640 | | * :indentSize=2:tabSize=8:noTabs=true: |
641 | | */ |