lwres_getnameinfo.html revision ea94d370123a5892f6c47a97f21d1b28d44bb168
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews<!--
885f47576842cf3c569315b9a48bd9f0ca03f203Automatic Updater - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
71bd43eebd9d6e42dbcae62b730f5b6508d5acd8Automatic Updater - Copyright (C) 2000, 2001 Internet Software Consortium.
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater -
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.
75b70a68aefaa17ac4e768d5ed85d2f50d471490Automatic Updater -
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.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater-->
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater<!-- $Id$ -->
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater<html>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<head>
96713299d08c0735c18ebe8772dd2cc1ecd4356aAutomatic Updater<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews<title>lwres_getnameinfo</title>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews</head>
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>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<div class="refnamediv">
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews<h2>Name</h2>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews<p>lwres_getnameinfo &#8212; lightweight resolver socket address structure to hostname and
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews service name
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson </p>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews</div>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews<div class="refsynopsisdiv">
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<h2>Synopsis</h2>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews<div class="funcsynopsis">
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<tr>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<td><code class="funcdef">
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updaterint
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<b class="fsfunc">lwres_getnameinfo</b>(</code></td>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<td>const struct sockaddr *�</td>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<td>
db5b7e2cdf150c46e8242d3e2e3ad3f5c7300258Automatic Updater<var class="pdparam">sa</var>, </td>
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater</tr>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<tr>
ca904804e43f663f08eb1ac9d6d617930b9a3cd3Automatic Updater<td>�</td>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<td>size_t �</td>
db5b7e2cdf150c46e8242d3e2e3ad3f5c7300258Automatic Updater<td>
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews<var class="pdparam">salen</var>, </td>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews</tr>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews<tr>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<td>�</td>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews<td>char *�</td>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews<td>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews<var class="pdparam">host</var>, </td>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews</tr>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<tr>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews<td>�</td>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews<td>size_t �</td>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<td>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews<var class="pdparam">hostlen</var>, </td>
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater</tr>
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updater<tr>
723bfc0fc28c486c805de016c4475a35328eb8abAutomatic Updater<td>�</td>
55e03fc54708d97917bf26639b987f759bdc1f44Automatic Updater<td>char *�</td>
723bfc0fc28c486c805de016c4475a35328eb8abAutomatic Updater<td>
723bfc0fc28c486c805de016c4475a35328eb8abAutomatic Updater<var class="pdparam">serv</var>, </td>
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont</tr>
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont<tr>
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont<td>�</td>
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont<td>size_t �</td>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<td>
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updater<var class="pdparam">servlen</var>, </td>
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updater</tr>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<tr>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<td>�</td>
885f47576842cf3c569315b9a48bd9f0ca03f203Automatic Updater<td>int �</td>
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updater<td>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<var class="pdparam">flags</var><code>)</code>;</td>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater</tr>
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updater</table>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews</div>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews</div>
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater<div class="refsect1" lang="en">
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater<a name="id2543394"></a><h2>DESCRIPTION</h2>
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater<p>
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 is
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews <em class="parameter"><code>salen</code></em> bytes long. The hostname is of
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson length
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
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews hostname is
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater 1025 bytes: <code class="constant">NI_MAXHOST</code>.
0df8ead472f207020f8da22a185fe4b945248ab8Automatic Updater </p>
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
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater bytes.
0df8ead472f207020f8da22a185fe4b945248ab8Automatic Updater </p>
3098364bcdd7a719fbafa5fc8d2cc9e90e5a5989Automatic Updater<p>
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater The <em class="parameter"><code>flags</code></em> argument sets the
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater following
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater bits:
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater </p>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<div class="variablelist"><dl>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dt><span class="term"><code class="constant">NI_NOFQDN</code></span></dt>
0df8ead472f207020f8da22a185fe4b945248ab8Automatic Updater<dd><p>
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
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater instead.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater </p></dd>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dt><span class="term"><code class="constant">NI_NUMERICHOST</code></span></dt>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<dd><p>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater Return the address in numeric form, as if calling inet_ntop(),
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater instead of a host name.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater </p></dd>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<dt><span class="term"><code class="constant">NI_NAMEREQD</code></span></dt>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dd><p>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater A name is required. If the hostname cannot be found in the DNS
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater and
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.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater </p></dd>
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater<dt><span class="term"><code class="constant">NI_NUMERICSERV</code></span></dt>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dd><p>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater The service name is returned as a digit string representing the
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater port number.
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater </p></dd>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dt><span class="term"><code class="constant">NI_DGRAM</code></span></dt>
71bd43eebd9d6e42dbcae62b730f5b6508d5acd8Automatic Updater<dd><p>
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 required
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater for the few ports (512-514) that have different services for UDP
bbb069be941f649228760edcc241122933c066d2Automatic Updater and
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater TCP.
4cda4fd158d6ded5586bacea8c388445d99611eaAutomatic Updater </p></dd>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews</dl></div>
b0d566a2ce0f5a67f537ee7f8233f82f2584cc61Automatic Updater<p>
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater </p>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews</div>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<div class="refsect1" lang="en">
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.
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater </p>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews</div>
c5a53da13bb2126dcbbd5b45ca4904eccafe6621Automatic Updater<div class="refsect1" lang="en">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<a name="id2543547"></a><h2>SEE ALSO</h2>
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>.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater </p>
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington</div>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<div class="refsect1" lang="en">
7eda3642eea03f1181e41540c7c8791a57759383Automatic Updater<a name="id2543605"></a><h2>BUGS</h2>
96713299d08c0735c18ebe8772dd2cc1ecd4356aAutomatic Updater<p>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater RFC2133 fails to define what the nonzero return values of
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <span class="citerefentry"><span class="refentrytitle">getnameinfo</span>(3)</span>
7eda3642eea03f1181e41540c7c8791a57759383Automatic Updater are.
00be0f9f61d4c6bf197d000bfa1a6b7e70ea0866Automatic Updater </p>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson</div>
00be0f9f61d4c6bf197d000bfa1a6b7e70ea0866Automatic Updater</div></body>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater</html>
5c0fc20d6e59216d9a142409e5fdb498153aeaa5Automatic Updater