3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-26 18:12:42 +01:00

nlmon: print Fast BSS Transition element

This commit is contained in:
James Prestwood 2021-09-21 13:44:46 -07:00 committed by Denis Kenzior
parent 6dc7fde272
commit 5c7b5920b0

View File

@ -2177,6 +2177,67 @@ static void print_measurement_report(unsigned int level, const char *label,
}
}
static void print_fast_bss_transition(unsigned int level, const char *label,
const void *data,
uint16_t size)
{
struct ie_ft_info ft_info;
uint32_t mic_len = 16;
/* Most likely the MIC is 16 bytes */
if (ie_parse_fast_bss_transition_from_data(data - 2, size + 2,
mic_len, &ft_info) < 0) {
mic_len = 24;
/* Must be FILS, try 24 */
if (ie_parse_fast_bss_transition_from_data(data - 2, size + 2,
mic_len, &ft_info) < 0) {
print_attr(level + 1, "error parsing");
return;
}
}
print_attr(level, "%s", label);
if (ft_info.rsnxe_used)
print_attr(level + 1, "RSNXE Used set");
print_attr(level + 1, "MIC Element Count: %u",
ft_info.mic_element_count);
print_attr(level + 1, "MIC:");
print_hexdump(level + 2, ft_info.mic, mic_len);
print_attr(level + 1, "ANONCE:");
print_hexdump(level + 2, ft_info.anonce, sizeof(ft_info.anonce));
print_attr(level + 1, "SNONCE:");
print_hexdump(level + 2, ft_info.snonce, sizeof(ft_info.snonce));
print_attr(level + 1, "R0KHID:");
print_hexdump(level + 2, ft_info.r0khid, ft_info.r0khid_len);
if (ft_info.r1khid_present) {
print_attr(level + 1, "R1KHID:");
print_hexdump(level + 2, ft_info.r1khid,
sizeof(ft_info.r1khid));
}
if (ft_info.gtk_len) {
print_attr(level + 1, "GTK Key ID: %u", ft_info.gtk_key_id);
print_attr(level + 1, "GTK RSC:");
print_hexdump(level + 2, ft_info.gtk_rsc,
sizeof(ft_info.gtk_rsc));
print_attr(level + 1, "GTK:");
print_hexdump(level + 2, ft_info.gtk, ft_info.gtk_len);
}
if (ft_info.igtk_len) {
print_attr(level + 1, "IGTK Key ID: %u", ft_info.igtk_key_id);
print_attr(level + 1, "IGTK IPN:");
print_hexdump(level + 2, ft_info.igtk_ipn,
sizeof(ft_info.igtk_ipn));
print_attr(level + 1, "IGTK:");
print_hexdump(level + 2, ft_info.igtk, ft_info.igtk_len);
}
}
static struct attr_entry ie_entry[] = {
{ IE_TYPE_SSID, "SSID",
ATTR_CUSTOM, { .function = print_ie_ssid } },
@ -2235,6 +2296,8 @@ static struct attr_entry ie_entry[] = {
ATTR_CUSTOM, { .function = print_measurement_request } },
{ IE_TYPE_MEASUREMENT_REPORT, "Measurement Report",
ATTR_CUSTOM, { .function = print_measurement_report } },
{ IE_TYPE_FAST_BSS_TRANSITION, "Fast BSS Transition",
ATTR_CUSTOM, { .function = print_fast_bss_transition } },
{ },
};