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