netns

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 7 Imported by: 18

Documentation

Overview

Package netns contains various utility functions to work with network namespaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListNamedNetNSWithPrefix

func ListNamedNetNSWithPrefix(prefix string) ([]string, error)

ListNamedNetNSWithPrefix returns list of named network namespaces which name starts with the given prefix.

func RemoveIfFromNetNSIfExists

func RemoveIfFromNetNSIfExists(netNS ns.NetNS, ifName string) error

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

func RemoveIfFromNetNSWithNameIfBothExist(netNSName, ifName string) error

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