lwres_getnameinfo.docbook revision ddccd5811feff696ba460dabfb666ce61040f545
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - Copyright (C) 2000, 2001 Internet Software Consortium.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - Permission to use, copy, modify, and distribute this software for any
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - purpose with or without fee is hereby granted, provided that the above
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - copyright notice and this permission notice appear in all copies.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<!-- $Id: lwres_getnameinfo.docbook,v 1.1 2001/03/31 00:08:13 gson Exp $ -->
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</refentryinfo>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>lwres_getnameinfo</refentrytitle>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refpurpose>lightweight resolver socket address structure to hostname and service name</refpurpose>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refsynopsisdiv>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getnameinfo</function></funcdef>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<paramdef>const struct sockaddr *sa</paramdef>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</funcsynopsis>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</refsynopsisdiv>
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThis function is equivalent to the
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>getnameinfo</refentrytitle><manvolnum>3
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonfunction defined in RFC2133.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonreturns the hostname for the
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe hostname is of length
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonand is returned via
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe maximum length of the hostname is
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe name of the service associated with the port number in
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe maximum length of the service name is
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<constant>NI_MAXSERV</constant> - 32 bytes.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonargument sets the following bits:
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<varlistentry><term><constant>NI_NOFQDN</constant></term>
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonA fully qualified domain name is not required for local hosts.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe local part of the fully qualified domain name is returned instead.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<varlistentry><term><constant>NI_NUMERICHOST</constant></term>
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonReturn the address in numeric form, as if calling inet_ntop(),
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssoninstead of a host name.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<varlistentry><term><constant>NI_NAMEREQD</constant></term>
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonA name is required. If the hostname cannot be found in the DNS and
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonthis flag is set, a non-zero error code is returned.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonIf the hostname is not found and the flag is not set, the
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonaddress is returned in numeric form.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<varlistentry><term><constant>NI_NUMERICSERV</constant></term>
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe service name is returned as a digit string representing the port number.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<varlistentry><term><constant>NI_DGRAM</constant></term>
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonSpecifies that the service being looked up is a datagram
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonservice, and causes getservbyport() to be called with a second
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonargument of "udp" instead of its default of "tcp". This is required
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonfor the few ports (512-514) that have different services for UDP and
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</variablelist>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonreturns 0 on success or a non-zero error code if an error occurs.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>getservbyport</refentrytitle><manvolnum>3</manvolnum>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>lwres_getnameinfo</refentrytitle><manvolnum>3</manvolnum>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>lwres_getnamebyaddr</refentrytitle><manvolnum>3</manvolnum>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>lwres_net_ntop</refentrytitle><manvolnum>3</manvolnum>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonRFC2133 fails to define what the nonzero return values of
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>getnameinfo</refentrytitle><manvolnum>3</manvolnum>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>