/* Get Chassis Status. */ static void rs01(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_01_pwr_state_policy, &hf_ipmi_chs_01_pwr_state_ctl_fault, &hf_ipmi_chs_01_pwr_state_fault, &hf_ipmi_chs_01_pwr_state_ilock, &hf_ipmi_chs_01_pwr_state_overload, &hf_ipmi_chs_01_pwr_state_powered, NULL }; static const int *byte2[] = { &hf_ipmi_chs_01_last_event_via_ipmi, &hf_ipmi_chs_01_last_event_down_by_fault, &hf_ipmi_chs_01_last_event_interlock, &hf_ipmi_chs_01_last_event_overload, &hf_ipmi_chs_01_last_event_ac_failed, NULL }; static const int *byte3[] = { &hf_ipmi_chs_01_misc_identsupp, &hf_ipmi_chs_01_misc_identstate, &hf_ipmi_chs_01_misc_fan, &hf_ipmi_chs_01_misc_drive, &hf_ipmi_chs_01_misc_fpl_active, &hf_ipmi_chs_01_misc_intrusion, NULL }; static const int *byte4[] = { &hf_ipmi_chs_01_fpb_standby_allowed, &hf_ipmi_chs_01_fpb_diagintr_allowed, &hf_ipmi_chs_01_fpb_reset_allowed, &hf_ipmi_chs_01_fpb_poweroff_allowed, &hf_ipmi_chs_01_fpb_standby_disabled, &hf_ipmi_chs_01_fpb_diagintr_disabled, &hf_ipmi_chs_01_fpb_reset_disabled, &hf_ipmi_chs_01_fpb_poweroff_disabled, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Current Power State: ", NULL, ett_ipmi_chs_01_pwr_state, byte1, TRUE, 0); proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Last Power Event: ", NULL, ett_ipmi_chs_01_last_event, byte2, TRUE, 0); proto_tree_add_bitmask_text(tree, tvb, 2, 1, "Misc. State: ", NULL, ett_ipmi_chs_01_misc, byte3, TRUE, 0); if (tvb_length(tvb) > 3) { proto_tree_add_bitmask_text(tree, tvb, 3, 1, "Front panel buttons capabilities: ", NULL, ett_ipmi_chs_01_fpb, byte4, TRUE, BMT_NO_TFS); }; }
static void rs27(tvbuff_t *tvb, proto_tree *tree) { static const int *status[] = { &hf_ipmi_stor_27_status, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_stor_27_status, status, ENC_LITTLE_ENDIAN, 0); }
/* Boot options - common for Get/Set Boot Options commands */ static void bootopt_00(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_bo00_sip, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_bo00_byte1, byte1, TRUE, 0); }
/* Set Power Restore Policy */ static void rq06(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_06_rq_policy, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_06_byte1, byte1, TRUE, 0); }
static void rs10(tvbuff_t *tvb, proto_tree *tree) { static const int *flags[] = { &hf_ipmi_stor_10_access, NULL }; proto_tree_add_item(tree, hf_ipmi_stor_10_size, tvb, 0, 2, TRUE); proto_tree_add_bitmask_text(tree, tvb, 2, 1, NULL, NULL, ett_ipmi_stor_10_flags, flags, TRUE, 0); }
static void rs47(tvbuff_t *tvb, proto_tree *tree) { static const int *status[] = { &hf_ipmi_stor_47_status, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_stor_47_status, status, TRUE, 0); }
static void rs2c(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_stor_2c_init_state, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_stor_2c_rs_byte1, byte1, TRUE, 0); }
/* Run Initialization Agent */ static void rq2c(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_stor_2c_init_agent, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_stor_2c_rq_byte1, byte1, ENC_LITTLE_ENDIAN, 0); }
static void bootopt_02(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_bo02_request, &hf_ipmi_chs_bo02_discovered, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Service partition scan: ", "Not discovered", ett_ipmi_chs_bo02_byte1, byte1, TRUE, 0); }
static void bootopt_03(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_bo03_pef, &hf_ipmi_chs_bo03_cctrl_timeout, &hf_ipmi_chs_bo03_wd_timeout, &hf_ipmi_chs_bo03_softreset, &hf_ipmi_chs_bo03_powerup, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, "BMC boot flag valid, don't clear on: ", "None", ett_ipmi_chs_bo03_byte1, byte1, TRUE, BMT_NO_TFS); }
/* Get Power Restore Policy */ static void rs06(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_06_rs_policy_support_powerup, &hf_ipmi_chs_06_rs_policy_support_restore, &hf_ipmi_chs_06_rs_policy_support_poweroff, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Power Restore Policy support: ", "None", ett_ipmi_chs_06_policy_support, byte1, TRUE, BMT_NO_TFS); }
/* Get System Restart Cause */ static void rs07(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_07_cause, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_07_byte1, byte1, TRUE, 0); proto_tree_add_item(tree, hf_ipmi_chs_07_chan, tvb, 1, 1, TRUE); }
static void bootopt_06(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_bo06_chan_num, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_bo06_byte1, byte1, TRUE, 0); proto_tree_add_item(tree, hf_ipmi_chs_bo06_session_id, tvb, 1, 4, TRUE); ipmi_add_timestamp(tree, hf_ipmi_chs_bo06_bootinfo_timestamp, tvb, 5); }
static void bootopt_04(tvbuff_t *tvb, proto_tree *tree) { static const int *byte2[] = { &hf_ipmi_chs_bo04_bootinit_ack_oem, &hf_ipmi_chs_bo04_bootinit_ack_sms, &hf_ipmi_chs_bo04_bootinit_ack_os, &hf_ipmi_chs_bo04_bootinit_ack_osloader, &hf_ipmi_chs_bo04_bootinit_ack_bios, NULL }; proto_tree_add_item(tree, hf_ipmi_chs_bo04_write_mask, tvb, 0, 1, TRUE); proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Boot Initiator Acknowledge data: ", "None", ett_ipmi_chs_bo04_byte2, byte2, TRUE, BMT_NO_TFS); }
/* Partial Add SEL Entry */ static void rq45(tvbuff_t *tvb, proto_tree *tree) { static const int *byte6[] = { &hf_ipmi_stor_45_inprogress, NULL }; proto_tree_add_item(tree, hf_ipmi_stor_45_rsrv_id, tvb, 0, 2, TRUE); proto_tree_add_item(tree, hf_ipmi_stor_45_rec_id, tvb, 2, 2, TRUE); proto_tree_add_item(tree, hf_ipmi_stor_45_offset, tvb, 4, 1, TRUE); proto_tree_add_bitmask_text(tree, tvb, 5, 1, NULL, NULL, ett_ipmi_stor_45_byte6, byte6, TRUE, 0); proto_tree_add_item(tree, hf_ipmi_stor_45_data, tvb, 6, tvb_length(tvb) - 6, TRUE); }
/* Partial Add SDR */ static void rq25(tvbuff_t *tvb, proto_tree *tree) { static const int *byte6[] = { &hf_ipmi_stor_25_inprogress, NULL }; proto_tree_add_item(tree, hf_ipmi_stor_25_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_stor_25_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_stor_25_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask_text(tree, tvb, 5, 1, NULL, NULL, ett_ipmi_stor_25_byte6, byte6, ENC_LITTLE_ENDIAN, 0); proto_tree_add_item(tree, hf_ipmi_stor_25_data, tvb, 6, tvb_length(tvb) - 6, ENC_NA); }
/* Get Auxiliary Log Status */ static void rq5a(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_stor_5a_log_type, NULL }; if (!tree) { ipmi_setsaveddata(0, tvb_get_guint8(tvb, 0) & 0x0f); return; } proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_stor_5a_byte1, byte1, TRUE, 0); }
/* Get SEL Info */ static void rs40(tvbuff_t *tvb, proto_tree *tree) { static const int *ops[] = { &hf_ipmi_stor_40_op_overflow, &hf_ipmi_stor_40_op_delete, &hf_ipmi_stor_40_op_partial_add, &hf_ipmi_stor_40_op_reserve, &hf_ipmi_stor_40_op_allocinfo, NULL }; proto_tree_add_item(tree, hf_ipmi_stor_40_sel_version, tvb, 0, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_stor_40_entries, tvb, 1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_stor_40_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN); ipmi_add_timestamp(tree, hf_ipmi_stor_40_ts_add, tvb, 5); ipmi_add_timestamp(tree, hf_ipmi_stor_40_ts_erase, tvb, 9); proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL, ett_ipmi_stor_40_ops, ops, ENC_LITTLE_ENDIAN, 0); }
/* Chassis Identify */ static void rq04(tvbuff_t *tvb, proto_tree *tree) { static const int *byte2[] = { &hf_ipmi_chs_04_perm_on, NULL }; if (tvb_length(tvb) > 0) { proto_tree_add_item(tree, hf_ipmi_chs_04_ival, tvb, 0, 1, TRUE); } if (tvb_length(tvb) > 1) { proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Flags: ", "None", ett_ipmi_chs_04_byte2, byte2, TRUE, 0); } }
static void bootopt_05(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_bo05_bootflags_valid, &hf_ipmi_chs_bo05_permanent, &hf_ipmi_chs_bo05_boottype, NULL }; static const int *byte2[] = { &hf_ipmi_chs_bo05_cmos_clear, &hf_ipmi_chs_bo05_lock_kbd, &hf_ipmi_chs_bo05_bootdev, &hf_ipmi_chs_bo05_screen_blank, &hf_ipmi_chs_bo05_lockout_reset, NULL }; static const int *byte3[] = { &hf_ipmi_chs_bo05_lockout_poweroff, &hf_ipmi_chs_bo05_bios_verbosity, &hf_ipmi_chs_bo05_progress_traps, &hf_ipmi_chs_bo05_pwd_bypass, &hf_ipmi_chs_bo05_lock_sleep, &hf_ipmi_chs_bo05_console_redirection, NULL }; static const int *byte4[] = { &hf_ipmi_chs_bo05_bios_shared_override, &hf_ipmi_chs_bo05_bios_muxctl_override, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_bo05_byte1, byte1, TRUE, 0); proto_tree_add_bitmask_text(tree, tvb, 1, 1, NULL, NULL, ett_ipmi_chs_bo05_byte2, byte2, TRUE, 0); proto_tree_add_bitmask_text(tree, tvb, 2, 1, NULL, NULL, ett_ipmi_chs_bo05_byte3, byte3, TRUE, 0); proto_tree_add_bitmask_text(tree, tvb, 3, 1, NULL, NULL, ett_ipmi_chs_bo05_byte4, byte4, TRUE, 0); proto_tree_add_item(tree, hf_ipmi_chs_bo05_byte5, tvb, 4, 1, TRUE); }
/* Set Chassis Capabilities. */ static void rq05(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_05_flags_fpl, &hf_ipmi_chs_05_flags_intrusion, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Capabilities: ", "None", ett_ipmi_chs_05_flags, byte1, TRUE, 0); proto_tree_add_item(tree, hf_ipmi_chs_05_fru_dev_addr, tvb, 1, 1, TRUE); proto_tree_add_item(tree, hf_ipmi_chs_05_sdr_dev_addr, tvb, 2, 1, TRUE); proto_tree_add_item(tree, hf_ipmi_chs_05_sel_dev_addr, tvb, 3, 1, TRUE); proto_tree_add_item(tree, hf_ipmi_chs_05_sm_dev_addr, tvb, 4, 1, TRUE); if (tvb_length(tvb) > 5) { /* Bridge device address is optional */ proto_tree_add_item(tree, hf_ipmi_chs_05_bridge_dev_addr, tvb, 5, 1, TRUE); } }
/* Get Chassis Capabilities (response) */ static void rs00(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_00_capflags_ppi, &hf_ipmi_chs_00_capflags_di, &hf_ipmi_chs_00_capflags_fpl, &hf_ipmi_chs_00_capflags_is, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Capabilities: ", "None", ett_ipmi_chs_00_capflags, byte1, TRUE, BMT_NO_TFS); proto_tree_add_item(tree, hf_ipmi_chs_00_fru_dev_addr, tvb, 1, 1, TRUE); proto_tree_add_item(tree, hf_ipmi_chs_00_sdr_dev_addr, tvb, 2, 1, TRUE); proto_tree_add_item(tree, hf_ipmi_chs_00_sel_dev_addr, tvb, 3, 1, TRUE); proto_tree_add_item(tree, hf_ipmi_chs_00_sm_dev_addr, tvb, 4, 1, TRUE); if (tvb_length(tvb) >= 5) { proto_tree_add_item(tree, hf_ipmi_chs_00_bridge_dev_addr, tvb, 5, 1, TRUE); } }
/* Get SDR Repository Info */ static void rs20(tvbuff_t *tvb, proto_tree *tree) { static const int *ops[] = { &hf_ipmi_stor_20_op_overflow, &hf_ipmi_stor_20_op_update, &hf_ipmi_stor_20_op_delete, &hf_ipmi_stor_20_op_partial_add, &hf_ipmi_stor_20_op_reserve, &hf_ipmi_stor_20_op_allocinfo, NULL }; guint8 v; v = tvb_get_guint8(tvb, 0); proto_tree_add_item(tree, hf_ipmi_stor_20_sdr_version, tvb, 0, 1, TRUE); proto_tree_add_item(tree, hf_ipmi_stor_20_rec_count, tvb, 1, 2, TRUE); proto_tree_add_item(tree, hf_ipmi_stor_20_free_space, tvb, 3, 2, TRUE); ipmi_add_timestamp(tree, hf_ipmi_stor_20_ts_add, tvb, 5); ipmi_add_timestamp(tree, hf_ipmi_stor_20_ts_erase, tvb, 9); proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL, ett_ipmi_stor_20_ops, ops, TRUE, 0); }
static void rs09(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_chs_09_rs_param_version, NULL }; proto_item *ti; proto_tree *s_tree; tvbuff_t *sub; guint8 pno; const char *desc; pno = tvb_get_guint8(tvb, 1) & 0x7f; if (pno < array_length(boot_options)) { desc = boot_options[pno].name; } else if (pno >= 96 && pno <= 127) { desc = "OEM"; } else { desc = "Reserved"; } proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_09_rs_byte1, byte1, TRUE, 0); ti = proto_tree_add_text(tree, tvb, 1, 1, "Boot option parameter selector: %s (0x%02x)", desc, pno); s_tree = proto_item_add_subtree(ti, ett_ipmi_chs_09_rs_byte2); proto_tree_add_item(s_tree, hf_ipmi_chs_09_rs_valid, tvb, 1, 1, TRUE); proto_tree_add_uint_format(s_tree, hf_ipmi_chs_09_rs_param_select, tvb, 1, 1, pno, "%sBoot option parameter selector: %s (0x%02x)", ipmi_dcd8(pno, 0x7f), desc, pno); if (pno < array_length(boot_options)) { sub = tvb_new_subset(tvb, 2, tvb_length(tvb) - 2, tvb_length(tvb) - 2); boot_options[pno].intrp(sub, tree); } else { proto_tree_add_item(tree, hf_ipmi_chs_09_rs_param_data, tvb, 2, tvb_length(tvb) - 2, TRUE); } }
/* Set Auxiliary Log Status */ static void rq5b(tvbuff_t *tvb, proto_tree *tree) { static const int *byte1[] = { &hf_ipmi_stor_5b_log_type, NULL }; guint8 v = tvb_get_guint8(tvb, 0); proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_stor_5b_byte1, byte1, TRUE, 0); if (v > 2) { proto_tree_add_item(tree, hf_ipmi_stor_5b_unknown, tvb, 1, tvb_length(tvb) - 1, TRUE); return; } ipmi_add_timestamp(tree, hf_ipmi_stor_5b_ts_add, tvb, 1); if (v == 0) { proto_tree_add_item(tree, hf_ipmi_stor_5b_num_entries, tvb, 5, 4, TRUE); } else if (v == 1 || v == 2) { proto_tree_add_item(tree, hf_ipmi_stor_5b_iana, tvb, 5, 3, TRUE); proto_tree_add_item(tree, hf_ipmi_stor_5b_bytes, tvb, 8, 8, TRUE); } }