diff options
author | Thomas Gschwantner <tharre3@gmail.com> | 2019-04-23 22:06:22 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2019-06-12 19:05:33 +0200 |
commit | 0f06351cb0085c79b617a4acc0bd6749b53c638e (patch) | |
tree | 13f6eb367f4ed326817741953166975b912b214e /common.h | |
parent | radix-trie: implement ipp_addrnd_* and related (diff) | |
download | wg-dynamic-0f06351cb0085c79b617a4acc0bd6749b53c638e.tar.xz wg-dynamic-0f06351cb0085c79b617a4acc0bd6749b53c638e.zip |
Implement basic lease management
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -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); |