Changeset View
Changeset View
Standalone View
Standalone View
head/tools/tools/net80211/wlanstats/main.c
Show All 28 Lines | |||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
/* | /* | ||||
* wlanstats [-i interface] | * wlanstats [-i interface] | ||||
* (default interface is wlan0). | * (default interface is wlan0). | ||||
*/ | */ | ||||
#include <sys/types.h> | #include <sys/param.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <net/ethernet.h> | #include <net/ethernet.h> | ||||
#include <net80211/_ieee80211.h> | #include <net80211/_ieee80211.h> | ||||
#include <stdlib.h> | |||||
#include <stdio.h> | |||||
#include <signal.h> | |||||
#include <unistd.h> | |||||
#include <err.h> | #include <err.h> | ||||
#include <signal.h> | |||||
#include <stdio.h> | |||||
#include <stdlib.h> | |||||
#include <strings.h> | #include <strings.h> | ||||
#include <unistd.h> | |||||
#include "wlanstats.h" | #include "wlanstats.h" | ||||
static struct { | static struct { | ||||
const char *tag; | const char *tag; | ||||
const char *fmt; | const char *fmt; | ||||
} tags[] = { | } tags[] = { | ||||
{ "default", | { "default", | ||||
"input,rx_mgmt,output,rx_badkeyid,scan_active,scan_bg,bmiss,rssi,noise,rate" | "input,rx_mgmt,output,rx_badkeyid,scan_active,scan_bg,bmiss,rssi,noise,rate" | ||||
}, | }, | ||||
{ "ampdu", | { "ampdu", | ||||
"input,output,ampdu_reorder,ampdu_oor,rx_dup,ampdu_flush,ampdu_move," | "input,output,ampdu_reorder,ampdu_oor,rx_dup,ampdu_flush,ampdu_move," | ||||
"ampdu_drop,ampdu_bar,ampdu_baroow,ampdu_barmove,ampdu_bartx," | "ampdu_drop,ampdu_bar,ampdu_baroow,ampdu_barmove,ampdu_bartx," | ||||
"ampdu_bartxfail,ampdu_bartxretry,rssi,rate" | "ampdu_bartxfail,ampdu_bartxretry,rssi,rate" | ||||
}, | }, | ||||
}; | }; | ||||
static const char * | static const char * | ||||
getfmt(const char *tag) | getfmt(const char *tag) | ||||
{ | { | ||||
#define N(a) (sizeof(a)/sizeof(a[0])) | |||||
int i; | int i; | ||||
for (i = 0; i < N(tags); i++) | for (i = 0; i < nitems(tags); i++) | ||||
if (strcasecmp(tags[i].tag, tag) == 0) | if (strcasecmp(tags[i].tag, tag) == 0) | ||||
return tags[i].fmt; | return tags[i].fmt; | ||||
return tag; | return tag; | ||||
#undef N | |||||
} | } | ||||
static int signalled; | static int signalled; | ||||
static void | static void | ||||
catchalarm(int signo __unused) | catchalarm(int signo __unused) | ||||
{ | { | ||||
signalled = 1; | signalled = 1; | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |