diff options
author | JingPiao Chen <chenjingpiao@gmail.com> | 2017-08-15 12:41:20 +0800 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2017-08-15 22:34:46 +0000 |
commit | 1569f4cfe51245799f721da9886f94c3d83aa021 (patch) | |
tree | 6cf806e9d23f3fcdfe354370c8d437c2c431db2a /rtnl_netconf.c | |
parent | 3d27e43d827ecfcef359b65a85e7c632c951a457 (diff) | |
download | strace-1569f4cfe51245799f721da9886f94c3d83aa021.tar.gz |
netlink: add basic decoding of NETLINK_ROUTE netconfmsg attributes
* rtnl_netconf.c: Include "netlink.h", "nlattr.h",
and "xlat/rtnl_netconf_attrs.h".
(decode_netconfmsg): Call decode_nlattr.
* xlat/rtnl_netconf_attrs.in: New file.
Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
Diffstat (limited to 'rtnl_netconf.c')
-rw-r--r-- | rtnl_netconf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rtnl_netconf.c b/rtnl_netconf.c index 852e908dd..7e9b173b7 100644 --- a/rtnl_netconf.c +++ b/rtnl_netconf.c @@ -32,9 +32,13 @@ #ifdef HAVE_STRUCT_NETCONFMSG # include "netlink_route.h" +# include "nlattr.h" # include "print_fields.h" # include <linux/netconf.h> +# include "netlink.h" + +# include "xlat/rtnl_netconf_attrs.h" DECL_NETLINK_ROUTE_DECODER(decode_netconfmsg) { @@ -42,6 +46,14 @@ DECL_NETLINK_ROUTE_DECODER(decode_netconfmsg) PRINT_FIELD_XVAL("{", ncm, ncm_family, addrfams, "AF_???"); tprints("}"); + + const size_t offset = NLMSG_ALIGN(sizeof(ncm)); + if (len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_netconf_attrs, "NETCONFA_???", + NULL, 0, NULL); + } } #endif |