Enumerate all network interfaces with IPs on FreeBSD

后端 未结 1 1727
夕颜
夕颜 2021-01-27 01:26

My application needs to list all network interafaces on a machine and their IPs, IPv4 and IPv6.

I can get all interfaces with IPv4 IPs using ioctl(SIOCGIFCONF), but I ne

相关标签:
1条回答
  • 2021-01-27 01:41

    getifaddrs(3) provides portable way to get network addresses and interface names.

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