lazybios 3.0.0
Lightweight SMBIOS/DMI parsing library
Loading...
Searching...
No Matches
Type 3: Chassis Information Guide

Chassis identity, state, security, contained elements, and rack data.

Result set and ownership

lazybiosGetType3 returns a lazybiosType3Array_t holding every matching structure. Iterate entries using count. A non-NULL result whose count is zero means the table contains no structure of this type; NULL means the arguments were unusable or an allocation failed. Release the set with lazybiosFreeType3, or assign it to ctx->Type3 and let lazybiosCleanup own it.

Every record carries its own SMBIOS handle and the structure length the firmware reported.

Encoded fields are decoded during parsing into decoded, which mirrors the raw member names (boot_up_state, power_supply_state, thermal_state, security_status). The raw value stays alongside it, so both the encoding and its meaning are available.

Chassis type and lock

The low seven bits of type select the enclosure type. Bit 7 indicates that a chassis lock is present. decoded.type decodes both parts.

const char* decode_type3(const lazybiosType3_t* chassis) {
if (LAZYBIOS_FIELD_STATUS(chassis, type) != LAZYBIOS_FIELD_PRESENT) return "Not Present";
return chassis->decoded.type;
}

State and security

Boot-up, power-supply, and thermal fields share the state decoder decoded.boot_up_state. Security status uses decoded.security_status. These fields require SMBIOS 2.1 or newer and otherwise report LAZYBIOS_FIELD_ABSENT through their field status. A zero legacy height or power-cord count means unspecified and reports absent. Legacy height 0xFF also reports absent because it selects the SMBIOS 3.9 rack-height field.

Contained elements

contained_elements stores raw fixed-size records. Its allocation contains contained_element_count * contained_element_record_length bytes. The first byte of each record identifies either an SMBIOS structure type or a baseboard type and can be decoded with decoded.contained_elements. Preserve the declared record length when advancing because later SMBIOS revisions can extend a record. A zero element count leaves the array absent and requires a zero record length. For a nonzero count, the parser requires the specification's minimum three-byte record length and the complete declared array before exposing the records or locating fields that follow them.

Rack fields

SKU position depends on the total contained-element area. Rack type and rack height follow that variable-length area and are parsed only for SMBIOS 3.9 or newer. Rack type zero means unspecified, so both rack fields report absent.

See also
Type 3: Chassis Information