X7ROOT File Manager
Current Path:
/usr/share/doc/neon-0.30.0/html
usr
/
share
/
doc
/
neon-0.30.0
/
html
/
π
..
π
api.html
(2.46 KB)
π
biblio.html
(4.59 KB)
π
compliance.html
(5.09 KB)
π
features.html
(4.59 KB)
π
index.html
(10.81 KB)
π
intro.html
(3.52 KB)
π
ref.html
(7.36 KB)
π
refalloc.html
(4.87 KB)
π
refauth.html
(5.84 KB)
π
refbuf.html
(3.46 KB)
π
refbufapp.html
(4.97 KB)
π
refbufcr.html
(3.24 KB)
π
refbufdest.html
(3.94 KB)
π
refbufutil.html
(3.84 KB)
π
refcert.html
(5.8 KB)
π
refclicert.html
(7.8 KB)
π
refconfig.html
(5.06 KB)
π
referr.html
(4.26 KB)
π
reffeat.html
(4.02 KB)
π
refgetst.html
(3.33 KB)
π
refi18n.html
(3.75 KB)
π
refiaddr.html
(8.93 KB)
π
refneon.html
(12.31 KB)
π
refopts.html
(6.22 KB)
π
refproxy.html
(9.04 KB)
π
refreq.html
(8.51 KB)
π
refreqbody.html
(4.27 KB)
π
refreqflags.html
(4.35 KB)
π
refreqhdr.html
(3.71 KB)
π
refresolve.html
(7.31 KB)
π
refresphdr.html
(5.13 KB)
π
refsess.html
(6.69 KB)
π
refsessflags.html
(5.13 KB)
π
refshave.html
(2.82 KB)
π
refsockinit.html
(6.57 KB)
π
refsslca.html
(3.89 KB)
π
refsslcert2.html
(3.01 KB)
π
refsslcertio.html
(5.48 KB)
π
refssldname.html
(3.78 KB)
π
refsslvfy.html
(7.1 KB)
π
refstatus.html
(4.17 KB)
π
reftok.html
(3.94 KB)
π
refvers.html
(3.3 KB)
π
refxml.html
(2.97 KB)
π
security.html
(6.81 KB)
π
using.html
(4.74 KB)
π
xml.html
(11.03 KB)
Editing: refresolve.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_addr_resolve</title><link rel="stylesheet" type="text/css" href="../manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refconfig.html" title="neon-config"><link rel="next" href="refbuf.html" title="ne_buffer"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_addr_resolve</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refconfig.html">Prev</a>Β </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right">Β <a accesskey="n" href="refbuf.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="refresolve"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_addr_resolve, ne_addr_result, ne_addr_first, ne_addr_next, ne_addr_error, ne_addr_destroy β functions to resolve hostnames to addresses</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_socket.h></pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">ne_sock_addr *<b class="fsfunc">ne_addr_resolve</b>(</code></td><td>const char *<var class="pdparam">hostname</var>, </td></tr><tr><td>Β </td><td>int <var class="pdparam">flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ne_addr_result</b>(</code></td><td>const ne_sock_addr *<var class="pdparam">addr</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">const ne_inet_addr *<b class="fsfunc">ne_addr_first</b>(</code></td><td>ne_sock_addr *<var class="pdparam">addr</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">const ne_inet_addr *<b class="fsfunc">ne_addr_next</b>(</code></td><td>ne_sock_addr *<var class="pdparam">addr</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">char *<b class="fsfunc">ne_addr_error</b>(</code></td><td>const ne_sock_addr *<var class="pdparam">addr</var>, </td></tr><tr><td>Β </td><td>char *<var class="pdparam">buffer</var>, </td></tr><tr><td>Β </td><td>size_t <var class="pdparam">bufsiz</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">ne_addr_destroy</b>(</code></td><td>ne_sock_addr *<var class="pdparam">addr</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div></div></div><div class="refsect1"><a name="idm140368851194688"></a><h2>Description</h2><p>The <code class="function">ne_addr_resolve</code> function resolves the given <code class="parameter">hostname</code>, returning an <em class="type">ne_sock_addr</em> object representing the address (or addresses) associated with the hostname. The <code class="parameter">flags</code> parameter is currently unused, and must be passed as 0.</p><p>The <code class="parameter">hostname</code> passed to <code class="function">ne_addr_resolve</code> can be a DNS hostname (e.g. <code class="literal">"www.example.com"</code>) or an IPv4 dotted quad (e.g. <code class="literal">"192.0.34.72"</code>); or, on systems which support IPv6, an IPv6 hex address, which may be enclosed in brackets, e.g. <code class="literal">"[::1]"</code>.</p><p>To determine whether the hostname was successfully resolved, the <code class="function">ne_addr_result</code> function is used, which returns non-zero if an error occurred. If an error did occur, the <code class="function">ne_addr_error</code> function can be used, which will copy the error string into a given <code class="parameter">buffer</code> (of size <code class="parameter">bufsiz</code>).</p><p>The functions <code class="function">ne_addr_first</code> and <code class="function">ne_addr_next</code> are used to retrieve the Internet addresses associated with an address object which has been successfully resolved. <code class="function">ne_addr_first</code> returns the first address; <code class="function">ne_addr_next</code> returns the next address after the most recent call to <code class="function">ne_addr_next</code> or <code class="function">ne_addr_first</code>, or <code class="literal">NULL</code> if there are no more addresses. The <em class="type">ne_inet_addr</em> pointer returned by these functions can be passed to <code class="function">ne_sock_connect</code> to connect a socket.</p><p>After the address object has been used, it should be destroyed using <code class="function">ne_addr_destroy</code>.</p></div><div class="refsect1"><a name="idm140368851177200"></a><h2>Return value</h2><p><code class="function">ne_addr_resolve</code> returns a pointer to an address object, and never <code class="literal">NULL</code>. <code class="function">ne_addr_error</code> returns the <code class="parameter">buffer</code> parameter .</p></div><div class="refsect1"><a name="idm140368851173680"></a><h2>Examples</h2><p>The code below prints out the set of addresses associated with the hostname <code class="literal">www.google.com</code>.</p><pre class="programlisting">ne_sock_addr *addr; char buf[256]; addr = ne_addr_resolve("www.google.com", 0); if (ne_addr_result(addr)) { printf("Could not resolve www.google.com: %s\n", ne_addr_error(addr, buf, sizeof buf)); } else { const ne_inet_addr *ia; printf("www.google.com:"); for (ia = ne_addr_first(addr); ia != NULL; ia = ne_addr_next(addr)) { printf(" %s", ne_iaddr_print(ia, buf, sizeof buf)); } putchar('\n'); } ne_addr_destroy(addr); </pre></div><div class="refsect1"><a name="idm140368851170704"></a><h2>See also</h2><p><a class="xref" href="refiaddr.html#ne_iaddr_print">ne_iaddr_print</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refconfig.html">Prev</a>Β </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right">Β <a accesskey="n" href="refbuf.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">neon-configΒ </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">Β ne_buffer</td></tr></table></div></body></html>
Upload File
Create Folder