diff options
Diffstat (limited to 'contrib/wireguard-tools/config.h')
-rw-r--r-- | contrib/wireguard-tools/config.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/wireguard-tools/config.h b/contrib/wireguard-tools/config.h new file mode 100644 index 000000000000..443cf2147446 --- /dev/null +++ b/contrib/wireguard-tools/config.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* + * Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. + */ + +#ifndef CONFIG_H +#define CONFIG_H + +#include <stdbool.h> + +struct wgdevice; +struct wgpeer; +struct wgallowedip; + +struct config_ctx { + struct wgdevice *device; + struct wgpeer *last_peer; + struct wgallowedip *last_allowedip; + bool is_peer_section, is_device_section; +}; + +struct wgdevice *config_read_cmd(const char *argv[], int argc); +bool config_read_init(struct config_ctx *ctx, bool append); +bool config_read_line(struct config_ctx *ctx, const char *line); +struct wgdevice *config_read_finish(struct config_ctx *ctx); + +#endif |