ippool

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAddress = errors.New("non-ipv4 address given")
	ErrNotInRange     = errors.New("provided ipv4 address does not fit to configured subnet")
	ErrAddressInUse   = errors.New("ip address is already used")
	ErrNotEnoughSpace = errors.New("not enough space in the pool")
)

Functions

This section is empty.

Types

type IPv4pool

type IPv4pool struct {
	// contains filtered or unexported fields
}

func NewIPv4FromSubnet

func NewIPv4FromSubnet(subnet *xnet.IPNet) (*IPv4pool, error)

func (*IPv4pool) Alloc

func (pool *IPv4pool) Alloc() (xnet.IP, error)

func (*IPv4pool) Available

func (pool *IPv4pool) Available() (xnet.IP, error)

Available returns an available ip address without actually allocating it.

func (*IPv4pool) IsAvailable

func (pool *IPv4pool) IsAvailable(ip xnet.IP) bool

IsAvailable checks whether given ip is used by the pool.

func (*IPv4pool) Running

func (pool *IPv4pool) Running() bool

func (*IPv4pool) ServerIP

func (pool *IPv4pool) ServerIP() xnet.IP

func (*IPv4pool) Set

func (pool *IPv4pool) Set(ip xnet.IP) error

func (*IPv4pool) Shutdown

func (pool *IPv4pool) Shutdown() error

func (*IPv4pool) Unset

func (pool *IPv4pool) Unset(ip xnet.IP) error

Jump to

Keyboard shortcuts

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