2017-01-10 06:36:19 +01:00
|
|
|
/* Copyright (C) 2015-2017 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */
|
2015-06-05 15:58:00 +02:00
|
|
|
|
|
|
|
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2017-09-25 04:22:09 +02:00
|
|
|
struct wgdevice;
|
|
|
|
struct wgpeer;
|
|
|
|
struct wgallowedip;
|
2015-06-05 15:58:00 +02:00
|
|
|
|
|
|
|
struct config_ctx {
|
2017-09-25 04:22:09 +02:00
|
|
|
struct wgdevice *device;
|
|
|
|
struct wgpeer *last_peer;
|
|
|
|
struct wgallowedip *last_allowedip;
|
|
|
|
bool is_peer_section, is_device_section;
|
2015-06-05 15:58:00 +02:00
|
|
|
};
|
|
|
|
|
2017-09-25 04:22:09 +02:00
|
|
|
struct wgdevice *config_read_cmd(char *argv[], int argc);
|
|
|
|
bool config_read_init(struct config_ctx *ctx, bool append);
|
2015-06-05 15:58:00 +02:00
|
|
|
bool config_read_line(struct config_ctx *ctx, const char *line);
|
2017-09-25 04:22:09 +02:00
|
|
|
struct wgdevice *config_read_finish(struct config_ctx *ctx);
|
2015-06-05 15:58:00 +02:00
|
|
|
|
|
|
|
#endif
|