Given an IPv4 address, I can verify whether the address is multicast in C by using the IN_MULTICAST
macro from netinet/in.h
header file. Similarly, for IPv6 I can use the IN6_IS_ADDR_MULTICAST
macro from netinet/in6.h
.
Is there any way to verify that a particular address is unicast? This would probably entail discarding other addressing methods like anycast and broadcast.
Ideally, but not necessarily, the solution to this would be in the C language.