1 .\" $NetBSD: lwres_getnameinfo.3,v 1.5 2014/12/10 04:38:02 christos Exp $
3 .\" Copyright (C) 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
6 .\" Permission to use, copy, modify, and/or distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 .\" PERFORMANCE OF THIS SOFTWARE.
22 .\" Title: lwres_getnameinfo
24 .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
25 .\" Date: June 18, 2007
29 .TH "LWRES_GETNAMEINFO" "3" "June 18, 2007" "BIND9" "BIND9"
30 .\" disable hyphenation
32 .\" disable justification (adjust text to left margin only)
35 lwres_getnameinfo \- lightweight resolver socket address structure to hostname and service name
38 #include <lwres/netdb.h>
41 .BI "int lwres_getnameinfo(const\ struct\ sockaddr\ *" "sa" ", size_t\ " "salen" ", char\ *" "host" ", size_t\ " "hostlen" ", char\ *" "serv" ", size_t\ " "servlen" ", int\ " "flags" ");"
44 This function is equivalent to the
46 function defined in RFC2133.
47 \fBlwres_getnameinfo()\fR
48 returns the hostname for the
53 bytes long. The hostname is of length
57 The maximum length of the hostname is 1025 bytes:
60 The name of the service associated with the port number in
66 bytes long. The maximum length of the service name is
72 argument sets the following bits:
76 A fully qualified domain name is not required for local hosts. The local part of the fully qualified domain name is returned instead.
81 Return the address in numeric form, as if calling inet_ntop(), instead of a host name.
86 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.
91 The service name is returned as a digit string representing the port number.
96 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.
100 \fBlwres_getnameinfo()\fR
101 returns 0 on success or a non\-zero error code if an error occurs.
105 \fBgetservbyport\fR(3),
107 \fBlwres_getnameinfo\fR(3),
108 \fBlwres_getnamebyaddr\fR(3).
109 \fBlwres_net_ntop\fR(3).
112 RFC2133 fails to define what the nonzero return values of
116 Copyright \(co 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC")
118 Copyright \(co 2000, 2001 Internet Software Consortium.