summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/wifi.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-06-22 01:22:57 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-06-22 01:22:57 +0200
commite38938384faa8857471fab0c05ade056b55fb360 (patch)
treec88ee6e8f2ccca4afb526583369e3d1d62e8a318 /sys/src/9/pc/wifi.c
parent769fcc82efccf0efe1395e6d4a67bb68cda48eed (diff)
wifi: add list of setup encryption key ciphers and lengths into ifstats file
it is usefull to see what encryption keys have been estabished by aux/wpa.
Diffstat (limited to 'sys/src/9/pc/wifi.c')
-rw-r--r--sys/src/9/pc/wifi.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/src/9/pc/wifi.c b/sys/src/9/pc/wifi.c
index 9d17fd249..bda7e985f 100644
--- a/sys/src/9/pc/wifi.c
+++ b/sys/src/9/pc/wifi.c
@@ -660,6 +660,7 @@ wifistat(Wifi *wifi, void *buf, long n, ulong off)
char *s, *p, *e;
Wnode *wn;
long now;
+ int i;
p = s = smalloc(4096);
e = s + 4096;
@@ -670,9 +671,16 @@ wifistat(Wifi *wifi, void *buf, long n, ulong off)
wn = wifi->bss;
if(wn != nil){
p = seprint(p, e, "bssid: %E\n", wn->bssid);
- if(wn->brsnelen > 0){
- int i;
+ /* only print key ciphers and key length */
+ for(i = 0; i<nelem(wn->rxkey); i++)
+ p = seprint(p, e, "rxkey%d: %s:[%d]\n", i,
+ ciphers[wn->rxkey[i].cipher], wn->rxkey[i].len);
+ for(i = 0; i<nelem(wn->txkey); i++)
+ p = seprint(p, e, "txkey%d: %s:[%d]\n", i,
+ ciphers[wn->txkey[i].cipher], wn->txkey[i].len);
+
+ if(wn->brsnelen > 0){
p = seprint(p, e, "brsne: ");
for(i=0; i<wn->brsnelen; i++)
p = seprint(p, e, "%.2X", wn->brsne[i]);