ipam

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressRange

type AddressRange struct {
	Sub        *net.IPNet
	Start, End uint64
}

AddressRange specifies first and last ip ordinal which identify a range in a a pool of addresses

func (*AddressRange) MarshalJSON

func (r *AddressRange) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of the Range object

func (*AddressRange) String

func (r *AddressRange) String() string

String returns the string form of the AddressRange object

func (*AddressRange) UnmarshalJSON

func (r *AddressRange) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes data into the Range object

type Allocator

type Allocator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Allocator provides per address space ipv4/ipv6 book keeping

func NewAllocator

func NewAllocator(lcDs, glDs datastore.DataStore) (*Allocator, error)

NewAllocator returns an instance of libnetwork ipam

func (*Allocator) DumpDatabase

func (a *Allocator) DumpDatabase() string

DumpDatabase dumps the internal info

func (*Allocator) GetDefaultAddressSpaces

func (a *Allocator) GetDefaultAddressSpaces() (string, string, error)

GetDefaultAddressSpaces returns the local and global default address spaces

func (*Allocator) ReleaseAddress

func (a *Allocator) ReleaseAddress(poolID string, address net.IP) error

ReleaseAddress releases the address from the specified pool ID

func (*Allocator) ReleasePool

func (a *Allocator) ReleasePool(poolID string) error

ReleasePool releases the address pool identified by the passed id

func (*Allocator) RequestAddress

func (a *Allocator) RequestAddress(poolID string, prefAddress net.IP, opts map[string]string) (*net.IPNet, map[string]string, error)

RequestAddress returns an address from the specified pool ID

func (*Allocator) RequestPool

func (a *Allocator) RequestPool(addressSpace, pool, subPool string, options map[string]string, v6 bool) (string, *net.IPNet, map[string]string, error)

RequestPool returns an address pool along with its unique id.

type PoolData

type PoolData struct {
	ParentKey SubnetKey
	Pool      *net.IPNet
	Range     *AddressRange `json:",omitempty"`
	RefCount  int
}

PoolData contains the configured pool data

func (*PoolData) CopyTo

func (p *PoolData) CopyTo(dstP *PoolData) error

CopyTo deep copies the pool data to the destination pooldata

func (*PoolData) MarshalJSON

func (p *PoolData) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of the PoolData object

func (*PoolData) String

func (p *PoolData) String() string

String returns the string form of the PoolData object

func (*PoolData) UnmarshalJSON

func (p *PoolData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes data into the PoolData object

type SubnetKey

type SubnetKey struct {
	AddressSpace string
	Subnet       string
	ChildSubnet  string
}

SubnetKey is the pointer to the configured pools in each address space

func (*SubnetKey) FromString

func (s *SubnetKey) FromString(str string) error

FromString populate the SubnetKey object reading it from string

func (*SubnetKey) String

func (s *SubnetKey) String() string

String returns the string form of the SubnetKey object

Jump to

Keyboard shortcuts

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