diff options
author | Thomas Gschwantner <tharre3@gmail.com> | 2019-08-03 04:30:37 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2019-08-17 19:31:31 +0200 |
commit | 2ac97d672f753c8e4a77542e51dcc963eba94279 (patch) | |
tree | da8891ff295dd736beee00315a62888f31a80b42 /lease.h | |
parent | radix-trie: implement pool shadowing (diff) | |
download | wg-dynamic-2ac97d672f753c8e4a77542e51dcc963eba94279.tar.xz wg-dynamic-2ac97d672f753c8e4a77542e51dcc963eba94279.zip |
Initialize pools from routes via netlink
Diffstat (limited to 'lease.h')
-rw-r--r-- | lease.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -8,7 +8,7 @@ #include <stdint.h> #include <sys/socket.h> -#include <time.h> +#include <libmnl/libmnl.h> #include "common.h" #include "netlink.h" @@ -23,9 +23,10 @@ struct wg_dynamic_lease { }; /* - * Initializes internal state, reads leases from fname. + * Initializes internal state, retrieves routes from nlsock and reads leases + * from fname. */ -void leases_init(char *fname); +void leases_init(char *fname, struct mnl_socket *nlsock); /* * Frees everything, closes file. @@ -56,8 +57,8 @@ bool extend_lease(struct wg_dynamic_lease *lease, uint32_t leasetime); int leases_refresh(); /* - * Updates all pools with information from the netlink file descriptor fd. + * Updates all pools with information from the mnl socket nlsock. */ -void leases_update_pools(int fd); +void leases_update_pools(struct mnl_socket *nlsock); #endif |