mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
nlmon: decode WSC_STATE attributes
This commit is contained in:
parent
d9b2d8151a
commit
8760e56278
@ -1504,6 +1504,24 @@ static void print_wsc_version(unsigned int level, const char *label,
|
||||
print_attr(level, "%s: %x", label, bytes[0]);
|
||||
}
|
||||
|
||||
static void print_wsc_state(unsigned int level, const char *label,
|
||||
const void *data, uint16_t size)
|
||||
{
|
||||
const uint8_t *bytes = data;
|
||||
static const char *state_table[3] = {
|
||||
"Reserved",
|
||||
"Not Configured",
|
||||
"Configured"
|
||||
};
|
||||
|
||||
if (size != 1 || bytes[0] == 0 || bytes[0] > 2) {
|
||||
printf("malformed packet\n");
|
||||
return;
|
||||
}
|
||||
|
||||
print_attr(level, "%s: %s", label, state_table[bytes[0]]);
|
||||
}
|
||||
|
||||
static struct attr_entry wsc_attr_entry[] = {
|
||||
{ WSC_ATTR_8021X_ENABLED, "802.1X Enabled",
|
||||
ATTR_CUSTOM, { .function = print_wsc_bool } },
|
||||
@ -1537,6 +1555,8 @@ static struct attr_entry wsc_attr_entry[] = {
|
||||
ATTR_CUSTOM, { .function = print_wsc_byte } },
|
||||
{ WSC_ATTR_VERSION, "Version",
|
||||
ATTR_CUSTOM, { .function = print_wsc_version } },
|
||||
{ WSC_ATTR_WSC_STATE, "WSC State",
|
||||
ATTR_CUSTOM, { .function = print_wsc_state } },
|
||||
{ },
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user