Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dhcp6rd

Library for parsing 6rd options from DHCP and calculating which prefix to assign

See godoc for full documentation

Example usage:

package main

import (
	"github.com/bonan/dhcp6rd"
	"log"
	"net"
)

func main() {
	// Parse option 212 received from dhclient
	opt, err := dhcp6rd.UnmarshalDhclient("0 32 2001:db8:: 192.0.2.1")

	if err != nil {
		log.Fatal(err)
	}

	// Get prefix delegation
	net, err := opt.IPNet(net.ParseIP("192.0.2.200"))

	if err != nil {
		log.Fatal(err)
	}

	// Log the prefix delegation
	log.Printf("Usable 6rd prefix: %v\n", net.String())
}

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages