lwres_inetntop.html revision 5347c0fcb04eaea19d9f39795646239f487c6207
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - This Source Code Form is subject to the terms of the Mozilla Public
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - License, v. 2.0. If a copy of the MPL was not distributed with this
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - file, You can obtain one at http://mozilla.org/MPL/2.0/.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<a name="id-1"></a><div class="titlepage"></div>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<p>lwres_net_ntop — lightweight resolver IP address presentation</p>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<pre class="funcsynopsisinfo">#include <lwres/net.h></pre>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<b class="fsfunc">lwres_net_ntop</b>(</code></td>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<td>int <var class="pdparam">af</var>, </td>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<td>const void *<var class="pdparam">src</var>, </td>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<td>char *<var class="pdparam">dst</var>, </td>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<td>size_t <var class="pdparam">size</var><code>)</code>;</td>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<p><code class="function">lwres_net_ntop()</code>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson converts an IP address of protocol family
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson <em class="parameter"><code>af</code></em> — IPv4 or IPv6 — at
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson location <em class="parameter"><code>src</code></em> from network format to its
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson conventional representation as a string. For IPv4 addresses,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson that string would be a dotted-decimal. An IPv6 address would be
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson represented in colon notation as described in RFC1884.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson The generated string is copied to <em class="parameter"><code>dst</code></em>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson <em class="parameter"><code>size</code></em> indicates it is long enough to
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson ASCII representation of the address.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<a name="id-1.8"></a><h2>RETURN VALUES</h2>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson If successful, the function returns <em class="parameter"><code>dst</code></em>:
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson a pointer to a string containing the presentation format of the
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson address. <code class="function">lwres_net_ntop()</code> returns
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson <span class="type">NULL</span> and sets the global variable
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson <code class="constant">errno</code> to <span class="errorcode">EAFNOSUPPORT</span> if
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson the protocol family given in <em class="parameter"><code>af</code></em> is
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<p><span class="citerefentry"><span class="refentrytitle">RFC1884</span></span>,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson <span class="citerefentry"><span class="refentrytitle">inet_ntop</span>(3)</span>,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson <span class="citerefentry"><span class="refentrytitle">errno</span>(3)</span>.