dmi_chassis
Synopsis
#include <opendmi/entity/chassis.h>
typedef struct dmi_chassis {
const char *vendor;
dmi_chassis_type_t type;
bool is_lock_present;
const char *version;
const char *serial_number;
const char *asset_tag;
dmi_status_t bootup_state;
dmi_status_t power_supply_state;
dmi_status_t thermal_state;
dmi_chassis_security_status_t security_status;
uint32_t oem_defined;
unsigned short height;
unsigned short power_cord_count;
size_t element_count;
size_t element_size;
dmi_chassis_element_t *elements;
const char *sku_number;
dmi_rack_type_t rack_type;
unsigned short rack_height;
} dmi_chassis_t;
Description
The dmi_chassis_t structure holds a decoded system enclosure or chassis
structure (type 3) of SMBIOS: the mechanical enclosure of the system, its
identification, its state at the last boot, its size and the elements it
contains. A system with several enclosures, such as a separate enclosure for
its peripherals, has one structure for each of them. Tables of SMBIOS 2.3 and
newer are required to have at least one.
The structure is returned by dmi_entity_info for the structures of type
DMI_TYPE(chassis), and lives as long as the context it has been decoded in.
Fields
vendor-
Name of the manufacturer of the enclosure, or
nullptrif not given. type-
Type of the enclosure.
is_lock_present-
Whether the enclosure has a lock.
falsewhen it has none, or when it is not known whether it has one. version-
Version of the enclosure, or
nullptrif not given. serial_number-
Serial number of the enclosure, or
nullptrif not given. Systems sharing a multi-system chassis report the same serial number. asset_tag-
Asset tag of the enclosure, or
nullptrif not given. bootup_state-
State of the enclosure at the last boot. Present since SMBIOS 2.1;
DMI_STATUS_UNSPECin older structures. power_supply_state-
State of the power supplies of the enclosure at the last boot. Present since SMBIOS 2.1;
DMI_STATUS_UNSPECin older structures. thermal_state-
Thermal state of the enclosure at the last boot. Present since SMBIOS 2.1;
DMI_STATUS_UNSPECin older structures. security_status-
Physical security status of the enclosure at the last boot. Present since SMBIOS 2.1;
DMI_CHASSIS_SECURITY_STATUS_UNSPECin older structures. oem_defined-
Information specific to the OEM or to the firmware vendor. Present since SMBIOS 2.3; 0 in older structures.
height-
Height of the enclosure, in rack units (U, 1.75 inches or 4.445 cm). 0 if unspecified; 255 if the height is given by
rack_heightinstead. Present since SMBIOS 2.3; 0 in older structures. power_cord_count-
Number of power cords of the enclosure, or 0 if unspecified. Present since SMBIOS 2.3; 0 in older structures.
element_count-
Number of items of
elements. Present since SMBIOS 2.3; 0 in older structures. element_size-
Size of each contained element record of the structure, in bytes, which may be larger than the part the library decodes. Present since SMBIOS 2.3; 0 in older structures.
elements-
Elements contained in the enclosure, such as power supplies or blades, an array of
element_countitems, ornullptrif there is none. Present since SMBIOS 2.3. sku_number-
SKU number of the enclosure, or
nullptrif not given. Present since SMBIOS 2.7. rack_type-
Type of the rack, which gives the unit of
rack_height. Present since SMBIOS 3.9;DMI_RACK_TYPE_UNSPECin older structures. rack_height-
Height of the enclosure, in the unit of the rack type, for example in OU (48 mm) for Open Rack. Present since SMBIOS 3.9; 0 in older structures.
Examples
dmi_registry_t *registry = dmi_get_registry(context);
dmi_entity_t *entity =
dmi_registry_lookup_first(registry, DMI_TYPE(chassis), false);
dmi_chassis_t *chassis = dmi_entity_info(entity, DMI_TYPE(chassis));
if (chassis != nullptr) {
printf("%s (%s)\n", dmi_chassis_type_name(chassis->type),
chassis->vendor ? chassis->vendor : "unknown vendor");
for (size_t i = 0; i < chassis->element_count; i++) {
const dmi_chassis_element_t *element = &chassis->elements[i];
if (element->type != DMI_TYPE_ID_INVALID)
printf(" structures of type %d: %zu to %zu\n",
(int)element->type, element->minimum_count,
element->maximum_count);
}
}