]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
add basic support for parsing WMM information element
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 4 May 2009 08:48:46 +0000 (01:48 -0700)
committerJohannes Berg <johannes@sipsolutions.net>
Mon, 4 May 2009 11:00:41 +0000 (13:00 +0200)
scan.c

diff --git a/scan.c b/scan.c
index 8cd1f9063119a8e06ef467d25057928fe5cea367..6ff4386eb0358915f2fddb193cdfe82a6b12a208 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -157,6 +157,28 @@ static void tab_on_first(bool *first)
                *first = false;
 }
 
+static void print_wifi_wmm(unsigned char type, unsigned char len, unsigned char *data)
+{
+       int i;
+
+       printf("\tWMM ");
+       switch (data[0]) {
+       case 0x00:
+               printf("information:");
+               break;
+       case 0x01:
+               printf("parameter:");
+               break;
+       default:
+               printf("type %d:", data[0]);
+               break;
+       }
+
+       for(i=0; i<len-1; i++)
+               printf(" %.02x", data[i + 1]);
+       printf("\n");
+}
+
 static void print_wifi_wps(unsigned char type, unsigned char len, unsigned char *data)
 {
        bool first = true;
@@ -238,6 +260,7 @@ static void print_wifi_wps(unsigned char type, unsigned char len, unsigned char
 }
 
 static const printfn wifiprinters[] = {
+       [2] = print_wifi_wmm,
        [4] = print_wifi_wps,
 };