From d5a5d7b946ae5fff92d10acb78e87fdd48e8085f Mon Sep 17 00:00:00 2001 From: Burt P Date: Mon, 25 Dec 2017 13:59:02 -0600 Subject: dmi_util: extend chassis_type table; add some functions to get information from dmidecode Signed-off-by: Burt P --- includes/dmi_util.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'includes') diff --git a/includes/dmi_util.h b/includes/dmi_util.h index aecda739..7ef33681 100644 --- a/includes/dmi_util.h +++ b/includes/dmi_util.h @@ -28,4 +28,22 @@ char *dmi_get_str(const char *id_str); * "Desktop". */ char *dmi_chassis_type_str(int chassis_type, gboolean with_val); +typedef struct { + unsigned long count; + unsigned long *handles; +} dmi_handle_list; + +/* get a list of handles that match a dmi_type */ +dmi_handle_list *dmidecode_handles(const unsigned long *dmi_type); +void dmi_handle_list_free(dmi_handle_list *hl); + +/* get a list of handles which have a name, and/or optional value, and/or limit to an optional dmi_type + * dmidecode_match_value("Name", NULL, NULL) : all dmi handles with an item called "Name" + * dmidecode_match_value("Name", "Value", NULL) : all dmi_handles with an item called "Name" that has a value of "Value" + * dmidecode_match_value("Name", "Value", &dt) : all dmi_handles with "Name: Value" that are of type stored in dt */ +dmi_handle_list *dmidecode_match_value(const char *name, const char *value, const unsigned long *dmi_type); + +/* get the first value for name, limiting to optional dmi_type and/or optional handle */ +char *dmidecode_match(const char *name, const unsigned long *dmi_type, const unsigned long *handle); + #endif -- cgit v1.2.3