aboutsummaryrefslogtreecommitdiffstats
path: root/lease.h
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2019-09-29 22:08:29 +0200
committerLinus Nordberg <linus@nordberg.se>2019-09-29 22:36:19 +0200
commit6dcf16386f710304af2a00706f24f683305b8825 (patch)
tree78da952e9b26949d4078e7da40bb058281e6359c /lease.h
parentAdd draft of protocol specification (diff)
downloadwg-dynamic-6dcf16386f710304af2a00706f24f683305b8825.tar.xz
wg-dynamic-6dcf16386f710304af2a00706f24f683305b8825.zip
Remove allowed-ips from peers as leases expire
Diffstat (limited to 'lease.h')
-rw-r--r--lease.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lease.h b/lease.h
index 3e1402d..23852e6 100644
--- a/lease.h
+++ b/lease.h
@@ -13,6 +13,8 @@
#include "common.h"
#include "netlink.h"
+#define WG_DYNAMIC_LEASE_CHUNKSIZE 256
+
struct wg_dynamic_lease {
time_t start_real;
time_t start_mono;
@@ -54,7 +56,7 @@ bool extend_lease(struct wg_dynamic_lease *lease, uint32_t leasetime);
/* Refreshes all leases, meaning expired ones will be removed. Returns the
* amount of seconds until the next lease will expire, or at most INT_MAX/1000.
*/
-int leases_refresh();
+int leases_refresh(void (*update_cb)(wg_key *, int));
/*
* Updates all pools with information from the mnl socket nlsock.