31f2cc76140daf9aeb60180d0e89ad31f7a01b96
2 * Copyright (C) 1997-2007 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
41 struct private_client_data
{
42 /** the state of the connection */
44 /** the file descriptor */
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 /** session key for receiving data */
56 /** session key for sending data */
58 /** the client task structure */
60 /** non-zero if task is unregistered */
62 /** the buffer used for handshake and receiving */
63 char buf
[CLIENT_BUFSIZE
];
64 /** number of bytes loaded in \p buf */
66 /** non-zero if the pre_select hook added \p fd to the read fd set */
68 /** non-zero if the pre_select hook added \p fd to the write fd set */
70 /** the decrypted challenge */
71 long unsigned challenge_nr
;
72 /** pointer to the data to be sent to para_server */
74 /** number of bytes loaded in \p inbuf */
76 /** Non-zero if input task encountered an eof or an error condition. */
80 void client_close(struct private_client_data
*pcd
);
81 int client_open(int argc
, char *argv
[], struct private_client_data
**pcd_ptr
);
82 void client_pre_select(struct sched
*s
, struct task
*t
);
83 void client_post_select(struct sched
*s
, struct task
*t
);