]> granicus.if.org Git - strace/blobdiff - rtnl_nsid.c
Move string_to_uint* functions to a separate file
[strace] / rtnl_nsid.c
index de2878808f8119e7f69fcfa163784379e4339647..e3fe18b6c571ccee2dde1a1177849ffee8fa4894 100644 (file)
 
 #include "defs.h"
 #include "netlink_route.h"
+#include "nlattr.h"
 #include "print_fields.h"
 
 #include "netlink.h"
 #include <linux/rtnetlink.h>
 
+#include "xlat/rtnl_nsid_attrs.h"
+
 DECL_NETLINK_ROUTE_DECODER(decode_rtgenmsg)
 {
        struct rtgenmsg rtgenmsg = { .rtgen_family = family };
 
        PRINT_FIELD_XVAL("{", rtgenmsg, rtgen_family, addrfams, "AF_???");
        tprints("}");
+
+       const size_t offset = NLMSG_ALIGN(sizeof(rtgenmsg));
+       if (len > offset) {
+               tprints(", ");
+               decode_nlattr(tcp, addr + offset, len - offset,
+                             rtnl_nsid_attrs, "NETNSA_???", NULL, 0, NULL);
+       }
 }