getaddresses.c File Reference

#include <config.h>
#include <string.h>
#include <isc/net.h>
#include <isc/netaddr.h>
#include <isc/netdb.h>
#include <isc/netscope.h>
#include <isc/result.h>
#include <isc/sockaddr.h>
#include <isc/util.h>
#include <bind9/getaddresses.h>

Go to the source code of this file.

Functions

isc_result_t bind9_getaddresses (const char *hostname, in_port_t port, isc_sockaddr_t *addrs, int addrsize, int *addrcount)
 Use the system resolver to get the addresses associated with a hostname. If successful, the number of addresses found is returned in 'addrcount'. If a hostname lookup is performed and addresses of an unknown family is seen, it is ignored. If more than 'addrsize' addresses are seen, the first 'addrsize' are returned and the remainder silently truncated.

Variables

int h_errno


Detailed Description

Definition in file getaddresses.c.


Function Documentation

isc_result_t bind9_getaddresses ( const char *  hostname,
in_port_t  port,
isc_sockaddr_t addrs,
int  addrsize,
int *  addrcount 
)

Use the system resolver to get the addresses associated with a hostname. If successful, the number of addresses found is returned in 'addrcount'. If a hostname lookup is performed and addresses of an unknown family is seen, it is ignored. If more than 'addrsize' addresses are seen, the first 'addrsize' are returned and the remainder silently truncated.

This routine may block. If called by a program using the isc_app framework, it should be surrounded by isc_app_block()/isc_app_unblock().

Requires:

Returns:

Definition at line 50 of file getaddresses.c.

References AF_INET6, h_errno, have_ipv4, have_ipv6, isc_net_probeipv4(), isc_net_probeipv6(), isc_netaddr_fromin6(), isc_netaddr_setzone(), isc_netscope_pton(), ISC_R_BADADDRESSFORM, ISC_R_FAILURE, ISC_R_FAMILYNOSUPPORT, ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_sockaddr_fromin(), isc_sockaddr_fromin6(), isc_sockaddr_fromnetaddr(), isc_sockaddr_v6fromin(), ISC_TF, PF_INET6, REQUIRE, sockaddr_in6::sin6_addr, and zone.

Referenced by get_address(), get_addresses(), getaddresses(), and set_nameserver().


Variable Documentation

int h_errno

Referenced by bind9_getaddresses().


Generated on Tue Apr 28 17:41:07 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha