@@ -9,6 +9,7 @@
#include <errno.h>
#include <stdint.h>
#include <limits.h>
+#include <inttypes.h>
#include <linux/genetlink.h>
#include <linux/rtnetlink.h>
#include <linux/if_link.h>
@@ -110,6 +111,9 @@ static int pretty_print_attr(const struct nlattr *attr,
case NLA_U32:
printf("%u", mnl_attr_get_u32(attr));
break;
+ case NLA_U64:
+ printf("%" PRIu64, mnl_attr_get_u64(attr));
+ break;
case NLA_X8:
printf("0x%02x", mnl_attr_get_u8(attr));
break;
@@ -119,6 +123,9 @@ static int pretty_print_attr(const struct nlattr *attr,
case NLA_X32:
printf("0x%08x", mnl_attr_get_u32(attr));
break;
+ case NLA_X64:
+ printf("%" PRIx64, mnl_attr_get_u64(attr));
+ break;
case NLA_S8:
printf("%d", (int)mnl_attr_get_u8(attr));
break;
@@ -128,6 +135,9 @@ static int pretty_print_attr(const struct nlattr *attr,
case NLA_S32:
printf("%d", (int)mnl_attr_get_u32(attr));
break;
+ case NLA_S64:
+ printf("%" PRId64, (int64_t)mnl_attr_get_u64(attr));
+ break;
case NLA_STRING:
printf("\"%.*s\"", alen, (const char *)adata);
break;
@@ -17,12 +17,15 @@ enum pretty_nla_format {
NLA_U8,
NLA_U16,
NLA_U32,
+ NLA_U64,
NLA_X8,
NLA_X16,
NLA_X32,
+ NLA_X64,
NLA_S8,
NLA_S16,
NLA_S32,
+ NLA_S64,
NLA_STRING,
NLA_FLAG,
NLA_BOOL,
@@ -62,12 +65,15 @@ struct pretty_nlmsg_desc {
#define NLATTR_DESC_U8(_name) NLATTR_DESC(_name, NLA_U8)
#define NLATTR_DESC_U16(_name) NLATTR_DESC(_name, NLA_U16)
#define NLATTR_DESC_U32(_name) NLATTR_DESC(_name, NLA_U32)
+#define NLATTR_DESC_U64(_name) NLATTR_DESC(_name, NLA_U64)
#define NLATTR_DESC_X8(_name) NLATTR_DESC(_name, NLA_X8)
#define NLATTR_DESC_X16(_name) NLATTR_DESC(_name, NLA_X16)
#define NLATTR_DESC_X32(_name) NLATTR_DESC(_name, NLA_X32)
+#define NLATTR_DESC_X64(_name) NLATTR_DESC(_name, NLA_X64)
#define NLATTR_DESC_S8(_name) NLATTR_DESC(_name, NLA_U8)
#define NLATTR_DESC_S16(_name) NLATTR_DESC(_name, NLA_U16)
#define NLATTR_DESC_S32(_name) NLATTR_DESC(_name, NLA_U32)
+#define NLATTR_DESC_S64(_name) NLATTR_DESC(_name, NLA_S64)
#define NLATTR_DESC_STRING(_name) NLATTR_DESC(_name, NLA_STRING)
#define NLATTR_DESC_FLAG(_name) NLATTR_DESC(_name, NLA_FLAG)
#define NLATTR_DESC_BOOL(_name) NLATTR_DESC(_name, NLA_BOOL)
Add NLA_U64 (unsigned), NLA_X64 (unsigned, printed as hex) and NLA_S64 (signed) attribute types in pretty printing code. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> --- netlink/prettymsg.c | 10 ++++++++++ netlink/prettymsg.h | 6 ++++++ 2 files changed, 16 insertions(+)