util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDefaultRoute

func AddDefaultRoute(gw net.IP, dev netlink.Link) error

AddDefaultRoute sets the default route on the given gateway.

func AddHostRoute

func AddHostRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error

AddHostRoute adds a host-scoped route to a device.

func AddRoute

func AddRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error

AddRoute adds a universally-scoped route to a device.

func DelLinkByName

func DelLinkByName(ifName string) error

DelLinkByName removes an interface link.

func NextIP added in v0.3.0

func NextIP(ip net.IP) net.IP

func ParseCIDR

func ParseCIDR(s string) (*net.IPNet, error)

ParseCIDR invokes net.ParseCIDR.

func PrevIP added in v0.3.0

func PrevIP(ip net.IP) net.IP

func SetNS

func SetNS(f *os.File, flags uintptr) error

SetNS sets the network namespace on a target file.

func SetupVeth

func SetupVeth(entropy, contVethName string, ipn *net.IPNet, 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 WithNetNSPath

func WithNetNSPath(nspath string, f func(*os.File) error) error

WithNetNSPath executes the passed closure under the given network namespace, restoring the original namespace afterwards.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL