autocfg

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package autocfg handles initial auto-configuration of new interfaces and peers

Index

Constants

This section is empty.

Variables

View Source
var Get = daemon.RegisterFeature(New, 10) //nolint:gochecknoglobals

Functions

This section is empty.

Types

type Interface

type Interface struct {
	*daemon.Interface
	// contains filtered or unexported fields
}

func New

func New(i *daemon.Interface) (*Interface, error)

func (*Interface) AddAddresses

func (i *Interface) AddAddresses(pk crypto.Key) error

func (*Interface) Close

func (i *Interface) Close() error

func (*Interface) ConfigureWireGuard

func (i *Interface) ConfigureWireGuard() error

ConfigureWireGuard configures the WireGuard device using the configuration provided by the user. Missing settings such as a private key or listen port are automatically generated/allocated.

func (*Interface) DetectMTU

func (i *Interface) DetectMTU() (mtu int, err error)

DetectMTU find a suitable MTU for the tunnel interface. The algorithm is the same as used by wg-quick:

The MTU is automatically determined from the endpoint addresses
or the system default route, which is usually a sane choice.

func (*Interface) OnInterfaceModified

func (i *Interface) OnInterfaceModified(ci *daemon.Interface, old *wg.Interface, mod daemon.InterfaceModifier)

func (*Interface) OnPeerAdded

func (i *Interface) OnPeerAdded(p *daemon.Peer)

func (*Interface) OnPeerRemoved

func (i *Interface) OnPeerRemoved(_ *daemon.Peer)

func (*Interface) RemoveAddresses

func (i *Interface) RemoveAddresses(pk crypto.Key) error

func (*Interface) Start

func (i *Interface) Start() error

Jump to

Keyboard shortcuts

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