aboutsummaryrefslogtreecommitdiffstats
path: root/lease.h
diff options
context:
space:
mode:
Diffstat (limited to 'lease.h')
-rw-r--r--lease.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/lease.h b/lease.h
index 4052bf9..95a7b58 100644
--- a/lease.h
+++ b/lease.h
@@ -35,12 +35,9 @@ void leases_free();
/*
* Creates a new lease and returns a pointer to it, or NULL if either we ran out
* of assignable IPs or the requested IP is already taken.
- * expires contains the (monotonic) timestamp after which the next lease,
- * possibly the newly created one, will expire.
*/
struct wg_dynamic_lease *new_lease(wg_key pubkey, uint32_t leasetime,
- struct in_addr *ipv4, struct in6_addr *ipv6,
- time_t *expires);
+ struct in_addr *ipv4, struct in6_addr *ipv6);
/*
* Returns all leases belonging to pubkey, or NULL if there are none.
@@ -48,17 +45,15 @@ struct wg_dynamic_lease *new_lease(wg_key pubkey, uint32_t leasetime,
struct wg_dynamic_lease *get_leases(wg_key pubkey);
/*
- * Extend the lease to be leasetime long again. Returns true on error, or false
- * otherwise. expires behaves exactly as in new_lease().
+ * Extend the lease to be leasetime seconds long again. Returns true on error,
+ * or false otherwise.
*/
-bool extend_lease(struct wg_dynamic_lease *lease, uint32_t leasetime,
- time_t *expires);
+bool extend_lease(struct wg_dynamic_lease *lease, uint32_t leasetime);
-/*
- * Refreshes all leases, meaning expired ones will be removed. Returns the
- * expiration timestamp of the lease that will expire next.
+/* 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.
*/
-time_t leases_refresh();
+int leases_refresh();
/*
* Updates all pools with information from the netlink file descriptor fd.