ipam

package
v0.0.0-...-fcacf22 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitMap

type BitMap struct {
	Bits     []byte `json:"bits"`
	Count    uint   `json:"count"`
	Capacity uint   `json:"cap"`
}

BitMap implement a bitmap

func NewBitMap

func NewBitMap(cap uint) *BitMap

NewBitMap Create a new BitMap

func (*BitMap) First

func (b *BitMap) First() int

First returns the index of the first zero value

func (*BitMap) Has

func (b *BitMap) Has(num uint) bool

func (*BitMap) IsFull

func (b *BitMap) IsFull() bool

func (*BitMap) Reset

func (b *BitMap) Reset(num uint)

func (*BitMap) Set

func (b *BitMap) Set(num uint)

func (*BitMap) String

func (b *BitMap) String() string

type IPAM

type IPAM struct {
	SubnetAllocatorPath string
	Subnets             *map[string]*BitMap
}

IPAM IP Address Management

func New

func New(allocatorPath string) *IPAM

New create a new IPAM

func (*IPAM) Allocate

func (i *IPAM) Allocate(subnet *net.IPNet) (ip net.IP, err error)

Allocate an available ip address of a subnet

func (*IPAM) Release

func (i *IPAM) Release(subnet *net.IPNet, ipaddr *net.IP) error

Release an assigned ip address of a subnet

Jump to

Keyboard shortcuts

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