Commit Graph

4 Commits

Author SHA1 Message Date
JingPiao Chen
19abd528fb rtnl_neigh: decode ndmsg netlink attributes
* nlattr.c: Include <netinet/in.h> and <arpa/inet.h>.
(decode_nla_be16): New function.
* nlattr.h (decode_nla_be16): New prototype.
* rtnl_neigh.c (decode_neigh_addr,
decode_nda_cacheinfo): New functions.
(ndmsg_nla_decoders): New array.
(decode_ndmsg): Use it.
2017-08-29 15:23:36 +08:00
JingPiao Chen
62c573a002 rtnl_neigh: fix ndm_type field decode in struct ndmsg
* defs.h (routing_types): New xlat prototype.
* rtnl_neigh.c (decode_ndmsg): Fix ndm_type decode.
* xlat/nda_types.in: Remove it.
* tests/netlink_route.c (test_rtnl_neigh): Update the test.
* tests/nlattr_ndmsg.c (init_ndmsg, print_ndmsg): Likewise.
2017-08-29 12:16:03 +08:00
JingPiao Chen
eede641dd2 netlink: add basic decoding of NETLINK_ROUTE ndmsg attributes
* 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>
2017-08-15 22:34:46 +00:00
JingPiao Chen
8f3b3e6578 netlink: add a basic rtnetlink parser of neigh messages
* rtnl_neigh.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_ndmsg, decode_rtm_getneigh): New prototypes.
* configure.ac (AC_CHECK_HEADERS): Add linux/neighbour.h.
* netlink_route.c (route_decoders): Add RTM_DELNEIGH, RTM_DELNEIGH,
and RTM_NEWNEIGH.
* xlat/nda_types.in: New file.
* xlat/neighbor_cache_entry_flags.in: Likewise.
* xlat/neighbor_cache_entry_states.in: Likewise.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
2017-08-14 01:07:07 +00:00