2022-06-10 19:35:38 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
|
2018-09-20 01:49:47 +02:00
|
|
|
/*
|
2020-01-02 19:52:25 +01:00
|
|
|
* Copyright (C) 2015-2020 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
|
|
|
};
|
|
|
|
|
2021-03-10 15:43:56 +01:00
|
|
|
struct wgdevice *config_read_cmd(const char *argv[], int argc);
|
2017-09-25 04:22:09 +02:00
|
|
|
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
|