ext_wg

package
v0.0.0-...-1058cde Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WGCtrl

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

WGCtrl is a toversok.WireGuardController implementation that takes a preconfigured `client`-tool compatible interface and interacts with it.

On macos, run: - sudo wireguard-go utun - sudo chown $USER /var/run/wireguard/utun* - wg show

To shut down the socket, run: - sudo rm /var/run/wireguard/utun*

func NewWGCtrl

func NewWGCtrl(client *wgctrl.Client, device string) *WGCtrl

func (*WGCtrl) ConnFor

func (w *WGCtrl) ConnFor(node key.NodePublic) types.UDPConn

func (*WGCtrl) Controller

func (w *WGCtrl) Controller(privateKey key.NodePrivate, addr4, addr6 netip.Prefix) (toversok.WireGuardController, error)

func (*WGCtrl) GetStats

func (w *WGCtrl) GetStats(publicKey key.NodePublic) (*toversok.WGStats, error)

func (*WGCtrl) RemovePeer

func (w *WGCtrl) RemovePeer(publicKey key.NodePublic) error

func (*WGCtrl) Reset

func (w *WGCtrl) Reset() error

func (*WGCtrl) UpdatePeer

func (w *WGCtrl) UpdatePeer(publicKey key.NodePublic, cfg toversok.PeerCfg) error

Jump to

Keyboard shortcuts

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