673N/A - Copyright (C) 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC") 673N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 673N/A - Permission to use, copy, modify, and/or distribute this software for any 673N/A - purpose with or without fee is hereby granted, provided that the above 673N/A - copyright notice and this permission notice appear in all copies. 673N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 673N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 673N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 673N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 673N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 673N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 673N/A - PERFORMANCE OF THIS SOFTWARE. 673N/A<!-- Converted by db4-upgrade version 1.0 --> 673N/A <
date>2007-06-18</
date>
673N/A <
corpname>ISC</
corpname>
673N/A <
corpauthor>Internet Systems Consortium, Inc.</
corpauthor>
673N/A <
refentrytitle>lwres_getnameinfo</
refentrytitle>
673N/A <
manvolnum>3</
manvolnum>
673N/A <
refmiscinfo>BIND9</
refmiscinfo>
673N/A <
holder>Internet Systems Consortium, Inc. ("ISC")</
holder>
673N/A <
holder>Internet Software Consortium.</
holder>
2095N/A <
refname>lwres_getnameinfo</
refname>
2095N/A <
refpurpose>lightweight resolver socket address structure to hostname and
673N/A<
function>lwres_getnameinfo</
function></
funcdef>
673N/A <
paramdef>const struct sockaddr *<
parameter>sa</
parameter></
paramdef>
673N/A <
paramdef>size_t <
parameter>salen</
parameter></
paramdef>
673N/A <
paramdef>char *<
parameter>host</
parameter></
paramdef>
673N/A <
paramdef>size_t <
parameter>hostlen</
parameter></
paramdef>
673N/A <
paramdef>char *<
parameter>serv</
parameter></
paramdef>
673N/A <
paramdef>size_t <
parameter>servlen</
parameter></
paramdef>
673N/A <
paramdef>int <
parameter>flags</
parameter></
paramdef>
673N/A <
refsection><
info><
title>DESCRIPTION</
title></
info>
673N/A This function is equivalent to the
673N/A <
refentrytitle>getnameinfo</
refentrytitle><
manvolnum>3</
manvolnum>
673N/A </
citerefentry> function defined in RFC2133.
673N/A <
function>lwres_getnameinfo()</
function> returns the
673N/A <
type>struct sockaddr</
type> <
parameter>sa</
parameter> which
673N/A <
parameter>salen</
parameter> bytes long. The hostname is of
673N/A <
parameter>hostlen</
parameter> and is returned via
673N/A <
parameter>*host.</
parameter> The maximum length of the
673N/A 1025 bytes: <
constant>NI_MAXHOST</
constant>.
6022N/A <
para> The name of the service associated with the port number in
6022N/A <
parameter>sa</
parameter> is returned in <
parameter>*serv.</
parameter>
6022N/A It is <
parameter>servlen</
parameter> bytes long. The
6022N/A of the service name is <
constant>NI_MAXSERV</
constant> - 32
673N/A The <
parameter>flags</
parameter> argument sets the
6022N/A <
term><
constant>NI_NOFQDN</
constant></
term>
6022N/A A fully qualified domain name is not required for local hosts.
673N/A 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
<
refsection><
info><
title>RETURN VALUES</
title></
info>
<
para><
function>lwres_getnameinfo()</
function>
returns 0 on success or a non-zero error code if an error occurs.
<
refsection><
info><
title>SEE ALSO</
title></
info>
<
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>
<
refsection><
info><
title>BUGS</
title></
info>
RFC2133 fails to define what the nonzero return values of
<
refentrytitle>getnameinfo</
refentrytitle><
manvolnum>3</
manvolnum>