diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-09-25 04:22:09 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-02 02:45:53 +0200 |
commit | f129bdab552d21ae3cd77412342b94b5f23587b2 (patch) | |
tree | 4cb9ebc3ed181a9fd463ac00dbca0274c647a79c /src/tools/config.h | |
parent | tools: uapi: only make sure socket file is socket (diff) | |
download | wireguard-monolithic-historical-f129bdab552d21ae3cd77412342b94b5f23587b2.tar.xz wireguard-monolithic-historical-f129bdab552d21ae3cd77412342b94b5f23587b2.zip |
netlink: switch from ioctl to netlink for configuration
Diffstat (limited to 'src/tools/config.h')
-rw-r--r-- | src/tools/config.h | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/tools/config.h b/src/tools/config.h index 5f7761f..63a272c 100644 --- a/src/tools/config.h +++ b/src/tools/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 |