2 * Copyright (C) 1997 Andre Noll <maan@tuebingen.mpg.de>
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 /** The different states of a connection from the view of the client. */
11 /** TCP connection is established. */
13 /** Server sends the welcome message. */
15 /** Client sends the authentication request. */
17 /** Server sends encrypted challenge. */
18 CL_RECEIVED_CHALLENGE,
19 /** Client solves the challenge and sends the result. */
21 /** Server accepts this authentication. */
23 /** Command is executing. */
25 /** Server is expecting data (addblob commands only). */
29 /** Data specific to a client task. */
31 /** The state of the connection. */
33 /** The file descriptor and the session keys. */
34 struct stream_cipher_context scc;
35 /** The sideband contexts for receiving/sending. */
36 struct sb_context *sbc[2];
37 /** The buffer tree nodes for receiving/sending. */
38 struct btr_node *btrn[2];
39 /** The hash value of the decrypted challenge. */
40 unsigned char *challenge_hash;
41 /** The parsed command line (including the command). */
42 struct lls_parse_result *lpr;
43 /** The config file for client options. */
45 /** The RSA private key. */
47 /** Paraslash user name. */
49 /** The client task structure. */
51 /** List of features supported by the server. */
55 #define CLIENT_CMD_PTR (lls_cmd(0, client_suite))
56 #define CLIENT_OPT_RESULT(_name, _lpr) \
57 (lls_opt_result(LSG_CLIENT_PARA_CLIENT_OPT_ ## _name, _lpr))
58 #define CLIENT_OPT_GIVEN(_name, _lpr) \
59 (lls_opt_given(CLIENT_OPT_RESULT(_name, _lpr)))
60 #define CLIENT_OPT_UINT32_VAL(_name, _lpr) \
61 (lls_uint32_val(0, CLIENT_OPT_RESULT(_name, _lpr)))
62 #define CLIENT_OPT_STRING_VAL(_name, _lpr) \
63 (lls_string_val(0, CLIENT_OPT_RESULT(_name, _lpr)))
65 void client_close(struct client_task *ct);
66 int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr,
68 int client_connect(struct client_task *ct, struct sched *s,
69 struct btr_node *parent, struct btr_node *child);
70 int client_open(int argc, char *argv[], struct client_task **ct_ptr,
71 int *loglevel, struct btr_node *parent, struct btr_node *child,