Documentation ¶
Overview ¶
Package ipam handles address allocation management
Index ¶
- Variables
- type Configuration
- type ErrAllocation
- type Family
- type IPAM
- func (ipam *IPAM) AllocateIP(ip net.IP, owner string) error
- func (ipam *IPAM) AllocateIPString(ipAddr, owner string) error
- func (ipam *IPAM) AllocateNext(family, owner string) (ipv4 net.IP, ipv6 net.IP, err error)
- func (ipam *IPAM) AllocateNextFamily(family Family, owner string) (ip net.IP, err error)
- func (ipam *IPAM) Dump() (map[string]string, map[string]string)
- func (ipam *IPAM) ReleaseIP(ip net.IP) error
- func (ipam *IPAM) ReleaseIPString(ipAddr string) error
- func (ipam *IPAM) ReserveLocalRoutes()
Constants ¶
This section is empty.
Variables ¶
var ( // ErrIPv4Disabled is returned when IPv4 allocation is disabled ErrIPv4Disabled = errors.New("IPv4 allocation disabled") // ErrIPv6Disabled is returned when Ipv6 allocation is disabled ErrIPv6Disabled = errors.New("IPv6 allocation disabled") )
Error definitions
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
Configuration is the configuration of an IP address manager
type ErrAllocation ¶
type ErrAllocation error
type Family ¶
type Family string
Family is the type describing all address families support by the IP allocation manager
type IPAM ¶
type IPAM struct { IPv6Allocator *ipallocator.Range IPv4Allocator *ipallocator.Range // contains filtered or unexported fields }
Config is the IPAM configuration used for a particular IPAM type.
func NewIPAM ¶
func NewIPAM(nodeAddressing datapath.NodeAddressing, c Configuration) *IPAM
NewIPAM returns a new IP address manager
func (*IPAM) AllocateIP ¶
AllocateIP allocates a IP address.
func (*IPAM) AllocateIPString ¶
AllocateIPString is identical to AllocateIP but takes a string
func (*IPAM) AllocateNext ¶
AllocateNext allocates the next available IPv4 and IPv6 address out of the configured address pool. If family is set to "ipv4" or "ipv6", then allocation is limited to the specified address family. If the pool has been drained of addresses, an error will be returned.
func (*IPAM) AllocateNextFamily ¶
AllocateNextFamily allocates the next IP of the requested address family
func (*IPAM) ReleaseIPString ¶
ReleaseIPString is identical to ReleaseIP but takes a string
func (*IPAM) ReserveLocalRoutes ¶
func (ipam *IPAM) ReserveLocalRoutes()
ReserveLocalRoutes walks through local routes/subnets and reserves them in the allocator pool in case of overlap