Documentation
¶
Index ¶
- type NS
- func (ns *NS) AddrAdd(linkName string, addr *net.IPNet) error
- func (ns *NS) Clone() (*NS, error)
- func (ns *NS) Close() error
- func (ns *NS) Delete() error
- func (ns *NS) DetectPodIP() (net.IP, string, error)
- func (ns *NS) FD() int
- func (ns *NS) GetAvailableTableID(iif string, priority, min, max int) (int, error)
- func (ns *NS) GetHardwareAddr(linkName string) (string, error)
- func (ns *NS) GetIP(linkName string) ([]net.IP, error)
- func (ns *NS) GetIPNet(linkName string) ([]*net.IPNet, error)
- func (ns *NS) GetMTU(linkName string) (int, error)
- func (ns *NS) GetRoutes() ([]*Route, error)
- func (ns *NS) LinkAdd(linkName string, link netlink.Link) error
- func (ns *NS) LinkByName(name string) (netlink.Link, error)
- func (ns *NS) LinkDel(linkName string) error
- func (ns *NS) LinkList() ([]netlink.Link, error)
- func (ns *NS) LinkNameByAddr(ip net.IP) (string, error)
- func (ns *NS) LinkSetMaster(linkName, masterName string) error
- func (ns *NS) LinkSetNS(linkName string, targetNS *NS) error
- func (ns *NS) LinkSetName(linkName, newName string) error
- func (ns *NS) LinkSetUp(linkName string) error
- func (ns *NS) LocalRouteDel(table int, dest *net.IPNet, dev string) error
- func (ns *NS) RedirectAdd(src, dst string) error
- func (ns *NS) RedirectDel(src string) error
- func (ns *NS) RouteAdd(table int, dest *net.IPNet, gw net.IP, dev string) error
- func (ns *NS) RouteAddOnlink(table int, dest *net.IPNet, gw net.IP, dev string) error
- func (ns *NS) RouteDel(table int, dest *net.IPNet, gw net.IP, dev string) error
- func (ns *NS) RuleAdd(src *net.IPNet, iif string, priority int, table int) error
- func (ns *NS) RuleDel(src *net.IPNet, iif string, priority int, table int) error
- func (ns *NS) RuleList(src *net.IPNet, iif string, priority int, table int) ([]netlink.Rule, error)
- func (ns *NS) Run(fn func() error) (err error)
- func (ns *NS) SetHardwareAddr(linkName, hwAddr string) error
- func (ns *NS) SetMTU(linkName string, mtu int) error
- func (ns *NS) SysctlGet(key string) (string, error)
- func (ns *NS) SysctlSet(key string, val string) error
- func (ns *NS) VethAdd(name string, peerNS *NS, peerName string) error
- func (ns *NS) VethAddPrefix(vethPrefix string, peerNS *NS, peerName string) (string, error)
- type Route
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NS ¶
NS represents a network namespace
func NewNSFromPath ¶
NewNSFromPath returns an NS specified by a namespace path
func NewNamedNS ¶
NewNamedNS returns an NS of the current network namespace
func (*NS) Clone ¶
Clone returns a copy of a network namespace. A returned network namespace need to be closed separately.
func (*NS) DetectPodIP ¶
DetectPodIP returns IP and link of the default route device
func (*NS) GetAvailableTableID ¶
GetAvailableTableID returns a table ID that is not currently used
func (*NS) LinkSetMaster ¶
LinkSetMaster sets a master device of a link
func (*NS) LinkSetName ¶
LinkSetName changes name of a link
func (*NS) LocalRouteDel ¶
LocalRouteDel deletes a route of the local local
func (*NS) RedirectAdd ¶
RedirectAdd adds a tc ingress qdisc and redirect filter that redirects all traffic from src to dst
func (*NS) RedirectDel ¶
RedirectDel deletes a tc ingress qdisc and redirect filters on src