lazybios 3.0.0
Lightweight SMBIOS/DMI parsing library
Loading...
Searching...
No Matches
type2.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 type2.h
21 * @brief Public API for SMBIOS Type 2 Baseboard Information.
22 * @author LazySeldi
23 */
24
25#ifndef LAZYBIOS_TYPE2_H
26#define LAZYBIOS_TYPE2_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 2 fields. */
52
53/**
54 * @brief Decoded forms of the Type 2 encoded fields.
55 *
56 * Each member holds the decoded form of the raw field it is named for.
57 * Consult the matching `field_status` member before using one.
58 */
59typedef struct {
60 const char* board_type;
63
64/**
65 * @brief Parsed SMBIOS Type 2 Baseboard Information.
66 * @ingroup api_type2
67 */
85
86/**
87 * @brief A parsed set of SMBIOS Type 2 structures.
88 * @ingroup api_type2
89 */
94
95/** @addtogroup api_type2
96 * @{
97 */
98
99/**
100 * @brief Parses all SMBIOS Type 2 structures.
101 * @param DMIData Raw DMI table container to parse.
102 * @return Newly allocated set, empty when the table holds no Type 2 structure,
103 * or NULL when the arguments are unusable or an allocation fails.
104 */
106
107/**
108 * @brief Releases a parsed set of SMBIOS Type 2 structures.
109 * @param Type2 Set to release; may be NULL.
110 */
112
113/** @} */
114
115#ifdef __cplusplus
116}
117#endif
118
119#endif
LAZYBIOS_WARN_UNUSED lazybiosType2Array_t * lazybiosGetType2(const lazybiosDMI_t *DMIData)
Parses all SMBIOS Type 2 structures.
void lazybiosFreeType2(lazybiosType2Array_t *Type2)
Releases a parsed set of SMBIOS Type 2 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 2 structures.
Definition type2.h:90
lazybiosType2_t * entries
Definition type2.h:91
Decoded forms of the Type 2 encoded fields.
Definition type2.h:59
const char * board_type
Definition type2.h:60
Availability metadata for SMBIOS Type 2 fields.
Definition type2.h:39
lazybiosFieldStatus_t feature_flags
Definition type2.h:45
lazybiosFieldStatus_t chassis_handle
Definition type2.h:47
lazybiosFieldStatus_t version
Definition type2.h:42
lazybiosFieldStatus_t number_of_contained_object_handles
Definition type2.h:49
lazybiosFieldStatus_t location_in_chassis
Definition type2.h:46
lazybiosFieldStatus_t manufacturer
Definition type2.h:40
lazybiosFieldStatus_t contained_object_handles
Definition type2.h:50
lazybiosFieldStatus_t product
Definition type2.h:41
lazybiosFieldStatus_t asset_tag
Definition type2.h:44
lazybiosFieldStatus_t board_type
Definition type2.h:48
lazybiosFieldStatus_t serial_number
Definition type2.h:43
Parsed SMBIOS Type 2 Baseboard Information.
Definition type2.h:68
uint16_t chassis_handle
Definition type2.h:78
lazybiosType2FieldStatus_t field_status
Definition type2.h:83
uint16_t handle
Definition type2.h:69
uint8_t board_type
Definition type2.h:79
lazybiosType2Decoded_t decoded
Definition type2.h:82
uint8_t length
Definition type2.h:70
uint8_t feature_flags
Definition type2.h:76
const char * manufacturer
Definition type2.h:71
uint16_t * contained_object_handles
Definition type2.h:81
const char * version
Definition type2.h:73
const char * product
Definition type2.h:72
const char * serial_number
Definition type2.h:74
const char * asset_tag
Definition type2.h:75
const char * location_in_chassis
Definition type2.h:77
uint8_t number_of_contained_object_handles
Definition type2.h:80