wg

package
v0.0.0-...-698cbd6 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {
	IP                string
	Port              int
	PublicKey         wgtypes.Key
	PresharedKey      wgtypes.Key
	KeepaliveInterval time.Duration
}

type State

type State struct {
	OverlayNetwork net.IPNet
	OverlayAddr    net.IPNet

	PublicKey wgtypes.Key
	// contains filtered or unexported fields
}

State holds the configured state of a Wesher Wireguard interface

func New

func New(iface string, port int, overlayNet net.IPNet, privKey string) (*State, error)

New creates a new Wesher Wireguard state The Wireguard keys are generated for every new interface The interface must later be setup using SetUpInterface

func (*State) AddPeers

func (s *State) AddPeers(peers []Peer) error

func (*State) DownInterface

func (s *State) DownInterface() error

DownInterface shuts down the associated network interface

func (*State) GetOverlayAddress

func (s *State) GetOverlayAddress(pubkey wgtypes.Key) net.IPNet

func (*State) GetPeers

func (s *State) GetPeers() ([]Peer, error)

func (*State) SetUpInterface

func (s *State) SetUpInterface() error

SetUpInterface creates and sets up the associated network interface

Jump to

Keyboard shortcuts

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