2 * Copyright (C) 1997-2009 Andre Noll <maan@systemlinux.org>
4 * Licensed under the GPL v2. For licencing details see COPYING.
7 /** \file client.h Common client functions and exported symbols from client_common.c. */
9 #include <openssl/rc4.h>
11 /** The different states of a connection from the view of the client. */
13 /** TCP connection is established. */
15 /** Server sends the welcome message. */
17 /** Client sends the authentification request. */
19 /** Server sends a challenge. */
20 CL_RECEIVED_CHALLENGE,
21 /** Client solves the challenge and sends the result. */
23 /** Server accepts this authentication. */
25 /** Client sends the command. */
27 /** Server expects data. */
29 /** Client expects data. */
33 /** The size of the receiving buffer. */
34 #define CLIENT_BUFSIZE 8192
36 /** Data specific to a client task. */
38 /** The state of the connection. */
40 /** The file descriptor and the rc4 keys. */
41 struct rc4_context rc4c;
42 /** The configuration (including the command). */
43 struct client_args_info conf;
44 /** The config file for client options. */
46 /** The RSA private key. */
48 /** Paraslash user name. */
50 /** The client task structure. */
52 /** The buffer used for handshake and receiving. */
54 /** Number of bytes loaded in \a buf. */
56 /** Non-zero if the pre_select hook added \a fd to the read fd set. */
58 /** Non-zero if the pre_select hook added \a fd to the write fd set. */
60 /** Pointer to the data to be sent to para_server. */
62 /** Number of bytes loaded in \a inbuf. */
64 /** Non-zero if input task encountered an eof or an error condition. */
68 void client_close(struct client_task *ct);
69 int client_open(int argc, char *argv[], struct client_task **ct,