3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-24 16:49:25 +01:00

monitor: print contents of beacon head/tail, and probe attributes

This commit is contained in:
James Prestwood 2023-02-23 10:14:16 -08:00 committed by Denis Kenzior
parent e9db40bb42
commit 95652a30d1

View File

@ -5068,6 +5068,16 @@ static void print_probe_response(unsigned int level,
(const uint8_t *) mmpdu + len - resp->ies); (const uint8_t *) mmpdu + len - resp->ies);
} }
static void print_beacon(unsigned int level,
const struct mmpdu_header *mmpdu, size_t len)
{
const struct mmpdu_beacon *beacon = mmpdu_body(mmpdu);
print_attr(level, "Subtype: Beacon");
print_ie(level + 1, "Beacon IEs", beacon->ies,
(const uint8_t *) mmpdu + len - beacon->ies);
}
static void print_frame_type(unsigned int level, const char *label, static void print_frame_type(unsigned int level, const char *label,
const void *data, uint16_t size) const void *data, uint16_t size)
{ {
@ -5122,6 +5132,9 @@ static void print_frame_type(unsigned int level, const char *label,
str = "Timing Advertisement"; str = "Timing Advertisement";
break; break;
case 0x08: case 0x08:
if (mpdu)
print_beacon(level + 1, mpdu, size);
else
str = "Beacon"; str = "Beacon";
break; break;
case 0x09: case 0x09:
@ -6240,9 +6253,10 @@ static const struct attr_entry attr_table[] = {
{ NL80211_ATTR_DTIM_PERIOD, { NL80211_ATTR_DTIM_PERIOD,
"DTIM Period", ATTR_U32 }, "DTIM Period", ATTR_U32 },
{ NL80211_ATTR_BEACON_HEAD, { NL80211_ATTR_BEACON_HEAD,
"Beacon Head", ATTR_BINARY }, "Beacon Head", ATTR_CUSTOM, { .function = print_frame } },
{ NL80211_ATTR_BEACON_TAIL, { NL80211_ATTR_BEACON_TAIL,
"Beacon Tail", ATTR_BINARY }, "Beacon Tail", ATTR_CUSTOM,
{ .function = print_management_ies } },
{ NL80211_ATTR_STA_AID, { NL80211_ATTR_STA_AID,
"Station AID", ATTR_U16 }, "Station AID", ATTR_U16 },
{ NL80211_ATTR_STA_FLAGS, { NL80211_ATTR_STA_FLAGS,
@ -6520,7 +6534,8 @@ static const struct attr_entry attr_table[] = {
{ NL80211_ATTR_PROBE_RESP_OFFLOAD, { NL80211_ATTR_PROBE_RESP_OFFLOAD,
"Probe Response Offload" }, "Probe Response Offload" },
{ NL80211_ATTR_PROBE_RESP, { NL80211_ATTR_PROBE_RESP,
"Probe Response" }, "Probe Response", ATTR_CUSTOM,
{ .function = print_frame} },
{ NL80211_ATTR_DFS_REGION, { NL80211_ATTR_DFS_REGION,
"DFS Region", ATTR_U8 }, "DFS Region", ATTR_U8 },
{ NL80211_ATTR_DISABLE_HT, { NL80211_ATTR_DISABLE_HT,