From e5f12bd13326d0d01470fd930f6513a7970e2f89 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 15 Sep 2016 10:55:22 -0500 Subject: [PATCH] monitor: Pretty print WSC OS Version --- monitor/nlmon.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 855cbbc4..54a36d50 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -1933,6 +1933,18 @@ static void print_wsc_model_number(unsigned int level, const char *label, print_wsc_ascii_string(level, label, data, size, 32); } +static void print_wsc_os_version(unsigned int level, const char *label, + const void *data, uint16_t size) +{ + uint32_t version; + + if (size != 4) + return; + + version = l_get_be32(data); + print_attr(level, "%s: %u", label, version & 0x7fffffff); +} + static void print_wsc_primary_device_type(unsigned int level, const char *label, const void *data, uint16_t size) { @@ -2212,6 +2224,8 @@ static struct attr_entry wsc_attr_entry[] = { ATTR_CUSTOM, { .function = print_wsc_byte } }, { WSC_ATTR_NETWORK_KEY_INDEX, "Network Key Index (Reserved)", ATTR_CUSTOM, { .function = print_wsc_byte } }, + { WSC_ATTR_OS_VERSION, "OS Version", + ATTR_CUSTOM, { .function = print_wsc_os_version } }, { WSC_ATTR_PORTABLE_DEVICE, "Portable Device", ATTR_CUSTOM, { .function = print_wsc_bool } }, { WSC_ATTR_PRIMARY_DEVICE_TYPE, "Primary Device Type",