From ac663fba6964d19d15ecd810b968de8af486388f Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Thu, 18 Dec 2014 11:41:35 +0200 Subject: [PATCH] monitor: Print SSID IE Print the SSID IE. If the SSID is not UTF-8 compliant, replace the non- compliant byte with the UTF-8 substitution character. If the SSID is hidden, its length and/or all characters are zero; print nothing in this case. --- monitor/nlmon.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 402e82b4..e9b86ff9 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -43,6 +43,7 @@ #include "linux/nl80211.h" #include "src/ie.h" +#include "src/util.h" #include "monitor/pcap.h" #include "monitor/display.h" #include "monitor/nlmon.h" @@ -325,6 +326,12 @@ static void print_ie_vendor(unsigned int level, const char *label, oui[0], oui[1], oui[2]); } +static void print_ie_ssid(unsigned int level, const char *label, + const void *data, uint16_t size) +{ + print_attr(level, "%s: %s", label, util_ssid_to_utf8(size, data)); +} + static void print_ie_rate(unsigned int level, const char *label, const void *data, uint16_t size) { @@ -519,6 +526,8 @@ static void print_ie_erp(unsigned int level, const char *label, } static struct attr_entry ie_entry[] = { + {IE_TYPE_SSID, "SSID", + ATTR_CUSTOM, { .function = print_ie_ssid } }, {IE_TYPE_SUPPORTED_RATES, "Supported rates", ATTR_CUSTOM, { .function = print_ie_rate } }, {IE_TYPE_DSSS_PARAMETER_SET, "DSSS parameter set",