diff options
author | Thomas Gschwantner <tharre3@gmail.com> | 2019-06-14 20:12:25 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2019-06-14 20:14:47 +0200 |
commit | 5b14f8e69f5bfa85708b190c34479bd539297bfe (patch) | |
tree | 6c0d7263d80b7229ffd071ca96262d73dc343df1 /common.h | |
parent | Remove CLOCK_MONOTONIC comment (diff) | |
download | wg-dynamic-5b14f8e69f5bfa85708b190c34479bd539297bfe.tar.xz wg-dynamic-5b14f8e69f5bfa85708b190c34479bd539297bfe.zip |
Use epoll() instead of poll()
This enables us to later use the timeout parameter of epoll_wait() to
timely remove expired leases.
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -59,6 +59,7 @@ struct wg_dynamic_attr { struct wg_dynamic_request { enum wg_dynamic_key cmd; uint32_t version; + int fd; wg_key pubkey; unsigned char *buf; size_t buflen; @@ -77,7 +78,7 @@ struct wg_combined_ip { #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) void free_wg_dynamic_request(struct wg_dynamic_request *req); -bool handle_request(int fd, struct wg_dynamic_request *req, +bool handle_request(struct wg_dynamic_request *req, bool (*success)(int, struct wg_dynamic_request *), bool (*error)(int, int)); size_t send_message(int fd, unsigned char *buf, size_t *len); @@ -85,7 +86,7 @@ void send_later(struct wg_dynamic_request *req, unsigned char *const buf, size_t msglen); int print_to_buf(char *buf, size_t bufsize, size_t len, char *fmt, ...); uint32_t current_time(); -void close_connection(int *fd, struct wg_dynamic_request *req); +void close_connection(struct wg_dynamic_request *req); bool is_link_local(unsigned char *addr); void iface_get_all_addrs(uint8_t family, mnl_cb_t data_cb, void *cb_data); int data_attr_cb(const struct nlattr *attr, void *data); |