aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorThomas Gschwantner <tharre3@gmail.com>2019-06-14 20:12:25 +0200
committerThomas Gschwantner <tharre3@gmail.com>2019-06-14 20:14:47 +0200
commit5b14f8e69f5bfa85708b190c34479bd539297bfe (patch)
tree6c0d7263d80b7229ffd071ca96262d73dc343df1 /common.h
parentRemove CLOCK_MONOTONIC comment (diff)
downloadwg-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.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/common.h b/common.h
index d0f8ffd..b2bd054 100644
--- a/common.h
+++ b/common.h
@@ -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);