link

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLinkNotExists is returned when a link does not exist.
	ErrLinkNotExists = errors.New("link does not exist")
)

Functions

func ActivateInterface

func ActivateInterface(ctx context.Context, name string) error

ActivateInterface activates the interface with the given name.

func DeactivateInterface

func DeactivateInterface(ctx context.Context, name string) error

DeactivateInterface deactivates the interface with the given name.

func InterfaceNetwork

func InterfaceNetwork(ifaceName string, forAddr netip.Addr, ipv6 bool) (netip.Prefix, error)

InterfaceNetwork returns the network for the given interface and address.

func NewKernel

func NewKernel(ctx context.Context, name string, mtu uint32) error

NewKernel creates a new kernel WireGuard interface on the host system with the given name.

func NewTUN

func NewTUN(ctx context.Context, name string, mtu uint32) (realName string, closer func(), err error)

NewTUN creates a new WireGuard interface using the userspace tun driver.

func RemoveInterface

func RemoveInterface(ctx context.Context, ifaceName string) error

RemoveInterface removes the given interface.

func SetInterfaceAddress

func SetInterfaceAddress(_ context.Context, name string, addr netip.Prefix) error

SetInterfaceAddress sets the address of the interface with the given name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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