diff options
Diffstat (limited to 'services/names.go')
-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 +} |