+/* Set the description strings if appropriate values are available from
+ * the DMI. */
+static void set_desc(void)
+{
+ const char *uuid = dmi_get_system_info(DMI_PRODUCT_UUID);
+ const char *uptr = uuid + 24;
+
+ if (!uuid || *uuid == '\0' || strlen(uuid) != 36)
+ return;
+
+ /* We are only interested version 1 UUIDs, since the last six bytes
+ * are an IEEE 802 MAC address. */
+ if (uuid[14] != '1')
+ return;
+
+ /* Only set if the UUID is from Nicira. */
+ if (strncmp(uptr, NICIRA_OUI_STR, strlen(NICIRA_OUI_STR)))
+ return;
+
+ strlcpy(mfr_desc, dmi_get_system_info(DMI_SYS_VENDOR), sizeof(mfr_desc));
+ snprintf(hw_desc, sizeof(hw_desc), "%s %s",
+ dmi_get_system_info(DMI_PRODUCT_NAME),
+ dmi_get_system_info(DMI_PRODUCT_VERSION));
+ strlcpy(serial_num, dmi_get_system_info(DMI_PRODUCT_SERIAL),
+ sizeof(serial_num));
+}
+