summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_ddb.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-02-05 20:26:53 +0000
committersam <sam@FreeBSD.org>2009-02-05 20:26:53 +0000
commit6c8a518fd3df42771b399580fa72789769059f60 (patch)
treee53f8c8e18676f97c5b0f4bee6dec3cddaa25582 /sys/net80211/ieee80211_ddb.c
parent5370f726263dc1e1d6255cac0805deb0632a4fbc (diff)
downloadFreeBSD-src-6c8a518fd3df42771b399580fa72789769059f60.zip
FreeBSD-src-6c8a518fd3df42771b399580fa72789769059f60.tar.gz
o change _db_show_key to always dump the contents instead of checking
IEEE80211_KEY_DEVKEY o fix channel power printing (they are signed values) o add show statab to dump a node table and automatically dump the sta table of a com structure with /s
Diffstat (limited to 'sys/net80211/ieee80211_ddb.c')
-rw-r--r--sys/net80211/ieee80211_ddb.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c
index ba6e4f0..4e3406b 100644
--- a/sys/net80211/ieee80211_ddb.c
+++ b/sys/net80211/ieee80211_ddb.c
@@ -61,6 +61,8 @@ static void _db_show_vap(const struct ieee80211vap *, int);
static void _db_show_com(const struct ieee80211com *,
int showvaps, int showsta, int showprocs);
+static void _db_show_node_table(const char *tag,
+ const struct ieee80211_node_table *);
static void _db_show_channel(const char *tag, const struct ieee80211_channel *);
static void _db_show_ssid(const char *tag, int ix, int len, const uint8_t *);
static void _db_show_appie(const char *tag, const struct ieee80211_appie *);
@@ -80,6 +82,15 @@ DB_SHOW_COMMAND(sta, db_show_sta)
_db_show_sta((const struct ieee80211_node *) addr);
}
+DB_SHOW_COMMAND(statab, db_show_statab)
+{
+ if (!have_addr) {
+ db_printf("usage: show statab <addr>\n");
+ return;
+ }
+ _db_show_node_table("", (const struct ieee80211_node_table *) addr);
+}
+
DB_SHOW_COMMAND(vap, db_show_vap)
{
int i, showprocs = 0;
@@ -509,9 +520,12 @@ _db_show_com(const struct ieee80211com *ic, int showvaps, int showsta, int showp
db_printf("\n");
db_printf("\tmax_keyix %d", ic->ic_max_keyix);
- db_printf(" sta %p", &ic->ic_sta);
db_printf(" wme %p", &ic->ic_wme);
+ if (!showsta)
+ db_printf(" sta %p", &ic->ic_sta);
db_printf("\n");
+ if (showsta)
+ _db_show_node_table("\t", &ic->ic_sta);
db_printf("\tprotmode %d", ic->ic_protmode);
db_printf(" nonerpsta %u", ic->ic_nonerpsta);
@@ -576,6 +590,26 @@ _db_show_com(const struct ieee80211com *ic, int showvaps, int showsta, int showp
}
static void
+_db_show_node_table(const char *tag, const struct ieee80211_node_table *nt)
+{
+ int i;
+
+ db_printf("%s%s@%p:\n", tag, nt->nt_name, nt);
+ db_printf("%s nodelock %p", tag, &nt->nt_nodelock);
+ db_printf(" inact_init %d", nt->nt_inact_init);
+ db_printf(" scanlock %p", &nt->nt_scanlock);
+ db_printf(" scangen %u\n", nt->nt_scangen);
+ db_printf("%s keyixmax %d keyixmap %p\n",
+ tag, nt->nt_keyixmax, nt->nt_keyixmap);
+ for (i = 0; i < nt->nt_keyixmax; i++) {
+ const struct ieee80211_node *ni = nt->nt_keyixmap[i];
+ if (ni != NULL)
+ db_printf("%s [%3u] %p %s\n", tag, i, ni,
+ ether_sprintf(ni->ni_macaddr));
+ }
+}
+
+static void
_db_show_channel(const char *tag, const struct ieee80211_channel *c)
{
db_printf("%s ", tag);
@@ -584,7 +618,7 @@ _db_show_channel(const char *tag, const struct ieee80211_channel *c)
else if (c == IEEE80211_CHAN_ANYC)
db_printf("<ANY>");
else
- db_printf("[%u (%u) flags=%b maxreg %u maxpow %u minpow %u state 0x%x extieee %u]",
+ db_printf("[%u (%u) flags=%b maxreg %d maxpow %d minpow %d state 0x%x extieee %u]",
c->ic_freq, c->ic_ieee,
c->ic_flags, IEEE80211_CHAN_BITS,
c->ic_maxregpower, c->ic_maxpower, c->ic_minpower,
@@ -639,8 +673,6 @@ _db_show_key(const char *tag, int ix, const struct ieee80211_key *wk)
const struct ieee80211_cipher *cip = wk->wk_cipher;
int keylen = wk->wk_keylen;
- if ((wk->wk_flags & IEEE80211_KEY_DEVKEY) == 0)
- return;
db_printf(tag, ix);
switch (cip->ic_cipher) {
case IEEE80211_CIPHER_WEP:
OpenPOWER on IntegriCloud