1 .\" Copyright (C) 2004, 2005, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001 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.
20 .\" Title: lwres_getnameinfo
22 .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
23 .\" Date: Jun 30, 2000
27 .TH "LWRES_GETNAMEINFO" "3" "Jun 30, 2000" "BIND9" "BIND9"
28 .\" disable hyphenation
30 .\" disable justification (adjust text to left margin only)
33 lwres_getnameinfo \- lightweight resolver socket address structure to hostname and service name
36 #include <lwres/netdb.h>
39 .BI "int lwres_getnameinfo(const\ struct\ sockaddr\ *" "sa" ", size_t\ " "salen" ", char\ *" "host" ", size_t\ " "hostlen" ", char\ *" "serv" ", size_t\ " "servlen" ", int\ " "flags" ");"
42 This function is equivalent to the
44 function defined in RFC2133.
45 \fBlwres_getnameinfo()\fR
46 returns the hostname for the
51 bytes long. The hostname is of length
55 The maximum length of the hostname is 1025 bytes:
58 The name of the service associated with the port number in
64 bytes long. The maximum length of the service name is
70 argument sets the following bits:
74 A fully qualified domain name is not required for local hosts. The local part of the fully qualified domain name is returned instead.
79 Return the address in numeric form, as if calling inet_ntop(), instead of a host name.
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.
89 The service name is returned as a digit string representing the port number.
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.
98 \fBlwres_getnameinfo()\fR
99 returns 0 on success or a non\-zero error code if an error occurs.
103 \fBgetservbyport\fR(3),
105 \fBlwres_getnameinfo\fR(3),
106 \fBlwres_getnamebyaddr\fR(3).
107 \fBlwres_net_ntop\fR(3).
110 RFC2133 fails to define what the nonzero return values of
114 Copyright \(co 2004, 2005, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
116 Copyright \(co 2000, 2001 Internet Software Consortium.