lazybios 3.0.0
Lightweight SMBIOS/DMI parsing library
Loading...
Searching...
No Matches
type3.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: LGPL-2.1-or-later
3 *
4 * This file is part of lazybios.
5 *
6 * lazybios is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * lazybios is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with lazybios. If not, see <https://www.gnu.org/licenses/>.
18 */
19/**
20 * @file type3.h
21 * @brief Public API for SMBIOS Type 3 Chassis Information.
22 * @author LazySeldi
23 */
24
25#ifndef LAZYBIOS_TYPE3_H
26#define LAZYBIOS_TYPE3_H
27
28#ifndef LAZYBIOS_SHARED_API_H
29#define LAZYBIOS_TYPE_HEADER_ONLY
30#include "lazybios/lazybios.h"
31#undef LAZYBIOS_TYPE_HEADER_ONLY
32#endif
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38/** @brief Availability metadata for SMBIOS Type 3 fields. */
59
60/**
61 * @brief Decoded forms of the Type 3 encoded fields.
62 *
63 * Each member mirrors the identically named raw field and points at a static
64 * string. Consult the matching `field_status` member before using one.
65 */
66typedef struct {
67 const char* boot_up_state;
68 const char* power_supply_state;
69 const char* thermal_state;
70 const char* security_status;
71 char* type;
74
75/**
76 * @brief Parsed SMBIOS Type 3 System Enclosure or Chassis Information.
77 * @ingroup api_type3
78 */
103
104/**
105 * @brief A parsed set of SMBIOS Type 3 structures.
106 * @ingroup api_type3
107 */
112
113/** @addtogroup api_type3
114 * @{
115 */
116
117/**
118 * @brief Parses all SMBIOS Type 3 Chassis Information structures.
119 * @param DMIData Raw DMI table container to parse.
120 * @return Newly allocated set, empty when the table holds no Type 3 structure,
121 * or NULL when the arguments are unusable or an allocation fails.
122 */
124
125/**
126 * @brief Releases a parsed set of SMBIOS Type 3 structures.
127 * @param Type3 Set to release; may be NULL.
128 */
130
131/** @} */
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif
LAZYBIOS_WARN_UNUSED lazybiosType3Array_t * lazybiosGetType3(const lazybiosDMI_t *DMIData)
Parses all SMBIOS Type 3 Chassis Information structures.
void lazybiosFreeType3(lazybiosType3Array_t *Type3)
Releases a parsed set of SMBIOS Type 3 structures.
Public API for lazybios. Include this and nothing else.
uint8_t lazybiosFieldStatus_t
Storage for one field's availability.
Definition lazybios.h:115
#define LAZYBIOS_WARN_UNUSED
Expands to nothing on compilers without a return-value check.
Definition lazybios.h:150
Owns raw DMI table data and its parsed SMBIOS entry point.
Definition lazybios.h:218
A parsed set of SMBIOS Type 3 structures.
Definition type3.h:108
lazybiosType3_t * entries
Definition type3.h:109
Decoded forms of the Type 3 encoded fields.
Definition type3.h:66
char ** contained_elements
Definition type3.h:72
const char * thermal_state
Definition type3.h:69
const char * boot_up_state
Definition type3.h:67
const char * security_status
Definition type3.h:70
const char * power_supply_state
Definition type3.h:68
Availability metadata for SMBIOS Type 3 fields.
Definition type3.h:39
lazybiosFieldStatus_t oem_defined
Definition type3.h:49
lazybiosFieldStatus_t power_supply_state
Definition type3.h:46
lazybiosFieldStatus_t number_of_power_cords
Definition type3.h:51
lazybiosFieldStatus_t type
Definition type3.h:41
lazybiosFieldStatus_t asset_tag
Definition type3.h:44
lazybiosFieldStatus_t contained_element_count
Definition type3.h:52
lazybiosFieldStatus_t rack_height
Definition type3.h:57
lazybiosFieldStatus_t serial_number
Definition type3.h:43
lazybiosFieldStatus_t contained_element_record_length
Definition type3.h:53
lazybiosFieldStatus_t manufacturer
Definition type3.h:40
lazybiosFieldStatus_t height
Definition type3.h:50
lazybiosFieldStatus_t thermal_state
Definition type3.h:47
lazybiosFieldStatus_t contained_elements
Definition type3.h:54
lazybiosFieldStatus_t sku_number
Definition type3.h:55
lazybiosFieldStatus_t boot_up_state
Definition type3.h:45
lazybiosFieldStatus_t rack_type
Definition type3.h:56
lazybiosFieldStatus_t security_status
Definition type3.h:48
lazybiosFieldStatus_t version
Definition type3.h:42
Parsed SMBIOS Type 3 System Enclosure or Chassis Information.
Definition type3.h:79
const char * manufacturer
Definition type3.h:82
lazybiosType3Decoded_t decoded
Definition type3.h:100
uint8_t type
Definition type3.h:83
uint8_t length
Definition type3.h:81
const char * asset_tag
Definition type3.h:86
uint8_t thermal_state
Definition type3.h:89
uint8_t contained_element_record_length
Definition type3.h:95
uint8_t contained_element_count
Definition type3.h:94
const char * sku_number
Definition type3.h:97
uint8_t boot_up_state
Definition type3.h:87
uint8_t rack_height
Definition type3.h:99
uint8_t number_of_power_cords
Definition type3.h:93
uint8_t * contained_elements
Definition type3.h:96
uint8_t height
Definition type3.h:92
lazybiosType3FieldStatus_t field_status
Definition type3.h:101
uint16_t handle
Definition type3.h:80
const char * serial_number
Definition type3.h:85
const char * version
Definition type3.h:84
uint8_t rack_type
Definition type3.h:98
uint32_t oem_defined
Definition type3.h:91
uint8_t security_status
Definition type3.h:90
uint8_t power_supply_state
Definition type3.h:88