iputil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSLAACPrefixInvalid reports that SLAAC prefix is invalid.
	ErrSLAACPrefixInvalid = errors.New("slaac prefix is invalid")
	// ErrMACInvalid reports that MAC is invalid.
	ErrMACInvalid = errors.New("mac is invalid")
)

Functions

func LinkLocal

func LinkLocal(mac net.HardwareAddr) (netip.Prefix, error)

LinkLocal derives the link-local address (RFC 4291) for the given EUI-48 MAC address.

func MustLinkLocal

func MustLinkLocal(mac net.HardwareAddr) netip.Prefix

MustLinkLocal calls LinkLocal and panics if an error occurs.

func MustSLAAC

func MustSLAAC(prefix netip.Prefix, mac net.HardwareAddr) netip.Prefix

MustSLAAC calls SLAAC and panics if an errors occurs.

func SLAAC

func SLAAC(prefix netip.Prefix, mac net.HardwareAddr) (netip.Prefix, error)

SLAAC derives the SLAAC address (RFC 4862) for the given /64 prefix and MAC address.

Types

This section is empty.

Jump to

Keyboard shortcuts

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