[50] = print_supprates,
[221] = print_vendor,
};
-#define NUMPRINTERS (sizeof(ieprinters)/sizeof(ieprinters[0]))
static void print_ies(unsigned char *ie, int ielen)
{
while (ielen >= 2 && ielen >= ie[1]) {
- if (ie[0] < NUMPRINTERS && ieprinters[ie[0]]) {
+ if (ie[0] < ARRAY_SIZE(ieprinters) && ieprinters[ie[0]]) {
ieprinters[ie[0]](ie[0], ie[1], ie + 2);
} else {
int i;
[NL80211_BSS_BEACON_INTERVAL] = { .type = NLA_U16 },
[NL80211_BSS_CAPABILITY] = { .type = NLA_U16 },
[NL80211_BSS_INFORMATION_ELEMENTS] = { },
+ [NL80211_BSS_SIGNAL_MBM] = { .type = NLA_U32 },
+ [NL80211_BSS_SIGNAL_UNSPEC] = { .type = NLA_U8 },
};
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
if (bss[NL80211_BSS_CAPABILITY])
printf("\tcapability: 0x%.4x\n",
nla_get_u16(bss[NL80211_BSS_CAPABILITY]));
+ if (bss[NL80211_BSS_SIGNAL_MBM]) {
+ int s = nla_get_u32(bss[NL80211_BSS_SIGNAL_MBM]);
+ printf("\tsignal: %d.%.2d dBm\n", s/100, s%100);
+ }
+ if (bss[NL80211_BSS_SIGNAL_UNSPEC]) {
+ unsigned char s = nla_get_u8(bss[NL80211_BSS_SIGNAL_UNSPEC]);
+ printf("\tsignal: %d/100\n", s);
+ }
if (bss[NL80211_BSS_INFORMATION_ELEMENTS])
print_ies(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]),
nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]));