lwres_getnameinfo.docbook revision 30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - Copyright (C) 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - Copyright (C) 2000, 2001 Internet Software Consortium.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - Permission to use, copy, modify, and/or distribute this software for any
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - purpose with or without fee is hereby granted, provided that the above
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - copyright notice and this permission notice appear in all copies.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes - PERFORMANCE OF THIS SOFTWARE.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes<!-- Converted by db4-upgrade version 1.0 -->
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes<refentry xmlns="http://docbook.org/ns/docbook" version="5.0">
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refentryinfo>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <corpauthor>Internet Systems Consortium, Inc.</corpauthor>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </refentryinfo>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </copyright>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </copyright>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refnamediv>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refpurpose>lightweight resolver socket address structure to hostname and
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes service name
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </refpurpose>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </refnamediv>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refsynopsisdiv>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <funcsynopsis>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes<funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes<funcprototype>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <paramdef>const struct sockaddr *<parameter>sa</parameter></paramdef>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <paramdef>size_t <parameter>salen</parameter></paramdef>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <paramdef>char *<parameter>host</parameter></paramdef>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <paramdef>size_t <parameter>hostlen</parameter></paramdef>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <paramdef>char *<parameter>serv</parameter></paramdef>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <paramdef>size_t <parameter>servlen</parameter></paramdef>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <paramdef>int <parameter>flags</parameter></paramdef>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </funcprototype>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes</funcsynopsis>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </refsynopsisdiv>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refsection><info><title>DESCRIPTION</title></info>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes This function is equivalent to the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <citerefentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refentrytitle>getnameinfo</refentrytitle><manvolnum>3</manvolnum>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </citerefentry> function defined in RFC2133.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <function>lwres_getnameinfo()</function> returns the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes hostname for the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <type>struct sockaddr</type> <parameter>sa</parameter> which
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <parameter>salen</parameter> bytes long. The hostname is of
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <parameter>hostlen</parameter> and is returned via
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <parameter>*host.</parameter> The maximum length of the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <para> The name of the service associated with the port number in
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <parameter>sa</parameter> is returned in <parameter>*serv.</parameter>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes It is <parameter>servlen</parameter> bytes long. The
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes maximum length
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes of the service name is <constant>NI_MAXSERV</constant> - 32
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes The <parameter>flags</parameter> argument sets the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <variablelist>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes A fully qualified domain name is not required for local hosts.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes The local part of the fully qualified domain name is returned
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes Return the address in numeric form, as if calling inet_ntop(),
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes instead of a host name.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes A name is required. If the hostname cannot be found in the DNS
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes this flag is set, a non-zero error code is returned.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes If the hostname is not found and the flag is not set, the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes address is returned in numeric form.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes The service name is returned as a digit string representing the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes port number.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes Specifies that the service being looked up is a datagram
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes service, and causes getservbyport() to be called with a second
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes argument of "udp" instead of its default of "tcp". This is
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes for the few ports (512-514) that have different services for UDP
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </varlistentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </variablelist>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </refsection>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refsection><info><title>RETURN VALUES</title></info>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes returns 0 on success or a non-zero error code if an error occurs.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </refsection>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </citerefentry>,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <citerefentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refentrytitle>getservbyport</refentrytitle><manvolnum>3</manvolnum>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </citerefentry>,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <citerefentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </citerefentry>,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <citerefentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refentrytitle>lwres_getnameinfo</refentrytitle><manvolnum>3</manvolnum>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </citerefentry>,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <citerefentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refentrytitle>lwres_getnamebyaddr</refentrytitle><manvolnum>3</manvolnum>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </citerefentry>.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <citerefentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refentrytitle>lwres_net_ntop</refentrytitle><manvolnum>3</manvolnum>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </citerefentry>.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </refsection>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes RFC2133 fails to define what the nonzero return values of
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <citerefentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes <refentrytitle>getnameinfo</refentrytitle><manvolnum>3</manvolnum>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </citerefentry>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes </refsection>