542N/A<!
DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1339N/A [<!ENTITY mdash "—">]>
1339N/A - Copyright (C) 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC") 542N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 919N/A - Permission to use, copy, modify, and/or distribute this software for any 919N/A - purpose with or without fee is hereby granted, provided that the above 919N/A - copyright notice and this permission notice appear in all copies. 919N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 919N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 919N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 919N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 919N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 919N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 919N/A - PERFORMANCE OF THIS SOFTWARE. 919N/A <
date>June 18, 2007</
date>
542N/A <
refentrytitle>lwres_getnameinfo</
refentrytitle>
970N/A <
manvolnum>3</
manvolnum>
977N/A <
refmiscinfo>BIND9</
refmiscinfo>
1339N/A <
holder>Internet Systems Consortium, Inc. ("ISC")</
holder>
542N/A <
holder>Internet Software Consortium.</
holder>
810N/A <
refname>lwres_getnameinfo</
refname>
810N/A <
refpurpose>lightweight resolver socket address structure to hostname and
970N/A<
function>lwres_getnameinfo</
function></
funcdef>
970N/A <
paramdef>const struct sockaddr *<
parameter>sa</
parameter></
paramdef>
970N/A <
paramdef>size_t <
parameter>salen</
parameter></
paramdef>
542N/A <
paramdef>char *<
parameter>host</
parameter></
paramdef>
542N/A <
paramdef>size_t <
parameter>hostlen</
parameter></
paramdef>
542N/A <
paramdef>char *<
parameter>serv</
parameter></
paramdef>
542N/A <
paramdef>size_t <
parameter>servlen</
parameter></
paramdef>
922N/A <
paramdef>int <
parameter>flags</
parameter></
paramdef>
851N/A <
title>DESCRIPTION</
title>
This function is equivalent to the
<
refentrytitle>getnameinfo</
refentrytitle><
manvolnum>3</
manvolnum>
</
citerefentry> function defined in RFC2133.
<
function>lwres_getnameinfo()</
function> returns the
<
type>struct sockaddr</
type> <
parameter>sa</
parameter> which
<
parameter>salen</
parameter> bytes long. The hostname is of
<
parameter>hostlen</
parameter> and is returned via
<
parameter>*host.</
parameter> The maximum length of the
1025 bytes: <
constant>NI_MAXHOST</
constant>.
<
para> The name of the service associated with the port number in
<
parameter>sa</
parameter> is returned in <
parameter>*serv.</
parameter>
It is <
parameter>servlen</
parameter> bytes long. The
of the service name is <
constant>NI_MAXSERV</
constant> - 32
The <
parameter>flags</
parameter> argument sets the
<
term><
constant>NI_NOFQDN</
constant></
term>
A fully qualified domain name is not required for local hosts.
The local part of the fully qualified domain name is returned
<
term><
constant>NI_NUMERICHOST</
constant></
term>
Return the address in numeric form, as if calling inet_ntop(),
<
term><
constant>NI_NAMEREQD</
constant></
term>
A name is required. If the hostname cannot be found in the DNS
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.
<
term><
constant>NI_NUMERICSERV</
constant></
term>
The service name is returned as a digit string representing the
<
term><
constant>NI_DGRAM</
constant></
term>
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
for the few ports (512-514) that have different services for UDP
<
title>RETURN VALUES</
title>
<
para><
function>lwres_getnameinfo()</
function>
returns 0 on success or a non-zero error code if an error occurs.
<
refentrytitle>RFC2133</
refentrytitle>
<
refentrytitle>getservbyport</
refentrytitle><
manvolnum>3</
manvolnum>
<
refentrytitle>lwres</
refentrytitle><
manvolnum>3</
manvolnum>
<
refentrytitle>lwres_getnameinfo</
refentrytitle><
manvolnum>3</
manvolnum>
<
refentrytitle>lwres_getnamebyaddr</
refentrytitle><
manvolnum>3</
manvolnum>
<
refentrytitle>lwres_net_ntop</
refentrytitle><
manvolnum>3</
manvolnum>
RFC2133 fails to define what the nonzero return values of
<
refentrytitle>getnameinfo</
refentrytitle><
manvolnum>3</
manvolnum>