bind - Removed version tag from contrib directory and updated README.DRAGONFLY.
[dragonfly.git] / contrib / bind / lib / lwres / man / lwres_getnameinfo.3
1 .\" Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
3 .\" 
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.
7 .\" 
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.
15 .\"
16 .\" $Id: lwres_getnameinfo.3,v 1.29.214.1 2009/07/11 01:43:31 tbox Exp $
17 .\"
18 .hy 0
19 .ad l
20 .\"     Title: lwres_getnameinfo
21 .\"    Author: 
22 .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
23 .\"      Date: Jun 30, 2000
24 .\"    Manual: BIND9
25 .\"    Source: BIND9
26 .\"
27 .TH "LWRES_GETNAMEINFO" "3" "Jun 30, 2000" "BIND9" "BIND9"
28 .\" disable hyphenation
29 .nh
30 .\" disable justification (adjust text to left margin only)
31 .ad l
32 .SH "NAME"
33 lwres_getnameinfo \- lightweight resolver socket address structure to hostname and service name
34 .SH "SYNOPSIS"
35 .nf
36 #include <lwres/netdb.h>
37 .fi
38 .HP 22
39 .BI "int lwres_getnameinfo(const\ struct\ sockaddr\ *" "sa" ", size_t\ " "salen" ", char\ *" "host" ", size_t\ " "hostlen" ", char\ *" "serv" ", size_t\ " "servlen" ", int\ " "flags" ");"
40 .SH "DESCRIPTION"
41 .PP
42 This function is equivalent to the
43 \fBgetnameinfo\fR(3)
44 function defined in RFC2133.
45 \fBlwres_getnameinfo()\fR
46 returns the hostname for the
47 \fBstruct sockaddr\fR
48 \fIsa\fR
49 which is
50 \fIsalen\fR
51 bytes long. The hostname is of length
52 \fIhostlen\fR
53 and is returned via
54 \fI*host.\fR
55 The maximum length of the hostname is 1025 bytes:
56 \fBNI_MAXHOST\fR.
57 .PP
58 The name of the service associated with the port number in
59 \fIsa\fR
60 is returned in
61 \fI*serv.\fR
62 It is
63 \fIservlen\fR
64 bytes long. The maximum length of the service name is
65 \fBNI_MAXSERV\fR
66 \- 32 bytes.
67 .PP
68 The
69 \fIflags\fR
70 argument sets the following bits:
71 .PP
72 \fBNI_NOFQDN\fR
73 .RS 4
74 A fully qualified domain name is not required for local hosts. The local part of the fully qualified domain name is returned instead.
75 .RE
76 .PP
77 \fBNI_NUMERICHOST\fR
78 .RS 4
79 Return the address in numeric form, as if calling inet_ntop(), instead of a host name.
80 .RE
81 .PP
82 \fBNI_NAMEREQD\fR
83 .RS 4
84 A name is required. If the hostname cannot be found in the DNS and this flag is set, a non\-zero error code is returned. If the hostname is not found and the flag is not set, the address is returned in numeric form.
85 .RE
86 .PP
87 \fBNI_NUMERICSERV\fR
88 .RS 4
89 The service name is returned as a digit string representing the port number.
90 .RE
91 .PP
92 \fBNI_DGRAM\fR
93 .RS 4
94 Specifies that the service being looked up is a datagram service, and causes getservbyport() to be called with a second argument of "udp" instead of its default of "tcp". This is required for the few ports (512\-514) that have different services for UDP and TCP.
95 .RE
96 .SH "RETURN VALUES"
97 .PP
98 \fBlwres_getnameinfo()\fR
99 returns 0 on success or a non\-zero error code if an error occurs.
100 .SH "SEE ALSO"
101 .PP
102 \fBRFC2133\fR(),
103 \fBgetservbyport\fR(3),
104 \fBlwres\fR(3),
105 \fBlwres_getnameinfo\fR(3),
106 \fBlwres_getnamebyaddr\fR(3).
107 \fBlwres_net_ntop\fR(3).
108 .SH "BUGS"
109 .PP
110 RFC2133 fails to define what the nonzero return values of
111 \fBgetnameinfo\fR(3)
112 are.
113 .SH "COPYRIGHT"
114 Copyright \(co 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
115 .br
116 Copyright \(co 2000, 2001 Internet Software Consortium.
117 .br