Documentation ¶
Index ¶
- type IPAMer
- type Ipam
- func (i *Ipam) AllocateChildPrefix(parentPrefix metal.Prefix, childLength uint8) (*metal.Prefix, error)
- func (i *Ipam) AllocateIP(prefix metal.Prefix) (string, error)
- func (i *Ipam) AllocateSpecificIP(prefix metal.Prefix, specificIP string) (string, error)
- func (i *Ipam) CreatePrefix(prefix metal.Prefix) error
- func (i *Ipam) DeletePrefix(prefix metal.Prefix) error
- func (i *Ipam) PrefixUsage(cidr string) (*metal.NetworkUsage, error)
- func (i *Ipam) PrefixesOverlapping(existingPrefixes metal.Prefixes, newPrefixes metal.Prefixes) error
- func (i *Ipam) ReleaseChildPrefix(childPrefix metal.Prefix) error
- func (i *Ipam) ReleaseIP(ip metal.IP) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPAMer ¶
type IPAMer interface { AllocateIP(prefix metal.Prefix) (string, error) AllocateSpecificIP(prefix metal.Prefix, specificIP string) (string, error) ReleaseIP(ip metal.IP) error AllocateChildPrefix(parentPrefix metal.Prefix, childLength uint8) (*metal.Prefix, error) ReleaseChildPrefix(childPrefix metal.Prefix) error CreatePrefix(prefix metal.Prefix) error DeletePrefix(prefix metal.Prefix) error PrefixUsage(cidr string) (*metal.NetworkUsage, error) PrefixesOverlapping(existingPrefixes metal.Prefixes, newPrefixes metal.Prefixes) error }
A IPAMer is responsible to allocate a IP for a given purpose On the other hand it should release the IP. Later Implementations should also allocate and release Networks.
type Ipam ¶
type Ipam struct {
// contains filtered or unexported fields
}
func InitTestIpam ¶
func (*Ipam) AllocateChildPrefix ¶
func (i *Ipam) AllocateChildPrefix(parentPrefix metal.Prefix, childLength uint8) (*metal.Prefix, error)
AllocateChildPrefix creates a child prefix from a parent prefix in the IPAM.
func (*Ipam) AllocateIP ¶
AllocateIP an ip in the IPAM and returns the allocated IP as a string.
func (*Ipam) AllocateSpecificIP ¶
AllocateSpecificIP a specific ip in the IPAM and returns the allocated IP as a string.
func (*Ipam) CreatePrefix ¶
CreatePrefix creates a prefix in the IPAM.
func (*Ipam) DeletePrefix ¶
DeletePrefix remove a prefix in the IPAM.
func (*Ipam) PrefixUsage ¶
func (i *Ipam) PrefixUsage(cidr string) (*metal.NetworkUsage, error)
PrefixUsage calculates the IP and Prefix Usage
func (*Ipam) PrefixesOverlapping ¶
func (i *Ipam) PrefixesOverlapping(existingPrefixes metal.Prefixes, newPrefixes metal.Prefixes) error
PrefixesOverlapping returns an error if prefixes overlap.
func (*Ipam) ReleaseChildPrefix ¶
ReleaseChildPrefix release a child prefix from a parent prefix in the IPAM.