Merge from vendor branch GCC:
[dragonfly.git] / contrib / bind-9.3 / lib / lwres / man / lwres_getnameinfo.3
1 .\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
3 .\" 
4 .\" Permission to use, copy, modify, and 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.15.2.1.8.5 2005/10/13 02:33:53 marka Exp $
17 .\"
18 .hy 0
19 .ad l
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.
24 .TH "LWRES_GETNAMEINFO" "3" "Jun 30, 2000" "BIND9" "BIND9"
25 .\" disable hyphenation
26 .nh
27 .\" disable justification (adjust text to left margin only)
28 .ad l
29 .SH "NAME"
30 lwres_getnameinfo \- lightweight resolver socket address structure to hostname and service name
31 .SH "SYNOPSIS"
32 .nf
33 #include <lwres/netdb.h>
34 .fi
35 .HP 22
36 \fBint\ \fBlwres_getnameinfo\fR\fR\fB(\fR\fBconst\ struct\ sockaddr\ *sa\fR\fB, \fR\fBsize_t\ salen\fR\fB, \fR\fBchar\ *host\fR\fB, \fR\fBsize_t\ hostlen\fR\fB, \fR\fBchar\ *serv\fR\fB, \fR\fBsize_t\ servlen\fR\fB, \fR\fBint\ flags\fR\fB);\fR
37 .SH "DESCRIPTION"
38 .PP
39 This function is equivalent to the
40 \fBgetnameinfo\fR(3)
41 function defined in RFC2133.
42 \fBlwres_getnameinfo()\fR
43 returns the hostname for the
44 \fBstruct sockaddr\fR\fIsa\fR
45 which is
46 \fIsalen\fR
47 bytes long. The hostname is of length
48 \fIhostlen\fR
49 and is returned via
50 \fI*host.\fR
51 The maximum length of the hostname is 1025 bytes:
52 \fBNI_MAXHOST\fR.
53 .PP
54 The name of the service associated with the port number in
55 \fIsa\fR
56 is returned in
57 \fI*serv.\fR
58 It is
59 \fIservlen\fR
60 bytes long. The maximum length of the service name is
61 \fBNI_MAXSERV\fR
62 \- 32 bytes.
63 .PP
64 The
65 \fIflags\fR
66 argument sets the following bits:
67 .TP
68 \fBNI_NOFQDN\fR
69 A fully qualified domain name is not required for local hosts. The local part of the fully qualified domain name is returned instead.
70 .TP
71 \fBNI_NUMERICHOST\fR
72 Return the address in numeric form, as if calling inet_ntop(), instead of a host name.
73 .TP
74 \fBNI_NAMEREQD\fR
75 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.
76 .TP
77 \fBNI_NUMERICSERV\fR
78 The service name is returned as a digit string representing the port number.
79 .TP
80 \fBNI_DGRAM\fR
81 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.
82 .SH "RETURN VALUES"
83 .PP
84 \fBlwres_getnameinfo()\fR
85 returns 0 on success or a non\-zero error code if an error occurs.
86 .SH "SEE ALSO"
87 .PP
88 \fBRFC2133\fR(),
89 \fBgetservbyport\fR(3),
90 \fBlwres\fR(3),
91 \fBlwres_getnameinfo\fR(3),
92 \fBlwres_getnamebyaddr\fR(3).
93 \fBlwres_net_ntop\fR(3).
94 .SH "BUGS"
95 .PP
96 RFC2133 fails to define what the nonzero return values of
97 \fBgetnameinfo\fR(3)
98 are.