The Router Advertisement option can take the MAC address of the sender.
Let's introduce a function to get it from the parsed options.
return 0;
}
+int sd_ndisc_router_get_sender_mac(sd_ndisc_router *rt, struct ether_addr *ret) {
+ assert_return(rt, -EINVAL);
+
+ return ndisc_option_get_mac(rt->options, SD_NDISC_OPTION_SOURCE_LL_ADDRESS, ret);
+}
+
int sd_ndisc_router_get_mtu(sd_ndisc_router *rt, uint32_t *ret) {
assert_return(rt, -EINVAL);
assert_return(ret, -EINVAL);
***/
#include <inttypes.h>
+#include <net/ethernet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <time.h>
int sd_ndisc_router_get_lifetime_timestamp(sd_ndisc_router *rt, clockid_t clock, uint64_t *ret);
int sd_ndisc_router_get_reachable_time(sd_ndisc_router *rt, uint64_t *ret);
int sd_ndisc_router_get_retransmission_time(sd_ndisc_router *rt, uint64_t *ret);
+int sd_ndisc_router_get_sender_mac(sd_ndisc_router *rt, struct ether_addr *ret);
int sd_ndisc_router_get_mtu(sd_ndisc_router *rt, uint32_t *ret);
/* Generic option access */