aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorThomas Gschwantner <tharre3@gmail.com>2019-04-23 22:06:22 +0200
committerThomas Gschwantner <tharre3@gmail.com>2019-06-12 19:05:33 +0200
commit0f06351cb0085c79b617a4acc0bd6749b53c638e (patch)
tree13f6eb367f4ed326817741953166975b912b214e /common.h
parentradix-trie: implement ipp_addrnd_* and related (diff)
downloadwg-dynamic-0f06351cb0085c79b617a4acc0bd6749b53c638e.tar.xz
wg-dynamic-0f06351cb0085c79b617a4acc0bd6749b53c638e.zip
Implement basic lease management
Diffstat (limited to 'common.h')
-rw-r--r--common.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/common.h b/common.h
index 7c0c0e9..d0f8ffd 100644
--- a/common.h
+++ b/common.h
@@ -6,10 +6,11 @@
#ifndef __COMMON_H__
#define __COMMON_H__
+#include <libmnl/libmnl.h>
+#include <netinet/in.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
-#include <netinet/in.h>
#include "netlink.h"
@@ -65,22 +66,14 @@ struct wg_dynamic_request {
};
struct wg_combined_ip {
- uint16_t family;
union {
struct in_addr ip4;
struct in6_addr ip6;
- } ip;
+ };
+ uint16_t family;
uint8_t cidr;
};
-struct wg_dynamic_lease {
- struct wg_combined_ip ip4;
- struct wg_combined_ip ip6;
- uint32_t start;
- uint32_t leasetime;
- struct wg_dynamic_lease *next;
-};
-
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
void free_wg_dynamic_request(struct wg_dynamic_request *req);