netutils

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIntToIP

func AddIntToIP(ip net.IP, ordinal uint64) net.IP

Adds the ordinal IP to the current array 192.168.0.0 + 53 => 192.168.0.53

func DefaultGateway

func DefaultGateway(cidr string) (string, error)

func DeleteInterfaceIfExists

func DeleteInterfaceIfExists(ctx context.Context, nsfd netns.NsHandle, ifname string) error

func GenerateIfaceName

func GenerateIfaceName(nlh netlink.Handler, prefix string, len int) (string, error)

GenerateIfaceName returns an interface name using the passed in prefix and the length of random bytes. The api ensures that the there are is no interface which exists with that name. From "github.com/docker/libnetwork/netutils"

func ParseAddr

func ParseAddr(s string) (*netlink.Addr, error)

ParseAddr parses the string representation of an address in the form $ip/$netmask $label. The label portion is optional From "github.com/vishvananda/netlink"

func ToCIDR added in v0.4.4

func ToCIDR(ip net.IP, mask net.IPMask) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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