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
This commit is contained in:
Ravi kumar Veeramally 2015-01-19 13:55:19 +02:00 committed by Denis Kenzior
parent 0922ce9817
commit 4d7ff64f38
1 changed files with 9 additions and 0 deletions

View File

@ -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: