From abb4643b51674e053a448eb4f16769c21dde67ee Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Sun, 15 Nov 2015 10:01:59 +0200 Subject: netsniff-ng: nlmsg: Print not dissected attribute type number Print not handled attributes which will be helpful to indicate such attributes and add dissection code. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- proto_nlmsg.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'proto_nlmsg.c') diff --git a/proto_nlmsg.c b/proto_nlmsg.c index 843e5cc..04f261d 100644 --- a/proto_nlmsg.c +++ b/proto_nlmsg.c @@ -319,6 +319,9 @@ static void rtnl_print_ifinfo(struct nlmsghdr *hdr) attr_fmt(attr, "Network namespace fd %d", RTA_INT(attr)); break; + default: + attr_fmt(attr, "0x%x", attr->rta_type); + break; } } } @@ -404,6 +407,9 @@ static void rtnl_print_ifaddr(struct nlmsghdr *hdr) tprintf(", updated on(%.2fs))", (double)ci->cstamp / 100); tprintf(", Len %d\n", RTA_LEN(attr)); break; + default: + attr_fmt(attr, "0x%x", attr->rta_type); + break; } } } @@ -461,7 +467,6 @@ static const char *route_type2str(uint8_t type) case RTN_THROW: return "throw"; case RTN_NAT: return "nat"; case RTN_XRESOLVE: return "xresolve"; - default: return "Unknown"; } } @@ -568,6 +573,9 @@ static void rtnl_print_route(struct nlmsghdr *hdr) tprintf(", ts age(%ds))", ci->rta_tsage); tprintf(", Len %d\n", RTA_LEN(attr)); break; + default: + attr_fmt(attr, "0x%x", attr->rta_type); + break; } } } @@ -673,6 +681,9 @@ static void rtnl_print_neigh(struct nlmsghdr *hdr) tprintf(", refcnt(%d))", ci->ndm_refcnt); tprintf(", Len %d\n", RTA_LEN(attr)); break; + default: + attr_fmt(attr, "0x%x", attr->rta_type); + break; } } } -- cgit v1.2.3-54-g00ecf