Use getifaddrs() to enumerate all addresses associated with all network interfaces, discarding duplicate interface names, and sorting. For OSes where getifaddrs() is not available, an interface name can still be manually typed in.