From ea053d96f7e89e053d4af8d39b04c5428760345f Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Tue, 23 Jun 2020 20:56:22 +0200 Subject: Big renaming, move some more functionality to shared lib --- minecproxy/server-proxy.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 minecproxy/server-proxy.h (limited to 'minecproxy/server-proxy.h') diff --git a/minecproxy/server-proxy.h b/minecproxy/server-proxy.h new file mode 100644 index 0000000..ee3bda3 --- /dev/null +++ b/minecproxy/server-proxy.h @@ -0,0 +1,51 @@ +#ifndef fooserverproxyhfoo +#define fooserverproxyhfoo + +struct server_proxy { + struct connection client_conn; + struct uring_task_buf clientbuf; + struct uring_task clienttask; + uint64_t client_bytes; + int cpipe[2]; + int cfd; + + struct connection server_conn; + struct uring_task_buf serverbuf; + struct uring_task servertask; + uint64_t server_bytes; + int spipe[2]; + int sfd; + + bool connecting; + time_t begin; + struct ptimer_task ptask; + struct uring_task task; + struct server *server; + struct list_head list; +}; + +void proxy_refdump(struct server_proxy *proxy); + +void proxy_delete(struct server_proxy *proxy); + +struct server_proxy *proxy_new(struct server *server, struct saddr *client, + int fd); + +struct server_local { + struct saddr local; + struct saddr client; + struct uring_task task; + + struct server *server; + struct list_head list; +}; + +bool local_open(struct server_local *local); + +void local_refdump(struct server_local *local); + +void local_delete(struct server_local *local); + +struct server_local *local_new(struct server *server, struct saddr *saddr); + +#endif -- cgit v1.2.3