486N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 486N/A - Permission to use, copy, modify, and distribute this software for any 486N/A - purpose with or without fee is hereby granted, provided that the above 486N/A - copyright notice and this permission notice appear in all copies. 486N/A - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM 486N/A - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 486N/A - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 486N/A - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 486N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 486N/A - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 486N/A - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 486N/A - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 486N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.61 486N/A>lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent -- lightweight resolver nodename / address translation API</
DIV 619N/ACLASS="FUNCSYNOPSISINFO" 486N/Alwres_getipnodebyname</
CODE 486N/A>(const char *name, int af, int flags, int *error_num);</
CODE 486N/Alwres_getipnodebyaddr</
CODE 486N/A>(const void *src, size_t len, int af, int *error_num);</
CODE 486N/A>(struct hostent *he);</
CODE 486N/A>These functions perform thread safe, protocol independent
486N/Anodename-to-address and address-to-nodename
486N/Atranslation as defined in RFC2553.</
P 830N/A char *h_name; /* official name of host */
830N/A char **h_aliases; /* alias list */
830N/A int h_addrtype; /* host address type */
830N/A int h_length; /* length of address */
830N/A char **h_addr_list; /* list of addresses from name server */
830N/A#define h_addr h_addr_list[0] /* address, for backward compatibility */</
PRE 502N/A>The members of this structure are:
502N/A>The official (canonical) name of the host.</
P 486N/A>A NULL-terminated array of alternate names (nicknames) for the host.</
P 486N/A>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 approriate 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