Coverage Report

Created: 2026-05-14 06:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-ipmi-chassis.c
Line
Count
Source
1
/* packet-ipmi-chassis.c
2
 * Sub-dissectors for IPMI messages (netFn=Chassis)
3
 * Copyright 2007-2008, Alexey Neyman, Pigeon Point Systems <avn@pigeonpoint.com>
4
 *
5
 * Wireshark - Network traffic analyzer
6
 * By Gerald Combs <gerald@wireshark.org>
7
 * Copyright 1998 Gerald Combs
8
 *
9
 * SPDX-License-Identifier: GPL-2.0-or-later
10
 */
11
12
#include "config.h"
13
14
#include <epan/packet.h>
15
#include <epan/tfs.h>
16
#include <wsutil/array.h>
17
18
#include "packet-ipmi.h"
19
20
void proto_register_ipmi_chassis(void);
21
22
/* Local variables.
23
 */
24
static int ett_ipmi_chs_bo00_byte1;
25
static int ett_ipmi_chs_bo02_byte1;
26
static int ett_ipmi_chs_bo03_byte1;
27
static int ett_ipmi_chs_bo04_byte2;
28
static int ett_ipmi_chs_bo05_byte1;
29
static int ett_ipmi_chs_bo05_byte2;
30
static int ett_ipmi_chs_bo05_byte3;
31
static int ett_ipmi_chs_bo05_byte4;
32
static int ett_ipmi_chs_bo06_byte1;
33
34
static int ett_ipmi_chs_00_capflags;
35
static int ett_ipmi_chs_01_pwr_state;
36
static int ett_ipmi_chs_01_last_event;
37
static int ett_ipmi_chs_01_misc;
38
static int ett_ipmi_chs_01_fpb;
39
static int ett_ipmi_chs_02_byte1;
40
static int ett_ipmi_chs_04_byte2;
41
static int ett_ipmi_chs_05_flags;
42
static int ett_ipmi_chs_06_byte1;
43
static int ett_ipmi_chs_06_policy_support;
44
static int ett_ipmi_chs_07_byte1;
45
static int ett_ipmi_chs_08_byte1;
46
static int ett_ipmi_chs_09_rq_byte1;
47
static int ett_ipmi_chs_09_rs_byte1;
48
static int ett_ipmi_chs_09_rs_byte2;
49
50
static int hf_ipmi_chs_bo00_sip;
51
static int hf_ipmi_chs_bo01_spsel;
52
static int hf_ipmi_chs_bo02_request;
53
static int hf_ipmi_chs_bo02_discovered;
54
static int hf_ipmi_chs_bo03_pef;
55
static int hf_ipmi_chs_bo03_cctrl_timeout;
56
static int hf_ipmi_chs_bo03_wd_timeout;
57
static int hf_ipmi_chs_bo03_softreset;
58
static int hf_ipmi_chs_bo03_powerup;
59
static int hf_ipmi_chs_bo04_write_mask;
60
static int hf_ipmi_chs_bo04_bootinit_ack_oem;
61
static int hf_ipmi_chs_bo04_bootinit_ack_sms;
62
static int hf_ipmi_chs_bo04_bootinit_ack_os;
63
static int hf_ipmi_chs_bo04_bootinit_ack_osloader;
64
static int hf_ipmi_chs_bo04_bootinit_ack_bios;
65
static int hf_ipmi_chs_bo05_bootflags_valid;
66
static int hf_ipmi_chs_bo05_permanent;
67
static int hf_ipmi_chs_bo05_boottype;
68
static int hf_ipmi_chs_bo05_cmos_clear;
69
static int hf_ipmi_chs_bo05_lock_kbd;
70
static int hf_ipmi_chs_bo05_bootdev;
71
static int hf_ipmi_chs_bo05_screen_blank;
72
static int hf_ipmi_chs_bo05_lockout_reset;
73
static int hf_ipmi_chs_bo05_lockout_poweroff;
74
static int hf_ipmi_chs_bo05_bios_verbosity;
75
static int hf_ipmi_chs_bo05_progress_traps;
76
static int hf_ipmi_chs_bo05_pwd_bypass;
77
static int hf_ipmi_chs_bo05_lock_sleep;
78
static int hf_ipmi_chs_bo05_console_redirection;
79
static int hf_ipmi_chs_bo05_bios_shared_override;
80
static int hf_ipmi_chs_bo05_bios_muxctl_override;
81
static int hf_ipmi_chs_bo05_byte5;
82
static int hf_ipmi_chs_bo06_chan_num;
83
static int hf_ipmi_chs_bo06_session_id;
84
static int hf_ipmi_chs_bo06_bootinfo_timestamp;
85
static int hf_ipmi_chs_bo07_block_selector;
86
static int hf_ipmi_chs_bo07_block_data;
87
88
static int hf_ipmi_chs_00_capflags_ppi;
89
static int hf_ipmi_chs_00_capflags_di;
90
static int hf_ipmi_chs_00_capflags_fpl;
91
static int hf_ipmi_chs_00_capflags_is;
92
static int hf_ipmi_chs_00_fru_dev_addr;
93
static int hf_ipmi_chs_00_sdr_dev_addr;
94
static int hf_ipmi_chs_00_sel_dev_addr;
95
static int hf_ipmi_chs_00_sm_dev_addr;
96
static int hf_ipmi_chs_00_bridge_dev_addr;
97
98
static int hf_ipmi_chs_01_pwr_state_policy;
99
static int hf_ipmi_chs_01_pwr_state_ctl_fault;
100
static int hf_ipmi_chs_01_pwr_state_fault;
101
static int hf_ipmi_chs_01_pwr_state_ilock;
102
static int hf_ipmi_chs_01_pwr_state_overload;
103
static int hf_ipmi_chs_01_pwr_state_powered;
104
static int hf_ipmi_chs_01_last_event_via_ipmi;
105
static int hf_ipmi_chs_01_last_event_down_by_fault;
106
static int hf_ipmi_chs_01_last_event_interlock;
107
static int hf_ipmi_chs_01_last_event_overload;
108
static int hf_ipmi_chs_01_last_event_ac_failed;
109
static int hf_ipmi_chs_01_misc_identsupp;
110
static int hf_ipmi_chs_01_misc_identstate;
111
static int hf_ipmi_chs_01_misc_fan;
112
static int hf_ipmi_chs_01_misc_drive;
113
static int hf_ipmi_chs_01_misc_fpl_active;
114
static int hf_ipmi_chs_01_misc_intrusion;
115
static int hf_ipmi_chs_01_fpb_standby_allowed;
116
static int hf_ipmi_chs_01_fpb_diagintr_allowed;
117
static int hf_ipmi_chs_01_fpb_reset_allowed;
118
static int hf_ipmi_chs_01_fpb_poweroff_allowed;
119
static int hf_ipmi_chs_01_fpb_standby_disabled;
120
static int hf_ipmi_chs_01_fpb_diagintr_disabled;
121
static int hf_ipmi_chs_01_fpb_reset_disabled;
122
static int hf_ipmi_chs_01_fpb_poweroff_disabled;
123
124
static int hf_ipmi_chs_02_cctrl;
125
126
static int hf_ipmi_chs_04_ival;
127
static int hf_ipmi_chs_04_perm_on;
128
129
static int hf_ipmi_chs_05_flags_fpl;
130
static int hf_ipmi_chs_05_flags_intrusion;
131
static int hf_ipmi_chs_05_fru_dev_addr;
132
static int hf_ipmi_chs_05_sdr_dev_addr;
133
static int hf_ipmi_chs_05_sel_dev_addr;
134
static int hf_ipmi_chs_05_sm_dev_addr;
135
static int hf_ipmi_chs_05_bridge_dev_addr;
136
137
static int hf_ipmi_chs_06_rq_policy;
138
static int hf_ipmi_chs_06_rs_policy_support_powerup;
139
static int hf_ipmi_chs_06_rs_policy_support_restore;
140
static int hf_ipmi_chs_06_rs_policy_support_poweroff;
141
142
static int hf_ipmi_chs_07_cause;
143
static int hf_ipmi_chs_07_chan;
144
145
static int hf_ipmi_chs_08_valid;
146
static int hf_ipmi_chs_08_selector;
147
static int hf_ipmi_chs_08_data;
148
149
static int hf_ipmi_chs_09_rq_param_select;
150
static int hf_ipmi_chs_09_rq_set_select;
151
static int hf_ipmi_chs_09_rq_block_select;
152
static int hf_ipmi_chs_09_rs_param_version;
153
static int hf_ipmi_chs_09_rs_valid;
154
static int hf_ipmi_chs_09_rs_param_select;
155
static int hf_ipmi_chs_09_rs_param_data;
156
157
static int hf_ipmi_chs_0f_minpercnt;
158
static int hf_ipmi_chs_0f_counter;
159
160
static const struct true_false_string tfs_00_provided = { "Provided", "Not Provided" };
161
162
static const value_string vals_01_pwr_policy[] = {
163
  { 0x00, "chassis stays powered off after AC returns" },
164
  { 0x01, "after AC returns, power is restored to the state that was in effect when AC was lost" },
165
  { 0x02, "chassis always powers up after AC returns" },
166
  { 0x03, "unknown" },
167
  { 0, NULL }
168
};
169
170
static const value_string vals_01_identstate[] = {
171
  { 0x00, "Off" },
172
  { 0x01, "Temporary (timed) On" },
173
  { 0x02, "On" },
174
  { 0, NULL }
175
};
176
177
static const value_string vals_02_cctrl[] = {
178
  { 0x00, "Power down" },
179
  { 0x01, "Power up" },
180
  { 0x02, "Power cycle" },
181
  { 0x03, "Hard reset" },
182
  { 0x04, "Pulse Diagnostic Interrupt" },
183
  { 0x05, "Initiate a soft-shutdown of OS via ACPI by emulating a fatal overtemperature" },
184
  { 0, NULL }
185
};
186
187
static const value_string vals_06_policy[] = {
188
  { 0x00, "Chassis always stays powered off after AC/mains is applied" },
189
  { 0x01, "After AC/mains is applied or returns, power is restored to the state that was in effect when AC/mains was removed or lost" },
190
  { 0x02, "Chassis always powers up after AC/mains is applied or returns" },
191
  { 0x03, "No change (just get policy support)" },
192
  { 0x04, "Reserved" },
193
  { 0x05, "Reserved" },
194
  { 0x06, "Reserved" },
195
  { 0x07, "Reserved" },
196
  { 0, NULL }
197
};
198
199
static const struct true_false_string tfs_06_supported = { "Supported", "Not supported" };
200
201
static const value_string vals_07_cause[] = {
202
  { 0x00, "Unknown" },
203
  { 0x01, "Chassis Control command" },
204
  { 0x02, "Reset via pushbutton" },
205
  { 0x03, "Power-up via pushbutton" },
206
  { 0x04, "Watchdog expiration" },
207
  { 0x05, "OEM" },
208
  { 0x06, "Automatic power-up on AC being applied due to 'always restore' power restore policy" },
209
  { 0x07, "Automatic power-up on AC being applied due to 'restore previous power state' power restore policy" },
210
  { 0x08, "Reset via PEF" },
211
  { 0x09, "Power-cycle via PEF" },
212
  { 0x0a, "Soft reset" },
213
  { 0x0b, "Power-up via RTC wakeup" },
214
  { 0x0c, "Reserved" },
215
  { 0x0d, "Reserved" },
216
  { 0x0e, "Reserved" },
217
  { 0x0f, "Reserved" },
218
  { 0, NULL }
219
};
220
221
static const value_string bo00_sip_vals[] = {
222
  { 0x00, "Set complete" },
223
  { 0x01, "Set in progress" },
224
  { 0x02, "Commit write" },
225
  { 0x03, "Reserved" },
226
  { 0, NULL }
227
};
228
229
static const struct true_false_string tfs_08_valid = {
230
  "Mark parameter invalid/locked",
231
  "Mark parameter valid/unlocked"
232
};
233
234
static const struct true_false_string bo03_dontclear_tfs = {
235
  "don't clear",
236
  "clear"
237
};
238
239
static const struct true_false_string bo04_bootinit_ack_tfs = {
240
  "has handled boot info",
241
  "hasn't handled boot info"
242
};
243
244
static const struct true_false_string bo05_permanent_tfs = {
245
  "options requested to be persistent for all future boots",
246
  "options apply to next boot only"
247
};
248
249
static const struct true_false_string bo05_boottype_tfs = {
250
  "Extensible Firmware Interface Boot (EFI)",
251
  "'PC compatible' boot (legacy)"
252
};
253
254
static const value_string bo05_bootdev_vals[] = {
255
  { 0x00, "No override" },
256
  { 0x01, "Force PXE" },
257
  { 0x02, "Force boot from default Hard-drive" },
258
  { 0x03, "Force boot from default Hard-drive, request Safe Mode" },
259
  { 0x04, "Force boot from default Diagnostic Partition" },
260
  { 0x05, "Force boot from default CD/DVD" },
261
  { 0x06, "Force boot into BIOS Setup" },
262
  { 0x07, "Reserved" },
263
  { 0x08, "Reserved" },
264
  { 0x09, "Reserved" },
265
  { 0x0a, "Reserved" },
266
  { 0x0b, "Reserved" },
267
  { 0x0c, "Reserved" },
268
  { 0x0d, "Reserved" },
269
  { 0x0e, "Reserved" },
270
  { 0x0f, "Force boot from floppy/primary removable media" },
271
  { 0, NULL }
272
};
273
274
static const value_string bo05_bios_verbosity_vals[] = {
275
  { 0x00, "System default" },
276
  { 0x01, "Request quiet display" },
277
  { 0x02, "Request verbose display" },
278
  { 0x03, "Reserved" },
279
  { 0, NULL }
280
};
281
282
static const value_string bo05_console_redir_vals[] = {
283
  { 0x00, "Console redirection occurs per BIOS configuration setting" },
284
  { 0x01, "Suppress (skip) console redirection" },
285
  { 0x02, "Request console redirection be enabled" },
286
  { 0x03, "Reserved" },
287
  { 0, NULL }
288
};
289
290
static const struct true_false_string bo05_bios_shared_tfs = {
291
  "Request BIOS to temporarily set the access mode for the channel specified in parameter #6 to 'Shared'",
292
  "No request to BIOS to change present access mode setting"
293
};
294
295
static const value_string bo05_bios_muxctl_vals[] = {
296
  { 0x00, "BIOS uses recommended setting of the mux at the end of POST" },
297
  { 0x01, "Requests BIOS to force mux to BMC at conclusion of POST/start of OS boot" },
298
  { 0x02, "Requests BIOS to force mux to system at conclusion of POST/start of OSboot" },
299
  { 0x03, "Reserved" },
300
  { 0x04, "Reserved" },
301
  { 0x05, "Reserved" },
302
  { 0x06, "Reserved" },
303
  { 0x07, "Reserved" },
304
  { 0, NULL }
305
};
306
307
static const struct true_false_string tfs_09_valid = {
308
  "Parameter marked invalid / locked",
309
  "Parameter marked valid / unlocked"
310
};
311
312
/* Boot options - common for Get/Set Boot Options commands
313
 */
