blob: acf31ff043f3fd8bac98957b52aee79d54523440 [file] [log] [blame]
Stephen M. Camerondd366722012-02-24 08:17:30 +01001#ifndef CLIENT_H
2#define CLIENT_H
3
Jens Axboe0f92bd22012-02-29 11:44:34 +01004#include <sys/socket.h>
5#include <sys/un.h>
6#include <netinet/in.h>
7#include <arpa/inet.h>
8
Stephen M. Camerondd366722012-02-24 08:17:30 +01009struct fio_net_cmd;
10
Jens Axboe0f92bd22012-02-29 11:44:34 +010011struct fio_client {
12 struct flist_head list;
13 struct flist_head hash_list;
14 struct flist_head arg_list;
15 union {
16 struct sockaddr_in addr;
17 struct sockaddr_in6 addr6;
18 struct sockaddr_un addr_un;
19 };
20 char *hostname;
21 int port;
22 int fd;
23
24 char *name;
25
26 int state;
27
28 int skip_newline;
29 int is_sock;
30 int disk_stats_shown;
31 unsigned int jobs;
32 int error;
33 int ipv6;
34 int sent_job;
35
36 struct flist_head eta_list;
37 struct client_eta *eta_in_flight;
38
39 struct flist_head cmd_list;
40
41 uint16_t argc;
42 char **argv;
43};
44
Stephen M. Camerondd366722012-02-24 08:17:30 +010045typedef void (*client_text_op_func)(struct fio_client *client,
46 FILE *f, __u16 pdu_len, const char *buf);
47
48typedef void (*client_disk_util_op_func)(struct fio_client *client, struct fio_net_cmd *cmd);
49
50typedef void (*client_thread_status_op)(struct fio_net_cmd *cmd);
51
52typedef void (*client_group_stats_op)(struct fio_net_cmd *cmd);
53
54typedef void (*client_eta_op)(struct fio_client *client, struct fio_net_cmd *cmd);
55
56typedef void (*client_probe_op)(struct fio_client *client, struct fio_net_cmd *cmd);
57
Stephen M. Cameron04cc6b72012-02-24 08:17:31 +010058typedef void (*client_thread_status_display_op)(char *status_message, double perc);
Stephen M. Cameronba936c42012-02-24 08:17:31 +010059
Stephen M. Camerondd366722012-02-24 08:17:30 +010060struct client_ops {
61 client_text_op_func text_op;
62 client_disk_util_op_func disk_util;
63 client_thread_status_op thread_status;
64 client_group_stats_op group_stats;
Jens Axboe0420ba62012-02-29 11:16:52 +010065 client_eta_op eta;
Stephen M. Camerondd366722012-02-24 08:17:30 +010066 client_probe_op probe;
Stephen M. Cameronba936c42012-02-24 08:17:31 +010067 client_thread_status_display_op thread_status_display;
Stephen M. Camerondd366722012-02-24 08:17:30 +010068};
69
70extern struct client_ops fio_client_ops;
71
72#endif
73