Documentation ¶
Index ¶
- Variables
- type IP
- type IPAM
- func (ipam *IPAM) AddOrUpdateIPPool(subnet, ippool string, ips []string) error
- func (ipam *IPAM) AddOrUpdateSubnet(name, cidrStr, gw string, excludeIps []string) error
- func (ipam *IPAM) ContainAddress(address string) bool
- func (ipam *IPAM) DeleteSubnet(subnetName string)
- func (ipam *IPAM) GetPodAddress(podName string) []*SubnetAddress
- func (ipam *IPAM) GetRandomAddress(podName, nicName string, mac *string, subnetName, poolName string, ...) (string, string, string, error)
- func (ipam *IPAM) GetStaticAddress(podName, nicName, ip string, mac *string, subnetName string, ...) (string, string, string, error)
- func (ipam *IPAM) GetSubnetIPRangeString(subnetName string, excludeIps []string) (string, string, string, string)
- func (ipam *IPAM) GetSubnetV4Mask(subnetName string) (string, error)
- func (ipam *IPAM) IPPoolStatistics(subnet, ippool string) (v4Available, v4Using, v6Available, v6Using internal.BigInt, ...)
- func (ipam *IPAM) IsIPAssignedToOtherPod(ip, subnetName, podName string) (string, bool)
- func (ipam *IPAM) ReleaseAddressByPod(podName, subnetName string)
- func (ipam *IPAM) RemoveIPPool(subnet, ippool string)
- type IPPool
- type IPRange
- func (r *IPRange) Add(ip IP) bool
- func (r *IPRange) Clone() *IPRange
- func (r *IPRange) Contains(ip IP) bool
- func (r *IPRange) Count() internal.BigInt
- func (r *IPRange) End() IP
- func (r *IPRange) Random() IP
- func (r *IPRange) Remove(ip IP) ([]*IPRange, bool)
- func (r *IPRange) SetEnd(ip IP)
- func (r *IPRange) SetStart(ip IP)
- func (r *IPRange) Start() IP
- func (r *IPRange) String() string
- type IPRangeList
- func (r *IPRangeList) Add(ip IP) bool
- func (r *IPRangeList) Allocate(skipped []IP) IP
- func (r *IPRangeList) At(i int) *IPRange
- func (r *IPRangeList) Clone() *IPRangeList
- func (r *IPRangeList) Contains(ip IP) bool
- func (r *IPRangeList) Count() internal.BigInt
- func (r *IPRangeList) Equal(x *IPRangeList) bool
- func (r *IPRangeList) Find(ip IP) (int, bool)
- func (r *IPRangeList) Intersect(x *IPRangeList) *IPRangeList
- func (r *IPRangeList) Len() int
- func (r *IPRangeList) Merge(x *IPRangeList) *IPRangeList
- func (r *IPRangeList) MergeRange(x *IPRange) *IPRangeList
- func (r *IPRangeList) Remove(ip IP) bool
- func (r *IPRangeList) Separate(x *IPRangeList) *IPRangeList
- func (r *IPRangeList) String() string
- type Subnet
- func (s *Subnet) AddOrUpdateIPPool(name string, ips []string) error
- func (s *Subnet) ContainAddress(address IP) bool
- func (s *Subnet) GetPodAddress(nicName string) (IP, IP, string, string)
- func (s *Subnet) GetRandomAddress(poolName, podName, nicName string, mac *string, skippedAddrs []string, ...) (IP, IP, string, error)
- func (s *Subnet) GetRandomMac(podName, nicName string) string
- func (s *Subnet) GetStaticAddress(podName, nicName string, ip IP, mac *string, force, checkConflict bool) (IP, string, error)
- func (s *Subnet) GetStaticMac(podName, nicName, mac string, checkConflict bool) error
- func (s *Subnet) IPPoolStatistics(ippool string) (v4Available, v4Using, v6Available, v6Using internal.BigInt, ...)
- func (s *Subnet) ReleaseAddress(podName string)
- func (s *Subnet) ReleaseAddressWithNicName(podName, nicName string)
- func (s *Subnet) RemoveIPPool(name string)
- type SubnetAddress
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type IP ¶
func (IP) GreaterThan ¶
type IPAM ¶
func (*IPAM) AddOrUpdateIPPool ¶ added in v1.12.0
func (*IPAM) AddOrUpdateSubnet ¶
func (*IPAM) ContainAddress ¶
func (*IPAM) DeleteSubnet ¶
func (*IPAM) GetPodAddress ¶
func (ipam *IPAM) GetPodAddress(podName string) []*SubnetAddress
func (*IPAM) GetRandomAddress ¶
func (*IPAM) GetStaticAddress ¶
func (*IPAM) GetSubnetIPRangeString ¶ added in v1.12.0
func (*IPAM) GetSubnetV4Mask ¶ added in v1.10.0
func (*IPAM) IPPoolStatistics ¶ added in v1.12.0
func (*IPAM) IsIPAssignedToOtherPod ¶ added in v1.11.0
func (*IPAM) ReleaseAddressByPod ¶
func (*IPAM) RemoveIPPool ¶ added in v1.12.0
type IPPool ¶ added in v1.12.0
type IPPool struct { V4IPs *IPRangeList V4Free *IPRangeList V4Available *IPRangeList V4Reserved *IPRangeList V4Released *IPRangeList V4Using *IPRangeList V6IPs *IPRangeList V6Free *IPRangeList V6Available *IPRangeList V6Reserved *IPRangeList V6Released *IPRangeList V6Using *IPRangeList }
type IPRange ¶
type IPRange struct {
// contains filtered or unexported fields
}
IPRange represents an IP range of [start, end]
func NewIPRange ¶ added in v1.12.0
func NewIPRangeFromCIDR ¶ added in v1.12.0
type IPRangeList ¶
type IPRangeList struct {
// contains filtered or unexported fields
}
func NewEmptyIPRangeList ¶ added in v1.12.0
func NewEmptyIPRangeList() *IPRangeList
func NewIPRangeList ¶ added in v1.12.0
func NewIPRangeList(ips ...IP) (*IPRangeList, error)
func NewIPRangeListFrom ¶ added in v1.12.0
func NewIPRangeListFrom(x ...string) (*IPRangeList, error)
func (*IPRangeList) Add ¶ added in v1.12.0
func (r *IPRangeList) Add(ip IP) bool
func (*IPRangeList) Allocate ¶ added in v1.12.0
func (r *IPRangeList) Allocate(skipped []IP) IP
func (*IPRangeList) At ¶ added in v1.12.0
func (r *IPRangeList) At(i int) *IPRange
func (*IPRangeList) Clone ¶ added in v1.12.0
func (r *IPRangeList) Clone() *IPRangeList
func (*IPRangeList) Contains ¶
func (r *IPRangeList) Contains(ip IP) bool
func (*IPRangeList) Count ¶ added in v1.12.0
func (r *IPRangeList) Count() internal.BigInt
func (*IPRangeList) Equal ¶ added in v1.12.0
func (r *IPRangeList) Equal(x *IPRangeList) bool
func (*IPRangeList) Intersect ¶ added in v1.12.0
func (r *IPRangeList) Intersect(x *IPRangeList) *IPRangeList
Intersect returns a new list which contains items which are in both `r` and `x`
func (*IPRangeList) Len ¶ added in v1.12.0
func (r *IPRangeList) Len() int
func (*IPRangeList) Merge ¶ added in v1.12.0
func (r *IPRangeList) Merge(x *IPRangeList) *IPRangeList
func (*IPRangeList) MergeRange ¶ added in v1.12.0
func (r *IPRangeList) MergeRange(x *IPRange) *IPRangeList
func (*IPRangeList) Remove ¶ added in v1.12.0
func (r *IPRangeList) Remove(ip IP) bool
func (*IPRangeList) Separate ¶ added in v1.12.0
func (r *IPRangeList) Separate(x *IPRangeList) *IPRangeList
Separate returns a new list which contains items which are in `r` but not in `x`
func (*IPRangeList) String ¶ added in v1.12.0
func (r *IPRangeList) String() string
type Subnet ¶
type Subnet struct { Name string Mutex sync.RWMutex CIDR string Protocol string V4CIDR *net.IPNet V4Free *IPRangeList V4Reserved *IPRangeList V4Available *IPRangeList V4Using *IPRangeList V4NicToIP map[string]IP V4IPToPod map[string]string V6CIDR *net.IPNet V6Free *IPRangeList V6Reserved *IPRangeList V6Available *IPRangeList V6Using *IPRangeList V6NicToIP map[string]IP V6IPToPod map[string]string NicToMac map[string]string MacToPod map[string]string PodToNicList map[string][]string V4Gw string V6Gw string IPPools map[string]*IPPool }
func (*Subnet) AddOrUpdateIPPool ¶ added in v1.12.0
func (*Subnet) ContainAddress ¶
func (*Subnet) GetPodAddress ¶
This func is only called in ipam.GetPodAddress, move mutex to caller
func (*Subnet) GetRandomAddress ¶
func (*Subnet) GetRandomMac ¶
func (*Subnet) GetStaticAddress ¶
func (*Subnet) GetStaticMac ¶
func (*Subnet) IPPoolStatistics ¶ added in v1.12.0
func (*Subnet) ReleaseAddress ¶
func (*Subnet) ReleaseAddressWithNicName ¶ added in v1.12.0
func (*Subnet) RemoveIPPool ¶ added in v1.12.0
type SubnetAddress ¶
Click to show internal directories.
Click to hide internal directories.