ipam

package
v0.0.0-...-50ffc52 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package ipam is a very simple IPAM it administers a single CIDR range, e.g "172.30.0.0/16"

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAddressesLeft    = errors.New("error: no addresses left")
	ErrAddressOutOfRange  = errors.New("error: address out of range")
	ErrAddressAlreadyUsed = errors.New("error: address already used")
)
View Source
var Check = Fix

Functions

func Allocate

func Allocate() (net.IP, error)

func Fix

func Fix() error

func Free

func Free(a net.IP)

func Reserve

func Reserve(a net.IP) error

func ReserveFirstAndLast

func ReserveFirstAndLast()

func Unallocated

func Unallocated() uint32

Types

type IPAM

type IPAM interface {
	Allocate() (net.IP, error)
	Free(a net.IP)
	Unallocated() uint32
	Reserve(a net.IP) error
	ReserveFirstAndLast()
}
var DefaultIPAM IPAM = &nullIPAM{}

func NewFileIPAM

func NewFileIPAM(fn, cidr string) (IPAM, error)

NewFileIPAM creates a new file backed IPAM for the passed subnet in CIDR form Error if the passed CIDR is invalid.

Jump to

Keyboard shortcuts

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