struct hostent * _gethostbynisname( const char *name, int af) { return _gethostbynis(name, "hosts.byname", af); }
struct hostent * _gethostbynisaddr( const char *addr, int len, int af) { return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr", af); }
static int _gethostbynisname_r(const char *name, int af, struct hostent *he, struct hostent_data *hed) { char *map; switch (af) { case AF_INET: map = "hosts.byname"; break; default: map = "ipnodes.byname"; break; } return (_gethostbynis(name, map, af, he, hed)); }
static int _gethostbynisaddr_r(const void *addr, socklen_t len, int af, struct hostent *he, struct hostent_data *hed) { char *map; char numaddr[46]; switch (af) { case AF_INET: map = "hosts.byaddr"; break; default: map = "ipnodes.byaddr"; break; } if (inet_ntop(af, addr, numaddr, sizeof(numaddr)) == NULL) return (-1); return (_gethostbynis(numaddr, map, af, he, hed)); }