Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-ipmi-vita.c
blobf6713a9de7752cba9380da2093b8c059f72b7ea2
1 /* packet-ipmi-vita.c
2 * Sub-dissectors for IPMI messages (netFn=Group, defining body = VSO)
3 * Copyright 2014, Dmitry Bazhenov, Pigeon Point Systems <dima_b@pigeonpoint.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "config.h"
14 #include <epan/packet.h>
15 #include <epan/tfs.h>
16 #include <wsutil/array.h>
17 #include "packet-ipmi.h"
19 void proto_register_ipmi_vita(void);
21 /* Tree type identifiers.
23 static int ett_vita_ipmc;
24 static int ett_vita_ipmb;
25 static int ett_vita_vso;
26 static int ett_vita_led_caps;
27 static int ett_vita_led_color;
28 static int ett_vita_led_flags;
29 static int ett_vita_led_states;
30 static int ett_vita_ipmb_state;
31 static int ett_vita_fru_policy_bits;
32 static int ett_vita_fan_properties;
33 static int ett_vita_fru_control_caps;
34 static int ett_vita_chassis_addr_type;
35 static int ett_vita_chassis_addr;
36 static int ett_vita_persistent_control_state;
37 static int ett_vita_persistent_control_caps;
39 /* Field identifiers.
41 static int hf_vita_reserved;
42 static int hf_vita_fruid;
43 static int hf_vita_addr_key_type;
44 static int hf_vita_addr_key;
45 static int hf_vita_hw_addr;
46 static int hf_vita_ipmb_addr;
47 static int hf_vita_site_type;
48 static int hf_vita_site_num;
49 static int hf_vita_ipmbl_addr;
51 static int hf_vita_chassis_identifier;
52 static int hf_vita_chassis_identifier_type;
53 static int hf_vita_chassis_identifier_length;
54 static int hf_vita_ipmc;
55 static int hf_vita_tier;
56 static int hf_vita_layer;
57 static int hf_vita_ipmb;
58 static int hf_vita_ipmb_itfs;
59 static int hf_vita_ipmb_freq;
60 static int hf_vita_vso;
61 static int hf_vita_vso_std;
62 static int hf_vita_rev;
63 static int hf_vita_max_fruid;
64 static int hf_vita_ipmc_fruid;
65 static int hf_vita_fru_control;
67 static int hf_vita_led_count;
68 static int hf_vita_led_id;
69 static int hf_vita_led_caps;
70 static int hf_vita_led_cap_blue;
71 static int hf_vita_led_cap_red;
72 static int hf_vita_led_cap_green;
73 static int hf_vita_led_cap_amber;
74 static int hf_vita_led_cap_orange;
75 static int hf_vita_led_cap_white;
76 static int hf_vita_led_def_loc_color;
77 static int hf_vita_led_def_ovr_color;
78 static int hf_vita_led_color;
79 static int hf_vita_led_flags;
80 static int hf_vita_led_flag_pwr;
81 static int hf_vita_led_flag_hw_restrict;
82 static int hf_vita_led_states;
83 static int hf_vita_led_loc_func;
84 static int hf_vita_led_loc_duration;
85 static int hf_vita_led_loc_color;
86 static int hf_vita_led_ovr_func;
87 static int hf_vita_led_ovr_duration;
88 static int hf_vita_led_ovr_color;
89 static int hf_vita_led_lamp_test_duration;
90 static int hf_vita_led_state_local;
91 static int hf_vita_led_state_override;
92 static int hf_vita_led_state_lamp_test;
93 static int hf_vita_led_state_hw_restrict;
95 static int hf_vita_ipmba_state;
96 static int hf_vita_ipmbb_state;
97 static int hf_vita_ipmb_state;
98 static int hf_vita_ipmb_link_id;
100 static int hf_vita_fru_policy_mask_bits;
101 static int hf_vita_fru_policy_set_bits;
102 static int hf_vita_fru_policy_bits;
103 static int hf_vita_fru_activation_locked;
104 static int hf_vita_fru_deactivation_locked;
105 static int hf_vita_fru_commanded_deactivation_ignored;
106 static int hf_vita_fru_default_activation_locked;
108 static int hf_vita_fru_activation;
110 static int hf_vita_record_id;
112 static int hf_vita_fan_min_level;
113 static int hf_vita_fan_max_level;
114 static int hf_vita_fan_norm_level;
115 static int hf_vita_fan_properties;
116 static int hf_vita_fan_prop_local_control;
117 static int hf_vita_fan_override_level;
118 static int hf_vita_fan_local_level;
119 static int hf_vita_fan_local_control;
121 static int hf_vita_ipmb_link_key_type;
122 static int hf_vita_ipmb_link_key_value;
123 static int hf_vita_ipmb_link_number;
124 static int hf_vita_ipmb_sensor_number;
126 static int hf_vita_active_chmc_ipmb_addr;
127 static int hf_vita_backup_chmc_ipmb_addr;
129 static int hf_vita_fan_number;
130 static int hf_vita_fan_policy;
131 static int hf_vita_fan_policy_timeout;
132 static int hf_vita_fan_coverage;
134 static int hf_vita_fru_control_caps;
135 static int hf_vita_fru_control_cap_cold;
136 static int hf_vita_fru_control_cap_warm;
137 static int hf_vita_fru_control_cap_grace;
138 static int hf_vita_fru_control_cap_diag;
139 static int hf_vita_fru_control_cap_pwr;
141 static int hf_vita_fru_lock_operation;
142 static int hf_vita_fru_lock_id;
143 static int hf_vita_fru_lock_timestamp;
145 static int hf_vita_fru_write_offset;
146 static int hf_vita_fru_write_data;
147 static int hf_vita_fru_write_count;
149 static int hf_vita_chassis_addr_number;
150 static int hf_vita_chassis_addr_timestamp;
151 static int hf_vita_chassis_addr_count;
152 static int hf_vita_chassis_max_unavail;
153 static int hf_vita_chassis_addr_type;
154 static int hf_vita_chassis_addr;
155 static int hf_vita_chassis_addr_chmc;
156 static int hf_vita_chassis_addr_format;
157 static int hf_vita_ipv4_addr;
158 static int hf_vita_rmcp_port;
160 static int hf_vita_persistent_control_state;
161 static int hf_vita_persistent_control_cold;
162 static int hf_vita_persistent_control_warm;
163 static int hf_vita_persistent_control_mask;
164 static int hf_vita_persistent_control_set;
165 static int hf_vita_persistent_control_caps;
166 static int hf_vita_persistent_control_cap_cold;
167 static int hf_vita_persistent_control_cap_warm;
169 static int hf_vita_fru_state_sensor_num;
170 static int hf_vita_fru_health_sensor_num;
171 static int hf_vita_fru_voltage_sensor_num;
172 static int hf_vita_fru_temp_sensor_num;
173 static int hf_vita_payload_test_results_sensor_num;
174 static int hf_vita_payload_test_status_sensor_num;
176 /* String values.
178 static const value_string str_vita_ipmc_tiers[] = {
179 { 0x00, "Tier-1" },
180 { 0x01, "Tier-2" },
181 { 0x02, "Reserved" },
182 { 0x03, "Reserved" },
183 { 0, NULL }
186 static const value_string str_vita_ipmc_layers[] = {
187 { 0x00, "IPMC" },
188 { 0x01, "Chassis Manager" },
189 { 0x02, "System Manager" },
190 { 0x03, "Reserved" },
191 { 0, NULL }
194 static const value_string str_vita_ipmb_itfs[] = {
195 { 0x00, "1 IPMB interface" },
196 { 0x01, "2 IPMB interfaces" },
197 { 0x02, "Reserved" },
198 { 0x03, "Reserved" },
199 { 0, NULL }
202 static const value_string str_vita_ipmb_freq[] = {
203 { 0x00, "100KHz" },
204 { 0x01, "400KHz" },
205 { 0x02, "Reserved" },
206 { 0x03, "Reserved" },
207 { 0, NULL }
210 static const value_string str_vita_vso_std[] = {
211 { 0x00, "VITA 46.11" },
212 { 0, NULL }
215 static const value_string str_vita_addr_key_types[] = {
216 { 0x00, "Hardware Address" },
217 { 0x01, "IPMB Address" },
218 { 0x02, "Reserved" },
219 { 0x03, "Physical Address" },
220 { 0, NULL }
223 static const value_string str_vita_site_types[] = {
224 { 0x00, "Front Loading VPX Plug-In Module" },
225 { 0x01, "Power Entry Module" },
226 { 0x02, "Chassis FRU Information Module" },
227 { 0x03, "Dedicated ChMC" },
228 { 0x04, "Fan Tray" },
229 { 0x05, "Fan Tray Filter" },
230 { 0x06, "Alarm Panel" },
231 { 0x07, "XMC" },
232 { 0x08, "Reserved" },
233 { 0x09, "VPX Rear Transition Module" },
234 { 0x0A, "Reserved" },
235 { 0x0B, "Reserved" },
236 { 0x0C, "Power Supply" },
237 { 0x0D, "Reserved" },
238 { 0x0E, "Reserved" },
239 { 0x0F, "FMC" },
240 { 0xC0, "OEM" },
241 { 0xC1, "OEM" },
242 { 0xC2, "OEM" },
243 { 0xC3, "OEM" },
244 { 0xC4, "OEM" },
245 { 0xC5, "OEM" },
246 { 0xC6, "OEM" },
247 { 0xC7, "OEM" },
248 { 0xC8, "OEM" },
249 { 0xC9, "OEM" },
250 { 0xCA, "OEM" },
251 { 0xCB, "OEM" },
252 { 0xCC, "OEM" },
253 { 0xCD, "OEM" },
254 { 0xCE, "OEM" },
255 { 0xCF, "OEM" },
256 { 0, NULL }
259 static value_string_ext str_vita_site_types_ext = VALUE_STRING_EXT_INIT(str_vita_site_types);
261 static const value_string str_vita_fru_controls[] = {
262 { 0x00, "Cold Reset" },
263 { 0x01, "Warm Reset" },
264 { 0x02, "Graceful Reboot" },
265 { 0x03, "Diagnostic Interrupt" },
266 { 0, NULL }
269 static const value_string str_vita_led_colors[] = {
270 { 0x00, "Reserved (Control not supported)" },
271 { 0x01, "BLUE" },
272 { 0x02, "RED" },
273 { 0x03, "GREEN" },
274 { 0x04, "AMBER" },
275 { 0x05, "ORANGE" },
276 { 0x06, "WHITE" },
277 { 0x0E, "Do not change" },
278 { 0x0F, "Use default" },
279 { 0, NULL }
282 static const range_string str_vita_led_func[] = {
283 { 0x00, 0x00, "LED off" },
284 { 0x01, 0xFA, "LED BLINKING (off duration)" },
285 { 0xFB, 0xFB, "LAMP TEST" },
286 { 0xFC, 0xFC, "LED restored to Local Control state" },
287 { 0xFF, 0xFF, "LED on" },
288 { 0, 0, NULL }
291 static const range_string str_vita_ipmb_state[] = {
292 { 0x0, 0xFE, "System IPMB state" },
293 { 0xFF, 0xFF, "Do not change current state" },
294 { 0, 0, NULL }
297 static const true_false_string str_vita_ipmb_override = {
298 "Local Control State",
299 "Override state - Isolate(disable)"
302 static const range_string str_vita_ipmb_link_id[] = {
303 { 0x00, 0x00, "Select all System IPMB Links" },
304 { 0x01, 0x5F, "System IPMB Link Number" },
305 { 0x60, 0x7F, "Reserved" },
306 { 0, 0, NULL }
309 static const value_string str_vita_fru_activation[] = {
310 { 0x00, "Deactivate FRU" },
311 { 0x01, "Activate FRU" },
312 { 0, NULL }
315 static const value_string str_vita_fan_levels[] = {
316 { 0xFE, "Shut Down" },
317 { 0xFF, "Local Control" },
318 { 0, NULL }
321 static const value_string str_vita_fan_local_control[] = {
322 { 0x00, "Disabled" },
323 { 0x01, "Enabled" },
324 { 0, NULL }
327 static const value_string str_vita_ipmb_link_key_types[] = {
328 { 0x00, "Key is IPMB Link Number" },
329 { 0x01, "Key is IPMB Sensor Number" },
330 { 0, NULL }
333 static const value_string str_vita_fan_policies[] = {
334 { 0x00, "Disable" },
335 { 0x01, "Enable" },
336 { 0xFF, "Indeterminate" },
337 { 0, NULL }
340 static const value_string str_vita_fan_policy_timeouts[] = {
341 { 0xFF, "Infinite" },
342 { 0, NULL }
345 static const value_string str_vita_fan_coverages[] = {
346 { 0x00, "Not Covered" },
347 { 0x01, "Covered" },
348 { 0, NULL }
351 static const value_string str_vita_fru_lock_operations[] = {
352 { 0x00, "Get Last Commit Timestamp" },
353 { 0x01, "Lock" },
354 { 0x02, "Unlock and Discard" },
355 { 0x03, "Unlock and Commit " },
356 { 0, NULL }
359 static const range_string str_vita_chassis_addr_formats[] = {
360 { 0x00, 0x00, "IPv4 Address" },
361 { 0x01, 0x5F, "Reserved" },
362 { 0x60, 0x7F, "OEM" },
363 { 0, 0, NULL }
367 static const value_string cc1F[] = {
368 { 0x80, "Invalid FRU Information" },
369 { 0x81, "Lock Failed" },
370 { 0, NULL }
373 static const value_string cc20[] = {
374 { 0x80, "Invalid Lock ID" },
375 { 0, NULL }
379 /* Array of sub-tree identifiers (needed for registration).
381 static int * const ett_ipmi_vita[] = {
382 &ett_vita_ipmc,
383 &ett_vita_ipmb,
384 &ett_vita_vso,
385 &ett_vita_led_caps,
386 &ett_vita_led_color,
387 &ett_vita_led_flags,
388 &ett_vita_led_states,
389 &ett_vita_ipmb_state,
390 &ett_vita_fru_policy_bits,
391 &ett_vita_fan_properties,
392 &ett_vita_fru_control_caps,
393 &ett_vita_chassis_addr_type,
394 &ett_vita_chassis_addr,
395 &ett_vita_persistent_control_state,
396 &ett_vita_persistent_control_caps
399 static int * const bits_vita_led_color[] = {
400 &hf_vita_led_color,
401 NULL
404 static int * const bits_vita_fru_policy_bits[] = {
405 &hf_vita_fru_activation_locked,
406 &hf_vita_fru_deactivation_locked,
407 &hf_vita_fru_commanded_deactivation_ignored,
408 &hf_vita_fru_default_activation_locked,
409 NULL
412 static int * const bits_vita_persistent_control_state[] = {
413 &hf_vita_persistent_control_cold,
414 &hf_vita_persistent_control_warm,
415 NULL
418 /* Array of field descriptors.
420 static hf_register_info hf_ipmi_vita[] = {
421 { &hf_vita_ipmc,
422 { "IPMC Identifier", "ipmi.vita.ipmc",
423 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
424 { &hf_vita_tier,
425 { "Tier Functionality", "ipmi.vita.ipmc.tier",
426 FT_UINT8, BASE_HEX, VALS(str_vita_ipmc_tiers), 0x3, NULL, HFILL }},
427 { &hf_vita_layer,
428 { "Layer Functionality", "ipmi.vita.ipmc.layer",
429 FT_UINT8, BASE_HEX, VALS(str_vita_ipmc_layers), 0x30, NULL, HFILL }},
430 { &hf_vita_ipmb,
431 { "IPMB Capabilities", "ipmi.vita.ipmb",
432 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
433 { &hf_vita_ipmb_itfs,
434 { "Number of supported interfaces", "ipmi.vita.ipmc.itfs",
435 FT_UINT8, BASE_HEX, VALS(str_vita_ipmb_itfs), 0x3, NULL, HFILL }},
436 { &hf_vita_ipmb_freq,
437 { "Maximum operating frequency", "ipmi.vita.ipmc.freq",
438 FT_UINT8, BASE_HEX, VALS(str_vita_ipmb_freq), 0x30, NULL, HFILL }},
439 { &hf_vita_vso,
440 { "VSO Standard", "ipmi.vita.vso",
441 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
442 { &hf_vita_vso_std,
443 { "VSO Standard", "ipmi.vita.vso.std",
444 FT_UINT8, BASE_HEX, VALS(str_vita_vso_std), 0x3, NULL, HFILL }},
445 { &hf_vita_rev,
446 { "VSO Specification Revision", "ipmi.vita.vso.rev",
447 FT_UINT8, BASE_CUSTOM, CF_FUNC(ipmi_fmt_version), 0, NULL, HFILL }},
448 { &hf_vita_max_fruid,
449 { "Max FRU Device ID", "ipmi.vita.max.fruid",
450 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
451 { &hf_vita_ipmc_fruid,
452 { "FRU Device ID for IPMC", "ipmi.vita.ipmc.fruid",
453 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
454 { &hf_vita_fruid,
455 { "FRU Device ID", "ipmi.vita.fruid",
456 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
457 { &hf_vita_addr_key_type,
458 { "Address Key Type", "ipmi.vita.key.type",
459 FT_UINT8, BASE_HEX, VALS(str_vita_addr_key_types), 0, NULL, HFILL }},
460 { &hf_vita_addr_key,
461 { "Address Key", "ipmi.vita.key",
462 FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL }},
463 { &hf_vita_site_type,
464 { "Site Type", "ipmi.vita.site.type",
465 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &str_vita_site_types_ext, 0, NULL, HFILL }},
466 { &hf_vita_hw_addr,
467 { "Hardware Address", "ipmi.vita.hwaddr",
468 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
469 { &hf_vita_ipmb_addr,
470 { "IPMB Address", "ipmi.vita.ipmb.addr",
471 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
472 { &hf_vita_site_num,
473 { "Site Number", "ipmi.vita.site.num",
474 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
475 { &hf_vita_ipmbl_addr,
476 { "Address on IPMI Channel 7", "ipmi.vita.ipmbl.addr",
477 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
478 { &hf_vita_chassis_identifier,
479 { "Chassis Identifier",
480 "ipmi.vita.chassis_identifier", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
481 { &hf_vita_chassis_identifier_type,
482 { "Type",
483 "ipmi.vita.chassis_identifier_type", FT_UINT8, BASE_DEC, NULL, 0xc0, NULL, HFILL }},
484 { &hf_vita_chassis_identifier_length,
485 { "Length",
486 "ipmi.vita.chassis_identifier_length", FT_UINT8, BASE_DEC, NULL, 0x3f, NULL, HFILL }},
487 { &hf_vita_reserved,
488 { "Reserved", "ipmi.vita.reserved",
489 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
490 { &hf_vita_fru_control,
491 { "FRU Control", "ipmi.vita.fru.control",
492 FT_UINT8, BASE_DEC, VALS(str_vita_fru_controls), 0, NULL, HFILL }},
493 { &hf_vita_led_count,
494 { "LED Count", "ipmi.vita.led.count",
495 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
496 { &hf_vita_led_id,
497 { "LED ID", "ipmi.vita.led.id",
498 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
499 { &hf_vita_led_caps,
500 { "LED Color Capabilities", "ipmi.vita.led.caps",
501 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
502 { &hf_vita_led_cap_blue,
503 { "LED supports BLUE", "ipmi.vita.led.cap.blue",
504 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
505 { &hf_vita_led_cap_red,
506 { "LED supports RED", "ipmi.vita.led.cap.red",
507 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
508 { &hf_vita_led_cap_green,
509 { "LED supports GREEN", "ipmi.vita.led.cap.green",
510 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
511 { &hf_vita_led_cap_amber,
512 { "LED supports AMBER", "ipmi.vita.led.cap.amber",
513 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
514 { &hf_vita_led_cap_orange,
515 { "LED supports ORANGE", "ipmi.vita.led.cap.orange",
516 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
517 { &hf_vita_led_cap_white,
518 { "LED supports WHITE", "ipmi.vita.led.cap.white",
519 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
520 { &hf_vita_led_def_loc_color,
521 { "Default LED Color in Local Control State", "ipmi.vita.led.def.loc.color",
522 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
523 { &hf_vita_led_def_ovr_color,
524 { "Default LED Color in Override State", "ipmi.vita.led.def.ovr.color",
525 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
526 { &hf_vita_led_flags,
527 { "LED Flags", "ipmi.vita.led.flags",
528 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
529 { &hf_vita_led_flag_pwr,
530 { "LED is powered from Payload power", "ipmi.vita.led.flag.pwr",
531 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
532 { &hf_vita_led_flag_hw_restrict,
533 { "LED has other hardware restrictions", "ipmi.vita.led.flag.hw.restrict",
534 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
535 { &hf_vita_led_color,
536 { "LED Color Value", "ipmi.vita.led.color",
537 FT_UINT8, BASE_HEX, VALS(str_vita_led_colors), 0x0F, NULL, HFILL }},
538 { &hf_vita_led_ovr_func,
539 { "Override State LED Function", "ipmi.vita.led.ovr.func",
540 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(str_vita_led_func), 0, NULL, HFILL }},
541 { &hf_vita_led_ovr_duration,
542 { "Override State On-Duration", "ipmi.vita.led.ovr.duration",
543 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
544 { &hf_vita_led_ovr_color,
545 { "Override State Color", "ipmi.vita.led.ovr.color",
546 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
547 { &hf_vita_led_lamp_test_duration,
548 { "Lamp Test Duration", "ipmi.vita.led.lamp.duration",
549 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
550 { &hf_vita_led_loc_func,
551 { "Local Control LED Function", "ipmi.vita.led.loc.func",
552 FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(str_vita_led_func), 0, NULL, HFILL }},
553 { &hf_vita_led_loc_duration,
554 { "Local Control On-Duration", "ipmi.vita.led.loc.duration",
555 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
556 { &hf_vita_led_loc_color,
557 { "Local Control Color", "ipmi.vita.led.loc.color",
558 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
559 { &hf_vita_led_states,
560 { "LED States", "ipmi.vita.led.states",
561 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
562 { &hf_vita_led_state_local,
563 { "Local Control State", "ipmi.vita.led.state.loc",
564 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
565 { &hf_vita_led_state_override,
566 { "Override State", "ipmi.vita.led.state.ovr",
567 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
568 { &hf_vita_led_state_lamp_test,
569 { "Lamp Test", "ipmi.vita.led.state.lamp",
570 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
571 { &hf_vita_led_state_hw_restrict,
572 { "Hardware Restriction", "ipmi.vita.led.state.hw",
573 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
574 { &hf_vita_ipmba_state,
575 { "IPMB-A State", "ipmi.vita.ipmba.state",
576 FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(str_vita_ipmb_state), 0, NULL, HFILL }},
577 { &hf_vita_ipmbb_state,
578 { "IPMB-B State", "ipmi.vita.ipmbb.state",
579 FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(str_vita_ipmb_state), 0, NULL, HFILL }},
580 { &hf_vita_ipmb_state,
581 { "IPMB State", "ipmi.vita.ipmb.ovr",
582 FT_BOOLEAN, 8, TFS(&str_vita_ipmb_override), 0x01, NULL, HFILL }},
583 { &hf_vita_ipmb_link_id,
584 { "IPMB Link ID", "ipmi.vita.ipmb.link.id",
585 FT_UINT8, BASE_DEC_HEX|BASE_RANGE_STRING, RVALS(str_vita_ipmb_link_id), 0xFE, NULL, HFILL }},
586 { &hf_vita_fru_policy_mask_bits,
587 { "FRU Activation Policy Mask Bits", "ipmi.vita.fru.policy.mask",
588 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
589 { &hf_vita_fru_policy_set_bits,
590 { "FRU Activation Policy Set Bits", "ipmi.vita.fru.policy.set",
591 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
592 { &hf_vita_fru_policy_bits,
593 { "FRU Activation Policies", "ipmi.vita.fru.policy.bits",
594 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
595 { &hf_vita_fru_activation_locked,
596 { "Activation Locked", "ipmi.vita.fru.policy.al",
597 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
598 { &hf_vita_fru_deactivation_locked,
599 { "Deactivation Locked", "ipmi.vita.fru.policy.dl",
600 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
601 { &hf_vita_fru_commanded_deactivation_ignored,
602 { "Commanded Deactivation Ignored", "ipmi.vita.fru.policy.cdi",
603 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
604 { &hf_vita_fru_default_activation_locked,
605 { "Default Activation Locked", "ipmi.vita.fru.policy.dal",
606 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
607 { &hf_vita_fru_activation,
608 { "FRU Activation/Deactivation", "ipmi.vita.fru.activation",
609 FT_UINT8, BASE_DEC, VALS(str_vita_fru_activation), 0, NULL, HFILL }},
610 { &hf_vita_record_id,
611 { "Record ID", "ipmi.vita.record.id",
612 FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
613 { &hf_vita_fan_min_level,
614 { "Minimum Speed Level", "ipmi.vita.fan.min",
615 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
616 { &hf_vita_fan_max_level,
617 { "Maximum Speed Level", "ipmi.vita.fan.max",
618 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
619 { &hf_vita_fan_norm_level,
620 { "Normal Operating Level", "ipmi.vita.fan.norm",
621 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
622 { &hf_vita_fan_properties,
623 { "Fan Tray Properties", "ipmi.vita.fan.props",
624 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
625 { &hf_vita_fan_prop_local_control,
626 { "Local Control Supported", "ipmi.vita.fan.prop.lc",
627 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
628 { &hf_vita_fan_override_level,
629 { "Override Fan Level", "ipmi.vita.fan.ovr",
630 FT_UINT8, BASE_HEX, VALS(str_vita_fan_levels), 0, NULL, HFILL }},
631 { &hf_vita_fan_local_level,
632 { "Local Control Fan Level", "ipmi.vita.fan.loc",
633 FT_UINT8, BASE_HEX, VALS(str_vita_fan_levels), 0, NULL, HFILL }},
634 { &hf_vita_fan_local_control,
635 { "Local Control Enable State", "ipmi.vita.fan.lc",
636 FT_UINT8, BASE_DEC, VALS(str_vita_fan_local_control), 0, NULL, HFILL }},
637 { &hf_vita_ipmb_link_key_type,
638 { "IPMB Link Info Key Type", "ipmi.vita.ipmb.link.key.type",
639 FT_UINT8, BASE_DEC, VALS(str_vita_ipmb_link_key_types), 0, NULL, HFILL }},
640 { &hf_vita_ipmb_link_key_value,
641 { "IPMB Link Info Key", "ipmi.vita.ipmb.link.key.value",
642 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
643 { &hf_vita_ipmb_link_number,
644 { "IPMB Link Number", "ipmi.vita.ipmb.link.number",
645 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
646 { &hf_vita_ipmb_sensor_number,
647 { "IPMB Sensor Number", "ipmi.vita.ipmb.sensor.number",
648 FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
649 { &hf_vita_active_chmc_ipmb_addr,
650 { "Active Chassis Manager IPMB Address", "ipmi.vita.active.chmc.ipmb.addr",
651 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
652 { &hf_vita_backup_chmc_ipmb_addr,
653 { "Backup Chassis Manager IPMB Address", "ipmi.vita.backup.chmc.ipmb.addr",
654 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
655 { &hf_vita_fan_number,
656 { "Fan Tray Site Number", "ipmi.vita.fan.num",
657 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
658 { &hf_vita_fan_policy,
659 { "Fan Enable State", "ipmi.vita.fan.policy",
660 FT_UINT8, BASE_DEC, VALS(str_vita_fan_policies), 0, NULL, HFILL }},
661 { &hf_vita_fan_policy_timeout,
662 { "Fan Policy Timeout", "ipmi.vita.fan.policy.timeout",
663 FT_UINT8, BASE_DEC, VALS(str_vita_fan_policy_timeouts), 0, NULL, HFILL }},
664 { &hf_vita_fan_coverage,
665 { "Coverage", "ipmi.vita.fan.coverage",
666 FT_UINT8, BASE_DEC, VALS(str_vita_fan_coverages), 0, NULL, HFILL }},
667 { &hf_vita_fru_control_caps,
668 { "FRU Control Capabilities Mask", "ipmi.vita.fru.control.caps",
669 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
670 { &hf_vita_fru_control_cap_cold,
671 { "Capable of issuing a cold reset", "ipmi.vita.fru.control.cap.cold",
672 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
673 { &hf_vita_fru_control_cap_warm,
674 { "Capable of issuing a warm reset", "ipmi.vita.fru.control.cap.warm",
675 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
676 { &hf_vita_fru_control_cap_grace,
677 { "Capable of issuing a graceful reboot", "ipmi.vita.fru.control.cap.grace",
678 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
679 { &hf_vita_fru_control_cap_diag,
680 { "Capable of issuing a diagnostic interrupt", "ipmi.vita.fru.control.cap.diag",
681 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
682 { &hf_vita_fru_control_cap_pwr,
683 { "Capable of controlling payload power", "ipmi.vita.fru.control.cap.pwr",
684 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
685 { &hf_vita_fru_lock_operation,
686 { "FRU Inventory Device Lock Operation", "ipmi.vita.fru.lock.op",
687 FT_UINT8, BASE_DEC, VALS(str_vita_fru_lock_operations), 0, NULL, HFILL }},
688 { &hf_vita_fru_lock_id,
689 { "FRU Inventory Device Lock ID", "ipmi.vita.fru.lock.id",
690 FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL }},
691 { &hf_vita_fru_lock_timestamp,
692 { "FRU Inventory Device Last Commit Timestamp", "ipmi.vita.fru.lock.stamp",
693 FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL }},
694 { &hf_vita_fru_write_offset,
695 { "FRU Inventory offset to write", "ipmi.vita.fru.write.offset",
696 FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
697 { &hf_vita_fru_write_data,
698 { "Data to write", "ipmi.vita.fru.write.data",
699 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
700 { &hf_vita_fru_write_count,
701 { "Written byte count", "ipmi.vita.fru.write.count",
702 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
703 { &hf_vita_chassis_addr_number,
704 { "Address Number", "ipmi.vita.chassis.addr.num",
705 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
706 { &hf_vita_chassis_addr_timestamp,
707 { "Chassis IP Address Last Change Timestamp", "ipmi.vita.chassis.stamp",
708 FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL }},
709 { &hf_vita_chassis_addr_count,
710 { "Address Count", "ipmi.vita.chassis.addr.count",
711 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
712 { &hf_vita_chassis_max_unavail,
713 { "Maximum Unavailable Time", "ipmi.vita.chassis.max.unavail",
714 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
715 { &hf_vita_chassis_addr_type,
716 { "Address Type", "ipmi.vita.chassis.addr.type",
717 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
718 { &hf_vita_chassis_addr,
719 { "Address", "ipmi.vita.chassis.addr",
720 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
721 { &hf_vita_chassis_addr_chmc,
722 { "Chassis Manager IP Address", "ipmi.vita.chassis.addr.chmc",
723 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
724 { &hf_vita_chassis_addr_format,
725 { "Address Type", "ipmi.vita.chassis.addr.format",
726 FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(str_vita_chassis_addr_formats), 0x7F, NULL, HFILL }},
727 { &hf_vita_ipv4_addr,
728 { "IPv4 Address", "ipmi.vita.ipv4.addr",
729 FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }},
730 { &hf_vita_rmcp_port,
731 { "RMCP Port", "ipmi.vita.rmcp.port",
732 FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL }},
733 { &hf_vita_persistent_control_state,
734 { "FRU Persistent Control Current State", "ipmi.vita.pers.state",
735 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
736 { &hf_vita_persistent_control_cold,
737 { "Persistent Cold Reset State", "ipmi.vita.pers.state.cold",
738 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
739 { &hf_vita_persistent_control_warm,
740 { "Persistent Warm Reset State", "ipmi.vita.pers.state.warm",
741 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
742 { &hf_vita_persistent_control_mask,
743 { "FRU Persistent Control Selection Mask", "ipmi.vita.pers.mask",
744 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
745 { &hf_vita_persistent_control_set,
746 { "FRU Persistent Control Selection", "ipmi.vita.pers.set",
747 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
748 { &hf_vita_persistent_control_caps,
749 { "FRU Persistent Control Capabilities Mask", "ipmi.vita.pers.caps",
750 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
751 { &hf_vita_persistent_control_cap_cold,
752 { "Capable of asserting a persistent cold reset", "ipmi.vita.pers.cap.cold",
753 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
754 { &hf_vita_persistent_control_cap_warm,
755 { "Capable of asserting a persistent warm reset", "ipmi.vita.pers.cap.warm",
756 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
757 { &hf_vita_fru_state_sensor_num,
758 { "FRU State Sensor Number", "ipmi.vita.sensor.fru.state",
759 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
760 { &hf_vita_fru_health_sensor_num,
761 { "FRU Health Sensor Number", "ipmi.vita.sensor.fru.health",
762 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
763 { &hf_vita_fru_voltage_sensor_num,
764 { "FRU Voltage Sensor Number", "ipmi.vita.sensor.fru.voltage",
765 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
766 { &hf_vita_fru_temp_sensor_num,
767 { "FRU Temperature Sensor Number", "ipmi.vita.sensor.fru.temp",
768 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
769 { &hf_vita_payload_test_results_sensor_num,
770 { "Payload Test Results Sensor Number", "ipmi.vita.sensor.payload.test.res",
771 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
772 { &hf_vita_payload_test_status_sensor_num,
773 { "Payload Test Status Sensor Number", "ipmi.vita.sensor.payload.test.status",
774 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}
777 /* Get VSO Capabilities (response).
779 static void
780 cmd00_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
782 static int * const bits_vita_ipmc[] = {
783 &hf_vita_tier, &hf_vita_layer, NULL
785 static int * const bits_vita_ipmb[] = {
786 &hf_vita_ipmb_itfs, &hf_vita_ipmb_freq, NULL
788 static int * const bits_vita_vso[] = {
789 &hf_vita_vso_std, NULL
792 proto_tree_add_bitmask(tree, tvb, 0, hf_vita_ipmc,
793 ett_vita_ipmc, bits_vita_ipmc, ENC_LITTLE_ENDIAN);
794 proto_tree_add_bitmask(tree, tvb, 1, hf_vita_ipmb,
795 ett_vita_ipmb, bits_vita_ipmb, ENC_LITTLE_ENDIAN);
796 proto_tree_add_bitmask(tree, tvb, 2, hf_vita_vso,
797 ett_vita_vso, bits_vita_vso, ENC_LITTLE_ENDIAN);
798 proto_tree_add_item(tree, hf_vita_rev, tvb, 3, 1, ENC_LITTLE_ENDIAN);
799 proto_tree_add_item(tree, hf_vita_max_fruid, tvb, 4, 1, ENC_LITTLE_ENDIAN);
800 proto_tree_add_item(tree, hf_vita_ipmc_fruid, tvb, 5, 1, ENC_LITTLE_ENDIAN);
803 /* Get Chassis Address Table Info (request).
805 static void
806 cmd01_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
808 unsigned len = tvb_captured_length(tvb);
810 if (len > 0) {
811 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
813 if (len > 1) {
814 proto_tree_add_item(tree, hf_vita_addr_key_type, tvb, 1, 1, ENC_LITTLE_ENDIAN);
816 if (len > 2) {
817 proto_tree_add_item(tree, hf_vita_addr_key, tvb, 2, 1, ENC_LITTLE_ENDIAN);
819 if (len > 3) {
820 proto_tree_add_item(tree, hf_vita_site_type, tvb, 3, 1, ENC_LITTLE_ENDIAN);
824 /* Get Chassis Address Table Info (response).
826 static void
827 cmd01_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
829 proto_tree_add_item(tree, hf_vita_hw_addr, tvb, 0, 1, ENC_LITTLE_ENDIAN);
830 proto_tree_add_item(tree, hf_vita_ipmb_addr, tvb, 1, 1, ENC_LITTLE_ENDIAN);
831 proto_tree_add_item(tree, hf_vita_reserved, tvb, 2, 1, ENC_LITTLE_ENDIAN);
832 proto_tree_add_item(tree, hf_vita_fruid, tvb, 3, 1, ENC_LITTLE_ENDIAN);
833 proto_tree_add_item(tree, hf_vita_site_num, tvb, 4, 1, ENC_LITTLE_ENDIAN);
834 proto_tree_add_item(tree, hf_vita_site_type, tvb, 5, 1, ENC_LITTLE_ENDIAN);
835 if (tvb_captured_length(tvb) > 7) {
836 proto_tree_add_item(tree, hf_vita_reserved, tvb, 6, 1, ENC_LITTLE_ENDIAN);
837 proto_tree_add_item(tree, hf_vita_ipmbl_addr, tvb, 7, 1, ENC_LITTLE_ENDIAN);
841 /* Get Chassis Identifier (response), Set Chassis Identifier (request)
843 static void
844 cmd02_rs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
846 ipmi_add_typelen(pinfo, tree, hf_vita_chassis_identifier, hf_vita_chassis_identifier_type, hf_vita_chassis_identifier_length, tvb, 0, true);
849 /* FRU Control (request)
851 static void
852 cmd04_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
854 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
855 proto_tree_add_item(tree, hf_vita_fru_control, tvb, 1, 1, ENC_LITTLE_ENDIAN);
858 /* Get FRU LED Properties (request)
860 static void
861 cmd05_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
863 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
866 /* Get FRU LED Properties (response)
868 static void
869 cmd05_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
871 proto_tree_add_item(tree, hf_vita_reserved, tvb, 0, 1, ENC_LITTLE_ENDIAN);
872 proto_tree_add_item(tree, hf_vita_led_count, tvb, 1, 1, ENC_LITTLE_ENDIAN);
875 /* Get LED Color Capabilities (request)
877 static void
878 cmd06_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
880 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
881 proto_tree_add_item(tree, hf_vita_led_id, tvb, 1, 1, ENC_LITTLE_ENDIAN);
884 /* Get LED Color Capabilities (response)
886 static void
887 cmd06_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
889 static int * const bits_vita_led_caps[] = {
890 &hf_vita_led_cap_white, &hf_vita_led_cap_orange,
891 &hf_vita_led_cap_amber, &hf_vita_led_cap_green,
892 &hf_vita_led_cap_red, &hf_vita_led_cap_blue,
893 NULL
895 static int * const bits_vita_led_flags[] = {
896 &hf_vita_led_flag_pwr,
897 &hf_vita_led_flag_hw_restrict,
898 NULL
901 proto_tree_add_bitmask(tree, tvb, 0, hf_vita_led_caps,
902 ett_vita_led_caps, bits_vita_led_caps, ENC_LITTLE_ENDIAN);
903 proto_tree_add_bitmask(tree, tvb, 1, hf_vita_led_def_loc_color,
904 ett_vita_led_color, bits_vita_led_color, ENC_LITTLE_ENDIAN);
905 proto_tree_add_bitmask(tree, tvb, 2, hf_vita_led_def_ovr_color,
906 ett_vita_led_color, bits_vita_led_color, ENC_LITTLE_ENDIAN);
907 proto_tree_add_bitmask(tree, tvb, 3, hf_vita_led_flags,
908 ett_vita_led_flags, bits_vita_led_flags, ENC_LITTLE_ENDIAN);
911 /* Set FRU LED State (request)
913 static void
914 cmd07_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
916 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
917 proto_tree_add_item(tree, hf_vita_led_id, tvb, 1, 1, ENC_LITTLE_ENDIAN);
918 proto_tree_add_item(tree, hf_vita_led_ovr_func, tvb, 2, 1, ENC_LITTLE_ENDIAN);
919 proto_tree_add_item(tree, hf_vita_led_ovr_duration, tvb, 3, 1, ENC_LITTLE_ENDIAN);
920 proto_tree_add_bitmask(tree, tvb, 4, hf_vita_led_ovr_color,
921 ett_vita_led_color, bits_vita_led_color, ENC_LITTLE_ENDIAN);
924 /* Get FRU LED State (response)
926 static void
927 cmd08_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
929 static int * const bits_vita_led_states[] = {
930 &hf_vita_led_state_local,
931 &hf_vita_led_state_override,
932 &hf_vita_led_state_lamp_test,
933 &hf_vita_led_state_hw_restrict,
934 NULL
936 proto_tree_add_bitmask(tree, tvb, 0, hf_vita_led_states,
937 ett_vita_led_states, bits_vita_led_states, ENC_LITTLE_ENDIAN);
938 proto_tree_add_item(tree, hf_vita_led_loc_func, tvb, 1, 1, ENC_LITTLE_ENDIAN);
939 proto_tree_add_item(tree, hf_vita_led_loc_duration, tvb, 2, 1, ENC_LITTLE_ENDIAN);
940 proto_tree_add_bitmask(tree, tvb, 3, hf_vita_led_loc_color,
941 ett_vita_led_color, bits_vita_led_color, ENC_LITTLE_ENDIAN);
942 if (tvb_captured_length(tvb) > 4) {
943 proto_tree_add_item(tree, hf_vita_led_ovr_func, tvb, 4, 1, ENC_LITTLE_ENDIAN);
944 proto_tree_add_item(tree, hf_vita_led_ovr_duration, tvb, 5, 1, ENC_LITTLE_ENDIAN);
945 proto_tree_add_bitmask(tree, tvb, 6, hf_vita_led_ovr_color,
946 ett_vita_led_color, bits_vita_led_color, ENC_LITTLE_ENDIAN);
948 if (tvb_captured_length(tvb) > 7) {
949 proto_tree_add_item(tree, hf_vita_led_lamp_test_duration, tvb, 7, 1, ENC_LITTLE_ENDIAN);
953 /* Set IPMB State (request)
955 static void
956 cmd09_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
958 static int * const bits_vita_ipmb_state[] = {
959 &hf_vita_ipmb_state,
960 &hf_vita_ipmb_link_id,
961 NULL
963 proto_tree_add_bitmask(tree, tvb, 0, hf_vita_ipmba_state,
964 ett_vita_ipmb_state, bits_vita_ipmb_state, ENC_LITTLE_ENDIAN);
965 proto_tree_add_bitmask(tree, tvb, 1, hf_vita_ipmbb_state,
966 ett_vita_ipmb_state, bits_vita_ipmb_state, ENC_LITTLE_ENDIAN);
969 /* Set FRU State Policy Bits (request)
971 static void
972 cmd0A_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
974 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
975 proto_tree_add_bitmask(tree, tvb, 1, hf_vita_fru_policy_mask_bits,
976 ett_vita_fru_policy_bits, bits_vita_fru_policy_bits,
977 ENC_LITTLE_ENDIAN);
978 proto_tree_add_bitmask(tree, tvb, 2, hf_vita_fru_policy_set_bits,
979 ett_vita_fru_policy_bits, bits_vita_fru_policy_bits,
980 ENC_LITTLE_ENDIAN);
983 /* Get FRU State Policy Bits (response)
985 static void
986 cmd0B_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
988 proto_tree_add_bitmask(tree, tvb, 0, hf_vita_fru_policy_bits,
989 ett_vita_fru_policy_bits, bits_vita_fru_policy_bits,
990 ENC_LITTLE_ENDIAN);
993 /* Set FRU Activation (request)
995 static void
996 cmd0C_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
998 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
999 proto_tree_add_item(tree, hf_vita_fru_activation, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1002 /* Get FRU Device Locator Record ID (response)
1004 static void
1005 cmd0D_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1007 proto_tree_add_item(tree, hf_vita_record_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
1010 /* Get FAN Speed Properties (response)
1012 static void
1013 cmd14_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1015 static int * const bits_vita_fan_properties[] = {
1016 &hf_vita_fan_prop_local_control,
1017 NULL
1019 proto_tree_add_item(tree, hf_vita_fan_min_level, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1020 proto_tree_add_item(tree, hf_vita_fan_max_level, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1021 proto_tree_add_item(tree, hf_vita_fan_norm_level, tvb, 2, 1, ENC_LITTLE_ENDIAN);
1022 proto_tree_add_bitmask(tree, tvb, 3, hf_vita_fan_properties,
1023 ett_vita_fan_properties, bits_vita_fan_properties, ENC_LITTLE_ENDIAN);
1026 /* Set FAN Level (request)
1028 static void
1029 cmd15_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1031 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1032 proto_tree_add_item(tree, hf_vita_fan_override_level, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1033 if (tvb_captured_length(tvb) > 2) {
1034 proto_tree_add_item(tree, hf_vita_fan_local_control, tvb, 2, 1, ENC_LITTLE_ENDIAN);
1038 /* Get FAN Level (response)
1040 static void
1041 cmd16_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1043 proto_tree_add_item(tree, hf_vita_fan_override_level, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1044 if (tvb_captured_length(tvb) > 1) {
1045 proto_tree_add_item(tree, hf_vita_fan_local_level, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1047 if (tvb_captured_length(tvb) > 2) {
1048 proto_tree_add_item(tree, hf_vita_fan_local_control, tvb, 2, 1, ENC_LITTLE_ENDIAN);
1052 /* Get IPMB Link Info (request)
1054 static void
1055 cmd18_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1057 proto_tree_add_item(tree, hf_vita_ipmb_link_key_type, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1058 proto_tree_add_item(tree, hf_vita_ipmb_link_key_value, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1061 /* Get IPMB Link Info (response)
1063 static void
1064 cmd18_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1066 proto_tree_add_item(tree, hf_vita_ipmb_link_number, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1067 proto_tree_add_item(tree, hf_vita_ipmb_sensor_number, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1070 /* Get Chassis Manager IPMB Address (response)
1072 static void
1073 cmd1B_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1075 proto_tree_add_item(tree, hf_vita_active_chmc_ipmb_addr, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1076 proto_tree_add_item(tree, hf_vita_backup_chmc_ipmb_addr, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1079 /* Set FAN Policy (request)
1081 static void
1082 cmd1C_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1084 proto_tree_add_item(tree, hf_vita_fan_number, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1085 proto_tree_add_item(tree, hf_vita_fan_policy, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1086 if (tvb_captured_length(tvb) > 2) {
1087 proto_tree_add_item(tree, hf_vita_fan_policy_timeout, tvb, 2, 1, ENC_LITTLE_ENDIAN);
1089 if (tvb_captured_length(tvb) > 3) {
1090 proto_tree_add_item(tree, hf_vita_site_num, tvb, 3, 1, ENC_LITTLE_ENDIAN);
1091 proto_tree_add_item(tree, hf_vita_site_type, tvb, 4, 1, ENC_LITTLE_ENDIAN);
1095 /* Get FAN Policy (request)
1097 static void
1098 cmd1D_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1100 proto_tree_add_item(tree, hf_vita_fan_number, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1101 if (tvb_captured_length(tvb) > 1) {
1102 proto_tree_add_item(tree, hf_vita_site_num, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1103 proto_tree_add_item(tree, hf_vita_site_type, tvb, 2, 1, ENC_LITTLE_ENDIAN);
1107 /* Get FAN Policy (response)
1109 static void
1110 cmd1D_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1112 proto_tree_add_item(tree, hf_vita_fan_policy, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1113 if (tvb_captured_length(tvb) > 1) {
1114 proto_tree_add_item(tree, hf_vita_fan_coverage, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1118 /* FRU Control Capabilities (response)
1120 static void
1121 cmd1E_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1123 static int * const bits_vita_fru_control_caps[] = {
1124 &hf_vita_fru_control_cap_cold,
1125 &hf_vita_fru_control_cap_warm,
1126 &hf_vita_fru_control_cap_grace,
1127 &hf_vita_fru_control_cap_diag,
1128 &hf_vita_fru_control_cap_pwr,
1129 NULL
1131 proto_tree_add_bitmask(tree, tvb, 0, hf_vita_fru_control_caps,
1132 ett_vita_fru_control_caps, bits_vita_fru_control_caps, ENC_LITTLE_ENDIAN);
1135 /* FRU Inventory Device Lock Control (request)
1137 static void
1138 cmd1F_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1140 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1141 proto_tree_add_item(tree, hf_vita_fru_lock_operation, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1142 proto_tree_add_item(tree, hf_vita_fru_lock_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
1145 /* FRU Inventory Device Lock Control (response)
1147 static void
1148 cmd1F_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1150 proto_tree_add_item(tree, hf_vita_fru_lock_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
1151 proto_tree_add_item(tree, hf_vita_fru_lock_timestamp, tvb, 2, 4, ENC_LITTLE_ENDIAN);
1154 /* FRU Inventory Device Write (request)
1156 static void
1157 cmd20_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1159 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1160 proto_tree_add_item(tree, hf_vita_fru_lock_id, tvb, 1, 2, ENC_LITTLE_ENDIAN);
1161 proto_tree_add_item(tree, hf_vita_fru_write_offset, tvb, 3, 2, ENC_LITTLE_ENDIAN);
1162 proto_tree_add_item(tree, hf_vita_fru_write_data, tvb, 5,
1163 tvb_captured_length(tvb) - 5, ENC_NA);
1166 /* FRU Inventory Device Write (response)
1168 static void
1169 cmd20_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1171 proto_tree_add_item(tree, hf_vita_fru_write_count, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1174 /* Get Chassis Manager IP Address (request)
1176 static void
1177 cmd21_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1179 proto_tree_add_item(tree, hf_vita_chassis_addr_number, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1182 /* Get Chassis Manager IP Address (response)
1184 static void
1185 cmd21_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1187 proto_item * item;
1188 static int * const bits_vita_chassis_addr_type[] = {
1189 &hf_vita_chassis_addr_chmc,
1190 &hf_vita_chassis_addr_format,
1191 NULL
1193 proto_tree_add_item(tree, hf_vita_chassis_addr_timestamp, tvb, 0, 4, ENC_LITTLE_ENDIAN);
1194 proto_tree_add_item(tree, hf_vita_chassis_addr_count, tvb, 4, 1, ENC_LITTLE_ENDIAN);
1195 proto_tree_add_item(tree, hf_vita_site_type, tvb, 5, 1, ENC_LITTLE_ENDIAN);
1196 proto_tree_add_item(tree, hf_vita_site_num, tvb, 6, 1, ENC_LITTLE_ENDIAN);
1197 proto_tree_add_item(tree, hf_vita_chassis_max_unavail, tvb, 7, 1, ENC_LITTLE_ENDIAN);
1198 proto_tree_add_bitmask(tree, tvb, 8, hf_vita_chassis_addr_type,
1199 ett_vita_chassis_addr_type, bits_vita_chassis_addr_type,
1200 ENC_LITTLE_ENDIAN);
1201 item = proto_tree_add_item(tree, hf_vita_chassis_addr, tvb, 8, -1, ENC_NA);
1203 if (!(tvb_get_uint8(tvb, 8) & 0x7f)) {
1204 proto_tree * sub = proto_item_add_subtree(item, ett_vita_chassis_addr);
1205 proto_tree_add_item(sub, hf_vita_ipv4_addr, tvb, 9, 4, ENC_BIG_ENDIAN);
1206 proto_tree_add_item(sub, hf_vita_rmcp_port, tvb, 13, 2, ENC_BIG_ENDIAN);
1210 /* Get FRU Persistent Control (response)
1212 static void
1213 cmd41_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1215 proto_tree_add_bitmask(tree, tvb, 0, hf_vita_persistent_control_state,
1216 ett_vita_persistent_control_state,
1217 bits_vita_persistent_control_state,
1218 ENC_LITTLE_ENDIAN);
1221 /* Set FRU Persistent Control (request)
1223 static void
1224 cmd42_rq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1226 proto_tree_add_item(tree, hf_vita_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1227 proto_tree_add_bitmask(tree, tvb, 1, hf_vita_persistent_control_mask,
1228 ett_vita_persistent_control_state,
1229 bits_vita_persistent_control_state,
1230 ENC_LITTLE_ENDIAN);
1231 proto_tree_add_bitmask(tree, tvb, 2, hf_vita_persistent_control_set,
1232 ett_vita_persistent_control_state,
1233 bits_vita_persistent_control_state,
1234 ENC_LITTLE_ENDIAN);
1237 /* FRU Persistent Control capabilities (response)
1239 static void
1240 cmd43_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1242 static int * const bits_vita_persistent_control_caps[] = {
1243 &hf_vita_persistent_control_cap_cold,
1244 &hf_vita_persistent_control_cap_warm,
1245 NULL
1247 proto_tree_add_bitmask(tree, tvb, 0, hf_vita_persistent_control_caps,
1248 ett_vita_persistent_control_caps,
1249 bits_vita_persistent_control_caps,
1250 ENC_LITTLE_ENDIAN);
1253 /* Get Mandatory Sensor Numbers (response)
1255 static void
1256 cmd44_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
1258 proto_tree_add_item(tree, hf_vita_fru_state_sensor_num, tvb, 0, 1, ENC_LITTLE_ENDIAN);
1259 proto_tree_add_item(tree, hf_vita_fru_health_sensor_num, tvb, 1, 1, ENC_LITTLE_ENDIAN);
1260 proto_tree_add_item(tree, hf_vita_fru_voltage_sensor_num, tvb, 2, 1, ENC_LITTLE_ENDIAN);
1261 proto_tree_add_item(tree, hf_vita_fru_temp_sensor_num, tvb, 3, 1, ENC_LITTLE_ENDIAN);
1262 proto_tree_add_item(tree, hf_vita_payload_test_results_sensor_num, tvb, 4, 1, ENC_LITTLE_ENDIAN);
1263 proto_tree_add_item(tree, hf_vita_payload_test_status_sensor_num, tvb, 5, 1, ENC_LITTLE_ENDIAN);
1266 /* Array of VITA 46.11 command descriptors.
1268 static const ipmi_cmd_t cmd_vita[] = {
1269 { 0x00, NULL, cmd00_rs, NULL, NULL, "[VITA] Get VSO Capabilities", 0 },
1270 { 0x01, cmd01_rq, cmd01_rs, NULL, NULL, "[VITA] Get Chassis Address Table Info", 0 },
1271 { 0x02, NULL, cmd02_rs, NULL, NULL, "[VITA] Get Chassis Identifier", 0 },
1272 { 0x03, cmd02_rs, NULL, NULL, NULL, "[VITA] Set Chassis Identifier", 0 },
1273 { 0x04, cmd04_rq, NULL, NULL, NULL, "[VITA] FRU Control", 0 },
1274 { 0x05, cmd05_rq, cmd05_rs, NULL, NULL, "[VITA] Get FRU LED Properties", 0 },
1275 { 0x06, cmd06_rq, cmd06_rs, NULL, NULL, "[VITA] Get LED Color Capabilities", 0 },
1276 { 0x07, cmd07_rq, NULL, NULL, NULL, "[VITA] Set FRU LED State", 0 },
1277 { 0x08, cmd06_rq, cmd08_rs, NULL, NULL, "[VITA] Get FRU LED State", 0 },
1278 { 0x09, cmd09_rq, NULL, NULL, NULL, "[VITA] Set IPMB State", 0 },
1279 { 0x0A, cmd0A_rq, NULL, NULL, NULL, "[VITA] Set FRU State Policy Bits", 0 },
1280 { 0x0B, cmd05_rq, cmd0B_rs, NULL, NULL, "[VITA] Get FRU State Policy Bits", 0 },
1281 { 0x0C, cmd0C_rq, NULL, NULL, NULL, "[VITA] Set FRU Activation", 0 },
1282 { 0x0D, cmd05_rq, cmd0D_rs, NULL, NULL, "[VITA] Get Device Locator Record ID", 0 },
1283 { 0x14, cmd05_rq, cmd14_rs, NULL, NULL, "[VITA] Get Fan Speed Properties", 0 },
1284 { 0x15, cmd15_rq, NULL, NULL, NULL, "[VITA] Set Fan Level", 0 },
1285 { 0x16, cmd05_rq, cmd16_rs, NULL, NULL, "[VITA] Get Fan Level", 0 },
1286 { 0x18, cmd18_rq, cmd18_rs, NULL, NULL, "[VITA] Get IPMB Link Info", 0 },
1287 { 0x1B, NULL, cmd1B_rs, NULL, NULL, "[VITA] Get Chassis Manager IPMB Address", 0 },
1288 { 0x1C, cmd1C_rq, NULL, NULL, NULL, "[VITA] Set Fan Policy", 0 },
1289 { 0x1D, cmd1D_rq, cmd1D_rs, NULL, NULL, "[VITA] Get Fan Policy", 0 },
1290 { 0x1E, cmd05_rq, cmd1E_rs, NULL, NULL, "[VITA] FRU Control Capabilities", 0 },
1291 { 0x1F, cmd1F_rq, cmd1F_rs, cc1F, NULL, "[VITA] FRU Inventory Device Lock Control", 0 },
1292 { 0x20, cmd20_rq, cmd20_rs, cc20, NULL, "[VITA] FRU Inventory Device Write", 0 },
1293 { 0x21, cmd21_rq, cmd21_rs, NULL, NULL, "[VITA] Get Chassis Manager IP Address", 0 },
1294 { 0x40, cmd01_rq, cmd01_rs, NULL, NULL, "[VITA] Get FRU Address Info", 0 },
1295 { 0x41, cmd05_rq, cmd41_rs, NULL, NULL, "[VITA] Get FRU Persistent Control", 0 },
1296 { 0x42, cmd42_rq, NULL, NULL, NULL, "[VITA] Set FRU Persistent Control", 0 },
1297 { 0x43, cmd05_rq, cmd43_rs, NULL, NULL, "[VITA] FRU Persistent Control Capabilities", 0 },
1298 { 0x44, cmd05_rq, cmd44_rs, NULL, NULL, "[VITA] Get Mandatory Sensor Numbers", 0 }
1301 /* VITA 46.11 command set registrator
1303 void
1304 proto_register_ipmi_vita(void)
1306 static const uint8_t sig_vita[1] = { 3 };
1308 proto_register_field_array(proto_ipmi, hf_ipmi_vita,
1309 array_length(hf_ipmi_vita));
1310 proto_register_subtree_array(ett_ipmi_vita,
1311 array_length(ett_ipmi_vita));
1312 ipmi_register_netfn_cmdtab(IPMI_GROUP_REQ, IPMI_OEM_NONE,
1313 sig_vita, 1, "VITA", cmd_vita, array_length(cmd_vita));
1318 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1320 * Local variables:
1321 * c-basic-offset: 8
1322 * tab-width: 8
1323 * indent-tabs-mode: t
1324 * End:
1326 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1327 * :indentSize=8:tabSize=8:noTabs=false: