util

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureInterface

func ConfigureInterface(currentIfaceName string, newIfaceName string, macAddr *net.HardwareAddr, mtu int, promisc bool, netns ns.NetNS) (*current.Interface, error)

Move an existing macvtap interface from the current netns to the target netns, and rename it.. Optionally configure the MAC address of the interface and the link's MTU.

func CreateMacvtap

func CreateMacvtap(name string, lowerDevice string, mode string) (int, error)

func FindSuitableMacvtapParents added in v0.2.0

func FindSuitableMacvtapParents() ([]string, error)

FindSuitableMacvtapParents lists all the links on the system and filters out those deemed inappropriate to be used as macvtap parents.

func GetMainThreadNetNsPath added in v0.2.0

func GetMainThreadNetNsPath() string

GetMainThreadNetNsPath returns the path of the main thread's namespace

func LinkDelete

func LinkDelete(link string) error

func LinkExists

func LinkExists(link string) (bool, error)

func ModeFromString

func ModeFromString(s string) (netlink.MacvlanMode, error)

func OnLinkEvent

func OnLinkEvent(name string, nsPath string, do func(), stop <-chan struct{}, errcb func(error))

OnLinkEvent listens for events on a specific interface and namespace, and callbacks if any. See onLinkEvent for more details.

func OnSuitableMacvtapParentEvent added in v0.2.0

func OnSuitableMacvtapParentEvent(nsPath string, do func(), stop <-chan struct{}, errcb func(error))

OnSuitableMacvtapParentEvent listens for events on any suitable macvtap parent link on a given namespace and callbacks if any. See onLinkEvent for more details.

func RecreateMacvtap

func RecreateMacvtap(name string, lowerDevice string, mode string) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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