From 4d7ff64f386313ac3b2aebdffc542518ca07b38a Mon Sep 17 00:00:00 2001 From: Ravi kumar Veeramally Date: Mon, 19 Jan 2015 13:55:19 +0200 Subject: [PATCH] monitor: Print NLMSG header Print NLMSG header for detailed information. e.g: > RTNL: Done (0x03) len 4 [multi] Flags: 2 (0x002) Sequence number: 1421667486 (0x54bcec9e) Port ID: 24768 --- monitor/nlmon.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 22865906..14630830 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -1724,6 +1724,14 @@ static void print_message(const struct timeval *tv, enum msg_type type, } } +static void print_nlmsghdr(const struct nlmsghdr *hdr) +{ + print_field("Flags: %d (0x%03x)", hdr->nlmsg_flags, hdr->nlmsg_flags); + print_field("Sequence number: %d (0x%08x)", + hdr->nlmsg_seq, hdr->nlmsg_seq); + print_field("Port ID: %d", hdr->nlmsg_pid); +} + struct nlmon_req_match { uint32_t seq; uint32_t pid; @@ -2000,6 +2008,7 @@ void nlmon_print_rtnl(struct nlmon *nlmon, const struct timeval *tv, print_packet(tv, out ? '<' : '>', COLOR_YELLOW, "RTNL", str, extra_str); + print_nlmsghdr(nlmsg); switch (nlmsg->nlmsg_type) { case RTM_SETLINK: