/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 | unsigned 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_ret_uint(msnlb_tree, hf_msnlb_signature, tvb, offset, 4, ENC_LITTLE_ENDIAN, &signature); |
136 | 6 | offset += 4; |
137 | | |
138 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_version, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
139 | 6 | offset += 4; |
140 | | |
141 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_uniquehostid, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
142 | 6 | offset += 4; |
143 | | |
144 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_clusterip, tvb, offset, 4, ENC_BIG_ENDIAN); |
145 | 6 | offset += 4; |
146 | | |
147 | 6 | proto_tree_add_item(msnlb_tree, hf_msnlb_dedicatedip, tvb, offset, 4, ENC_BIG_ENDIAN); |
148 | 6 | offset += 4; |
149 | | |
150 | 6 | ti = proto_tree_add_item(msnlb_tree, hf_msnlb_signature_data, tvb, offset, -1, ENC_NA); |
151 | 6 | proto_item_append_text(ti, " - %s", val_to_str(pinfo->pool, signature, nlb_signature_vals, "Unknown (%u)")); |
152 | 6 | col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str(pinfo->pool, signature, nlb_signature_vals, "Unknown (%u)")); |
153 | 6 | msnlb_subtree = proto_item_add_subtree(ti, ett_msnlb_signature); |
154 | | |
155 | 6 | switch(signature){ |
156 | 0 | case NLB_CLUSTER_MEMBERSHIP_HB:{ |
157 | 0 | uint32_t i; |
158 | 0 | proto_tree *teamingcfg_tree, *subtree; |
159 | |
|
160 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_myhostid, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
161 | 0 | offset += 2; |
162 | |
|
163 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_defaulthostid, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
164 | 0 | offset += 2; |
165 | |
|
166 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_convergencestate, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
167 | 0 | offset += 2; |
168 | |
|
169 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_numberofportrules, tvb, offset, 2, ENC_LITTLE_ENDIAN); |
170 | 0 | offset += 2; |
171 | |
|
172 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_uniquehostcode, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
173 | 0 | offset += 4; |
174 | |
|
175 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_packetshandled, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
176 | 0 | offset += 4; |
177 | | |
178 | | /* Teaming configuration/state code, which is of the form: |
179 | | |
180 | | ------------------------------------- |
181 | | |XXXXXXXX|PPPPPPPP|PPPPPPPP|NNNNNHMA| |
182 | | ------------------------------------- |
183 | | |
184 | | X: Reserved |
185 | | P: XOR of the least significant 16 bits of each participant's cluster IP address |
186 | | N: Number of participants |
187 | | H: Hashing (Reverse=1, Normal=0) |
188 | | M: Master (Yes=1, No=0) |
189 | | A: Teaming active (Yes=1, No=0) |
190 | | */ |
191 | |
|
192 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_teamingcfg, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
193 | 0 | teamingcfg_tree = proto_item_add_subtree(ti, ett_msnlb_teamingcfg); |
194 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
195 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_xorclusterip, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
196 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_numberofparticipants, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
197 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_hashing, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
198 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_master, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
199 | 0 | proto_tree_add_item(teamingcfg_tree, hf_msnlb_teamingcfg_active, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
200 | 0 | offset += 4; |
201 | |
|
202 | 0 | proto_tree_add_item(msnlb_subtree, hf_msnlb_reserved, tvb, offset, 4, ENC_NA); |
203 | 0 | offset += 4; |
204 | |
|
205 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_portruleconfiguration, tvb, offset, 4*33, ENC_NA); |
206 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_portruleconfiguration); |
207 | 0 | for(i = 1; i <= 33; i++){ |
208 | 0 | proto_tree_add_item(subtree, hf_msnlb_portruleconfiguration_data, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
209 | 0 | offset += 4; |
210 | 0 | } |
211 | |
|
212 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_currentmap, tvb, offset, 8*33, ENC_NA); |
213 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_currentmap); |
214 | 0 | for(i = 1; i <= 33; i++){ |
215 | 0 | proto_tree_add_item(subtree, hf_msnlb_currentmap_data, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
216 | 0 | offset += 8; |
217 | 0 | } |
218 | |
|
219 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_newmap, tvb, offset, 8*33, ENC_NA); |
220 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_newmap); |
221 | 0 | for(i = 1; i <= 33; i++){ |
222 | 0 | proto_tree_add_item(subtree, hf_msnlb_newmap_data, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
223 | 0 | offset += 8; |
224 | 0 | } |
225 | |
|
226 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_idlemap, tvb, offset, 8*33, ENC_NA); |
227 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_idlemap); |
228 | 0 | for(i = 1; i <= 33; i++){ |
229 | 0 | proto_tree_add_item(subtree, hf_msnlb_idlemap_data, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
230 | 0 | offset += 8; |
231 | 0 | } |
232 | |
|
233 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_readymap, tvb, offset, 8*33, ENC_NA); |
234 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_readymap); |
235 | 0 | for(i = 1; i <= 33; i++){ |
236 | 0 | proto_tree_add_item(subtree, hf_msnlb_readymap_data, tvb, offset, 8, ENC_LITTLE_ENDIAN); |
237 | 0 | offset += 8; |
238 | 0 | } |
239 | |
|
240 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_loadweights, tvb, offset, 4*33, ENC_NA); |
241 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_loadweights); |
242 | 0 | for(i = 1; i <= 33; i++){ |
243 | 0 | proto_tree_add_item(subtree, hf_msnlb_loadweights_data, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
244 | 0 | offset += 4; |
245 | 0 | } |
246 | |
|
247 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_reserved2, tvb, offset, 4*33, ENC_NA); |
248 | 0 | subtree = proto_item_add_subtree(ti, ett_msnlb_reserved); |
249 | 0 | for(i = 1; i <= 33; i++){ |
250 | 0 | proto_tree_add_item(subtree, hf_msnlb_reserved2_data, tvb, offset, 4, ENC_LITTLE_ENDIAN); |
251 | 0 | offset += 4; |
252 | 0 | } |
253 | 0 | } |
254 | 0 | break; |
255 | 0 | case NLB_EXTENDED_HB:{ |
256 | 0 | uint8_t hb_type; |
257 | 0 | proto_tree *hb_tree; |
258 | 0 | while (tvb_reported_length_remaining(tvb, offset) > 0) { |
259 | 0 | ti = proto_tree_add_item(msnlb_subtree, hf_msnlb_extended_hb, tvb, offset, -1, ENC_NA); |
260 | 0 | hb_tree = proto_item_add_subtree(ti, ett_msnlb_extended_hb); |
261 | |
|
262 | 0 | proto_tree_add_item_ret_uint8(hb_tree, hf_msnlb_extended_hb_type, tvb, offset, 1, ENC_LITTLE_ENDIAN, &hb_type); |
263 | 0 | proto_item_append_text(ti, " - %s", val_to_str(pinfo->pool, hb_type, nlb_extended_hb_type_vals, "Unknown (%u)")); |
264 | 0 | offset += 1; |
265 | |
|
266 | 0 | switch(hb_type){ |
267 | 0 | case 1:{ /* FQDN */ |
268 | 0 | char *fqdn = NULL; |
269 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
270 | 0 | offset += 1; |
271 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 2, ENC_NA); |
272 | 0 | offset += 2; |
273 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 4, ENC_NA); |
274 | 0 | offset += 4; |
275 | 0 | offset = display_unicode_string(tvb, pinfo, hb_tree, offset, hf_msnlb_host_name, &fqdn); |
276 | 0 | offset += 6; |
277 | 0 | proto_item_append_text(ti, ": %s", fqdn); |
278 | 0 | } |
279 | 0 | break; |
280 | 0 | case 2:{ /* IP */ |
281 | 0 | uint16_t address_family; |
282 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); |
283 | 0 | offset += 1; |
284 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 2, ENC_NA); |
285 | 0 | offset += 2; |
286 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 4, ENC_NA); |
287 | 0 | offset += 4; |
288 | 0 | proto_tree_add_item_ret_uint16(hb_tree, hf_msnlb_address_family, tvb, offset, 2, ENC_LITTLE_ENDIAN, &address_family); |
289 | 0 | offset += 2; |
290 | 0 | switch(address_family){ |
291 | 0 | case 0x2: /* IPv4 */ |
292 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_host_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); |
293 | 0 | proto_item_append_text(ti, ": %s", tvb_ip_to_str(pinfo->pool, tvb, offset)); |
294 | 0 | offset += 4; |
295 | 0 | break; |
296 | 0 | case 0x17: /* IPv6 */ |
297 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_host_ipv6, tvb, offset, 16, ENC_NA); |
298 | 0 | proto_item_append_text(ti, ": %s", tvb_ip6_to_str(pinfo->pool, tvb, offset)); |
299 | 0 | offset += 16; |
300 | 0 | break; |
301 | 0 | default: /* Unknown */ |
302 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_host_unknown, tvb, offset, -1, ENC_NA); |
303 | 0 | offset += tvb_reported_length_remaining(tvb, offset); |
304 | 0 | break; |
305 | 0 | } |
306 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_padding, tvb, offset, -1, ENC_NA); |
307 | 0 | offset += tvb_reported_length_remaining(tvb, offset); |
308 | 0 | } |
309 | 0 | break; |
310 | 0 | default: /* default ?! */ |
311 | 0 | proto_tree_add_item(hb_tree, hf_msnlb_extended_hb_unknown, tvb, offset, -1, ENC_NA); |
312 | 0 | offset += tvb_reported_length_remaining(tvb, offset); |
313 | 0 | break; |
314 | 0 | } |
315 | 0 | } |
316 | | |
317 | |
|
318 | 0 | } |
319 | 0 | break; |
320 | | |
321 | 5 | default: |
322 | 5 | break; |
323 | 6 | } |
324 | | |
325 | 5 | return tvb_captured_length(tvb); |
326 | 6 | } |
327 | | |
328 | | void |
329 | | proto_register_msnlb(void) |
330 | 16 | { |
331 | 16 | static hf_register_info hf[] = { |
332 | 16 | { &hf_msnlb_signature, |
333 | 16 | { "Signature", "msnlb.signature", |
334 | 16 | FT_UINT32, BASE_HEX, |
335 | 16 | VALS(nlb_signature_vals), 0, |
336 | 16 | NULL, HFILL } |
337 | 16 | }, |
338 | 16 | { &hf_msnlb_version, |
339 | 16 | { "Version", "msnlb.version", |
340 | 16 | FT_UINT32, BASE_CUSTOM, |
341 | 16 | CF_FUNC(version_base_custom), 0, |
342 | 16 | NULL, HFILL } |
343 | 16 | }, |
344 | 16 | { &hf_msnlb_uniquehostid, |
345 | 16 | { "Unique Host ID", "msnlb.unique_host_id", |
346 | 16 | FT_UINT32, BASE_DEC, |
347 | 16 | NULL, 0, |
348 | 16 | NULL, HFILL } |
349 | 16 | }, |
350 | 16 | { &hf_msnlb_clusterip, |
351 | 16 | { "Cluster IP", "msnlb.cluster_ip", |
352 | 16 | FT_IPv4, BASE_NONE, |
353 | 16 | NULL, 0, |
354 | 16 | NULL, HFILL } |
355 | 16 | }, |
356 | 16 | { &hf_msnlb_dedicatedip, |
357 | 16 | { "Host IP", "msnlb.host_ip", |
358 | 16 | FT_IPv4, BASE_NONE, |
359 | 16 | NULL, 0, |
360 | 16 | NULL, HFILL } |
361 | 16 | }, |
362 | 16 | { &hf_msnlb_signature_data, |
363 | 16 | { "Signature Data", "msnlb.signature_data", |
364 | 16 | FT_NONE, BASE_NONE, |
365 | 16 | NULL, 0, |
366 | 16 | NULL, HFILL } |
367 | 16 | }, |
368 | 16 | { &hf_msnlb_myhostid, |
369 | 16 | { "My Host id", "msnlb.my_host_ip", |
370 | 16 | FT_UINT16, BASE_DEC, |
371 | 16 | NULL, 0, |
372 | 16 | NULL, HFILL } |
373 | 16 | }, |
374 | 16 | { &hf_msnlb_defaulthostid, |
375 | 16 | { "Default Host id", "msnlb.default_host_ip", |
376 | 16 | FT_UINT16, BASE_DEC, |
377 | 16 | NULL, 0, |
378 | 16 | NULL, HFILL } |
379 | 16 | }, |
380 | 16 | { &hf_msnlb_convergencestate, |
381 | 16 | { "Convergence State", "msnlb.convergence_state", |
382 | 16 | FT_UINT16, BASE_DEC, |
383 | 16 | NULL, 0, |
384 | 16 | NULL, HFILL } |
385 | 16 | }, |
386 | 16 | { &hf_msnlb_numberofportrules, |
387 | 16 | { "Number of Port Rules", "msnlb.number_of_port_rules", |
388 | 16 | FT_UINT16, BASE_DEC, |
389 | 16 | NULL, 0, |
390 | 16 | NULL, HFILL } |
391 | 16 | }, |
392 | 16 | { &hf_msnlb_uniquehostcode, |
393 | 16 | { "Unique Host Code", "msnlb.unique_host_code", |
394 | 16 | FT_UINT32, BASE_DEC, |
395 | 16 | NULL, 0, |
396 | 16 | NULL, HFILL } |
397 | 16 | }, |
398 | 16 | { &hf_msnlb_packetshandled, |
399 | 16 | { "Packets Handled", "msnlb.packets_handled", |
400 | 16 | FT_UINT32, BASE_DEC, |
401 | 16 | NULL, 0, |
402 | 16 | NULL, HFILL } |
403 | 16 | }, |
404 | 16 | { &hf_msnlb_teamingcfg, |
405 | 16 | { "Teaming Configuration", "msnlb.teamincfg", |
406 | 16 | FT_UINT32, BASE_HEX, |
407 | 16 | NULL, 0, |
408 | 16 | NULL, HFILL } |
409 | 16 | }, |
410 | 16 | { &hf_msnlb_teamingcfg_reserved, |
411 | 16 | { "Reserved", "msnlb.teamincfg.reserved", |
412 | 16 | FT_UINT32, BASE_HEX, |
413 | 16 | NULL, 0xFF000000, |
414 | 16 | "Must be zero", HFILL } |
415 | 16 | }, |
416 | 16 | { &hf_msnlb_teamingcfg_xorclusterip, |
417 | 16 | { "XOR of the least significant 16 bits of each participant's cluster IP address", "msnlb.teamingcfg.xorclusterip", |
418 | 16 | FT_UINT32, BASE_HEX, |
419 | 16 | NULL, 0x00FFFF00, |
420 | 16 | NULL, HFILL } |
421 | 16 | }, |
422 | 16 | { &hf_msnlb_teamingcfg_numberofparticipants, |
423 | 16 | { "Number of Participants", "msnlb.teamingcfg.number_of_participants", |
424 | 16 | FT_UINT32, BASE_HEX, |
425 | 16 | NULL, 0x000000F8, |
426 | 16 | NULL, HFILL } |
427 | 16 | }, |
428 | 16 | { &hf_msnlb_teamingcfg_hashing, |
429 | 16 | { "Hashing", "msnlb.teamingcfg.hashing", |
430 | 16 | FT_BOOLEAN, 32, |
431 | 16 | TFS(&tfs_reverse_normal), 0x00000004, |
432 | 16 | NULL, HFILL } |
433 | 16 | }, |
434 | 16 | { &hf_msnlb_teamingcfg_master, |
435 | 16 | { "Master", "msnlb.teamingcfg.master", |
436 | 16 | FT_BOOLEAN, 32, |
437 | 16 | NULL, 0x00000002, |
438 | 16 | NULL, HFILL } |
439 | 16 | }, |
440 | 16 | { &hf_msnlb_teamingcfg_active, |
441 | 16 | { "Active", "msnlb.teamingcfg.active", |
442 | 16 | FT_BOOLEAN, 32, |
443 | 16 | NULL, 0x00000001, |
444 | 16 | NULL, HFILL } |
445 | 16 | }, |
446 | 16 | { &hf_msnlb_reserved, |
447 | 16 | { "Reserved", "msnlb.reserved", |
448 | 16 | FT_BYTES, BASE_NONE, |
449 | 16 | NULL, 0, |
450 | 16 | NULL, HFILL } |
451 | 16 | }, |
452 | 16 | { &hf_msnlb_portruleconfiguration, |
453 | 16 | { "Port Rule Configuration", "msnlb.portruleconfiguration", |
454 | 16 | FT_NONE, BASE_NONE, |
455 | 16 | NULL, 0, |
456 | 16 | NULL, HFILL } |
457 | 16 | }, |
458 | 16 | { &hf_msnlb_portruleconfiguration_data, |
459 | 16 | { "Port Rule Configuration Data", "msnlb.portruleconfiguration.data", |
460 | 16 | FT_UINT32, BASE_DEC_HEX, |
461 | 16 | NULL, 0, |
462 | 16 | NULL, HFILL } |
463 | 16 | }, |
464 | 16 | { &hf_msnlb_currentmap, |
465 | 16 | { "Current Map", "msnlb.currentmap", |
466 | 16 | FT_NONE, BASE_NONE, |
467 | 16 | NULL, 0, |
468 | 16 | NULL, HFILL } |
469 | 16 | }, |
470 | 16 | { &hf_msnlb_currentmap_data, |
471 | 16 | { "Current Map Data", "msnlb.currentmap.data", |
472 | 16 | FT_UINT64, BASE_DEC_HEX, |
473 | 16 | NULL, 0, |
474 | 16 | NULL, HFILL } |
475 | 16 | }, |
476 | 16 | { &hf_msnlb_newmap, |
477 | 16 | { "New Map", "msnlb.newmap", |
478 | 16 | FT_NONE, BASE_NONE, |
479 | 16 | NULL, 0, |
480 | 16 | NULL, HFILL } |
481 | 16 | }, |
482 | 16 | { &hf_msnlb_newmap_data, |
483 | 16 | { "New Map Data", "msnlb.newmap.data", |
484 | 16 | FT_UINT64, BASE_DEC_HEX, |
485 | 16 | NULL, 0, |
486 | 16 | NULL, HFILL } |
487 | 16 | }, |
488 | 16 | { &hf_msnlb_idlemap, |
489 | 16 | { "Idle Map", "msnlb.idlemap", |
490 | 16 | FT_NONE, BASE_NONE, |
491 | 16 | NULL, 0, |
492 | 16 | NULL, HFILL } |
493 | 16 | }, |
494 | 16 | { &hf_msnlb_idlemap_data, |
495 | 16 | { "Idle Map Data", "msnlb.idlemap.data", |
496 | 16 | FT_UINT64, BASE_DEC_HEX, |
497 | 16 | NULL, 0, |
498 | 16 | NULL, HFILL } |
499 | 16 | }, |
500 | 16 | { &hf_msnlb_readymap, |
501 | 16 | { "Ready Map", "msnlb.readymap", |
502 | 16 | FT_NONE, BASE_NONE, |
503 | 16 | NULL, 0, |
504 | 16 | NULL, HFILL } |
505 | 16 | }, |
506 | 16 | { &hf_msnlb_readymap_data, |
507 | 16 | { "Ready Map Data", "msnlb.readymap.data", |
508 | 16 | FT_UINT64, BASE_DEC_HEX, |
509 | 16 | NULL, 0, |
510 | 16 | NULL, HFILL } |
511 | 16 | }, |
512 | 16 | { &hf_msnlb_loadweights, |
513 | 16 | { "Load Weights", "msnlb.loadweights", |
514 | 16 | FT_NONE, BASE_NONE, |
515 | 16 | NULL, 0, |
516 | 16 | NULL, HFILL } |
517 | 16 | }, |
518 | 16 | { &hf_msnlb_loadweights_data, |
519 | 16 | { "Load Weights Data", "msnlb.loadweights.data", |
520 | 16 | FT_UINT32, BASE_DEC_HEX, |
521 | 16 | NULL, 0, |
522 | 16 | NULL, HFILL } |
523 | 16 | }, |
524 | 16 | { &hf_msnlb_reserved2, |
525 | 16 | { "Reserved", "msnlb.reserved2", |
526 | 16 | FT_NONE, BASE_NONE, |
527 | 16 | NULL, 0, |
528 | 16 | NULL, HFILL } |
529 | 16 | }, |
530 | 16 | { &hf_msnlb_reserved2_data, |
531 | 16 | { "Reserved Data", "msnlb.reserved2.data", |
532 | 16 | FT_UINT32, BASE_DEC_HEX, |
533 | 16 | NULL, 0, |
534 | 16 | NULL, HFILL } |
535 | 16 | }, |
536 | | |
537 | 16 | { &hf_msnlb_extended_hb, |
538 | 16 | { "Extended HB", "msnlb.extended_hb", |
539 | 16 | FT_NONE, BASE_NONE, |
540 | 16 | NULL, 0, |
541 | 16 | NULL, HFILL } |
542 | 16 | }, |
543 | | |
544 | 16 | { &hf_msnlb_extended_hb_type, |
545 | 16 | { "Type", "msnlb.extended_hb.type", |
546 | 16 | FT_UINT8, BASE_DEC, |
547 | 16 | VALS(nlb_extended_hb_type_vals), 0, |
548 | 16 | NULL, HFILL } |
549 | 16 | }, |
550 | 16 | { &hf_msnlb_length, |
551 | 16 | { "Length", "msnlb.length", |
552 | 16 | FT_UINT8, BASE_DEC, |
553 | 16 | NULL, 0, |
554 | 16 | NULL, HFILL } |
555 | 16 | }, |
556 | 16 | { &hf_msnlb_address_family, |
557 | 16 | { "Address Family", "msnlb.address_family", |
558 | 16 | FT_UINT16, BASE_HEX_DEC, |
559 | 16 | VALS(nlb_address_family_vals), 0, |
560 | 16 | NULL, HFILL } |
561 | 16 | }, |
562 | 16 | { &hf_msnlb_host_name, |
563 | 16 | { "Host name", "msnlb.host_name", |
564 | 16 | FT_STRING, BASE_NONE, |
565 | 16 | NULL, 0, |
566 | 16 | NULL, HFILL } |
567 | 16 | }, |
568 | 16 | { &hf_msnlb_host_ipv4, |
569 | 16 | { "Host IPv4", "msnlb.host_ipv4", |
570 | 16 | FT_IPv4, BASE_NONE, |
571 | 16 | NULL, 0, |
572 | 16 | NULL, HFILL } |
573 | 16 | }, |
574 | 16 | { &hf_msnlb_host_ipv6, |
575 | 16 | { "Host IPv6", "msnlb.host_ipv6", |
576 | 16 | FT_IPv6, BASE_NONE, |
577 | 16 | NULL, 0, |
578 | 16 | NULL, HFILL } |
579 | 16 | }, |
580 | 16 | { &hf_msnlb_host_unknown, |
581 | 16 | { "Host Unknown", "msnlb.host_unknown", |
582 | 16 | FT_BYTES, BASE_NONE, |
583 | 16 | NULL, 0, |
584 | 16 | NULL, HFILL } |
585 | 16 | }, |
586 | 16 | { &hf_msnlb_padding, |
587 | 16 | { "Padding", "msnlb.padding", |
588 | 16 | FT_BYTES, BASE_NONE, |
589 | 16 | NULL, 0, |
590 | 16 | NULL, HFILL } |
591 | 16 | }, |
592 | 16 | { &hf_msnlb_extended_hb_unknown, |
593 | 16 | { "Unknown HB Data", "msnlb.extended_hb.unknown", |
594 | 16 | FT_BYTES, BASE_NONE, |
595 | 16 | NULL, 0, |
596 | 16 | NULL, HFILL } |
597 | 16 | } |
598 | 16 | }; |
599 | | |
600 | 16 | static int *ett[] = { |
601 | 16 | &ett_msnlb, |
602 | 16 | &ett_msnlb_signature, |
603 | 16 | &ett_msnlb_teamingcfg, |
604 | 16 | &ett_msnlb_portruleconfiguration, |
605 | 16 | &ett_msnlb_currentmap, |
606 | 16 | &ett_msnlb_newmap, |
607 | 16 | &ett_msnlb_idlemap, |
608 | 16 | &ett_msnlb_readymap, |
609 | 16 | &ett_msnlb_loadweights, |
610 | 16 | &ett_msnlb_reserved, |
611 | 16 | &ett_msnlb_extended_hb |
612 | 16 | }; |
613 | | |
614 | 16 | proto_msnlb = proto_register_protocol("MS Network Load Balancing", "MS NLB", "msnlb"); |
615 | 16 | proto_register_field_array(proto_msnlb, hf, array_length(hf)); |
616 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
617 | | |
618 | 16 | msnlb_handle = register_dissector("msnlb", dissect_msnlb, proto_msnlb); |
619 | 16 | } |
620 | | |
621 | | void |
622 | | proto_reg_handoff_msnlb(void) |
623 | 16 | { |
624 | 16 | dissector_add_uint("ethertype", ETHERTYPE_MS_NLB_HEARTBEAT, msnlb_handle); |
625 | 16 | } |
626 | | |
627 | | /* |
628 | | * Editor modelines |
629 | | * |
630 | | * Local Variables: |
631 | | * c-basic-offset: 2 |
632 | | * tab-width: 8 |
633 | | * indent-tabs-mode: nil |
634 | | * End: |
635 | | * |
636 | | * ex: set shiftwidth=2 tabstop=8 expandtab: |
637 | | * :indentSize=2:tabSize=8:noTabs=true: |
638 | | */ |