Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPrefix = netip.MustParsePrefix("0.0.0.0/0")
Functions ¶
func CreateNamedNamespace ¶
CreateNamedNamespace creates a new named network namespace, and returns its path
func DeleteNamedNamespace ¶
DeleteNamedNamespace deletes a named NS
Types ¶
type Link ¶
type Link interface { Name() string Namespace() Namespace Type() string Delete() error GetAddr() ([]netip.Prefix, error) AddAddr(prefix netip.Prefix) error GetHardwareAddr() (string, error) SetHardwareAddr(hwAddr string) error GetMTU() (int, error) SetMTU(mtu int) error SetMaster(master Link) error SetNamespace(target Namespace) error SetName(name string) error SetUp() error }
type Namespace ¶
type Namespace interface { Close() error LinkAdd(name string, device Device) (Link, error) LinkFind(name string) (Link, error) LinkList() ([]Link, error) Path() string RedirectAdd(src, dst string) error RedirectDel(src string) error RouteAdd(route *Route) error RouteDel(route *Route) error RouteList(filters ...*Route) ([]*Route, error) RuleAdd(rule *Rule) error RuleDel(rule *Rule) error RuleList(rule *Rule) ([]*Rule, error) Run(fn func() error) error }
func OpenCurrentNamespace ¶
OpenCurrentNamespace returns the current network namespace
func OpenNamespace ¶
OpenNamespace returns a namespace specified by a path
Click to show internal directories.
Click to hide internal directories.