getaddresses.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2007, 2009  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 2001  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 /* $Id: getaddresses.h,v 1.11 2009/01/17 23:47:42 tbox Exp $ */
00019 
00020 #ifndef BIND9_GETADDRESSES_H
00021 #define BIND9_GETADDRESSES_H 1
00022 
00023 /*! \file bind9/getaddresses.h */
00024 
00025 #include <isc/lang.h>
00026 #include <isc/types.h>
00027 
00028 #include <isc/net.h>
00029 
00030 ISC_LANG_BEGINDECLS
00031 
00032 isc_result_t
00033 bind9_getaddresses(const char *hostname, in_port_t port,
00034                    isc_sockaddr_t *addrs, int addrsize, int *addrcount);
00035 /*%<
00036  * Use the system resolver to get the addresses associated with a hostname.
00037  * If successful, the number of addresses found is returned in 'addrcount'.
00038  * If a hostname lookup is performed and addresses of an unknown family is
00039  * seen, it is ignored.  If more than 'addrsize' addresses are seen, the
00040  * first 'addrsize' are returned and the remainder silently truncated.
00041  *
00042  * This routine may block.  If called by a program using the isc_app
00043  * framework, it should be surrounded by isc_app_block()/isc_app_unblock().
00044  *
00045  *  Requires:
00046  *\li   'hostname' is not NULL.
00047  *\li   'addrs' is not NULL.
00048  *\li   'addrsize' > 0
00049  *\li   'addrcount' is not NULL.
00050  *
00051  *
00052  * Returns:
00053  *\li   #ISC_R_SUCCESS
00054  *\li   #ISC_R_NOTFOUND
00055  *\li   #ISC_R_NOFAMILYSUPPORT - 'hostname' is an IPv6 address, and IPv6 is
00056  *              not supported.
00057  */
00058 
00059 ISC_LANG_ENDDECLS
00060 
00061 #endif /* BIND9_GETADDRESSES_H */

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