1 .\" Copyright (C) 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
4 .\" Permission to use, copy, modify, and/or distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 .\" PERFORMANCE OF THIS SOFTWARE.
19 .\" Title: lwres_getipnode
21 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
27 .TH "LWRES_GETIPNODE" "3" "2007\-06\-18" "ISC" "BIND9"
28 .\" -----------------------------------------------------------------
29 .\" * Define some portability stuff
30 .\" -----------------------------------------------------------------
31 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 .\" http://bugs.debian.org/507673
33 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 .\" -----------------------------------------------------------------
38 .\" * set default formatting
39 .\" -----------------------------------------------------------------
40 .\" disable hyphenation
42 .\" disable justification (adjust text to left margin only)
44 .\" -----------------------------------------------------------------
45 .\" * MAIN CONTENT STARTS HERE *
46 .\" -----------------------------------------------------------------
48 lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent \- lightweight resolver nodename / address translation API
53 #include <lwres/netdb\&.h>
56 .HP \w'struct\ hostent\ *\ lwres_getipnodebyname('u
57 .BI "struct hostent * lwres_getipnodebyname(const\ char\ *" "name" ", int\ " "af" ", int\ " "flags" ", int\ *" "error_num" ");"
58 .HP \w'struct\ hostent\ *\ lwres_getipnodebyaddr('u
59 .BI "struct hostent * lwres_getipnodebyaddr(const\ void\ *" "src" ", size_t\ " "len" ", int\ " "af" ", int\ *" "error_num" ");"
60 .HP \w'void\ lwres_freehostent('u
61 .BI "void lwres_freehostent(struct\ hostent\ *" "he" ");"
64 These functions perform thread safe, protocol independent nodename\-to\-address and address\-to\-nodename translation as defined in RFC2553\&.
76 char *h_name; /* official name of host */
77 char **h_aliases; /* alias list */
78 int h_addrtype; /* host address type */
79 int h_length; /* length of address */
80 char **h_addr_list; /* list of addresses from name server */
82 #define h_addr h_addr_list[0] /* address, for backward compatibility */
88 The members of this structure are:
92 The official (canonical) name of the host\&.
97 A NULL\-terminated array of alternate names (nicknames) for the host\&.
102 The type of address being returned \- usually
110 The length of the address in bytes\&.
117 terminated array of network addresses for the host\&. Host addresses are returned in network byte order\&.
120 \fBlwres_getipnodebyname()\fR
121 looks up addresses of protocol family
126 parameter contains ORed flag bits to specify the types of addresses that are searched for, and the types of addresses that are returned\&. The flag bits are:
132 of AF_INET6, and causes IPv4 addresses to be returned as IPv4\-mapped IPv6 addresses\&.
139 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 IPv6 addresses\&.
144 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\&.
149 This default sets the
156 \fBlwres_getipnodebyaddr()\fR
157 performs a reverse lookup of address
163 denotes the protocol family, typically
168 \fBlwres_freehostent()\fR
169 releases all the memory associated with the
172 \fIhe\fR\&. Any memory allocated for the
177 is freed, as is the memory for the
183 \fBlwres_getipnodebyname()\fR
185 \fBlwres_getipnodebyaddr()\fR
188 to an appropriate error code and the function returns a
190 pointer\&. The error codes and their meanings are defined in
195 No such host is known\&.
200 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\&.
205 A temporary and possibly transient error occurred, such as a failure of a server to respond\&. The request may succeed if retried\&.
210 An unexpected failure occurred, and retrying the request is pointless\&.
213 \fBlwres_hstrerror\fR(3)
214 translates these error codes to suitable error messages\&.
219 \fBlwres_gethostent\fR(3),
220 \fBlwres_getaddrinfo\fR(3),
221 \fBlwres_getnameinfo\fR(3),
222 \fBlwres_hstrerror\fR(3)\&.
225 \fBInternet Systems Consortium, Inc\&.\fR
228 Copyright \(co 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
230 Copyright \(co 2000, 2001, 2003 Internet Software Consortium.