Add GUI probe support
[fio.git] / client.h
CommitLineData
dd366728
SC
1#ifndef CLIENT_H
2#define CLIENT_H
3
0f92bd20
JA
4#include <sys/socket.h>
5#include <sys/un.h>
6#include <netinet/in.h>
7#include <arpa/inet.h>
8
dd366728
SC
9struct fio_net_cmd;
10
0f92bd20
JA
11struct 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
dd366728
SC
45typedef 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
04cc6b77 58typedef void (*client_thread_status_display_op)(char *status_message, double perc);
ba936c4b 59
dd366728
SC
60struct 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;
0420ba6a 65 client_eta_op eta;
dd366728 66 client_probe_op probe;
ba936c4b 67 client_thread_status_display_op thread_status_display;
dd366728
SC
68};
69
70extern struct client_ops fio_client_ops;
71
72#endif
73