libhd  5.0
Data Structures | Macros | Enumerations | Functions | Variables
smbios.c File Reference
#include <stdio.h>
#include <string.h>
#include <uuid/uuid.h>
#include "hd.h"
#include "hd_int.h"
#include "smbios.h"

Data Structures

struct  sm_num2str_t
 
struct  sm_str_map_t
 

Macros

#define UUID_STR_LEN   37
 
#define SMBIOS_PRINT_ID(a, b)   smbios_id_print(f, &sm->a, b)
 
#define SMBIOS_PRINT_STR(a, b)   smbios_str_print(f, sm->a, b)
 
#define SMBIOS_PRINT_BITMAP_SHORT(a, b)   smbios_bitmap_print(f, &sm->a, b, 0)
 
#define SMBIOS_PRINT_BITMAP_LONG(a, b)   smbios_bitmap_print(f, &sm->a, b, 1)
 
#define SMBIOS_DEF_MAP(a)
 
#define READ_MEM16(ptr)   ((ptr)[0] + ((ptr)[1] << 8))
 
#define READ_MEM32(ptr)   ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24))
 
#define READ_MEM64(ptr)   (READ_MEM32(ptr) + ((uint64_t) READ_MEM32(ptr + 4) << 32))
 
#define smbios_memarray_ecc   smbios_cache_ecc
 

Enumerations

enum  sm_map_type { sm_map_str, sm_map_num2str }
 

Functions

static char * get_string (str_list_t *sl, int index)
 
static void smbios_bitmap_print (FILE *f, hd_bitmap_t *hbm, char *label, int style)
 
static void smbios_id_print (FILE *f, hd_id_t *hid, char *label)
 
static void smbios_str_print (FILE *f, char *str, char *label)
 
static void smbios_id2str (hd_id_t *hid, sm_str_map_t *map, unsigned def)
 
static void smbios_bitmap2str (hd_bitmap_t *hbm, sm_str_map_t *map)
 
static char * smbios_decode_uuid (uuid_t uuid)
 
 SMBIOS_DEF_MAP (smbios_bios_feature)
 
 SMBIOS_DEF_MAP (smbios_system_wakeups)
 
 SMBIOS_DEF_MAP (smbios_board_feature)
 
 SMBIOS_DEF_MAP (smbios_board_types)
 
 SMBIOS_DEF_MAP (smbios_chassis_types)
 
 SMBIOS_DEF_MAP (smbios_chassis_states)
 
 SMBIOS_DEF_MAP (smbios_chassis_sec_states)
 
 SMBIOS_DEF_MAP (smbios_proc_upgrades)
 
 SMBIOS_DEF_MAP (smbios_proc_cpu_status)
 
 SMBIOS_DEF_MAP (smbios_proc_types)
 
 SMBIOS_DEF_MAP (smbios_proc_families)
 
 SMBIOS_DEF_MAP (smbios_cache_mode)
 
 SMBIOS_DEF_MAP (smbios_cache_location)
 
 SMBIOS_DEF_MAP (smbios_cache_ecc)
 
 SMBIOS_DEF_MAP (smbios_cache_type)
 
 SMBIOS_DEF_MAP (smbios_cache_assoc)
 
 SMBIOS_DEF_MAP (smbios_cache_sram)
 
 SMBIOS_DEF_MAP (smbios_connect_conn_type)
 
 SMBIOS_DEF_MAP (smbios_connect_port_type)
 
 SMBIOS_DEF_MAP (smbios_slot_type)
 
 SMBIOS_DEF_MAP (smbios_slot_bus_width)
 
 SMBIOS_DEF_MAP (smbios_slot_usage)
 
 SMBIOS_DEF_MAP (smbios_slot_length)
 
 SMBIOS_DEF_MAP (smbios_slot_feature)
 
 SMBIOS_DEF_MAP (smbios_onboard_type)
 
 SMBIOS_DEF_MAP (smbios_memarray_location)
 
 SMBIOS_DEF_MAP (smbios_memarray_use)
 
 SMBIOS_DEF_MAP (smbios_mouse_type)
 
 SMBIOS_DEF_MAP (smbios_mouse_interface)
 
 SMBIOS_DEF_MAP (smbios_memdevice_form)
 
 SMBIOS_DEF_MAP (smbios_memdevice_type)
 
 SMBIOS_DEF_MAP (smbios_memdevice_detail)
 
 SMBIOS_DEF_MAP (smbios_memerror_type)
 
 SMBIOS_DEF_MAP (smbios_memerror_granularity)
 
 SMBIOS_DEF_MAP (smbios_memerror_operation)
 
 SMBIOS_DEF_MAP (smbios_secure_state)
 
void smbios_parse (hd_data_t *hd_data)
 
hd_smbios_tsmbios_add_entry (hd_smbios_t **sm, hd_smbios_t *new_sm)
 
hd_smbios_tsmbios_free (hd_smbios_t *sm)
 
void smbios_dump (hd_data_t *hd_data, FILE *f)
 

Variables

static sm_num2str_t smbios_bios_feature_ []
 
static char * smbios_system_wakeups_ []
 
static char * smbios_board_feature_ []
 
static char * smbios_board_types_ []
 
static char * smbios_chassis_types_ []
 
static char * smbios_chassis_states_ []
 
static char * smbios_chassis_sec_states_ []
 
static char * smbios_proc_upgrades_ []
 
static char * smbios_proc_cpu_status_ [8]
 
static char * smbios_proc_types_ []
 
static sm_num2str_t smbios_proc_families_ []
 
static char * smbios_cache_mode_ []
 
static char * smbios_cache_location_ []
 
static char * smbios_cache_ecc_ []
 
static char * smbios_cache_type_ []
 
static char * smbios_cache_assoc_ []
 
static char * smbios_cache_sram_ []
 
static sm_num2str_t smbios_connect_conn_type_ []
 
static sm_num2str_t smbios_connect_port_type_ []
 
static sm_num2str_t smbios_slot_type_ []
 
static char * smbios_slot_bus_width_ []
 
static char * smbios_slot_usage_ []
 
static char * smbios_slot_length_ []
 
static char * smbios_slot_feature_ []
 
static char * smbios_onboard_type_ []
 
static sm_num2str_t smbios_memarray_location_ []
 
static char * smbios_memarray_use_ []
 
static char * smbios_mouse_type_ []
 
static sm_num2str_t smbios_mouse_interface_ []
 
static char * smbios_memdevice_form_ []
 
static char * smbios_memdevice_type_ []
 
static char * smbios_memdevice_detail_ []
 
static char * smbios_memerror_type_ []
 
static char * smbios_memerror_granularity_ []
 
static char * smbios_memerror_operation_ []
 
static char * smbios_secure_state_ []
 

Macro Definition Documentation

◆ UUID_STR_LEN

#define UUID_STR_LEN   37

Referenced by smbios_decode_uuid().