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/misc.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 minecproxy/misc.h (limited to 'minecproxy/misc.h') diff --git a/minecproxy/misc.h b/minecproxy/misc.h new file mode 100644 index 0000000..6627913 --- /dev/null +++ b/minecproxy/misc.h @@ -0,0 +1,36 @@ +#ifndef foomischfoo +#define foomischfoo + +#include +#include +#include +#include +#include + +#include "utils.h" + +void debug_resource_usage(); + +struct connection; + +typedef void(*connection_cb_t)(struct connection *, bool); + +struct connection { + struct saddr remote; + struct saddr local; + + struct list_head *addrs; + unsigned next_addr; + + connection_cb_t cb; +}; + +void connection_set_local(struct connection *conn, int fd); + +void connection_set_remote(struct connection *conn, struct saddr *remote); + +void connect_any(struct uring_task *task, + struct list_head *addrs, struct connection *conn, + connection_cb_t cb); + +#endif -- cgit v1.2.3