* rtnl_neigh.c: Include "nlattr.h" and "xlat/rtnl_neigh_attrs.h".
(decode_ndmsg): Call decode_nlattr.
* xlat/rtnl_neigh_attrs.in: New file.
Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
#include "defs.h"
#include "netlink_route.h"
#include "defs.h"
#include "netlink_route.h"
#include "print_fields.h"
#include "netlink.h"
#include "print_fields.h"
#include "netlink.h"
#include "xlat/nda_types.h"
#include "xlat/neighbor_cache_entry_flags.h"
#include "xlat/neighbor_cache_entry_states.h"
#include "xlat/nda_types.h"
#include "xlat/neighbor_cache_entry_flags.h"
#include "xlat/neighbor_cache_entry_states.h"
+#include "xlat/rtnl_neigh_attrs.h"
DECL_NETLINK_ROUTE_DECODER(decode_ndmsg)
{
struct ndmsg ndmsg = { .ndm_family = family };
DECL_NETLINK_ROUTE_DECODER(decode_ndmsg)
{
struct ndmsg ndmsg = { .ndm_family = family };
- const size_t offset = sizeof(ndmsg.ndm_family);
+ size_t offset = sizeof(ndmsg.ndm_family);
+ bool decode_nla = false;
PRINT_FIELD_XVAL("{", ndmsg, ndm_family, addrfams, "AF_???");
PRINT_FIELD_XVAL("{", ndmsg, ndm_family, addrfams, "AF_???");
"NTF_???");
PRINT_FIELD_XVAL(", ", ndmsg, ndm_type,
nda_types, "NDA_???");
"NTF_???");
PRINT_FIELD_XVAL(", ", ndmsg, ndm_type,
nda_types, "NDA_???");
}
} else
tprints("...");
tprints("}");
}
} else
tprints("...");
tprints("}");
+
+ offset = NLMSG_ALIGN(sizeof(ndmsg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_neigh_attrs, "NDA_???", NULL, 0, NULL);
+ }
}
DECL_NETLINK_ROUTE_DECODER(decode_rtm_getneigh)
}
DECL_NETLINK_ROUTE_DECODER(decode_rtm_getneigh)
--- /dev/null
+NDA_UNSPEC 0
+NDA_DST 1
+NDA_LLADDR 2
+NDA_CACHEINFO 3
+NDA_PROBES 4
+NDA_VLAN 5
+NDA_PORT 6
+NDA_VNI 7
+NDA_IFINDEX 8
+NDA_MASTER 9
+NDA_LINK_NETNSID 10
+NDA_SRC_VNI 11