aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/service/names.go
blob: 453f3b290973ab4459b013b1a88c27cdb4ad084f (plain) (tree)






















                                                                 
                                                           
 
/* 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
}