netns

package
v3.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNetlink(name string) (*netlink.Handle, error)

NewNetlink returns netlink handle created in the specified netns

func NewNetns

func NewNetns(name string) (netns.NsHandle, error)

NewNetns creates and returns named network namespace, or the current namespace if no name is specified

Types

type NetnsIsolation

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

NetnsIsolation is the recommended implementation as by the wireguard developers It keeps the wireguard sockets and interfaces in different netns to facilitate isolation

func NewNetnsIsolation

func NewNetnsIsolation(group int, transit, target string) (*NetnsIsolation, error)

NewNetnsIsolation takes two arguments: transit and interface namespace the creation of netns is handled internally the links and sockets will be created in the transit namespace and the links will be moved into the interface namespace

func (*NetnsIsolation) LinkAbsent

func (i *NetnsIsolation) LinkAbsent(attrs misc.Link) error

func (*NetnsIsolation) LinkEnsure

func (i *NetnsIsolation) LinkEnsure(attrs misc.Link) (err error)
func (i *NetnsIsolation) LinkList() ([]misc.Link, error)

Jump to

Keyboard shortcuts

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