prefix

package
v0.0.0-...-fda5957 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package prefix implements a plugin offering prefixes to clients requesting them This plugin attributes prefixes to clients requesting them with IA_PREFIX requests.

Arguments for the plugin configuration are as follows, in this order: - prefix: The base prefix from which assigned prefixes are carved - max: maximum size of the prefix delegated to clients. When a client requests a larger prefix than this, this is the size of the offered prefix

Index

Constants

This section is empty.

Variables

View Source
var Plugin = plugins.Plugin{
	Name:   "prefix",
	Setup6: setupPrefix,
}

Plugin registers the prefix. Prefix delegation only exists for DHCPv6

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// Mutex here is the simplest implementation fit for purpose.
	// We can revisit for perf when we move lease management to separate plugins
	sync.Mutex
	// Records has a string'd []byte as key, because []byte can't be a key itself
	// Since it's not valid utf-8 we can't use any other string function though
	Records map[string][]lease
	// contains filtered or unexported fields
}

Handler holds state of allocations for the plugin

func (*Handler) Handle

func (h *Handler) Handle(req, resp dhcpv6.DHCPv6) (dhcpv6.DHCPv6, bool)

Handle processes DHCPv6 packets for the prefix plugin for a given allocator/leaseset

Jump to

Keyboard shortcuts

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