link

package
v0.0.0-...-686bfca Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectDefaultRouteInterface

func DetectDefaultRouteInterface() (netlink.Link, error)

func DetectDefaultRouteInterfaceName

func DetectDefaultRouteInterfaceName() (string, error)

func DisableRpFilter

func DisableRpFilter(ifName string) error

DisableRpFilter tries to disable rpfilter on specified interface

func EnsureLinkAddr

func EnsureLinkAddr(addr *netlink.Addr, dev netlink.Link) error

func FindENILinkByMac

func FindENILinkByMac(macAddress string) (netlink.Link, error)

FindENILinkByMac the MAC address inputted will return the corresponding netlink.Link network equipment.

func IsExistsError

func IsExistsError(err error) bool

IsExistsError returns true if the error type is syscall.EEXIST

func IsLinkNotFound

func IsLinkNotFound(err error) bool

IsLinkNotFound returns true if error is LinkNotFoundError

func IsNoRouteToHostError

func IsNoRouteToHostError(err error) bool

func IsNotExistError

func IsNotExistError(err error) bool

IsNotExistError returns true if the error type is syscall.ENOENT or syscall.ESRCH

func MoveAndRenameLink(dev netlink.Link, targetNs ns.NetNS, devName string) (err error)

MoveAndRenameLink Reename the network equipment after moving to target namespace

func ReplaceRoute

func ReplaceRoute(routes []netlink.Route) error

Types

type ContainerContext

type ContainerContext struct {
	ID             string
	NetnsPath      string
	Driver         string
	ContainerDev   netlink.Link
	HostDev        netlink.Link
	ContainerNetns ns.NetNS
}

func NewContainerContext

func NewContainerContext(id string, netnsPath string) (*ContainerContext, error)

func (*ContainerContext) Close

func (ctx *ContainerContext) Close()

func (*ContainerContext) GetContainerDev

func (ctx *ContainerContext) GetContainerDev(devName string) ([]netlink.Link, error)

Jump to

Keyboard shortcuts

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