To determine if an IPv4 gateway is alive or not programatically, raw packet socket with ETH_P_ARP as the protocol, can be used as follows:
int fd = socket (PF_PACKET, SOCK_RAW, ETH_P_ARP);
I’m looking for an IPv6 equivalent of ETH_P_ARP to use to ping an IPv6 gateway along similar lines. What are the other options in which this can be achieved programmatically?
Thanks!
Using wireshark, the protocol on a ND solicitation and on advertisement is just 0x86DD, and in if_ether.h that is assigned to ETH_P_IPV6.