2018-09-20 01:49:47 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
2018-01-03 21:58:00 +01:00
|
|
|
* Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
2017-11-30 16:23:50 +01:00
|
|
|
*/
|
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
|