Use DNSServiceGetAddrInfo in dns_sd.h to implement your own getaddrinfo, and use if_nametoindex to get interfaceIndex.
You can find an example of dns-sd.c in apple open source.
Topic:
App & System Services
SubTopic:
Core OS
Tags: