Documentation ¶
Overview ¶
Package netns contains various utility functions to work with network namespaces
Index ¶
- func ListNamedNetNSWithPrefix(prefix string) ([]string, error)
- func RemoveIfFromNetNSIfExists(netNS ns.NetNS, ifName string) error
- func RemoveIfFromNetNSWithNameIfBothExist(netNSName, ifName string) error
- func RemoveNetNSWithName(netNSName string) error
- func ReplaceNetNSWithName(netNSName string) (ns.NetNS, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListNamedNetNSWithPrefix ¶
ListNamedNetNSWithPrefix returns list of named network namespaces which name starts with the given prefix.
func RemoveIfFromNetNSIfExists ¶
RemoveIfFromNetNSIfExists removes the given interface from the given network namespace.
If the interface does not exist, no error will be returned.
func RemoveIfFromNetNSWithNameIfBothExist ¶ added in v1.6.0
RemoveIfFromNetNSWithNameIfBothExist removes the given interface from the given network namespace identified by its name.
If either the interface or the namespace do not exist, no error will be returned.
func RemoveNetNSWithName ¶
RemoveNetNSWithName removes the given named network namespace.
FIXME: replace "ip-netns" invocations with native Go code
func ReplaceNetNSWithName ¶
ReplaceNetNSWithName creates a network namespace with the given name. If such netns already exists from a previous run, it will be removed and then re-created to avoid any previous state of the netns.
FIXME: replace "ip-netns" invocations with native Go code
Types ¶
This section is empty.