Common client functions and exported symbols from client_common.c.
More...
|
#define | CLIENT_CMD_PTR (lls_cmd(0, client_suite)) |
|
#define | CLIENT_OPT_RESULT(_name, _lpr) (lls_opt_result(LSG_CLIENT_PARA_CLIENT_OPT_ ## _name, _lpr)) |
|
#define | CLIENT_OPT_GIVEN(_name, _lpr) (lls_opt_given(CLIENT_OPT_RESULT(_name, _lpr))) |
|
#define | CLIENT_OPT_UINT32_VAL(_name, _lpr) (lls_uint32_val(0, CLIENT_OPT_RESULT(_name, _lpr))) |
|
#define | CLIENT_OPT_STRING_VAL(_name, _lpr) (lls_string_val(0, CLIENT_OPT_RESULT(_name, _lpr))) |
|
|
void | client_close (struct client_task *ct) |
| Close the connection to para_server and free all resources. More...
|
|
int | client_parse_config (int argc, char *argv[], struct client_task **ct_ptr, int *loglevel) |
| Parse a client configuration. More...
|
|
int | client_connect (struct client_task *ct, struct sched *s, struct btr_node *parent, struct btr_node *child) |
| Connect to para_server and register the client task. More...
|
|
int | client_open (int argc, char *argv[], struct client_task **ct_ptr, int *loglevel, struct btr_node *parent, struct btr_node *child, struct sched *sched) |
| Parse the client configuration and open a connection to para_server. More...
|
|
Common client functions and exported symbols from client_common.c.
◆ CLIENT_CMD_PTR
#define CLIENT_CMD_PTR (lls_cmd(0, client_suite)) |
◆ CLIENT_OPT_RESULT
#define CLIENT_OPT_RESULT |
( |
|
_name, |
|
|
|
_lpr |
|
) |
| (lls_opt_result(LSG_CLIENT_PARA_CLIENT_OPT_ ## _name, _lpr)) |
◆ CLIENT_OPT_GIVEN
#define CLIENT_OPT_GIVEN |
( |
|
_name, |
|
|
|
_lpr |
|
) |
| (lls_opt_given(CLIENT_OPT_RESULT(_name, _lpr))) |
◆ CLIENT_OPT_UINT32_VAL
#define CLIENT_OPT_UINT32_VAL |
( |
|
_name, |
|
|
|
_lpr |
|
) |
| (lls_uint32_val(0, CLIENT_OPT_RESULT(_name, _lpr))) |
◆ CLIENT_OPT_STRING_VAL
#define CLIENT_OPT_STRING_VAL |
( |
|
_name, |
|
|
|
_lpr |
|
) |
| (lls_string_val(0, CLIENT_OPT_RESULT(_name, _lpr))) |
◆ anonymous enum
The different states of a connection from the view of the client.
Enumerator |
---|
CL_CONNECTED | TCP connection is established.
|
CL_RECEIVED_WELCOME | Server sends the welcome message.
|
CL_SENT_AUTH | Client sends the authentication request.
|
CL_RECEIVED_CHALLENGE | Server sends encrypted challenge.
|
CL_SENT_CH_RESPONSE | Client solves the challenge and sends the result.
|
CL_RECEIVED_PROCEED | Server accepts this authentication.
|
CL_EXECUTING | Command is executing.
|
CL_SENDING | Server is expecting data (addblob commands only).
|
◆ client_close()
Close the connection to para_server and free all resources.
- Parameters
-
ct | Pointer to the client data. |
- See also
- client_open().
◆ client_parse_config()
int client_parse_config |
( |
int |
argc, |
|
|
char * |
argv[], |
|
|
struct client_task ** |
ct_ptr, |
|
|
int * |
loglevel |
|
) |
| |
Parse a client configuration.
- Parameters
-
argc | Usual argument count. |
argv | Usual argument vector. |
ct_ptr | Filled in by this function. |
loglevel | If not NULL , the number of the loglevel is stored here. |
This checks the command line options given by argc and argv, sets default values for the user name and the name of the rsa key file and reads further options from the config file.
Upon successful return, ct_ptr points to a dynamically allocated and initialized client task struct.
- Returns
- The number of non-option arguments in argc/argv on success, negative on errors.
Referenced by main().
◆ client_connect()
int client_connect |
( |
struct client_task * |
ct, |
|
|
struct sched * |
s, |
|
|
struct btr_node * |
parent, |
|
|
struct btr_node * |
child |
|
) |
| |
Connect to para_server and register the client task.
- Parameters
-
ct | The initialized client task structure. |
s | The scheduler instance to register the client task to. |
parent | The parent node of the client btr node. |
child | The child node of the client node. |
The client task structure given by ct must be allocated and initialized by client_parse_config() before this function is called.
- Returns
- Standard.
◆ client_open()
int client_open |
( |
int |
argc, |
|
|
char * |
argv[], |
|
|
struct client_task ** |
ct_ptr, |
|
|
int * |
loglevel, |
|
|
struct btr_node * |
parent, |
|
|
struct btr_node * |
child, |
|
|
struct sched * |
sched |
|
) |
| |
Parse the client configuration and open a connection to para_server.
- Parameters
-
This function combines client_parse_config() and client_connect(). It is considered a syntax error if no command was given, i.e. if the number of non-option arguments is zero.
- Returns
- Standard.