lazybios 3.0.0
Lightweight SMBIOS/DMI parsing library
Loading...
Searching...
No Matches
lazybios.h File Reference

Public API for lazybios. Include this and nothing else. More...

#include <stdint.h>
#include <stddef.h>
#include "lazybios/structures/type0.h"
#include "lazybios/structures/type1.h"
#include "lazybios/structures/type2.h"
#include "lazybios/structures/type3.h"
#include "lazybios/structures/type4.h"
#include "lazybios/structures/type5.h"
#include "lazybios/structures/type6.h"
#include "lazybios/structures/type7.h"
#include "lazybios/structures/type8.h"
#include "lazybios/structures/type9.h"
#include "lazybios/structures/type10.h"
#include "lazybios/structures/type11.h"
#include "lazybios/structures/type12.h"
#include "lazybios/structures/type13.h"
#include "lazybios/structures/type14.h"
#include "lazybios/structures/type15.h"
#include "lazybios/structures/type16.h"
#include "lazybios/structures/type17.h"
#include "lazybios/structures/type18.h"
#include "lazybios/structures/type19.h"
#include "lazybios/structures/type20.h"
#include "lazybios/structures/type21.h"
#include "lazybios/structures/type22.h"
#include "lazybios/structures/type23.h"
#include "lazybios/structures/type24.h"
#include "lazybios/structures/type25.h"
#include "lazybios/structures/type26.h"
#include "lazybios/structures/type27.h"
#include "lazybios/structures/type28.h"
#include "lazybios/structures/type29.h"
#include "lazybios/structures/type30.h"
#include "lazybios/structures/type31.h"
#include "lazybios/structures/type32.h"
#include "lazybios/structures/type33.h"
#include "lazybios/structures/type34.h"
#include "lazybios/structures/type35.h"
#include "lazybios/structures/type36.h"
#include "lazybios/structures/type37.h"
#include "lazybios/structures/type38.h"
#include "lazybios/structures/type39.h"
#include "lazybios/structures/type40.h"
#include "lazybios/structures/type41.h"
#include "lazybios/structures/type42.h"
#include "lazybios/structures/type43.h"
#include "lazybios/structures/type44.h"
#include "lazybios/structures/type45.h"
#include "lazybios/structures/type46.h"
#include "lazybios/structures/oem/dell/dell_type177.h"
#include "lazybios/structures/oem/dell/dell_type212.h"
#include "lazybios/structures/oem/dell/dell_type218.h"
#include "lazybios/structures/oem/hp/hp_type204.h"
#include "lazybios/json/lazybios_json.h"

Go to the source code of this file.

Data Structures

struct  lazybiosCTX_t
 Top-level lazybios context containing raw and parsed SMBIOS data. More...
struct  lazybiosDMI_t
 Owns raw DMI table data and its parsed SMBIOS entry point. More...
struct  lazybiosOem_t
 Vendor-specific structures held by a context. More...
struct  lazybiosOemDell_t
 Dell OEM structures held by a context. More...
struct  lazybiosOemHp_t
 HP OEM structures held by a context. More...
struct  lazybiosSMBIOS2Entry
 Raw SMBIOS 2.x entry point layout. More...
struct  lazybiosSMBIOS3Entry
 Raw SMBIOS 3.x entry point layout. More...
struct  lazybiosTypeIndex_t
 Cached location and population count for one SMBIOS structure type. More...

Macros

#define LAZYBIOS_DATA
 Complete lazybios semantic version string.
#define LAZYBIOS_FIELD_STATUS(structure, field)
 Returns the status associated with a parsed structure field.
#define LAZYBIOS_MAJOR   3
 Major component of the lazybios version.
#define LAZYBIOS_MINOR   0
 Minor component of the lazybios version.
#define LAZYBIOS_PATCH   0
 Patch component of the lazybios version.
#define LAZYBIOS_WARN_UNUSED
 Expands to nothing on compilers without a return-value check.

Typedefs

typedef uint8_t lazybiosFieldStatus_t
 Storage for one field's availability.

Enumerations

enum  lazybiosBackend_t {
  LAZYBIOS_BACKEND_LINUX , LAZYBIOS_BACKEND_WINDOWS , LAZYBIOS_BACKEND_MACOS , LAZYBIOS_BACKEND_OPENBSD ,
  LAZYBIOS_BACKEND_FREEBSD , LAZYBIOS_BACKEND_NETBSD , LAZYBIOS_BACKEND_SUNOS , LAZYBIOS_BACKEND_DRAGONFLY ,
  LAZYBIOS_BACKEND_HAIKU , LAZYBIOS_BACKEND_BEOS , LAZYBIOS_BACKEND_REACTOS , LAZYBIOS_BACKEND_GENERIC ,
  LAZYBIOS_BACKEND_UNKNOWN , LAZYBIOS_BACKEND_QNX , LAZYBIOS_BACKEND_MINIX
}
 Selects the platform backend used to obtain SMBIOS data. More...
enum  lazybiosFieldStatusValue_t { LAZYBIOS_FIELD_ABSENT = 0 , LAZYBIOS_FIELD_PRESENT , LAZYBIOS_FIELD_UNREACHABLE }
 Describes whether a parsed SMBIOS field was available and valid. More...
enum  lazybiosSMBIOSVersionTag { SMBIOS_VER_UNKNOWN = 0 , SMBIOS_VER_2X , SMBIOS_VER_3X }
 Identifies the SMBIOS entry point layout stored in a DMI container. More...

Functions

int lazybiosCleanup (lazybiosCTX_t *ctx)
 Releases a context and all SMBIOS data owned by it.
LAZYBIOS_WARN_UNUSED lazybiosCTX_t * lazybiosCTXNew (void)
 Allocates and initializes a lazybios context.
LAZYBIOS_WARN_UNUSED int lazybiosInit (lazybiosCTX_t *ctx, const char *entry_point, const char *DMI_BIN)
 Loads SMBIOS data from the host system or from captured table files.
int lazybiosIsVersionPlus (const lazybiosDMI_t *DMIData, uint8_t required_major, uint8_t required_minor)
 Tests whether the parsed SMBIOS version meets a minimum version.
LAZYBIOS_WARN_UNUSED int lazybiosParseAll (lazybiosCTX_t *ctx)
 Parses every implemented structure type into the context.

Variables

LAZYBIOS_DATA const char lazybiosVersion []

Detailed Description

Public API for lazybios. Include this and nothing else.

Author
LazySeldi

Definition in file lazybios.h.

Macro Definition Documentation

◆ LAZYBIOS_FIELD_STATUS

#define LAZYBIOS_FIELD_STATUS ( structure,
field )
Value:
((structure)->field_status.field)

Returns the status associated with a parsed structure field.

Parameters
structureNon-NULL pointer to a parsed SMBIOS structure.
fieldPublic field name in the parsed structure.

Definition at line 122 of file lazybios.h.

◆ LAZYBIOS_WARN_UNUSED

Typedef Documentation

◆ lazybiosFieldStatus_t

typedef uint8_t lazybiosFieldStatus_t

Storage for one field's availability.

Holds a lazybiosFieldStatusValue_t. C99 cannot give an enum a one-byte underlying type, and status metadata is roughly half the size of a parsed structure, so the value is stored as a byte and compared against the enumerators directly.

Definition at line 115 of file lazybios.h.