+
+ char *name;
+
+ int state;
+
+ int skip_newline;
+ int is_sock;
+ int disk_stats_shown;
+ unsigned int jobs;
+ int error;
+ int ipv6;
+ int sent_job;
+
+ struct flist_head eta_list;
+ struct client_eta *eta_in_flight;
+
+ struct flist_head cmd_list;
+
+ uint16_t argc;
+ char **argv;
+};
+
+static void fio_client_text_op(struct fio_client *client,
+ FILE *f, __u16 pdu_len, const char *buf)
+{
+ const char *name;
+ int fio_unused ret;
+
+ name = client->name ? client->name : client->hostname;
+
+ if (!client->skip_newline)
+ fprintf(f, "<%s> ", name);
+ ret = fwrite(buf, pdu_len, 1, f);
+ fflush(f);
+ client->skip_newline = strchr(buf, '\n') == NULL;
+}
+
+static void handle_du(struct fio_client *client, struct fio_net_cmd *cmd);
+static void handle_ts(struct fio_net_cmd *cmd);
+static void handle_gs(struct fio_net_cmd *cmd);
+static void handle_eta(struct fio_client *client, struct fio_net_cmd *cmd);
+static void handle_probe(struct fio_client *client, struct fio_net_cmd *cmd);
+
+struct client_ops fio_client_ops = {
+ .text_op = fio_client_text_op,
+ .disk_util = handle_du,
+ .thread_status = handle_ts,
+ .group_stats = handle_gs,
+ .eta = handle_eta,
+ .probe = handle_probe,
+ /* status display, if NULL, printf is used */
+};
+
+static struct timeval eta_tv;
+
+enum {
+ Client_created = 0,
+ Client_connected = 1,
+ Client_started = 2,
+ Client_running = 3,
+ Client_stopped = 4,
+ Client_exited = 5,