source: yaz/trunk/fuentes/doc/comstack.addresses.html @ 255

Last change on this file since 255 was 255, checked in by mabarracus, 4 years ago

added trusty code to xenial

File size: 4.3 KB
Line 
1<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.78.1"><link rel="home" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="comstack.html" title="Chapter 9. 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">Chapter 9. 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>
2    The low-level format of the addresses are different depending on the
3    mode of communication you have chosen. A function is provided by each
4    of the lower layers to map a user-friendly string-form address to the
5    binary form required by the lower layers.
6   </p><pre class="synopsis">
7    void *cs_straddr(COMSTACK handle, const char *str);
8   </pre><p>
9    The format for TCP/IP and SSL addresses is:
10   </p><pre class="synopsis">
11    &lt;host&gt; [ ':' &lt;portnum&gt; ]
12   </pre><p>
13    The <code class="literal">hostname</code> can be either a domain name or an
14    IP address. The port number, if omitted, defaults to 210.
15   </p><p>
16    For TCP/IP and SSL, the special hostnames <code class="literal">@</code>,
17    maps to <code class="literal">IN6ADDR_ANY_INIT</code> with
18    IPV4 binding as well (bindv6only=0),
19    The special hostname <code class="literal">@4</code> binds to
20    <code class="literal">INADDR_ANY</code> (IPV4 only listener).
21    The special hostname <code class="literal">@6</code> binds to
22    <code class="literal">IN6ADDR_ANY_INIT</code> with bindv6only=1 (IPV6 only listener).
23   </p><p>
24    For UNIX sockets, the format of an address is the socket filename.
25   </p><p>
26    When a connection has been established, you can use
27   </p><pre class="synopsis">
28    const char *cs_addrstr(COMSTACK h);
29   </pre><p>
30    to retrieve the host name of the peer system. The function returns
31    a pointer to a static area, which is overwritten on the next call
32    to the function.
33   </p><p>
34    A fairly recent addition to the <acronym class="acronym">COMSTACK</acronym> module is the utility
35    function
36   </p><pre class="synopsis">
37    COMSTACK cs_create_host (const char *str, int blocking, void **vp);
38   </pre><p>
39    which is just a wrapper for <code class="function">cs_create</code> and
40    <code class="function">cs_straddr</code>. The <em class="parameter"><code>str</code></em>
41    is similar to that described for <code class="function">cs_straddr</code>
42    but with a prefix denoting the <acronym class="acronym">COMSTACK</acronym> type. Prefixes supported
43    are <code class="literal">tcp:</code>, <code class="literal">unix:</code> and
44    <code class="literal">ssl:</code> for TCP/IP, UNIX and SSL respectively.
45    If no prefix is given, then TCP/IP is used.
46    The <em class="parameter"><code>blocking</code></em> is passed to
47    function <code class="function">cs_create</code>. The third parameter
48    <em class="parameter"><code>vp</code></em> is a pointer to <acronym class="acronym">COMSTACK</acronym> stack type
49    specific values.
50    Parameter <em class="parameter"><code>vp</code></em> is reserved for future use.
51    Set it to <code class="literal">NULL</code>.
52   </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>
Note: See TracBrowser for help on using the repository browser.