aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/config.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-09-25 04:22:09 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-02 02:45:53 +0200
commit5b65f87e9fcad48d7a31daee986f1a0b78d9d8f9 (patch)
treeb7a18ba0b93471238a9867708a89354cc5dfcacc /src/config.h
parentwg: uapi: only make sure socket file is socket (diff)
downloadwireguard-tools-5b65f87e9fcad48d7a31daee986f1a0b78d9d8f9.tar.xz
wireguard-tools-5b65f87e9fcad48d7a31daee986f1a0b78d9d8f9.zip
netlink: switch from ioctl to netlink for configuration
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/config.h b/src/config.h
index 5f7761f..63a272c 100644
--- a/src/config.h
+++ b/src/config.h
@@ -4,31 +4,21 @@
#define CONFIG_H
#include <stdbool.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include "../uapi.h"
-struct inflatable_device {
- struct wgdevice *dev;
- size_t len;
- size_t pos;
-};
+struct wgdevice;
+struct wgpeer;
+struct wgallowedip;
struct config_ctx {
- struct inflatable_device buf;
- size_t peer_offset;
- struct wgdevice **device;
- bool is_peer_section;
- bool is_device_section;
+ struct wgdevice *device;
+ struct wgpeer *last_peer;
+ struct wgallowedip *last_allowedip;
+ bool is_peer_section, is_device_section;
};
-bool config_read_cmd(struct wgdevice **dev, char *argv[], int argc);
-bool config_read_init(struct config_ctx *ctx, struct wgdevice **device, bool append);
+struct wgdevice *config_read_cmd(char *argv[], int argc);
+bool config_read_init(struct config_ctx *ctx, bool append);
bool config_read_line(struct config_ctx *ctx, const char *line);
-bool config_read_finish(struct config_ctx *ctx);
+struct wgdevice *config_read_finish(struct config_ctx *ctx);
#endif