0

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.

dbush
  • 205,898
  • 23
  • 218
  • 273
Daniel Lovasko
  • 471
  • 2
  • 10
  • Check this answer. Then use the macro defined in in.h to achieve what you want. https://stackoverflow.com/a/48238426/2540947 – Lê Quang Duy Jul 09 '19 at 08:57
  • @LêQuangDuy He knows that. Read the question. – user207421 Jul 10 '19 at 11:58
  • @user207421 Please enlighten me, maybe my knowledge/English is not enough, so what does he want to achieve, exactly? a macro, a method to verify an address is unicast or something else? – Lê Quang Duy Jul 11 '19 at 03:03

0 Answers0