314
static void
315
bootopt_00(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree)
316
0
{
317
0
  static int * const byte1[] = { &hf_ipmi_chs_bo00_sip, NULL };
318
319
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_bo00_byte1, byte1,
320
0
      ENC_LITTLE_ENDIAN, 0);
321
0
}
322
323
static void
324
bootopt_01(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree)
325
0
{
326
0
  proto_tree_add_item(tree, hf_ipmi_chs_bo01_spsel, tvb, 0, 1, ENC_LITTLE_ENDIAN);
327
0
}
328
329
static void
330
bootopt_02(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree)
331
0
{
332
0
  static int * const byte1[] = { &hf_ipmi_chs_bo02_request, &hf_ipmi_chs_bo02_discovered, NULL };
333
334
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Service partition scan: ",
335
0
      "Not discovered", ett_ipmi_chs_bo02_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
336
0
}
337
338
static void
339
bootopt_03(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree)
340
0
{
341
0
  static int * const byte1[] = { &hf_ipmi_chs_bo03_pef, &hf_ipmi_chs_bo03_cctrl_timeout,
342
0
    &hf_ipmi_chs_bo03_wd_timeout, &hf_ipmi_chs_bo03_softreset, &hf_ipmi_chs_bo03_powerup, NULL };
343
344
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, "BMC boot flag valid, don't clear on: ",
345
0
      "None", ett_ipmi_chs_bo03_byte1, byte1, ENC_LITTLE_ENDIAN, BMT_NO_TFS);
