batctl ping: add IPv6 to ethernet address resolution
RFC 1/1 batctl ping: add IPv6 to ethernet address resolution
Extends the "ping" command available in batctl with the capability of resolving the ethernet link layer (MAC) address from the IPv6 address of any node partecipating the mesh.
This is possible by adding to 'batctl' a new set of functions to leverage when performing netlink queries towards the kernel network infrastructure. These new functions, which act as a library, have been inserted into the "bat-mnl.c" and corresponding "bat-mnl.h" files. Such code has been taken from the libmnl library version 1.0.3 with minor modifications.
The netlink query is needed to extract the ethernet address, corresponding to the target IPv6 address, from the local neighbor discovery table. If the target address is not initially found in the table, one or more datagram are sent to it to initialize neighbor discovery exchange, just like what already happens for ARP tables in the IPv4 case.
--- Makefile | 2 +- bat-mnl.c | 560 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ bat-mnl.h | 92 ++++++++++ functions.c | 201 +++++++++++++++++++++- 4 files changed, 853 insertions(+), 2 deletions(-) create mode 100644 bat-mnl.c create mode 100644 bat-mnl.h
Makefile +1 -1
@@ -24,7 +24,7 @@ export CONFIG_BATCTL_BISECT=n # batctl build BINARY_NAME = batctl -OBJ = main.o bat-hosts.o functions.o sys.o debug.o ping.o traceroute.o tcpdump.o hash.o debugfs.o ioctl.o list-batman.o translate.o +OBJ = main.o bat-hosts.o functions.o sys.o debug.o ping.o traceroute.o tcpdump.o hash.o debugfs.o ioctl.o list-batman.o translate.o bat-mnl.o OBJ_BISECT = bisect_iv.o MANPAGE = man/batctl.8
bat-mnl.c new file +560 -0
560 lines not on this page · raw message
bat-mnl.h new file +92 -0
92 lines not on this page · raw message
functions.c +200 -1
245 lines not on this page · raw message
Signature · 1 line
1.8.3.2