IPv6 parsing in C

前端 未结 7 1104
猫巷女王i
猫巷女王i 2020-12-15 08:35

I wanted to know how I can parse an IPv6 address in C and convert it to a 128 bit value?

So a hex address like 1:22:333:aaaa:b:c:d:e needs to be convert

相关标签:
7条回答
  • 2020-12-15 09:22

    getaddrinfo() can understand IPv6 addresses. Pass AF_INET6 to it in the hints, as well as AI_NUMERICHOST (to prevent a DNS lookup). Linux has it, Windows has it as of Windows XP.

    0 讨论(0)
提交回复
热议问题