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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
|
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!-- Process this file with docbook-to-man to generate an nroff manual
page: `docbook-to-man manpage.sgml > manpage.1'. You may view
the manual page with: `docbook-to-man manpage.sgml | nroff -man |
less'. A typical entry in a Makefile or Makefile.am is:
manpage.1: manpage.sgml
docbook-to-man $< > $@
The docbook-to-man binary is found in the docbook-to-man package.
Please remember that if you create the nroff version in one of the
debian/rules file targets (such as build), you will need to include
docbook-to-man in your Build-Depends control field.
-->
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
<!ENTITY dhfirstname "<firstname>Sergiusz</firstname>">
<!ENTITY dhsurname "<surname>Pawlowicz</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
<!ENTITY dhdate "<date>January 9, 2012</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>1</manvolnum>">
<!ENTITY dhemail "<email>debian@pawlowicz.name</email>">
<!ENTITY dhusername "Sergiusz Pawlowicz">
<!ENTITY dhucpackage "<refentrytitle>NaCl</refentrytitle>">
<!ENTITY dhpackage "CurveCP">
<!ENTITY debian "<productname>Debian</productname>">
]>
<refentry>
<refentryinfo>
<address>
&dhemail;
</address>
<author>
&dhfirstname;
&dhsurname;
</author>
<copyright>
<year>2012</year>
<holder>&dhusername;</holder>
</copyright>
&dhdate;
</refentryinfo>
<refmeta>
&dhucpackage;
&dhsection;
</refmeta>
<refnamediv>
<refname>&dhpackage;</refname>
<refpurpose>Message-handling programs</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>curvecpserver</command>
<arg><option>-q <replaceable>(optional)</replaceable></option></arg>
<arg><option>-Q <replaceable>(optional)</replaceable></option></arg>
<arg><option>-v <replaceable>(optional)</replaceable></option></arg>
<arg><option>-c n<replaceable>(optional)</replaceable></option></arg>
<arg>sname</arg>
<arg>keydir</arg>
<arg>ip</arg>
<arg>port</arg>
<arg>ext</arg>
<arg>prog</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>This manual page documents briefly the
<command>&dhpackage;</command> commands.</para>
<para>A traditional UNIX-style server such as ftpd handles just
one network connection, reading input from stdin and writing output
to stdout. A "superserver" such as inetd or tcpserver listens for
network connections and starts a separate server process for
each connection.</para>
<para>The <command>&dhpackage;</command> command-line tools have
an extra level of modularity. The <command>curvecpserver</command>
superserver listens for network connections. For each connection,
<command>curvecpserver</command> starts the
<command>curvecpmessage</command> message handler;
<command>curvecpmessage</command> then starts a server such as ftpd.
Then ftpd sends a stream of data to <command>curvecpmessage</command>,
which in turn sends messages to <command>curvecpserver</command>,
which encrypts and authenticates the messages and sends them inside
network packets. At the same time <command>curvecpclient</command>
receives network packets, verifies and decrypts messages inside the
packets, and passes the messages to <command>curvecpmessage</command>;
<command>curvecpmessage</command> sends a stream of data to ftpd.
The same curvecpmessage tool is also used by
<command>curvecpclient</command>.</para>
<para><command>curvecpserver</command> and
<command>curvecpclient</command> can use programs other than
<command>curvecpmessage</command>. Those programs can directly
generate messages in the CurveCP message format without talking to
separate tools such as ftpd; or they can support a completely
different protocol that reuses CurveCP's cryptographic layer
but transmits different kinds of messages.</para>
<para>This page explains what programmers have to do to write
<command>curvecpmessage</command> replacements that talk to
<command>curvecpserver</command> and
<command>curvecpclient.</command></para>
</refsect1>
<refsect1>
<title>Incoming messagess</title>
<para>File descriptor 8 is a pipe. Read from this pipe a length
byte n, between 1 and 68, and a 16*n-byte message. Repeat.
The pipe is set to non-blocking mode; be prepared for EAGAIN
and EWOULDBLOCK, even in the middle of a message.</para>
<para>This pipe reading must always be active. The
<command>curvecpclient</command> and
<command>curvecpserver</command> programs assume that every
message is read immediately. If you can't handle a message
immediately, read it and put it onto a queue. If you don't
have queue space, throw the message away; this shouldn't cause
trouble, since you have to be able to handle missing
messages in any case.</para>
</refsect1>
<refsect1>
<title>Outgoing messagess</title>
<para>File descriptor 9 is a pipe. Write to this pipe a length
byte n, between 1 and 68, and a 16*n-byte message. Repeat.
The pipe is set to non-blocking mode; be prepared for EAGAIN
and EWOULDBLOCK, even in the middle of a message.</para>
<para>As a client, do not use length bytes above 40 until a message
has arrived from the server. (The messages inside CurveCP
Initiate packets are limited to 640 bytes.)</para>
<para>The CurveCP server does not start until it has received
a message from the client. Furthermore, the CurveCP server
must receive this message within 60 seconds of the client
starting up. (The CurveCP Initiate packet is valid for only
60 seconds after the corresponding CurveCP Cookie packet.)
This does not mean that the client must start sending
messages immediately, but it does mean that waiting for
more than a second to send a message is a bad idea.</para>
</refsect1>
<refsect1>
<title>OPTIONS</title>
<para>How to use <command>curvecpserver</command>:</para>
<variablelist>
<varlistentry>
<term><option>-q</option>
<option>optional</option>
</term>
<listitem>
<para>no error messages</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-Q</option>
<option>optional</option>
</term>
<listitem>
<para>print error messages (default)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option>
<option>optional</option>
</term>
<listitem>
<para>print extra information</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-c n</option>
<option>optional</option>
</term>
<listitem>
<para>allow at most n clients at once (default 100)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>sname</option>
</term>
<listitem>
<para>server's name</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>keydir</option>
</term>
<listitem>
<para>use this public-key directory</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>ip</option>
</term>
<listitem>
<para>server's IP address</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>port</option>
</term>
<listitem>
<para>server's UDP port</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>ext</option>
</term>
<listitem>
<para>server's extension</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>prog</option>
</term>
<listitem>
<para>run this server</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>curvecpmessage (1), curvecpclient (1), inetd (8), tcpserver (1).</para>
</refsect1>
<refsect1>
<title>AUTHOR</title>
<para>This manual page was written by &dhusername; &dhemail; for
the &debian; system (and may be used by others). The source
of this page is a webpage http://curvecp.org/messageapi.html .
Permission is granted to copy, distribute and/or modify this
document under public domain.
</para>
<para>This manual page was rewritten for the &debian; distribution
because the original program does not have a manual page.</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|