lwres_getnameinfo.html revision ea94d370123a5892f6c47a97f21d1b28d44bb168
885f47576842cf3c569315b9a48bd9f0ca03f203Automatic Updater - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
71bd43eebd9d6e42dbcae62b730f5b6508d5acd8Automatic Updater - Copyright (C) 2000, 2001 Internet Software Consortium.
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater - Permission to use, copy, modify, and/or distribute this software for any
2bb3422dc683c013db7042f5736240de6b86f182Automatic Updater - purpose with or without fee is hereby granted, provided that the above
7b67cfadd077feb0ec3e6c78385ba0d845a9789bMark Andrews - copyright notice and this permission notice appear in all copies.
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updater - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington - PERFORMANCE OF THIS SOFTWARE.
96713299d08c0735c18ebe8772dd2cc1ecd4356aAutomatic Updater<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
96713299d08c0735c18ebe8772dd2cc1ecd4356aAutomatic Updater<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater<a name="id2476275"></a><div class="titlepage"></div>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews<p>lwres_getnameinfo — lightweight resolver socket address structure to hostname and
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews service name
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington<pre class="funcsynopsisinfo">#include <lwres/netdb.h></pre>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<b class="fsfunc">lwres_getnameinfo</b>(</code></td>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<var class="pdparam">flags</var><code>)</code>;</td>
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater<a name="id2543394"></a><h2>DESCRIPTION</h2>
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater This function is equivalent to the
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater <span class="citerefentry"><span class="refentrytitle">getnameinfo</span>(3)</span> function defined in RFC2133.
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater <code class="function">lwres_getnameinfo()</code> returns the
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews hostname for the
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson <span class="type">struct sockaddr</span> <em class="parameter"><code>sa</code></em> which
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews <em class="parameter"><code>salen</code></em> bytes long. The hostname is of
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews <em class="parameter"><code>hostlen</code></em> and is returned via
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson <em class="parameter"><code>*host.</code></em> The maximum length of the
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater 1025 bytes: <code class="constant">NI_MAXHOST</code>.
0df8ead472f207020f8da22a185fe4b945248ab8Automatic Updater<p> The name of the service associated with the port number in
0ce87e5749aabb8eef1e0a37e4bd6e6ffa1d7196Automatic Updater <em class="parameter"><code>sa</code></em> is returned in <em class="parameter"><code>*serv.</code></em>
0ce87e5749aabb8eef1e0a37e4bd6e6ffa1d7196Automatic Updater It is <em class="parameter"><code>servlen</code></em> bytes long. The
0df8ead472f207020f8da22a185fe4b945248ab8Automatic Updater maximum length
2bb3422dc683c013db7042f5736240de6b86f182Automatic Updater of the service name is <code class="constant">NI_MAXSERV</code> - 32
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater The <em class="parameter"><code>flags</code></em> argument sets the
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dt><span class="term"><code class="constant">NI_NOFQDN</code></span></dt>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater A fully qualified domain name is not required for local hosts.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater The local part of the fully qualified domain name is returned
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dt><span class="term"><code class="constant">NI_NUMERICHOST</code></span></dt>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater Return the address in numeric form, as if calling inet_ntop(),
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater instead of a host name.
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<dt><span class="term"><code class="constant">NI_NAMEREQD</code></span></dt>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater A name is required. If the hostname cannot be found in the DNS
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater this flag is set, a non-zero error code is returned.
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater If the hostname is not found and the flag is not set, the
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater address is returned in numeric form.
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater<dt><span class="term"><code class="constant">NI_NUMERICSERV</code></span></dt>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater The service name is returned as a digit string representing the
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dt><span class="term"><code class="constant">NI_DGRAM</code></span></dt>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater Specifies that the service being looked up is a datagram
7262eb86f2b465822206122921e2f357218f0cfdAutomatic Updater service, and causes getservbyport() to be called with a second
96ea71632887c58a9d00f47eb318bf76b35903c3Mark Andrews argument of "udp" instead of its default of "tcp". This is
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater for the few ports (512-514) that have different services for UDP
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<a name="id2543536"></a><h2>RETURN VALUES</h2>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<p><code class="function">lwres_getnameinfo()</code>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews returns 0 on success or a non-zero error code if an error occurs.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<p><span class="citerefentry"><span class="refentrytitle">RFC2133</span></span>,
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater <span class="citerefentry"><span class="refentrytitle">getservbyport</span>(3)</span>,
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater <span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <span class="citerefentry"><span class="refentrytitle">lwres_getnameinfo</span>(3)</span>,
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater <span class="citerefentry"><span class="refentrytitle">lwres_getnamebyaddr</span>(3)</span>.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <span class="citerefentry"><span class="refentrytitle">lwres_net_ntop</span>(3)</span>.
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater RFC2133 fails to define what the nonzero return values of
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <span class="citerefentry"><span class="refentrytitle">getnameinfo</span>(3)</span>