I need to collect all the interface names, even the ones that aren\'t up at the moment. Like ifconfig -a.
ifconfig -a
getifaddrs() is iterating through
getifaddrs()
You are on the right track (it is getifaddrs). It returns each interface once per family, so you get eth0 for ipv4 and one for ipv6. If you just want each interface once you will have to uniq the output yourself.