diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-24 10:14:16 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-24 10:59:52 +0200 |
commit | 5eae61a48e48d90a57810355e673170b88247a49 (patch) | |
tree | cfee428900f6fb08015620c12c3f18b3583458ac /services | |
parent | version: bump (diff) | |
download | wireguard-windows-5eae61a48e48d90a57810355e673170b88247a49.tar.xz wireguard-windows-5eae61a48e48d90a57810355e673170b88247a49.zip |
tunnel: move Run into own module to reduce file size
Diffstat (limited to 'services')
-rw-r--r-- | services/names.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/services/names.go b/services/names.go new file mode 100644 index 00000000..3b9003d0 --- /dev/null +++ b/services/names.go @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: MIT + * + * Copyright (C) 2019 WireGuard LLC. All Rights Reserved. + */ + +package services + +import ( + "errors" + + "golang.zx2c4.com/wireguard/windows/conf" +) + +func ServiceNameOfTunnel(tunnelName string) (string, error) { + if !conf.TunnelNameIsValid(tunnelName) { + return "", errors.New("Tunnel name is not valid") + } + return "WireGuardTunnel$" + tunnelName, nil +} + +func PipePathOfTunnel(tunnelName string) (string, error) { + if !conf.TunnelNameIsValid(tunnelName) { + return "", errors.New("Tunnel name is not valid") + } + return "\\\\.\\pipe\\WireGuard\\" + tunnelName, nil +} |