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