Add string conversion for tunnel config.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -57,6 +57,20 @@ extension Interface {
|
||||
}
|
||||
}
|
||||
|
||||
func export() -> String {
|
||||
var exportString = "[Interface]\n"
|
||||
if let privateKey = privateKey {
|
||||
exportString.append("PrivateKey=\(privateKey)")
|
||||
}
|
||||
if listenPort > 0 {
|
||||
exportString.append("ListenPort=\(listenPort)")
|
||||
}
|
||||
|
||||
exportString.append("\n")
|
||||
|
||||
return exportString
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
enum InterfaceValidationError: Error {
|
||||
|
||||
Reference in New Issue
Block a user