lease

package
v2.0.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2016 License: GPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(cidr CIDR, id uint64) (ip net.IP, err error)

Generate takes the CIDR (both IPv4 and IPv6 is supported) and a ID (which is used to increment the IP address from the CIDR). Then the incremented IP address is returned.

Types

type CIDR

type CIDR struct {
	Start   net.IP
	Network *net.IPNet
}

CIDR holds a start address, the allowed network and a ID to add to the start IP.

func ParseCIDR

func ParseCIDR(cidr string) (c CIDR, err error)

ParseCIDR acts as a wrapper for net.ParseCIDR and populates a lease.CIDR struct.

Jump to

Keyboard shortcuts

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