X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fiw.git;a=blobdiff_plain;f=util.c;h=1750de26c1379c237b4aec9bed10966528b6992c;hp=dcb3de610352d0516895a0b8fd065f6075ced784;hb=748f8489caad151e01922f0ba26847aedfd36daf;hpb=d8004bddb204f6cd21209703c344508afefc8bc9 diff --git a/util.c b/util.c index dcb3de6..1750de2 100644 --- a/util.c +++ b/util.c @@ -1,3 +1,4 @@ +#include #include "iw.h" #include "nl80211.h" @@ -89,3 +90,15 @@ int ieee80211_frequency_to_channel(int freq) /* FIXME: dot11ChannelStartingFactor (802.11-2007 17.3.8.3.2) */ return freq/5 - 1000; } + +void print_ssid_escaped(const uint8_t len, const uint8_t *data) +{ + int i; + + for (i = 0; i < len; i++) { + if (isprint(data[i])) + printf("%c", data[i]); + else + printf("\\x%.2x", data[i]); + } +}