aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/manager/names.go
blob: bebf0caeb7179d6d1666e12650c31b18700209f6 (plain) (tree)
1
2
3
4
5
6
7
8
9




                                                         
               


                
 






                                                                 
                                                   





                                                                 
                                                           
 
/* SPDX-License-Identifier: MIT
 *
 * Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
 */

package manager

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
}