package ipallocator

import "github.com/dotcloud/docker/daemon/networkdriver/ipallocator"

Index

Variables

var (
	ErrNoAvailableIPs     = errors.New("no available ip addresses on network")
	ErrIPAlreadyAllocated = errors.New("ip already allocated")
)

Functions

func ReleaseIP

func ReleaseIP(address *net.IPNet, ip *net.IP) error

ReleaseIP adds the provided ip back into the pool of available ips to be returned for use.

func RequestIP

func RequestIP(address *net.IPNet, ip *net.IP) (*net.IP, error)

RequestIP requests an available ip from the given network. It will return the next available ip if the ip provided is nil. If the ip provided is not nil it will validate that the provided ip is available for use or return an error

Source Files

allocator.go

Version
v0.11.1
Published
May 8, 2014
Platform
js/wasm
Imports
6 packages
Last checked
7 minutes ago

Tools for package owners.