implementation of addrinfo.