o add IEEE80211_KEY_BITS for %b printing of wk_flags

o replace hand-rolled code to print wk_flags
o add display of ni_ucastkey in show sta
o fix \n in _db_show_key
This commit is contained in:
Sam Leffler 2009-02-05 19:20:34 +00:00
parent cdaf8487a3
commit f2ce0f5181
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=188170
2 changed files with 9 additions and 15 deletions

View File

@ -104,6 +104,10 @@ struct ieee80211_key {
(IEEE80211_KEY_SWENCRYPT | IEEE80211_KEY_SWDECRYPT)
#define IEEE80211_KEY_SWMIC (IEEE80211_KEY_SWENMIC | IEEE80211_KEY_SWDEMIC)
#define IEEE80211_KEY_BITS \
"\20\1XMIT\2RECV\3GROUP\4SWENCRYPT\5SWDECRYPT\6SWENMIC\7SWDEMIC" \
"\10DEVKEY\11CIPHER0\12CIPHER1"
#define IEEE80211_KEYIX_NONE ((ieee80211_keyix) -1)
/*

View File

@ -219,6 +219,7 @@ _db_show_sta(const struct ieee80211_node *ni)
ni->ni_rxfragstamp);
db_printf("\trxfrag[0] %p rxfrag[1] %p rxfrag[2] %p\n",
ni->ni_rxfrag[0], ni->ni_rxfrag[1], ni->ni_rxfrag[2]);
_db_show_key("\tucastkey", 0, &ni->ni_ucastkey);
db_printf("\trstamp %u avgrssi 0x%x (rssi %d) noise %d\n",
ni->ni_rstamp, ni->ni_avgrssi,
IEEE80211_RSSI_GET(ni->ni_avgrssi), ni->ni_noise);
@ -670,6 +671,8 @@ _db_show_key(const char *tag, int ix, const struct ieee80211_key *wk)
cip->ic_cipher, wk->wk_keyix, 8*keylen);
break;
}
if (wk->wk_rxkeyix != wk->wk_keyix)
db_printf(" rxkeyix %u", wk->wk_rxkeyix);
if (memcmp(wk->wk_key, zerodata, keylen) != 0) {
int i;
@ -683,22 +686,9 @@ _db_show_key(const char *tag, int ix, const struct ieee80211_key *wk)
if (cip->ic_cipher != IEEE80211_CIPHER_WEP &&
wk->wk_keytsc != 0)
db_printf(" tsc %ju", (uintmax_t)wk->wk_keytsc);
if (wk->wk_flags != 0) {
const char *sep = " ";
if (wk->wk_flags & IEEE80211_KEY_XMIT)
db_printf("%stx", sep), sep = "+";
if (wk->wk_flags & IEEE80211_KEY_RECV)
db_printf("%srx", sep), sep = "+";
if (wk->wk_flags & IEEE80211_KEY_DEFAULT)
db_printf("%sdef", sep), sep = "+";
if (wk->wk_flags & IEEE80211_KEY_SWCRYPT)
db_printf("%sswcrypt", sep), sep = "+";
if (wk->wk_flags & IEEE80211_KEY_SWMIC)
db_printf("%sswmic", sep), sep = "+";
}
db_printf("\n");
db_printf(" flags=%b", wk->wk_flags, IEEE80211_KEY_BITS);
}
db_printf("\n");
}
static void