mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-26 01:02:35 +01:00
monitor: Add support for attributes containing signed 32-bit integers
This commit is contained in:
parent
080338ba41
commit
477682ad5d
@ -112,6 +112,7 @@ enum attr_type {
|
||||
ATTR_U16,
|
||||
ATTR_U32,
|
||||
ATTR_U64,
|
||||
ATTR_S32,
|
||||
ATTR_STRING,
|
||||
ATTR_ADDRESS,
|
||||
ATTR_BINARY,
|
||||
@ -597,6 +598,7 @@ static void print_attributes(int indent, const struct attr_entry *table,
|
||||
uint32_t val32;
|
||||
uint16_t val16;
|
||||
uint8_t val8;
|
||||
int32_t val_s32;
|
||||
uint8_t *ptr;
|
||||
char addr[18];
|
||||
|
||||
@ -654,6 +656,12 @@ static void print_attributes(int indent, const struct attr_entry *table,
|
||||
if (NLA_PAYLOAD(nla) != 8)
|
||||
printf("malformed packet\n");
|
||||
break;
|
||||
case ATTR_S32:
|
||||
val_s32 = *((int32_t *) NLA_DATA(nla));
|
||||
printf("%*c%s: %d\n", indent, ' ', str, val_s32);
|
||||
if (NLA_PAYLOAD(nla) != 4)
|
||||
printf("malformed packet\n");
|
||||
break;
|
||||
case ATTR_STRING:
|
||||
printf("%*c%s: %s\n", indent, ' ', str,
|
||||
(char *) NLA_DATA(nla));
|
||||
|
Loading…
Reference in New Issue
Block a user