From 477682ad5d82a1c1dbc0529918876d7a98a5e437 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 6 Aug 2014 04:01:49 +0200 Subject: [PATCH] monitor: Add support for attributes containing signed 32-bit integers --- monitor/nlmon.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 4a0da38d..92b329d5 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -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));