aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorThomas Gschwantner <tharre3@gmail.com>2019-02-08 07:59:54 +0100
committerThomas Gschwantner <tharre3@gmail.com>2019-02-08 08:00:01 +0100
commited194fa8fcfeec3840489cb2a1ad88e124e5f1fd (patch)
treece2ad500f429e8deed564b5b0af967ab8e4524f8 /common.h
parentWIP: parsing (diff)
downloadwg-dynamic-kv_parsing.tar.xz
wg-dynamic-kv_parsing.zip
WIP: parsing (2)kv_parsing
Diffstat (limited to 'common.h')
-rw-r--r--common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/common.h b/common.h
index fbb0c95..91dbf2a 100644
--- a/common.h
+++ b/common.h
@@ -9,6 +9,8 @@
#include <stdint.h>
#include <stdlib.h>
+#include <netinet/in.h>
+
#define MAX_CONNECTIONS 16
#define MAX_LINESIZE 4096
@@ -50,8 +52,18 @@ struct wg_dynamic_request {
struct wg_dynamic_attr *first, *last;
};
+struct wg_combined_ip {
+ uint16_t family;
+ union {
+ struct in_addr ip4;
+ struct in6_addr ip6;
+ } ip;
+ uint8_t cidr;
+};
+
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+void free_wg_dynamic_request(struct wg_dynamic_request *req);
int parse_request(struct wg_dynamic_request *req, unsigned char *buf,
size_t len);