On Thu, Aug 10, 2017 at 09:04:52AM +0800, JingPiao Chen wrote:
> * rtnl_addr.c: New file.
> * Makefile.am (strace_SOURCES): Add it.
> * configure.ac (AC_CHECK_HEADERS): Add linux/if_addr.h.
> * netlink_route.h (decode_ifaddrmsg): New prototype.
> * netlink_route.c (route_decoders): Add RTM_DELADDR,
> RTM_GETADDR, RTM_GETANYCAST, RTM_GETMULTICAST add RTM_NEWADDR.
> * xlat/ifaddrflags.in: New file.
[...]
> +DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg)
> +{
> + struct ifaddrmsg ifaddr = { .ifa_family = family };
> + const size_t offset = sizeof(ifaddr.ifa_family);
> +
> + PRINT_FIELD_XVAL("{", ifaddr, ifa_family, addrfams, "AF_???");
> +
> + tprints(", ");
> + if (len >= sizeof(ifaddr)) {
> + if (!umoven_or_printaddr(tcp, addr + offset,
> + sizeof(ifaddr) - offset,
> + (void *) &ifaddr + offset)) {
> + PRINT_FIELD_U("", ifaddr, ifa_prefixlen);
> + PRINT_FIELD_FLAGS(", ", ifaddr, ifa_flags,
> + ifaddrflags, "IFA_F_???");
> + PRINT_FIELD_U(", ", ifaddr, ifa_scope);When ifaddr.ifa_flags contains one of RT_SCOPE_* constants defined in linux/rtnetlink.h, it would be better if this constant was printed in its symbolic form. -- ldv
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
