diff options
author | David Härdeman <david@hardeman.nu> | 2020-06-22 10:50:15 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-06-22 10:50:15 +0200 |
commit | 31afd2aaaeb76a12e232eab0fb6a550b73948737 (patch) | |
tree | 7125a54d09904eef6c558a682cff0a7976529fad /utils.h | |
parent | 41dc97f5d0dbcfe4399656c9aabb597f6366ca23 (diff) |
Make struct cfg global and make the corresponding changes throughout
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -49,6 +49,10 @@ struct saddr { struct list_head list; }; +struct connection; + +typedef void(*connection_cb_t)(struct connection *, bool); + struct connection { struct saddr remote; struct saddr local; @@ -56,21 +60,20 @@ struct connection { struct list_head *addrs; unsigned next_addr; - void (*callback)(struct cfg *, struct connection *, bool); + connection_cb_t cb; }; struct uring_task; -void socket_set_low_latency(struct cfg *cfg, int sfd); +void socket_set_low_latency(int sfd); -void connection_set_local(struct cfg *cfg, struct connection *conn, int fd); +void connection_set_local(struct connection *conn, int fd); -void connection_set_remote(struct cfg *cfg, struct connection *conn, - struct saddr *remote); +void connection_set_remote(struct connection *conn, struct saddr *remote); -void connect_any(struct cfg *cfg, struct uring_task *task, +void connect_any(struct uring_task *task, struct list_head *addrs, struct connection *conn, - void (*callback)(struct cfg *, struct connection *, bool)); + connection_cb_t cb); char *saddr_addr(struct saddr *saddr, char *buf, size_t len); |