diff options
Diffstat (limited to 'minecproxy/misc.h')
-rw-r--r-- | minecproxy/misc.h | 36 |
1 files changed, 36 insertions, 0 deletions
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 <stdio.h> +#include <string.h> +#include <stdbool.h> +#include <stdlib.h> +#include <linux/if_packet.h> + +#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 |