Stephen M. Cameron | dd36672 | 2012-02-24 08:17:30 +0100 | [diff] [blame] | 1 | #ifndef CLIENT_H |
| 2 | #define CLIENT_H |
| 3 | |
Jens Axboe | 0f92bd2 | 2012-02-29 11:44:34 +0100 | [diff] [blame^] | 4 | #include <sys/socket.h> |
| 5 | #include <sys/un.h> |
| 6 | #include <netinet/in.h> |
| 7 | #include <arpa/inet.h> |
| 8 | |
Stephen M. Cameron | dd36672 | 2012-02-24 08:17:30 +0100 | [diff] [blame] | 9 | struct fio_net_cmd; |
| 10 | |
Jens Axboe | 0f92bd2 | 2012-02-29 11:44:34 +0100 | [diff] [blame^] | 11 | struct 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. Cameron | dd36672 | 2012-02-24 08:17:30 +0100 | [diff] [blame] | 45 | typedef void (*client_text_op_func)(struct fio_client *client, |
| 46 | FILE *f, __u16 pdu_len, const char *buf); |
| 47 | |
| 48 | typedef void (*client_disk_util_op_func)(struct fio_client *client, struct fio_net_cmd *cmd); |
| 49 | |
| 50 | typedef void (*client_thread_status_op)(struct fio_net_cmd *cmd); |
| 51 | |
| 52 | typedef void (*client_group_stats_op)(struct fio_net_cmd *cmd); |
| 53 | |
| 54 | typedef void (*client_eta_op)(struct fio_client *client, struct fio_net_cmd *cmd); |
| 55 | |
| 56 | typedef void (*client_probe_op)(struct fio_client *client, struct fio_net_cmd *cmd); |
| 57 | |
Stephen M. Cameron | 04cc6b7 | 2012-02-24 08:17:31 +0100 | [diff] [blame] | 58 | typedef void (*client_thread_status_display_op)(char *status_message, double perc); |
Stephen M. Cameron | ba936c4 | 2012-02-24 08:17:31 +0100 | [diff] [blame] | 59 | |
Stephen M. Cameron | dd36672 | 2012-02-24 08:17:30 +0100 | [diff] [blame] | 60 | struct 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 Axboe | 0420ba6 | 2012-02-29 11:16:52 +0100 | [diff] [blame] | 65 | client_eta_op eta; |
Stephen M. Cameron | dd36672 | 2012-02-24 08:17:30 +0100 | [diff] [blame] | 66 | client_probe_op probe; |
Stephen M. Cameron | ba936c4 | 2012-02-24 08:17:31 +0100 | [diff] [blame] | 67 | client_thread_status_display_op thread_status_display; |
Stephen M. Cameron | dd36672 | 2012-02-24 08:17:30 +0100 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | extern struct client_ops fio_client_ops; |
| 71 | |
| 72 | #endif |
| 73 | |