Help us shape the future of Go! Take the 2026 Go Developer Survey

macaddr

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package macaddr keeps one MAC format across the project: AA:BB:CC:DD:EE:FF, so MACs from NAS, clientdb and option 82 compare as plain strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromRemoteID added in v0.3.13

func FromRemoteID(remoteID []byte) string

FromRemoteID extracts the switch MAC from the DHCP option 82 remote-id. Ported from remoteReader() in the legacy abills.pl with offsets shifted by one byte (FreeRADIUS passed hex there, we get raw bytes). Some NAS send the MAC as text; the 18-byte form carries trailing garbage after the MAC.

func Normalize

func Normalize(mac string) string

Normalize returns AA:BB:CC:DD:EE:FF. Input that does not hold exactly 12 hex digits is returned as bare upper-case hex, so broken data stays visible in logs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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