defaultipam

package
v27.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DriverName is the name of the built-in default IPAM driver.
	DriverName = "default"
)

Variables

This section is empty.

Functions

func Register

func Register(ic ipamapi.Registerer, lAddrPools, gAddrPools []*ipamutils.NetworkToSplit) error

Register registers the default ipam driver with libnetwork. It takes two optional address pools respectively containing the list of user-defined address pools for 'local' and 'global' address spaces.

Types

type Allocator

type Allocator struct {
	// contains filtered or unexported fields
}

Allocator provides per address space ipv4/ipv6 bookkeeping

func NewAllocator

func NewAllocator(lcAs, glAs []*ipamutils.NetworkToSplit) (*Allocator, error)

NewAllocator returns an instance of libnetwork ipam

func (*Allocator) GetDefaultAddressSpaces

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

GetDefaultAddressSpaces returns the local and global default address spaces

func (*Allocator) IsBuiltIn

func (a *Allocator) IsBuiltIn() bool

IsBuiltIn returns true for builtin drivers

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(req ipamapi.PoolRequest) (ipamapi.AllocatedPool, error)

RequestPool returns an address pool along with its unique id. addressSpace must be a valid address space name and must not be the empty string. If requestedPool is the empty string then the default predefined pool for addressSpace will be used, otherwise pool must be a valid IP address and length in CIDR notation. If requestedSubPool is not empty, it must be a valid IP address and length in CIDR notation which is a sub-range of requestedPool. requestedSubPool must be empty if requestedPool is empty.

type PoolData

type PoolData struct {
	// contains filtered or unexported fields
}

PoolData contains the configured pool data

func (*PoolData) String

func (p *PoolData) String() string

String returns the string form of the PoolData object

type PoolID

type PoolID struct {
	AddressSpace string
	SubnetKey
}

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

func PoolIDFromString

func PoolIDFromString(str string) (pID PoolID, err error)

PoolIDFromString creates a new PoolID and populates the SubnetKey object reading it from the given string.

func (*PoolID) String

func (s *PoolID) String() string

String returns the string form of the SubnetKey object

type SubnetKey

type SubnetKey struct {
	Subnet, ChildSubnet netip.Prefix
}

SubnetKey is the composite key to an address pool within an address space.

func (SubnetKey) Is6

func (k SubnetKey) Is6() bool

Jump to

Keyboard shortcuts

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