util

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IPv4InterfaceArpProxySysctlTemplate allows proxy_arp on a given interface
	IPv4InterfaceArpProxySysctlTemplate = "net.ipv4.conf.%s.proxy_arp"
)

Variables

This section is empty.

Functions

func ConfigureInterface

func ConfigureInterface(currentIfaceName string, newIfaceName string, macAddr *net.HardwareAddr, mtu int, 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, master string, mode string) (int, error)

func FindSuitableMacvtapParents

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

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

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, master 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