70N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 70N/A - Permission to use, copy, modify, and distribute this software for any 911N/A - purpose with or without fee is hereby granted, provided that the above 851N/A - copyright notice and this permission notice appear in all copies. 70N/A - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM 919N/A - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 919N/A - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 919N/A - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 919N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 919N/A - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 919N/A - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 919N/A - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 919N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.73 70N/A>lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent -- lightweight resolver nodename / address translation API</
DIV 70N/ACLASS="REFSYNOPSISDIV" 70N/ACLASS="FUNCSYNOPSIS" lwres_getipnodebyname</
CODE>(const char *name, int af, int flags, int *error_num);</
CODElwres_getipnodebyaddr</
CODE>(const void *src, size_t len, int af, int *error_num);</
CODE>(struct hostent *he);</
CODE>These functions perform thread safe, protocol independent
nodename-to-address and address-to-nodename
translation as defined in RFC2553.</
P char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
#define h_addr h_addr_list[0] /* address, for backward compatibility */</
PRE>The members of this structure are:
>The official (canonical) name of the host.</
P>A NULL-terminated array of alternate names (nicknames) for the host.</
P>The type of address being returned - usually
>The length of the address in bytes.</
Pterminated array of network addresses for the host.
Host addresses are returned in network byte order.</
P>lwres_getipnodebyname()</
TTlooks up addresses of protocol family
parameter contains ORed flag bits to
specify the types of addresses that are searched
for, and the types of addresses that are returned.
of AF_INET6, and causes IPv4 addresses to be returned as IPv4-mapped
of AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned.
If AI_V4MAPPED is also set, the IPv4 addresses are return as mapped
>Only return an IPv6 or IPv4 address if here is an active network
interface of that type. This is not currently implemented
in the BIND 9 lightweight resolver, and the flag is ignored.</
P>lwres_getipnodebyaddr()</
TTperforms a reverse lookup
denotes the protocol family, typically
releases all the memory associated with
Any memory allocated for the
is freed, as is the memory for the
>lwres_getipnodebyname()</
TT>lwres_getipnodebyaddr()</
TTto an appropriate error code and the function returns a
The error codes and their meanings are defined in
>No such host is known.</
P>The server recognised the request and the name but no address is
available. Another type of request to the name server for the
domain might return an answer.</
P>A temporary and possibly transient error occurred, such as a
failure of a server to respond. The request may succeed if
>An unexpected failure occurred, and retrying the request
translates these error codes to suitable error messages.</
P