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>
12 * the different states of a connection from the view of the client
15 /** tcp connection is established */
17 /** server sends the welcome message */
19 /** client sends the authentification request */
21 /** server sends a challenge */
22 CL_RECEIVED_CHALLENGE
,
23 /** clientd solves the challenge and sends the result */
25 /** server accepts this authentication */
27 /** client sends the command */
29 /** server expects data */
31 /** client expects data */
35 /** size of the receiving buffer */
36 #define CLIENT_BUFSIZE 8192
39 * data specific to a client task
42 /** the state of the connection */
44 /** The file descriptor and the rc4 keys. */
45 struct rc4_context rc4c
;
46 /** the configuration (including the command) */
47 struct client_args_info conf
;
48 /** the config file for client options */
50 /** the RSA private key */
52 /** paraslash user name */
54 /** the client task structure */
56 /** the buffer used for handshake and receiving */
58 /** number of bytes loaded in \p buf */
60 /** non-zero if the pre_select hook added \p fd to the read fd set */
62 /** non-zero if the pre_select hook added \p fd to the write fd set */
64 /** the decrypted challenge */
65 long unsigned challenge_nr
;
66 /** pointer to the data to be sent to para_server */
68 /** number of bytes loaded in \p inbuf */
70 /** Non-zero if input task encountered an eof or an error condition. */
74 void client_close(struct client_task
*ct
);
75 int client_open(int argc
, char *argv
[], struct client_task
**ct
,