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