package ip
import "github.com/containernetworking/cni/pkg/ip"
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 EnableIP4Forward() error
- func EnableIP6Forward() error
- func Network(ipn *net.IPNet) *net.IPNet
- func NextIP(ip net.IP) net.IP
- func PrevIP(ip net.IP) net.IP
- func RandomVethName() (string, error)
- func RenameLink(curName, newName string) error
- func SetHWAddrByIP(ifName string, ip4 net.IP, ip6 net.IP) error
- func SetupIPMasq(ipn *net.IPNet, chain string, comment string) error
- func SetupVeth(contVethName string, mtu int, hostNS ns.NetNS) (hostVeth, contVeth netlink.Link, err error)
- func TeardownIPMasq(ipn *net.IPNet, chain string, comment string) error
Functions ¶
func AddDefaultRoute ¶
AddDefaultRoute sets the default route on the given gateway.
func AddHostRoute ¶
AddHostRoute adds a host-scoped route to a device.
func AddRoute ¶
AddRoute adds a universally-scoped route to a device.
func DelLinkByName ¶
DelLinkByName removes an interface link.
func DelLinkByNameAddr ¶
DelLinkByNameAddr remove an interface returns its IP address of the specified family
func EnableIP4Forward ¶
func EnableIP4Forward() error
func EnableIP6Forward ¶
func EnableIP6Forward() error
func Network ¶
Network masks off the host portion of the IP
func NextIP ¶
NextIP returns IP incremented by 1
func PrevIP ¶
PrevIP returns IP decremented by 1
func RandomVethName ¶
RandomVethName returns string "veth" with random prefix (hashed from entropy)
func RenameLink ¶
func SetHWAddrByIP ¶
func SetupIPMasq ¶
SetupIPMasq installs iptables rules to masquerade traffic coming from ipn and going outside of it
func SetupVeth ¶
func SetupVeth(contVethName string, mtu int, hostNS ns.NetNS) (hostVeth, contVeth netlink.Link, err error)
SetupVeth sets up a virtual ethernet link. Should be in container netns, and will switch back to hostNS to set the host veth end up.
func TeardownIPMasq ¶
TeardownIPMasq undoes the effects of SetupIPMasq
Source Files ¶
cidr.go ipforward.go ipmasq.go link.go route.go route_unspecified.go
- Version
- v0.5.0
- Published
- Mar 6, 2017
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 3 days ago –
Tools for package owners.