diff options
Diffstat (limited to 'service/names.go')
-rw-r--r-- | service/names.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/service/names.go b/service/names.go new file mode 100644 index 00000000..45f590a3 --- /dev/null +++ b/service/names.go @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: MIT + * + * Copyright (C) 2019 WireGuard LLC. All Rights Reserved. + */ + +package service + +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 "WireGuard Tunnel: " + 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 +} |