Documentation ¶
Index ¶
- Constants
- func ConfigureInterface(currentIfaceName string, newIfaceName string, macAddr *net.HardwareAddr, ...) (*current.Interface, error)
- func CreateMacvtap(name string, master string, mode string) (int, error)
- func FindSuitableMacvtapParents() ([]string, error)
- func GetMainThreadNetNsPath() string
- func LinkDelete(link string) error
- func LinkExists(link string) (bool, error)
- func ModeFromString(s string) (netlink.MacvlanMode, error)
- func OnLinkEvent(name string, nsPath string, do func(), stop <-chan struct{}, errcb func(error))
- func OnSuitableMacvtapParentEvent(nsPath string, do func(), stop <-chan struct{}, errcb func(error))
- func RecreateMacvtap(name string, master string, mode string) (int, error)
Constants ¶
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 FindSuitableMacvtapParents ¶
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 LinkExists ¶
func ModeFromString ¶
func ModeFromString(s string) (netlink.MacvlanMode, error)
func OnLinkEvent ¶
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.
Types ¶
This section is empty.