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

monitor: Print Netlink Rekey nested attributes

This commit is contained in:
Ravi kumar Veeramally 2015-02-04 15:09:23 +02:00 committed by Denis Kenzior
parent ea4158c76c
commit e79ab9d622

View File

@ -1030,6 +1030,49 @@ static const struct attr_entry key_default_type_table[] = {
{ }
};
static void print_rekey_kek(unsigned int level, const char *label,
const void *data, uint16_t size)
{
print_attr(level, "%s: len %u", label, size);
if (size != NL80211_KEK_LEN)
printf("malformed packet");
print_hexdump(level + 1, data, size);
}
static void print_rekey_kck(unsigned int level, const char *label,
const void *data, uint16_t size)
{
print_attr(level, "%s: len %u", label, size);
if (size != NL80211_KCK_LEN)
printf("malformed packet");
print_hexdump(level + 1, data, size);
}
static void print_rekey_replay_ctr(unsigned int level, const char *label,
const void *data, uint16_t size)
{
print_attr(level, "%s: len %u", label, size);
if (size != NL80211_REPLAY_CTR_LEN)
printf("malformed packet");
print_hexdump(level + 1, data, size);
}
static const struct attr_entry rekey_table[] = {
{ NL80211_REKEY_DATA_KEK, "KEK", ATTR_CUSTOM,
{ .function = print_rekey_kek } },
{ NL80211_REKEY_DATA_KCK, "KCK", ATTR_CUSTOM,
{ .function = print_rekey_kck } },
{ NL80211_REKEY_DATA_REPLAY_CTR, "Replay CTR", ATTR_CUSTOM,
{ .function = print_rekey_replay_ctr } },
{ }
};
static const struct attr_entry attr_table[] = {
{ NL80211_ATTR_WIPHY,
"Wiphy", ATTR_U32 },
@ -1289,7 +1332,7 @@ static const struct attr_entry attr_table[] = {
"Software Interface Types", ATTR_NESTED,
{ iftype_table } },
{ NL80211_ATTR_REKEY_DATA,
"Rekey Data" },
"Rekey Data", ATTR_NESTED, { rekey_table } },
{ NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
"Max Num Sched Scan SSIDs", ATTR_U8 },
{ NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,