lazybios 3.0.0
Lightweight SMBIOS/DMI parsing library
Loading...
Searching...
No Matches
type1.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 type1.h
21 * @brief Public API for SMBIOS Type 1 System Information.
22 * @author LazySeldi
23 */
24
25#ifndef LAZYBIOS_TYPE1_H
26#define LAZYBIOS_TYPE1_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 1 fields. */
49
50/**
51 * @brief Decoded forms of the Type 1 encoded fields.
52 *
53 * Each member holds the decoded form of the raw field it is named for.
54 * Consult the matching `field_status` member before using one.
55 */
56typedef struct {
57 const char* wake_up_type;
59
60/**
61 * @brief Parsed SMBIOS Type 1 System Information.
62 * @ingroup api_type1
63 */
64typedef struct {
65 uint16_t handle;
66 uint8_t length;
67 const char* manufacturer;
68 const char* product_name;
69 const char* version;
70 const char* serial_number;
71 uint8_t uuid[16];
72 uint8_t wake_up_type;
73 const char* sku_number;
74 const char* family;
78
79/**
80 * @brief A parsed set of SMBIOS Type 1 structures.
81 * @ingroup api_type1
82 */
87
88/** @addtogroup api_type1
89 * @{
90 */
91
92/**
93 * @brief Parses all SMBIOS Type 1 structures.
94 * @param DMIData Raw DMI table container to parse.
95 * @return Newly allocated set, empty when the table holds no Type 1 structure,
96 * or NULL when the arguments are unusable or an allocation fails.
97 */
99
100/**
101 * @brief Releases a parsed set of SMBIOS Type 1 structures.
102 * @param Type1 Set to release; may be NULL.
103 */
105
106/** @} */
107
108#ifdef __cplusplus
109}
110#endif
111
112#endif
LAZYBIOS_WARN_UNUSED lazybiosType1Array_t * lazybiosGetType1(const lazybiosDMI_t *DMIData)
Parses all SMBIOS Type 1 structures.
void lazybiosFreeType1(lazybiosType1Array_t *Type1)
Releases a parsed set of SMBIOS Type 1 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 1 structures.
Definition type1.h:83
lazybiosType1_t * entries
Definition type1.h:84
Decoded forms of the Type 1 encoded fields.
Definition type1.h:56
const char * wake_up_type
Definition type1.h:57
Availability metadata for SMBIOS Type 1 fields.
Definition type1.h:39
lazybiosFieldStatus_t uuid
Definition type1.h:44
lazybiosFieldStatus_t wake_up_type
Definition type1.h:45
lazybiosFieldStatus_t serial_number
Definition type1.h:43
lazybiosFieldStatus_t sku_number
Definition type1.h:46
lazybiosFieldStatus_t family
Definition type1.h:47
lazybiosFieldStatus_t manufacturer
Definition type1.h:40
lazybiosFieldStatus_t version
Definition type1.h:42
lazybiosFieldStatus_t product_name
Definition type1.h:41
Parsed SMBIOS Type 1 System Information.
Definition type1.h:64
const char * family
Definition type1.h:74
const char * serial_number
Definition type1.h:70
uint8_t wake_up_type
Definition type1.h:72
const char * version
Definition type1.h:69
lazybiosType1Decoded_t decoded
Definition type1.h:75
uint16_t handle
Definition type1.h:65
uint8_t length
Definition type1.h:66
const char * product_name
Definition type1.h:68
lazybiosType1FieldStatus_t field_status
Definition type1.h:76
uint8_t uuid[16]
Definition type1.h:71
const char * manufacturer
Definition type1.h:67
const char * sku_number
Definition type1.h:73