lwres_getipnode.docbook revision 8eea877894ea5bcf5cdd9ca124a8601ad421d753
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
6a42ab64276ff832a47e009be1208f7c7d4da22dAutomatic Updater - Copyright (C) 2001 Internet Software Consortium.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater - Permission to use, copy, modify, and distribute this software for any
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - purpose with or without fee is hereby granted, provided that the above
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - copyright notice and this permission notice appear in all copies.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
6a42ab64276ff832a47e009be1208f7c7d4da22dAutomatic Updater - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<!-- $Id: lwres_getipnode.docbook,v 1.3 2001/04/24 18:11:13 gson Exp $ -->
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refentryinfo>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews</refentryinfo>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<refpurpose>lightweight resolver nodename / address translation API</refpurpose>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews</refnamediv>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<refsynopsisdiv>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<funcsynopsis>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<funcprototype>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userstruct hostent *
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<function>lwres_getipnodebyname</function></funcdef>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</funcprototype>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<funcprototype>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userstruct hostent *
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<function>lwres_getipnodebyaddr</function></funcdef>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews</funcprototype>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<funcprototype>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<function>lwres_freehostent</function></funcdef>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</funcprototype>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews</funcsynopsis>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews</refsynopsisdiv>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark AndrewsThese functions perform thread safe, protocol independent
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usernodename-to-address and address-to-nodename
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrewstranslation as defined in RFC2553.
cd791043c8a6edbcacc2392575a9816d19b8157cTinderbox Userwhich is defined in
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<programlisting>
481870b95fee976541f4fe455c0ef2dbeab3ec7aTinderbox Userstruct hostent {
481870b95fee976541f4fe455c0ef2dbeab3ec7aTinderbox User char *h_name; /* official name of host */
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User char **h_aliases; /* alias list */
e839bf134fb138920d4833cf05cb8b8906787a8dAutomatic Updater int h_addrtype; /* host address type */
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User int h_length; /* length of address */
e839bf134fb138920d4833cf05cb8b8906787a8dAutomatic Updater char **h_addr_list; /* list of addresses from name server */
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater#define h_addr h_addr_list[0] /* address, for backward compatibility */
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</programlisting>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterThe members of this structure are:
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<variablelist>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater<varlistentry><term><constant>h_name</constant></term>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterThe official (canonical) name of the host.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater<varlistentry><term><constant>h_aliases</constant></term>
795a316ec568b2470aab18b9481443966047652eAutomatic UpdaterA NULL-terminated array of alternate names (nicknames) for the host.
795a316ec568b2470aab18b9481443966047652eAutomatic Updater<varlistentry><term><constant>h_addrtype</constant></term>
795a316ec568b2470aab18b9481443966047652eAutomatic UpdaterThe type of address being returned - usually
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox User<varlistentry><term><constant>h_length</constant></term>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserThe length of the address in bytes.
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater<varlistentry><term><constant>h_addr_list</constant></term>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrewsterminated array of network addresses for the host.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserHost addresses are returned in network byte order.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</variablelist>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater<function>lwres_getipnodebyname()</function>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updaterlooks up addresses of protocol family
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userfor the hostname
6f1205897504b8f50b1785975482c995888dd630Tinderbox Userparameter contains ORed flag bits to
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userspecify the types of addresses that are searched
6f1205897504b8f50b1785975482c995888dd630Tinderbox Userfor, and the types of addresses that are returned.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserThe flag bits are:
6f1205897504b8f50b1785975482c995888dd630Tinderbox User<variablelist>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<varlistentry><term><constant>AI_V4MAPPED</constant></term>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserThis is used with an
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userof AF_INET6, and causes IPv4 addresses to be returned as IPv4-mapped
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark AndrewsIPv6 addresses.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<varlistentry><term><constant>AI_ALL</constant></term>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserThis is used with an
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrewsof AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserIf AI_V4MAPPED is also set, the IPv4 addresses are return as mapped
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark AndrewsIPv6 addresses.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<varlistentry><term><constant>AI_ADDRCONFIG</constant></term>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark AndrewsOnly return an IPv6 or IPv4 address if here is an active network
b27ce68bae92006e2ad7a9b75602c6385e529c3bAutomatic Updaterinterface of that type. This is not currently implemented
922312472e2e05ebc64993d465999c5351b83036Automatic Updaterin the BIND 9 lightweight resolver, and the flag is ignored.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<varlistentry><term><constant>AI_DEFAULT</constant></term>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark AndrewsThis default sets the
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</variablelist>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userperforms a reverse lookup
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrewsdenotes the protocol family, typically
50066670817cdf9e86c832066d73715232b29680Tinderbox Userreleases all the memory associated with
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark AndrewsAny memory allocated for the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis freed, as is the memory for the
922312472e2e05ebc64993d465999c5351b83036Automatic Updaterstructure itself.