1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
2/*
3 * Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
4 */
5
6#ifndef CONFIG_H
7#define CONFIG_H
8
9#include <stdbool.h>
10
11struct wgdevice;
12struct wgpeer;
13struct wgallowedip;
14
15struct config_ctx {
16	struct wgdevice *device;
17	struct wgpeer *last_peer;
18	struct wgallowedip *last_allowedip;
19	bool is_peer_section, is_device_section;
20};
21
22struct wgdevice *config_read_cmd(const char *argv[], int argc);
23bool config_read_init(struct config_ctx *ctx, bool append);
24bool config_read_line(struct config_ctx *ctx, const char *line);
25struct wgdevice *config_read_finish(struct config_ctx *ctx);
26
27#endif
28