simple-ipam

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: Apache-2.0

README

simple-ipam

A super-simple IPAM.

This IPAM administers addresses from a single CIDR range, e.g 1100::/120.

GoDoc

Example;

package main

import (
	"fmt"
	"github.com/Nordix/simple-ipam/pkg/ipam"
)

func main() {
	cidr := "1100::/120"
	ipam, _ := ipam.New(cidr)
	fmt.Printf("Unallocated addresses in %s; %d\n", cidr, ipam.Unallocated())
	a, _ := ipam.Allocate()
	fmt.Printf("Allocated; %s\n", a)
	ipam.Free(a)
}

Go playground

Directories

Path Synopsis
pkg
ipaddr
Package ipaddr provides basic iterator functions for ip-addresses Some code is taken from github.com/mikioh/ipaddr.
Package ipaddr provides basic iterator functions for ip-addresses Some code is taken from github.com/mikioh/ipaddr.
ipam
Package ipam is a very simple IPAM it administers a single CIDR range, e.g "1000::/124".
Package ipam is a very simple IPAM it administers a single CIDR range, e.g "1000::/124".

Jump to

Keyboard shortcuts

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