346
0
}
347
348
static void
349
bootopt_04(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree)
350
0
{
351
0
  static int * const byte2[] = { &hf_ipmi_chs_bo04_bootinit_ack_oem, &hf_ipmi_chs_bo04_bootinit_ack_sms,
352
0
    &hf_ipmi_chs_bo04_bootinit_ack_os, &hf_ipmi_chs_bo04_bootinit_ack_osloader,
353
0
    &hf_ipmi_chs_bo04_bootinit_ack_bios, NULL };
354
355
0
  proto_tree_add_item(tree, hf_ipmi_chs_bo04_write_mask, tvb, 0, 1, ENC_LITTLE_ENDIAN);
356
0
  proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Boot Initiator Acknowledge data: ",
357
0
      "None", ett_ipmi_chs_bo04_byte2, byte2, ENC_LITTLE_ENDIAN, BMT_NO_TFS);
358
0
}
359
360
static void
361
bootopt_05(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree)
362
0
{
363
0
  static int * const byte1[] = { &hf_ipmi_chs_bo05_bootflags_valid,
364
0
    &hf_ipmi_chs_bo05_permanent, &hf_ipmi_chs_bo05_boottype, NULL };
365
0
  static int * const byte2[] = { &hf_ipmi_chs_bo05_cmos_clear, &hf_ipmi_chs_bo05_lock_kbd,
366
0
    &hf_ipmi_chs_bo05_bootdev, &hf_ipmi_chs_bo05_screen_blank, &hf_ipmi_chs_bo05_lockout_reset, NULL };
367
0
  static int * const byte3[] = { &hf_ipmi_chs_bo05_lockout_poweroff, &hf_ipmi_chs_bo05_bios_verbosity,
368
0
    &hf_ipmi_chs_bo05_progress_traps, &hf_ipmi_chs_bo05_pwd_bypass, &hf_ipmi_chs_bo05_lock_sleep,
369
0
    &hf_ipmi_chs_bo05_console_redirection, NULL };
370
0
  static int * const byte4[] = { &hf_ipmi_chs_bo05_bios_shared_override,
371
0
    &hf_ipmi_chs_bo05_bios_muxctl_override, NULL };
372
373
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_bo05_byte1,
374
0
      byte1, ENC_LITTLE_ENDIAN, 0);
375
0
  proto_tree_add_bitmask_text(tree, tvb, 1, 1, NULL, NULL, ett_ipmi_chs_bo05_byte2,
376
0
      byte2, ENC_LITTLE_ENDIAN, 0);
377
0
  proto_tree_add_bitmask_text(tree, tvb, 2, 1, NULL, NULL, ett_ipmi_chs_bo05_byte3,
378
0
      byte3, ENC_LITTLE_ENDIAN, 0);
379
0
  proto_tree_add_bitmask_text(tree, tvb, 3, 1, NULL, NULL, ett_ipmi_chs_bo05_byte4,
380
0
      byte4, ENC_LITTLE_ENDIAN, 0);
381
0
  proto_tree_add_item(tree, hf_ipmi_chs_bo05_byte5, tvb, 4, 1, ENC_LITTLE_ENDIAN);
382
0
}
383
384
static void
385
bootopt_06(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree)
386
0
{
387
0
  static int * const byte1[] = { &hf_ipmi_chs_bo06_chan_num, NULL };
388
389
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
390
0
      ett_ipmi_chs_bo06_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
391
0
  proto_tree_add_item(tree, hf_ipmi_chs_bo06_session_id, tvb, 1, 4, ENC_LITTLE_ENDIAN);
392
0
  ipmi_add_timestamp(pinfo, tree, hf_ipmi_chs_bo06_bootinfo_timestamp, tvb, 5);
393
0
}
394
395
static void
396
bootopt_07(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree)
397
0
{
398
0
  proto_tree_add_item(tree, hf_ipmi_chs_bo07_block_selector, tvb, 0, 1, ENC_LITTLE_ENDIAN);
399
0
  proto_tree_add_item(tree, hf_ipmi_chs_bo07_block_data, tvb, 1, -1, ENC_NA);
400
0
}
401
402
403
static const struct {
404
  void (*intrp)(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree);
405
  const char *name;
406
} boot_options[] = {
407
  { bootopt_00, "Set In Progress" },
408
  { bootopt_01, "Service Partition Selector" },
409
  { bootopt_02, "Service Partition Scan" },
410
  { bootopt_03, "BMC boot flag valid bit clearing" },
411
  { bootopt_04, "Boot info acknowledge" },
412
  { bootopt_05, "Boot flags" },
413
  { bootopt_06, "Boot initiator info" },
414
  { bootopt_07, "Boot initiator mailbox" }
415
};
416
417
418
/* Get Chassis Capabilities (response)
419
 */
420
static void
421
rs00(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
422
0
{
423
0
  static int * const byte1[] = { &hf_ipmi_chs_00_capflags_ppi, &hf_ipmi_chs_00_capflags_di,
424
0
    &hf_ipmi_chs_00_capflags_fpl, &hf_ipmi_chs_00_capflags_is, NULL };
425
426
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Capabilities: ", "None",
427
0
      ett_ipmi_chs_00_capflags, byte1, ENC_LITTLE_ENDIAN, BMT_NO_TFS);
428
0
  proto_tree_add_item(tree, hf_ipmi_chs_00_fru_dev_addr, tvb, 1, 1, ENC_LITTLE_ENDIAN);
429
0
  proto_tree_add_item(tree, hf_ipmi_chs_00_sdr_dev_addr, tvb, 2, 1, ENC_LITTLE_ENDIAN);
430
0
  proto_tree_add_item(tree, hf_ipmi_chs_00_sel_dev_addr, tvb, 3, 1, ENC_LITTLE_ENDIAN);
431
0
  proto_tree_add_item(tree, hf_ipmi_chs_00_sm_dev_addr, tvb, 4, 1, ENC_LITTLE_ENDIAN);
432
433
0
  if (tvb_captured_length(tvb) >= 5) {
434
0
    proto_tree_add_item(tree, hf_ipmi_chs_00_bridge_dev_addr, tvb, 5, 1, ENC_LITTLE_ENDIAN);
435
0
  }
436
0
}
437
438
/* Get Chassis Status.
439
 */
