diff options
author | Burt P <pburt0@gmail.com> | 2017-12-25 13:59:02 -0600 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-10-22 19:45:23 -0700 |
commit | d5a5d7b946ae5fff92d10acb78e87fdd48e8085f (patch) | |
tree | 194e5ffee33badda4739ef3ca93844d445582189 /includes/dmi_util.h | |
parent | 459f2b1922fff188ea7912dca0f83ebc587a11c4 (diff) |
dmi_util: extend chassis_type table; add some functions to get information from dmidecode
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'includes/dmi_util.h')
-rw-r--r-- | includes/dmi_util.h | 18 |
1 files changed, 18 insertions, 0 deletions
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 |