1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>6.Addresses</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="comstack.html" title="Chapter9.The COMSTACK Module"><link rel="prev" href="comstack.server.html" title="5.Server Side"><link rel="next" href="comstack.ssl.html" title="7.SSL"></head><body><link rel="stylesheet" type="text/css" href="common/style1.css"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.Addresses</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="comstack.server.html">Prev</a></td><th width="60%" align="center">Chapter9.The COMSTACK Module</th><td width="20%" align="right"><a accesskey="n" href="comstack.ssl.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="comstack.addresses"></a>6.Addresses</h2></div></div></div><p>
The low-level format of the addresses are different depending on the
mode of communication you have chosen. A function is provided by each
of the lower layers to map a user-friendly string-form address to the
binary form required by the lower layers.
</p><pre class="synopsis">
void *cs_straddr(COMSTACK handle, const char *str);
</pre><p>
The format for TCP/IP and SSL addresses is:
</p><pre class="synopsis">
<host> [ ':' <portnum> ]
</pre><p>
The <code class="literal">hostname</code> can be either a domain name or an
IP address. The port number, if omitted, defaults to 210.
</p><p>
For TCP/IP and SSL, the special hostnames <code class="literal">@</code>,
maps to <code class="literal">IN6ADDR_ANY_INIT</code> with
IPV4 binding as well (bindv6only=0),
The special hostname <code class="literal">@4</code> binds to
<code class="literal">INADDR_ANY</code> (IPV4 only listener).
The special hostname <code class="literal">@6</code> binds to
<code class="literal">IN6ADDR_ANY_INIT</code> with bindv6only=1 (IPV6 only listener).
</p><p>
For UNIX sockets, the format of an address is the socket filename.
</p><p>
When a connection has been established, you can use
</p><pre class="synopsis">
const char *cs_addrstr(COMSTACK h);
</pre><p>
to retrieve the host name of the peer system. The function returns
a pointer to a static area, which is overwritten on the next call
to the function.
</p><p>
A fairly recent addition to the <acronym class="acronym">COMSTACK</acronym> module is the utility
function
</p><pre class="synopsis">
COMSTACK cs_create_host (const char *str, int blocking, void **vp);
</pre><p>
which is just a wrapper for <code class="function">cs_create</code> and
<code class="function">cs_straddr</code>. The <em class="parameter"><code>str</code></em>
is similar to that described for <code class="function">cs_straddr</code>
but with a prefix denoting the <acronym class="acronym">COMSTACK</acronym> type. Prefixes supported
are <code class="literal">tcp:</code> and <code class="literal">unix:</code> and
<code class="literal">ssl:</code> for TCP/IP and UNIX and SSL respectively.
If no prefix is given, then TCP/IP is used.
The <em class="parameter"><code>blocking</code></em> is passed to
function <code class="function">cs_create</code>. The third parameter
<em class="parameter"><code>vp</code></em> is a pointer to <acronym class="acronym">COMSTACK</acronym> stack type
specific values.
Parameter <em class="parameter"><code>vp</code></em> is reserved for future use.
Set it to <code class="literal">NULL</code>.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="comstack.server.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="comstack.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="comstack.ssl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.Server Side</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">7.SSL</td></tr></table></div></body></html>
|