440
static void
441
rs01(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
442
0
{
443
0
  static int * const byte1[] = { &hf_ipmi_chs_01_pwr_state_policy,
444
0
    &hf_ipmi_chs_01_pwr_state_ctl_fault, &hf_ipmi_chs_01_pwr_state_fault,
445
0
    &hf_ipmi_chs_01_pwr_state_ilock, &hf_ipmi_chs_01_pwr_state_overload,
446
0
    &hf_ipmi_chs_01_pwr_state_powered, NULL };
447
0
  static int * const byte2[] = { &hf_ipmi_chs_01_last_event_via_ipmi,
448
0
    &hf_ipmi_chs_01_last_event_down_by_fault, &hf_ipmi_chs_01_last_event_interlock,
449
0
    &hf_ipmi_chs_01_last_event_overload, &hf_ipmi_chs_01_last_event_ac_failed, NULL };
450
0
  static int * const byte3[] = { &hf_ipmi_chs_01_misc_identsupp, &hf_ipmi_chs_01_misc_identstate,
451
0
    &hf_ipmi_chs_01_misc_fan, &hf_ipmi_chs_01_misc_drive, &hf_ipmi_chs_01_misc_fpl_active,
452
0
    &hf_ipmi_chs_01_misc_intrusion, NULL };
453
0
  static int * const byte4[] = { &hf_ipmi_chs_01_fpb_standby_allowed,
454
0
    &hf_ipmi_chs_01_fpb_diagintr_allowed, &hf_ipmi_chs_01_fpb_reset_allowed,
455
0
    &hf_ipmi_chs_01_fpb_poweroff_allowed, &hf_ipmi_chs_01_fpb_standby_disabled,
456
0
    &hf_ipmi_chs_01_fpb_diagintr_disabled, &hf_ipmi_chs_01_fpb_reset_disabled,
457
0
    &hf_ipmi_chs_01_fpb_poweroff_disabled, NULL };
458
459
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Current Power State: ", NULL,
460
0
      ett_ipmi_chs_01_pwr_state, byte1, ENC_LITTLE_ENDIAN, 0);
461
0
  proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Last Power Event: ", NULL,
462
0
      ett_ipmi_chs_01_last_event, byte2, ENC_LITTLE_ENDIAN, 0);
463
0
  proto_tree_add_bitmask_text(tree, tvb, 2, 1, "Misc. State: ", NULL,
464
0
      ett_ipmi_chs_01_misc, byte3, ENC_LITTLE_ENDIAN, 0);
465
0
  if (tvb_captured_length(tvb) > 3) {
466
0
    proto_tree_add_bitmask_text(tree, tvb, 3, 1, "Front panel buttons capabilities: ",
467
0
        NULL, ett_ipmi_chs_01_fpb, byte4, ENC_LITTLE_ENDIAN, BMT_NO_TFS);
468
0
  };
469
0
}
470
471
/* Chassis Control.
472
 */
