Esempio n. 1
0
struct hostent *
_gethostbynisname(
	const char *name,
	int af)
{
	return _gethostbynis(name, "hosts.byname", af);
}
Esempio n. 2
0
struct hostent *
_gethostbynisaddr(
	const char *addr,
	int len,
	int af)
{
	return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr", af);
}
Esempio n. 3
0
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));
}
Esempio n. 4
0
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));
}