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.70.1"><link rel="start" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="comstack.html" title="Chapter 10. 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 10. 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" lang="en"><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);
9 The format for TCP/IP and SSL addresses is:
10 </p><pre class="synopsis">
11 <host> [ ':' <portnum> ]
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.
16 For TCP/IP and SSL transport modes, the special hostname "@"
17 is mapped to any local address
18 (the manifest constant <code class="literal">INADDR_ANY</code>).
19 It is used to establish local listening endpoints in the server role.
21 For UNIX sockets, the format of an address is the socket filename.
23 When a connection has been established, you can use
24 </p><pre class="synopsis">
25 char *cs_addrstr(COMSTACK h);
27 to retrieve the host name of the peer system. The function returns
28 a pointer to a static area, which is overwritten on the next call
31 A fairly recent addition to the <acronym class="acronym">COMSTACK</acronym> module is the utility
33 </p><pre class="synopsis">
34 COMSTACK cs_create_host (const char *str, int blocking, void **vp);
36 which is just a wrapper for <code class="function">cs_create</code> and
37 <code class="function">cs_straddr</code>. The <em class="parameter"><code>str</code></em>
38 is similar to that described for <code class="function">cs_straddr</code>
39 but with a prefix denoting the <acronym class="acronym">COMSTACK</acronym> type. Prefixes supported
40 are <code class="literal">tcp:</code>, <code class="literal">unix:</code> and
41 <code class="literal">ssl:</code> for TCP/IP, UNIX and SSL respectively.
42 If no prefix is given, then TCP/IP is used.
43 The <em class="parameter"><code>blocking</code></em> is passed to
44 function <code class="function">cs_create</code>. The third parameter
45 <em class="parameter"><code>vp</code></em> is a pointer to <acronym class="acronym">COMSTACK</acronym> stack type
47 For SSL (ssl_type) <em class="parameter"><code>vp</code></em> is an already create
48 OpenSSL CTX. For TCP/IP and UNIX <em class="parameter"><code>vp</code></em>
49 is unused (can be set to <code class="literal">NULL</code>.
50 </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>