Documentation ¶
Index ¶
- func AddDefaultRoute(gw net.IP, dev netlink.Link) error
- func AddHostRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error
- func AddRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error
- func DelLinkByName(ifName string) error
- func DelLinkByNameAddr(ifName string, family int) (*net.IPNet, error)
- func NextIP(ip net.IP) net.IP
- func ParseCIDR(s string) (*net.IPNet, error)
- func PrevIP(ip net.IP) net.IP
- func SetNS(f *os.File, flags uintptr) error
- func SetupIPMasq(ipn *net.IPNet, chain string) error
- func SetupVeth(entropy, contVethName string, mtu int, hostNS *os.File) (hostVeth, contVeth netlink.Link, err error)
- func TeardownIPMasq(ipn *net.IPNet, chain string) error
- func WithNetNSPath(nspath string, f func(*os.File) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultRoute ¶
AddDefaultRoute sets the default route on the given gateway.
func AddHostRoute ¶
AddHostRoute adds a host-scoped route to a device.
func DelLinkByName ¶
DelLinkByName removes an interface link.
func DelLinkByNameAddr ¶ added in v0.3.2
DelLinkByNameAddr remove an interface returns its IP address of the specified family
func SetupIPMasq ¶ added in v0.3.2
Installs iptables rules to masquerade traffic coming from ipn and going outside of it
func SetupVeth ¶
func SetupVeth(entropy, contVethName string, mtu int, hostNS *os.File) (hostVeth, contVeth netlink.Link, err error)
SetupVeth sets up a virtual ethernet link. Should be in container netns. TODO(eyakubovich): get rid of entropy and ask kernel to pick name via pattern
func TeardownIPMasq ¶ added in v0.3.2
Undoes the effects of SetupIPMasq
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.