configurer

package
v0.30.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const WgInterfaceDefault = "wt0"

WgInterfaceDefault is a default interface name of Wiretrustee

Variables

View Source
var ErrAllowedIPNotFound = fmt.Errorf("allowed IP not found")
View Source
var ErrPeerNotFound = errors.New("peer not found")

Functions

This section is empty.

Types

type KernelConfigurer

type KernelConfigurer struct {
	// contains filtered or unexported fields
}

func NewKernelConfigurer

func NewKernelConfigurer(deviceName string) *KernelConfigurer

func (*KernelConfigurer) AddAllowedIP

func (c *KernelConfigurer) AddAllowedIP(peerKey string, allowedIP string) error

func (*KernelConfigurer) Close

func (c *KernelConfigurer) Close()

func (*KernelConfigurer) ConfigureInterface

func (c *KernelConfigurer) ConfigureInterface(privateKey string, port int) error

func (*KernelConfigurer) GetStats

func (c *KernelConfigurer) GetStats(peerKey string) (WGStats, error)

func (*KernelConfigurer) RemoveAllowedIP

func (c *KernelConfigurer) RemoveAllowedIP(peerKey string, allowedIP string) error

func (*KernelConfigurer) RemovePeer

func (c *KernelConfigurer) RemovePeer(peerKey string) error

func (*KernelConfigurer) UpdatePeer

func (c *KernelConfigurer) UpdatePeer(peerKey string, allowedIps string, keepAlive time.Duration, endpoint *net.UDPAddr, preSharedKey *wgtypes.Key) error

type WGStats

type WGStats struct {
	LastHandshake time.Time
	TxBytes       int64
	RxBytes       int64
}

type WGUSPConfigurer

type WGUSPConfigurer struct {
	// contains filtered or unexported fields
}

func NewUSPConfigurer

func NewUSPConfigurer(device *device.Device, deviceName string) *WGUSPConfigurer

func (*WGUSPConfigurer) AddAllowedIP

func (c *WGUSPConfigurer) AddAllowedIP(peerKey string, allowedIP string) error

func (*WGUSPConfigurer) Close

func (t *WGUSPConfigurer) Close()

func (*WGUSPConfigurer) ConfigureInterface

func (c *WGUSPConfigurer) ConfigureInterface(privateKey string, port int) error

func (*WGUSPConfigurer) GetStats

func (t *WGUSPConfigurer) GetStats(peerKey string) (WGStats, error)

func (*WGUSPConfigurer) RemoveAllowedIP

func (c *WGUSPConfigurer) RemoveAllowedIP(peerKey string, ip string) error

func (*WGUSPConfigurer) RemovePeer

func (c *WGUSPConfigurer) RemovePeer(peerKey string) error

func (*WGUSPConfigurer) UpdatePeer

func (c *WGUSPConfigurer) UpdatePeer(peerKey string, allowedIps string, keepAlive time.Duration, endpoint *net.UDPAddr, preSharedKey *wgtypes.Key) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL