package ipamutils

import "github.com/docker/libnetwork/ipamutils"

Package ipamutils provides utililty functions for ipam management

Package ipamutils provides utililty functions for ipam management

Index

Variables

var (
	// PredefinedBroadNetworks contains a list of 31 IPv4 private networks with host size 16 and 12
	// (172.17-31.x.x/16, 192.168.x.x/20) which do not overlap with the networks in `PredefinedGranularNetworks`
	PredefinedBroadNetworks []*net.IPNet
	// PredefinedGranularNetworks contains a list of 64K IPv4 private networks with host size 8
	// (10.x.x.x/24) which do not overlap with the networks in `PredefinedBroadNetworks`
	PredefinedGranularNetworks []*net.IPNet
)

Functions

func ElectInterfaceAddresses

func ElectInterfaceAddresses(name string) (*net.IPNet, []*net.IPNet, error)

ElectInterfaceAddresses looks for an interface on the OS with the specified name and returns its IPv4 and IPv6 addresses in CIDR form. If the interface does not exist, it chooses from a predifined list the first IPv4 address which does not conflict with other interfaces on the system.

func FindAvailableNetwork

func FindAvailableNetwork(list []*net.IPNet) (*net.IPNet, error)

FindAvailableNetwork returns a network from the passed list which does not overlap with existing interfaces in the system

func InitNetworks

func InitNetworks()

InitNetworks initializes the pre-defined networks used by the built-in IP allocator

Source Files

utils.go utils_linux.go

Version
v0.8.0-dev.1
Published
Apr 16, 2016
Platform
linux/amd64
Imports
7 packages
Last checked
3 hours ago

Tools for package owners.