473
static void
474
rq02(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
475
0
{
476
0
  static int * const byte1[] = { &hf_ipmi_chs_02_cctrl, NULL };
477
478
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
479
0
      ett_ipmi_chs_02_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
480
0
}
481
482
/* Chassis Identify
483
 */
484
static void
485
rq04(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
486
0
{
487
0
  static int * const byte2[] = { &hf_ipmi_chs_04_perm_on, NULL };
488
489
0
  if (tvb_captured_length(tvb) > 0) {
490
0
    proto_tree_add_item(tree, hf_ipmi_chs_04_ival, tvb, 0, 1, ENC_LITTLE_ENDIAN);
491
0
  }
492
493
0
  if (tvb_captured_length(tvb) > 1) {
494
0
    proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Flags: ", "None",
495
0
        ett_ipmi_chs_04_byte2, byte2, ENC_LITTLE_ENDIAN, 0);
496
0
  }
497
0
}
498
499
/* Set Chassis Capabilities.
500
 */
501
static void
502
rq05(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
503
0
{
504
0
  static int * const byte1[] = { &hf_ipmi_chs_05_flags_fpl, &hf_ipmi_chs_05_flags_intrusion, NULL };
505
506
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Capabilities: ", "None",
507
0
      ett_ipmi_chs_05_flags, byte1, ENC_LITTLE_ENDIAN, 0);
508
0
  proto_tree_add_item(tree, hf_ipmi_chs_05_fru_dev_addr, tvb, 1, 1, ENC_LITTLE_ENDIAN);
509
0
  proto_tree_add_item(tree, hf_ipmi_chs_05_sdr_dev_addr, tvb, 2, 1, ENC_LITTLE_ENDIAN);
510
0
  proto_tree_add_item(tree, hf_ipmi_chs_05_sel_dev_addr, tvb, 3, 1, ENC_LITTLE_ENDIAN);
511
0
  proto_tree_add_item(tree, hf_ipmi_chs_05_sm_dev_addr, tvb, 4, 1, ENC_LITTLE_ENDIAN);
512
0
  if (tvb_captured_length(tvb) > 5) {
513
    /* Bridge device address is optional */
514
0
    proto_tree_add_item(tree, hf_ipmi_chs_05_bridge_dev_addr, tvb, 5, 1, ENC_LITTLE_ENDIAN);
515
0
  }
516
0
}
517
518
/* Set Power Restore Policy
519
 */
520
static void
521
rq06(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
522
0
{
523
0
  static int * const byte1[] = { &hf_ipmi_chs_06_rq_policy, NULL };
524
525
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
526
0
      ett_ipmi_chs_06_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
527
0
}
528
529
/* Get Power Restore Policy
530
 */
531
static void
532
rs06(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
533
0
{
534
0
  static int * const byte1[] = { &hf_ipmi_chs_06_rs_policy_support_powerup,
535
0
    &hf_ipmi_chs_06_rs_policy_support_restore, &hf_ipmi_chs_06_rs_policy_support_poweroff, NULL };
536
537
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Power Restore Policy support: ", "None",
538
0
      ett_ipmi_chs_06_policy_support, byte1, ENC_LITTLE_ENDIAN, BMT_NO_TFS);
539
0
}
540
541
/* Get System Restart Cause
542
 */
543
static void
544
rs07(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
545
0
{
546
0
  static int * const byte1[] = { &hf_ipmi_chs_07_cause, NULL };
547
548
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
549
0
      ett_ipmi_chs_07_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
550
0
  proto_tree_add_item(tree, hf_ipmi_chs_07_chan, tvb, 1, 1, ENC_LITTLE_ENDIAN);
551
0
}
552
553
/* Set System Boot Options
554
 */
555
static void
556
rq08(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
557
0
{
558
0
  proto_tree *s_tree;
559
0
  tvbuff_t *sub;
560
0
  uint8_t pno;
561
0
  const char *desc;
562
563
0
  pno = tvb_get_uint8(tvb, 0) & 0x7f;
564
0
  if (pno < array_length(boot_options)) {
565
0
    desc = boot_options[pno].name;
566
0
  } else if (pno >= 96 && pno <= 127) {
567
0
    desc = "OEM";
568
0
  } else {
569
0
    desc = "Reserved";
570
0
  }
571
572
0
  s_tree = proto_tree_add_subtree_format(tree, tvb, 0, 1,
573
0
      ett_ipmi_chs_08_byte1, NULL, "Boot option parameter selector: %s (0x%02x)",
574
0
      desc, pno);
575
0
  proto_tree_add_item(s_tree, hf_ipmi_chs_08_valid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
576
0
  proto_tree_add_uint_format_value(s_tree, hf_ipmi_chs_08_selector, tvb, 0, 1,
577
0
      pno, "Boot option parameter selector: %s (0x%02x)",
578
0
      desc, pno);
579
580
  /* Data is optional; no data means 'just set validity' */
581
0
  if (tvb_captured_length(tvb) > 1) {
582
0
    if (pno < array_length(boot_options)) {
583
0
      sub = tvb_new_subset_remaining(tvb, 1);
584
0
      boot_options[pno].intrp(pinfo, sub, tree);
585
0
    } else {
586
0
      proto_tree_add_none_format(tree, hf_ipmi_chs_08_data, tvb, 1,
587
0
          -1, "Parameter data: %s", desc);
588
0
    }
589
0
  }
590
0
}
591
592
static const value_string cc08[] = {
593
  { 0x80, "Parameter not supported" },
594
  { 0x81, "Attempt to set the 'set in progress' value (in parameter #0) when not in the 'set complete' state" },
595
  { 0x82, "Attempt to write read-only parameter" },
596
  { 0, NULL }
597
};
598
599
/* Get System Boot Options
600
 */
601
static void
602
rq09(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
603
0
{
604
0
  proto_tree *s_tree;
605
0
  uint8_t pno;
606
0
  const char *desc;
607
608
0
  pno = tvb_get_uint8(tvb, 0) & 0x7f;
609
0
  if (pno < array_length(boot_options)) {
610
0
    desc = boot_options[pno].name;
611
0
  } else if (pno >= 96 && pno <= 127) {
612
0
    desc = "OEM";
613
0
  } else {
614
0
    desc = "Reserved";
615
0
  }
616
617
618
0
  s_tree = proto_tree_add_subtree_format(tree, tvb, 0, 1,
619
0
      ett_ipmi_chs_09_rq_byte1, NULL, "Boot option parameter selector: %s (0x%02x)",
620
0
      desc, pno);
621
0
  proto_tree_add_uint_format_value(s_tree, hf_ipmi_chs_09_rq_param_select, tvb, 0, 1,
622
0
      pno, "Boot option parameter selector: %s (0x%02x)",
623
0
      desc, pno);
624
625
0
  proto_tree_add_item(tree, hf_ipmi_chs_09_rq_set_select, tvb, 1, 1, ENC_LITTLE_ENDIAN);
626
0
  proto_tree_add_item(tree, hf_ipmi_chs_09_rq_block_select, tvb, 2, 1, ENC_LITTLE_ENDIAN);
627
0
}
628
629
static void
630
rs09(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
631
0
{
632
0
  static int * const byte1[] = { &hf_ipmi_chs_09_rs_param_version, NULL };
633
0
  proto_tree *s_tree;
634
0
  tvbuff_t *sub;
635
0
  uint8_t pno;
636
0
  const char *desc;
637
638
0
  pno = tvb_get_uint8(tvb, 1) & 0x7f;
639
0
  if (pno < array_length(boot_options)) {
640
0
    desc = boot_options[pno].name;
641
0
  } else if (pno >= 96 && pno <= 127) {
642
0
    desc = "OEM";
643
0
  } else {
644
0
    desc = "Reserved";
645
0
  }
646
647
0
  proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
648
0
      ett_ipmi_chs_09_rs_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
649
650
0
  s_tree = proto_tree_add_subtree_format(tree, tvb, 1, 1,
651
0
      ett_ipmi_chs_09_rs_byte2, NULL, "Boot option parameter selector: %s (0x%02x)",
652
0
      desc, pno);
653
0
  proto_tree_add_item(s_tree, hf_ipmi_chs_09_rs_valid, tvb, 1, 1, ENC_LITTLE_ENDIAN);
654
0
  proto_tree_add_uint_format_value(s_tree, hf_ipmi_chs_09_rs_param_select, tvb, 1, 1,
655
0
      pno, "Boot option parameter selector: %s (0x%02x)",
656
0
      desc, pno);
657
658
0
  if (pno < array_length(boot_options)) {
659
0
    sub = tvb_new_subset_remaining(tvb, 2);
660
0
    boot_options[pno].intrp(pinfo, sub, tree);
661
0
  } else {
662
0
    proto_tree_add_item(tree, hf_ipmi_chs_09_rs_param_data, tvb, 2, -1, ENC_NA);
663
0
  }
664
0
}
665
666
static const value_string cc09[] = {
667
  { 0x80, "Parameter not supported" },
668
  { 0, NULL }
669
};
670
671
/* Get POH Counter
672
 */
673
static void
674
rs0f(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
675
0
{
676
0
  proto_tree_add_item(tree, hf_ipmi_chs_0f_minpercnt, tvb, 0, 1, ENC_LITTLE_ENDIAN);
677
0
  proto_tree_add_item(tree, hf_ipmi_chs_0f_counter, tvb, 1, 4, ENC_LITTLE_ENDIAN);
678
0
}
679
680
static const ipmi_cmd_t cmd_chassis[] = {
681
  /* Chassis commands */
682
  { 0x00, NULL, rs00, NULL, NULL, "Get Chassis Capabilities", 0 },
683
  { 0x01, NULL, rs01, NULL, NULL, "Get Chassis Status", 0 },
684
  { 0x02, rq02, NULL, NULL, NULL, "Chassis Control", 0 },
685
  { 0x03, NULL, NULL, NULL, NULL, "Chassis Reset", 0 },
686
  { 0x04, rq04, NULL, NULL, NULL, "Chassis Identify", 0 },
687
  { 0x05, rq05, NULL, NULL, NULL, "Set Chassis Capabilities", 0 },
688
  { 0x06, rq06, rs06, NULL, NULL, "Set Power Restore Policy", 0 },
689
  { 0x07, NULL, rs07, NULL, NULL, "Get System Restart Cause", 0 },
690
  { 0x08, rq08, NULL, cc08, NULL, "Set System Boot Options", 0 },
691
  { 0x09, rq09, rs09, cc09, NULL, "Get System Boot Options", 0 },
692
  { 0x0a, IPMI_TBD,   NULL, NULL, "Set Front Panel Buttons Enables", 0 },
693
  { 0x0b, IPMI_TBD,   NULL, NULL, "Set Power Cycle Interval", 0 },
694
  { 0x0f, NULL, rs0f, NULL, NULL, "Get POH Counter", 0 },
695
};
696
697
void
698
proto_register_ipmi_chassis(void)
699
15
{
700
15
  static hf_register_info hf[] = {
701
15
    { &hf_ipmi_chs_bo00_sip,
702
15
      { "Set In Progress",
703
15
        "ipmi.bootopt00.sip", FT_UINT8, BASE_HEX, VALS(bo00_sip_vals), 0x03, NULL, HFILL }},
704
15
    { &hf_ipmi_chs_bo01_spsel,
705
15
      { "Service Partition Selector",
706
15
        "ipmi.bootopt01.spsel", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
707
15
    { &hf_ipmi_chs_bo02_request,
708
15
      { "Request BIOS to scan for specified service partition",
709
15
        "ipmi.bootopt02.spscan.request", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
710
15
    { &hf_ipmi_chs_bo02_discovered,
711
15
      { "Service Partition discovered",
712
15
        "ipmi.bootopt02.spscan.discovered", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
713
15
    { &hf_ipmi_chs_bo03_pef,
714
15
      { "Reset/power cycle caused by PEF",
715
15
        "ipmi.bootopt03.bmcboot.pef", FT_BOOLEAN, 8, TFS(&bo03_dontclear_tfs), 0x10, NULL, HFILL }},
716
15
    { &hf_ipmi_chs_bo03_cctrl_timeout,
717
15
      { "Chassis Control command not received within 60s timeout",
718
15
        "ipmi.bootopt03.bmcboot.cctrl_timeout", FT_BOOLEAN, 8, TFS(&bo03_dontclear_tfs), 0x08, NULL, HFILL }},
719
15
    { &hf_ipmi_chs_bo03_wd_timeout,
720
15
      { "Reset/power cycle caused by watchdog timeout",
721
15
        "ipmi.bootopt03.bmcboot.wd_timeout", FT_BOOLEAN, 8, TFS(&bo03_dontclear_tfs), 0x04, NULL, HFILL }},
722
15
    { &hf_ipmi_chs_bo03_softreset,
723
15
      { "Pushbutton reset / soft reset",
724
15
        "ipmi.bootopt03.bmcboot.softreset", FT_BOOLEAN, 8, TFS(&bo03_dontclear_tfs), 0x02, NULL, HFILL }},
725
15
    { &hf_ipmi_chs_bo03_powerup,
726
15
      { "Power up via pushbutton or wake event",
727
15
        "ipmi.bootopt03.bmcboot.powerup", FT_BOOLEAN, 8, TFS(&bo03_dontclear_tfs), 0x01, NULL, HFILL }},
728
15
    { &hf_ipmi_chs_bo04_write_mask,
729
15
      { "Write mask",
730
15
        "ipmi.bootopt04.write_mask", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
731
15
    { &hf_ipmi_chs_bo04_bootinit_ack_oem,
732
15
      { "OEM",
733
15
        "ipmi.bootopt04.bootinit_ack.oem", FT_BOOLEAN, 8, TFS(&bo04_bootinit_ack_tfs), 0x10, NULL, HFILL }},
734
15
    { &hf_ipmi_chs_bo04_bootinit_ack_sms,
735
15
      { "SMS",
736
15
        "ipmi.bootopt04.bootinit_ack.sms", FT_BOOLEAN, 8, TFS(&bo04_bootinit_ack_tfs), 0x08, NULL, HFILL }},
737
15
    { &hf_ipmi_chs_bo04_bootinit_ack_os,
738
15
      { "OS / Service Partition",
739
15
        "ipmi.bootopt04.bootinit_ack.os", FT_BOOLEAN, 8, TFS(&bo04_bootinit_ack_tfs), 0x04, NULL, HFILL }},
740
15
    { &hf_ipmi_chs_bo04_bootinit_ack_osloader,
741
15
      { "OS Loader",
742
15
        "ipmi.bootopt04.bootinit_ack.osloader", FT_BOOLEAN, 8, TFS(&bo04_bootinit_ack_tfs), 0x02, NULL, HFILL }},
743
15
    { &hf_ipmi_chs_bo04_bootinit_ack_bios,
744
15
      { "BIOS/POST",
745
15
        "ipmi.bootopt04.bootinit_ack.bios", FT_BOOLEAN, 8, TFS(&bo04_bootinit_ack_tfs), 0x01, NULL, HFILL }},
746
15
    { &hf_ipmi_chs_bo05_bootflags_valid,
747
15
      { "Boot flags valid",
748
15
        "ipmi.bootopt05.boot_flags_valid", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
749
15
    { &hf_ipmi_chs_bo05_permanent,
750
15
      { "Permanency",
751
15
        "ipmi.bootopt05.permanent", FT_BOOLEAN, 8, TFS(&bo05_permanent_tfs), 0x40, NULL, HFILL }},
752
15
    { &hf_ipmi_chs_bo05_boottype,
753
15
      { "Boot type",
754
15
        "ipmi.bootopt05.boottype", FT_BOOLEAN, 8, TFS(&bo05_boottype_tfs), 0x20, NULL, HFILL }},
755
15
    { &hf_ipmi_chs_bo05_cmos_clear,
756
15
      { "CMOS Clear",
757
15
        "ipmi.bootopt05.cmos_clear", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
758
15
    { &hf_ipmi_chs_bo05_lock_kbd,
759
15
      { "Lock Keyboard",
760
15
        "ipmi.bootopt05.lock_kbd", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
761
15
    { &hf_ipmi_chs_bo05_bootdev,
762
15
      { "Boot Device Selector",
763
15
        "ipmi.bootopt05.bootdev", FT_UINT8, BASE_HEX, VALS(bo05_bootdev_vals), 0x3c, NULL, HFILL }},
764
15
    { &hf_ipmi_chs_bo05_screen_blank,
765
15
      { "Screen Blank",
766
15
        "ipmi.bootopt05.screen_blank", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
767
15
    { &hf_ipmi_chs_bo05_lockout_reset,
768
15
      { "Lock out Reset buttons",
769
15
        "ipmi.bootopt05.lockout_reset", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
770
15
    { &hf_ipmi_chs_bo05_lockout_poweroff,
771
15
      { "Lock out (power off / sleep request) via Power Button",
772
15
        "ipmi.bootopt05.lockout_poweroff", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
773
15
    { &hf_ipmi_chs_bo05_bios_verbosity,
774
15
      { "BIOS verbosity",
775
15
        "ipmi.bootopt05.bios_verbosity", FT_UINT8, BASE_HEX, VALS(bo05_bios_verbosity_vals), 0x60, NULL, HFILL }},
776
15
    { &hf_ipmi_chs_bo05_progress_traps,
777
15
      { "Force Progress Event Traps",
778
15
        "ipmi.bootopt05.progress_traps", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
779
15
    { &hf_ipmi_chs_bo05_pwd_bypass,
780
15
      { "User password bypass",
781
15
        "ipmi.bootopt05.pwd_bypass", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
782
15
    { &hf_ipmi_chs_bo05_lock_sleep,
783
15
      { "Lock Out Sleep Button",
784
15
        "ipmi.bootopt05.lock_sleep", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
785
15
    { &hf_ipmi_chs_bo05_console_redirection,
786
15
      { "Console redirection",
787
15
        "ipmi.bootopt05.console_redirection", FT_UINT8, BASE_HEX, VALS(bo05_console_redir_vals), 0x03, NULL, HFILL }},
788
15
    { &hf_ipmi_chs_bo05_bios_shared_override,
789
15
      { "BIOS Shared Mode Override",
790
15
        "ipmi.bootopt05.bios_shared_override", FT_BOOLEAN, 8, TFS(&bo05_bios_shared_tfs), 0x08, NULL, HFILL }},
791
15
    { &hf_ipmi_chs_bo05_bios_muxctl_override,
792
15
      { "BIOS Mux Control Override",
793
15
        "ipmi.bootopt05.bios_muxctl_override", FT_UINT8, BASE_HEX, VALS(bo05_bios_muxctl_vals), 0x07, NULL, HFILL }},
794
15
    { &hf_ipmi_chs_bo05_byte5,
795
15
      { "Data 5 (reserved)",
796
15
        "ipmi.bootopt05.byte5", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
797
15
    { &hf_ipmi_chs_bo06_chan_num,
798
15
      { "Channel",
799
15
        "ipmi.bootopt06.chan_num", FT_UINT8, BASE_CUSTOM, CF_FUNC(ipmi_fmt_channel), 0x0f, NULL, HFILL }},
800
15
    { &hf_ipmi_chs_bo06_session_id,
801
15
      { "Session ID",
802
15
        "ipmi.bootopt06.session_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
803
15
    { &hf_ipmi_chs_bo06_bootinfo_timestamp,
804
15
      { "Boot Info Timestamp",
805
15
        "impi.bootopt06.bootinfo_timestamp", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
806
15
    { &hf_ipmi_chs_bo07_block_selector,
807
15
      { "Block selector",
808
15
        "ipmi.bootopt07.block_selector", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
809
15
    { &hf_ipmi_chs_bo07_block_data,
810
15
      { "Block data",
811
15
        "ipmi.bootopt07.block_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
812
813
15
    { &hf_ipmi_chs_00_capflags_ppi,
814
15
      { "Power interlock",
815
15
        "ipmi.ch00.cap.power_interlock", FT_BOOLEAN, 8, TFS(&tfs_00_provided), 0x08, NULL, HFILL }},
816
15
    { &hf_ipmi_chs_00_capflags_di,
817
15
      { "Diagnostic Interrupt",
818
15
        "ipmi.ch00.cap.diag_int", FT_BOOLEAN, 8, TFS(&tfs_00_provided), 0x04, NULL, HFILL }},
819
15
    { &hf_ipmi_chs_00_capflags_fpl,
820
15
      { "Front Panel Lockout",
821
15
        "ipmi.ch00.cap.fpl", FT_BOOLEAN, 8, TFS(&tfs_00_provided), 0x02, NULL, HFILL }},
822
15
    { &hf_ipmi_chs_00_capflags_is,
823
15
      { "Intrusion sensor",
824
15
        "ipmi.ch00.cap.intrusion", FT_BOOLEAN, 8, TFS(&tfs_00_provided), 0x01, NULL, HFILL }},
825
15
    { &hf_ipmi_chs_00_fru_dev_addr,
826
15
      { "Chassis FRU Info Device Address",
827
15
        "ipmi.ch00.fru_info", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
828
15
    { &hf_ipmi_chs_00_sdr_dev_addr,
829
15
      { "Chassis SDR Device Address",
830
15
        "ipmi.ch00.sdr", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
831
15
    { &hf_ipmi_chs_00_sel_dev_addr,
832
15
      { "Chassis SEL Device Address",
833
15
        "ipmi.ch00.sel", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
834
15
    { &hf_ipmi_chs_00_sm_dev_addr,
835
15
      { "Chassis System Management Device Address",
836
15
        "ipmi.ch00.sm", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
837
15
    { &hf_ipmi_chs_00_bridge_dev_addr,
838
15
      { "Chassis Bridge Device Address",
839
15
        "ipmi.ch00.bridge", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
840
841
15
    { &hf_ipmi_chs_01_pwr_state_policy,
842
15
      { "Power Restore Policy",
843
15
        "ipmi.ch01.cur_pwr.policy", FT_UINT8, BASE_HEX, VALS(vals_01_pwr_policy), 0x60, NULL, HFILL }},
844
15
    { &hf_ipmi_chs_01_pwr_state_ctl_fault,
845
15
      { "Power Control Fault",
846
15
        "ipmi.ch01.cur_pwr.ctl_fault", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
847
15
    { &hf_ipmi_chs_01_pwr_state_fault,
848
15
      { "Power Fault",
849
15
        "ipmi.ch01.cur_pwr.fault", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
850
15
    { &hf_ipmi_chs_01_pwr_state_ilock,
851
15
      { "Interlock",
852
15
        "ipmi.ch01.cur_pwr.interlock", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
853
15
    { &hf_ipmi_chs_01_pwr_state_overload,
854
15
      { "Overload",
855
15
        "ipmi.ch01.cur_pwr.overload", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
856
15
    { &hf_ipmi_chs_01_pwr_state_powered,
857
15
      { "Power is on",
858
15
        "ipmi.ch01.cur_pwr.powered", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
859
15
    { &hf_ipmi_chs_01_last_event_via_ipmi,
860
15
      { "Last `Power is on' state was entered via IPMI command",
861
15
        "ipmi.ch01.last.on_via_ipmi", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
862
15
    { &hf_ipmi_chs_01_last_event_down_by_fault,
863
15
      { "Last power down caused by power fault",
864
15
        "ipmi.ch01.last.down_by_fault", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
865
15
    { &hf_ipmi_chs_01_last_event_interlock,
866
15
      { "Last power down caused by a power interlock being activated",
867
15
        "ipmi.ch01.last.interlock", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
868
15
    { &hf_ipmi_chs_01_last_event_overload,
869
15
      { "Last power down caused by a power overload",
870
15
        "ipmi.ch01.last.overload", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
871
15
    { &hf_ipmi_chs_01_last_event_ac_failed,
872
15
      { "AC failed",
873
15
        "ipmi.ch01.last.ac_failed", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
874
15
    { &hf_ipmi_chs_01_misc_identsupp,
875
15
      { "Chassis Identify command and state info supported",
876
15
        "ipmi.ch01.identsupp", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
877
15
    { &hf_ipmi_chs_01_misc_identstate,
878
15
      { "Chassis Identify state (if supported)",
879
15
        "ipmi.ch01.identstate", FT_UINT8, BASE_HEX, VALS(vals_01_identstate), 0x30, NULL, HFILL }},
880
15
    { &hf_ipmi_chs_01_misc_fan,
881
15
      { "Cooling/fan fault detected",
882
15
        "ipmi.ch01.misc.fan", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
883
15
    { &hf_ipmi_chs_01_misc_drive,
884
15
      { "Drive Fault",
885
15
        "ipmi.ch01.misc.drive", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
886
15
    { &hf_ipmi_chs_01_misc_fpl_active,
887
15
      { "Front Panel Lockout active",
888
15
        "ipmi.ch01.misc.fpl_active", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
889
15
    { &hf_ipmi_chs_01_misc_intrusion,
890
15
      { "Chassis intrusion active",
891
15
        "ipmi.ch01.misc.intrusion", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
892
15
    { &hf_ipmi_chs_01_fpb_standby_allowed,
893
15
      { "Standby disable allowed",
894
15
        "ipmi.ch01.fpb.standby_allowed", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
895
15
    { &hf_ipmi_chs_01_fpb_diagintr_allowed,
896
15
      { "Diagnostic interrupt disable allowed",
897
15
        "ipmi.ch01.fpb.diagintr_allowed", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
898
15
    { &hf_ipmi_chs_01_fpb_reset_allowed,
899
15
      { "Reset disable allowed",
900
15
        "ipmi.ch01.fpb.reset_allowed", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
901
15
    { &hf_ipmi_chs_01_fpb_poweroff_allowed,
902
15
      { "Poweroff disable allowed",
903
15
        "ipmi.ch01.fpb.poweroff_allowed", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
904
15
    { &hf_ipmi_chs_01_fpb_standby_disabled,
905
15
      { "Standby disabled",
906
15
        "ipmi.ch01.fpb.standby_disabled", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
907
15
    { &hf_ipmi_chs_01_fpb_diagintr_disabled,
908
15
      { "Diagnostic interrupt disabled",
909
15
        "ipmi.ch01.fpb.diagintr_disabled", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
910
15
    { &hf_ipmi_chs_01_fpb_reset_disabled,
911
15
      { "Reset disabled",
912
15
        "ipmi.ch01.fpb.reset_disabled", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
913
15
    { &hf_ipmi_chs_01_fpb_poweroff_disabled,
914
15
      { "Poweroff disabled",
915
15
        "ipmi.ch01.fpb.poweroff_disabled", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
916
917
15
    { &hf_ipmi_chs_02_cctrl,
918
15
      { "Chassis Control",
919
15
        "ipmi.ch02.chassis_control", FT_UINT8, BASE_HEX, VALS(vals_02_cctrl), 0x0f, NULL, HFILL }},
920
921
15
    { &hf_ipmi_chs_04_ival,
922
15
      { "Identify Interval in seconds",
923
15
        "ipmi.ch04.interval", FT_UINT8, BASE_CUSTOM, CF_FUNC(ipmi_fmt_1s_1based), 0, NULL, HFILL }},
924
15
    { &hf_ipmi_chs_04_perm_on,
925
15
      { "Turn on Identify indefinitely",
926
15
        "ipmi.ch04.perm_on", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
927
928
15
    { &hf_ipmi_chs_05_flags_fpl,
929
15
      { "Provides Front Panel Lockout",
930
15
        "ipmi.ch05.flags.fpl", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
931
15
    { &hf_ipmi_chs_05_flags_intrusion,
932
15
      { "Provides intrusion sensor",
933
15
        "ipmi.ch05.flags.intrusion", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
934
15
    { &hf_ipmi_chs_05_fru_dev_addr,
935
15
      { "Chassis FRU Info Device Address",
936
15
        "ipmi.ch05.fru_info", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
937
15
    { &hf_ipmi_chs_05_sdr_dev_addr,
938
15
      { "Chassis SDR Device Address",
939
15
        "ipmi.ch05.sdr", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
940
15
    { &hf_ipmi_chs_05_sel_dev_addr,
941
15
      { "Chassis SEL Device Address",
942
15
        "ipmi.ch05.sel", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
943
15
    { &hf_ipmi_chs_05_sm_dev_addr,
944
15
      { "Chassis System Management Device Address",
945
15
        "ipmi.ch05.sm", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
946
15
    { &hf_ipmi_chs_05_bridge_dev_addr,
947
15
      { "Chassis Bridge Device Address",
948
15
        "ipmi.ch05.bridge", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
949
950
15
    { &hf_ipmi_chs_06_rq_policy,
951
15
      { "Power Restore Policy",
952
15
        "ipmi.ch06.rq_policy", FT_UINT8, BASE_HEX, VALS(vals_06_policy), 0x07, NULL, HFILL }},
953
15
    { &hf_ipmi_chs_06_rs_policy_support_powerup,
954
15
      { "Always powering up",
955
15
        "ipmi.ch06.rs_support.powerup", FT_BOOLEAN, 8, TFS(&tfs_06_supported), 0x04, NULL, HFILL }},
956
15
    { &hf_ipmi_chs_06_rs_policy_support_restore,
957
15
      { "Restoring previous state",
958
15
        "ipmi.ch06.rs_support.restore", FT_BOOLEAN, 8, TFS(&tfs_06_supported), 0x02, NULL, HFILL }},
959
15
    { &hf_ipmi_chs_06_rs_policy_support_poweroff,
960
15
      { "Staying powered off",
961
15
        "ipmi.ch06.rs_support.poweroff", FT_BOOLEAN, 8, TFS(&tfs_06_supported), 0x01, NULL, HFILL }},
962
963
15
    { &hf_ipmi_chs_07_cause,
964
15
      { "Restart Cause",
965
15
        "ipmi.ch07.cause", FT_UINT8, BASE_HEX, VALS(vals_07_cause), 0x0f, NULL, HFILL }},
966
15
    { &hf_ipmi_chs_07_chan,
967
15
      { "Channel",
968
15
        "ipmi.ch07.chan", FT_UINT8, BASE_CUSTOM, CF_FUNC(ipmi_fmt_channel), 0, NULL, HFILL }},
969
970
15
    { &hf_ipmi_chs_08_valid,
971
15
      { "Validity",
972
15
        "ipmi.ch08.valid", FT_BOOLEAN, 8, TFS(&tfs_08_valid), 0x80, NULL, HFILL }},
973
15
    { &hf_ipmi_chs_08_selector,
974
15
      { "Boot option parameter selector",
975
15
        "ipmi.ch08.selector", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL }},
976
15
    { &hf_ipmi_chs_08_data,
977
15
      { "Boot option parameter data",
978
15
        "ipmi.ch08.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
979
980
15
    { &hf_ipmi_chs_09_rq_param_select,
981
15
      { "Parameter selector",
982
15
        "ipmi.ch09.rq_param_select", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL }},
983
15
    { &hf_ipmi_chs_09_rq_set_select,
984
15
      { "Set Selector",
985
15
        "ipmi.ch09.rq_set_select", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
986
15
    { &hf_ipmi_chs_09_rq_block_select,
987
15
      { "Block Selector",
988
15
        "ipmi.ch09.rq_block_select", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
989
15
    { &hf_ipmi_chs_09_rs_param_version,
990
15
      { "Parameter Version",
991
15
        "ipmi.ch09.rs_param_version", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL }},
992
15
    { &hf_ipmi_chs_09_rs_valid,
993
15
      { "Parameter Valid",
994
15
        "ipmi.ch09.rs_valid", FT_BOOLEAN, 8, TFS(&tfs_09_valid), 0x80, NULL, HFILL }},
995
15
    { &hf_ipmi_chs_09_rs_param_select,
996
15
      { "Parameter Selector",
997
15
        "ipmi.ch09.rs_param_select", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL }},
998
15
    { &hf_ipmi_chs_09_rs_param_data,
999
15
      { "Configuration parameter data",
1000
15
        "ipmi.ch09.rs_param_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1001
1002
15
    { &hf_ipmi_chs_0f_minpercnt,
1003
15
      { "Minutes per count",
1004
15
        "ipmi.ch0f.minpercnt", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1005
15
    { &hf_ipmi_chs_0f_counter,
1006
15
      { "Counter reading",
1007
15
        "ipmi.ch0f.counter", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1008
15
  };
1009
1010
15
  static int *ett[] = {
1011
15
    &ett_ipmi_chs_bo00_byte1,
1012
15
    &ett_ipmi_chs_bo02_byte1,
1013
15
    &ett_ipmi_chs_bo03_byte1,
1014
15
    &ett_ipmi_chs_bo04_byte2,
1015
15
    &ett_ipmi_chs_bo05_byte1,
1016
15
    &ett_ipmi_chs_bo05_byte2,
1017
15
    &ett_ipmi_chs_bo05_byte3,
1018
15
    &ett_ipmi_chs_bo05_byte4,
1019
15
    &ett_ipmi_chs_bo06_byte1,
1020
15
    &ett_ipmi_chs_00_capflags,
1021
15
    &ett_ipmi_chs_01_pwr_state,
1022
15
    &ett_ipmi_chs_01_last_event,
1023
15
    &ett_ipmi_chs_01_misc,
1024
15
    &ett_ipmi_chs_01_fpb,
1025
15
    &ett_ipmi_chs_02_byte1,
1026
15
    &ett_ipmi_chs_04_byte2,
1027
15
    &ett_ipmi_chs_05_flags,
1028
15
    &ett_ipmi_chs_06_byte1,
1029
15
    &ett_ipmi_chs_06_policy_support,
1030
15
    &ett_ipmi_chs_07_byte1,
1031
15
    &ett_ipmi_chs_08_byte1,
1032
15
    &ett_ipmi_chs_09_rq_byte1,
1033
15
    &ett_ipmi_chs_09_rs_byte1,
1034
15
    &ett_ipmi_chs_09_rs_byte2,
1035
15
  };
1036
1037
15
  proto_register_field_array(proto_ipmi, hf, array_length(hf));
1038
15
  proto_register_subtree_array(ett, array_length(ett));
1039
15
  ipmi_register_netfn_cmdtab(IPMI_CHASSIS_REQ, IPMI_OEM_NONE, NULL, 0, NULL,
1040
15
      cmd_chassis, array_length(cmd_chassis));
1041
15
}
1042
1043
1044
/*
1045
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
1046
 *
1047
 * Local variables:
1048
 * c-basic-offset: 8
1049
 * tab-width: 8
1050
 * indent-tabs-mode: t
1051
 * End:
1052
 *
1053
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1054
 * :indentSize=8:tabSize=8:noTabs=false:
1055
 */