1
.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
1
.\" Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
2
2
.\" Copyright (C) 2001 Internet Software Consortium.
4
4
.\" Permission to use, copy, modify, and distribute this software for any
13
13
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
.\" PERFORMANCE OF THIS SOFTWARE.
16
.\" $Id: lwres_gethostent.3,v 1.16.2.1.8.5 2005/10/13 02:33:53 marka Exp $
16
.\" $Id: lwres_gethostent.3,v 1.29 2007/01/30 00:24:59 marka Exp $
20
.\" ** You probably do not want to edit this file directly **
21
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
22
.\" Instead of manually editing it, you probably should edit the DocBook XML
23
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
20
.\" Title: lwres_gethostent
22
.\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
23
.\" Date: Jun 30, 2000
24
27
.TH "LWRES_GETHOSTENT" "3" "Jun 30, 2000" "BIND9" "BIND9"
25
28
.\" disable hyphenation
33
36
#include <lwres/netdb.h>
36
\fBstruct\ hostent\ *\ \fBlwres_gethostbyname\fR\fR\fB(\fR\fBconst\ char\ *name\fR\fB);\fR
39
.BI "struct hostent * lwres_gethostbyname(const\ char\ *" "name" ");"
38
\fBstruct\ hostent\ *\ \fBlwres_gethostbyname2\fR\fR\fB(\fR\fBconst\ char\ *name\fR\fB, \fR\fBint\ af\fR\fB);\fR
41
.BI "struct hostent * lwres_gethostbyname2(const\ char\ *" "name" ", int\ " "af" ");"
40
\fBstruct\ hostent\ *\ \fBlwres_gethostbyaddr\fR\fR\fB(\fR\fBconst\ char\ *addr\fR\fB, \fR\fBint\ len\fR\fB, \fR\fBint\ type\fR\fB);\fR
43
.BI "struct hostent * lwres_gethostbyaddr(const\ char\ *" "addr" ", int\ " "len" ", int\ " "type" ");"
42
\fBstruct\ hostent\ *\ \fBlwres_gethostent\fR\fR\fB(\fR\fBvoid\fR\fB);\fR
44
\fBvoid\ \fBlwres_sethostent\fR\fR\fB(\fR\fBint\ stayopen\fR\fB);\fR
46
\fBvoid\ \fBlwres_endhostent\fR\fR\fB(\fR\fBvoid\fR\fB);\fR
48
\fBstruct\ hostent\ *\ \fBlwres_gethostbyname_r\fR\fR\fB(\fR\fBconst\ char\ *name\fR\fB, \fR\fBstruct\ hostent\ *resbuf\fR\fB, \fR\fBchar\ *buf\fR\fB, \fR\fBint\ buflen\fR\fB, \fR\fBint\ *error\fR\fB);\fR
50
\fBstruct\ hostent\ *\ \fBlwres_gethostbyaddr_r\fR\fR\fB(\fR\fBconst\ char\ *addr\fR\fB, \fR\fBint\ len\fR\fB, \fR\fBint\ type\fR\fB, \fR\fBstruct\ hostent\ *resbuf\fR\fB, \fR\fBchar\ *buf\fR\fB, \fR\fBint\ buflen\fR\fB, \fR\fBint\ *error\fR\fB);\fR
45
.BI "struct hostent * lwres_gethostent(void);"
47
.BI "void lwres_sethostent(int\ " "stayopen" ");"
49
.BI "void lwres_endhostent(void);"
51
.BI "struct hostent * lwres_gethostbyname_r(const\ char\ *" "name" ", struct\ hostent\ *" "resbuf" ", char\ *" "buf" ", int\ " "buflen" ", int\ *" "error" ");"
53
.BI "struct hostent * lwres_gethostbyaddr_r(const\ char\ *" "addr" ", int\ " "len" ", int\ " "type" ", struct\ hostent\ *" "resbuf" ", char\ *" "buf" ", int\ " "buflen" ", int\ *" "error" ");"
52
\fBstruct\ hostent\ *\ \fBlwres_gethostent_r\fR\fR\fB(\fR\fBstruct\ hostent\ *resbuf\fR\fB, \fR\fBchar\ *buf\fR\fB, \fR\fBint\ buflen\fR\fB, \fR\fBint\ *error\fR\fB);\fR
54
\fBvoid\ \fBlwres_sethostent_r\fR\fR\fB(\fR\fBint\ stayopen\fR\fB);\fR
56
\fBvoid\ \fBlwres_endhostent_r\fR\fR\fB(\fR\fBvoid\fR\fB);\fR
55
.BI "struct hostent * lwres_gethostent_r(struct\ hostent\ *" "resbuf" ", char\ *" "buf" ", int\ " "buflen" ", int\ *" "error" ");"
57
.BI "void lwres_sethostent_r(int\ " "stayopen" ");"
59
.BI "void lwres_endhostent_r(void);"
59
62
These functions provide hostname\-to\-address and address\-to\-hostname lookups by means of the lightweight resolver. They are similar to the standard
61
64
functions provided by most operating systems. They use a
62
65
\fBstruct hostent\fR
63
66
which is usually defined in
68
72
char *h_name; /* official name of host */
74
78
#define h_addr h_addr_list[0] /* address, for backward compatibility */
78
83
The members of this structure are:
81
87
The official (canonical) name of the host.
84
92
A NULL\-terminated array of alternate names (nicknames) for the host.
87
97
The type of address being returned \(em
93
105
The length of the address in bytes.
98
112
terminated array of network addresses for the host. Host addresses are returned in network byte order.
100
115
For backward compatibility with very old software,
217
231
\fBlwres_h_errno\fR
218
232
will contain one of the following error codes defined in
219
233
\fI<lwres/netdb.h>\fR:
221
235
\fBHOST_NOT_FOUND\fR
222
237
The host or address was not found.
225
242
A recoverable error occurred, e.g., a timeout. Retrying the lookup may succeed.
227
245
\fBNO_RECOVERY\fR
228
247
A non\-recoverable error occurred.
231
252
The name exists, but has no address information associated with it (or vice versa in the case of a reverse lookup). The code NO_ADDRESS is accepted as a synonym for NO_DATA for backwards compatibility.
233
\fBlwres_hstrerror\fR(3 )
255
\fBlwres_hstrerror\fR(3)
234
256
translates these error codes to suitable error messages.
236
258
\fBlwres_gethostent()\fR