link

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachToBridge

func AttachToBridge(br *netlink.Bridge, ifName string, namespace netns.NsHandle) error

func CreateBridge

func CreateBridge(name string, namespace netns.NsHandle) (*netlink.Bridge, error)

func CreateMacVlan added in v0.1.1

func CreateMacVlan(name string, parent string, group int, namespace netns.NsHandle) (*netlink.Macvlan, error)

func CreateNetem added in v0.1.2

func CreateNetem(ifname string, namespace netns.NsHandle, delay int, jitter int, loss float64) error

func CreateTbf added in v0.1.2

func CreateTbf(ifname string, namespace netns.NsHandle, delay, rate int, bufFactor float64) error
func CreateVethLink(name string, namespace netns.NsHandle, peerName string, peerNamespace netns.NsHandle) (*netlink.Veth, error)

func CreateVrf

func CreateVrf(name string, namespace netns.NsHandle, table int) (*netlink.Vrf, error)
func DeleteLink(name string, namespace netns.NsHandle) error

func GetRootNetns

func GetRootNetns() netns.NsHandle

func IsLinkExist

func IsLinkExist(name string, namespace netns.NsHandle) bool

func MoveInterfacesNetns

func MoveInterfacesNetns(ifNames map[string]IfState, current netns.NsHandle, target netns.NsHandle) error
func RenameLink(name string, target string, namespace netns.NsHandle) error

func SetInterfaceState

func SetInterfaceState(name string, namespace netns.NsHandle, state IfState) error

Types

type IfState

type IfState int
const (
	IFSTATE_UP IfState = iota
	IFSTATE_DOWN
)

Jump to

Keyboard shortcuts

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