Documentation
¶
Overview ¶
Package isolation provides primitives for isolating overlay from underlay
Index ¶
- func LinkIn(list []*LinkAttrs, item *LinkAttrs) bool
- func LinkString(links []*LinkAttrs) (stringed []string)
- func NetNSFromName(name string) (netns.NsHandle, error)
- func NetlinkFromName(name string) (*netlink.Handle, error)
- func Register(name string, fn func(string, string) (Isolation, error))
- type Isolation
- type LinkAttrs
- type NetnsIsolation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LinkString ¶ added in v2.4.0
func NetNSFromName ¶ added in v2.4.0
NetNSFromName creates and returns named network namespace, or the current namespace if no name is specified
func NetlinkFromName ¶
NetlinkFromName returns netlink handle created in the specified netns
Types ¶
type Isolation ¶
type Isolation interface { // LinkEnsure ensures the existence and state of the given link is as expected // this method should be idempotent as it's also used to sync the state of links LinkEnsure(attrs *LinkAttrs, config wgtypes.Config) error // LinkAbsent ensures the absence of the given link LinkAbsent(attrs *LinkAttrs) error // LinkList returns the wireguard links as seen by the isolation LinkList() ([]*LinkAttrs, error) }
Isolation represents a management interface for wireguard links together with the isolation technique employed to isolate overlay from underlay
func NewIsolation ¶ added in v2.4.0
NewIsolation provides a unified constructor for concrete implementations current supported isolation types are netns and vrf
func NewNetnsIsolation ¶
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
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 (*NetnsIsolation) LinkAbsent ¶
func (i *NetnsIsolation) LinkAbsent(attrs *LinkAttrs) error
func (*NetnsIsolation) LinkEnsure ¶
func (i *NetnsIsolation) LinkEnsure(attrs *LinkAttrs, config wgtypes.Config) (err error)
func (*NetnsIsolation) LinkList ¶ added in v2.4.0
func (i *NetnsIsolation) LinkList() ([]*LinkAttrs, error)