cli/wireguard: add import functionality for WireGuard

Support importing ".conf" files as `wg-quick up` supports it.

`wg-quick` parses several options under "[Interface]" and
passes the remainder to `wg setconf`.

The PreUp/PreDown/PostUp/PostDown options are of course not supported.

"Table" for the moment behaves different.

(cherry picked from commit a3a8583c31)
This commit is contained in:
Thomas Haller
2019-02-28 14:22:35 +01:00
parent 0d178a968d
commit a6ee43d1c1
6 changed files with 598 additions and 17 deletions

View File

@@ -268,8 +268,8 @@ nm_utils_fd_get_contents (int fd,
* @flags: %NMUtilsFileGetContentsFlags for reading the file.
* @contents: the output buffer with the file read. It is always
* NUL terminated. The buffer is at most @max_length long, including
* the NUL byte. That is, it reads only files up to a length of
* @max_length - 1 bytes.
* the NUL byte. That is, it reads only files up to a length of
* @max_length - 1 bytes.
* @length: optional output argument of the read file size.
*
* A reimplementation of g_file_get_contents() with a few differences: