devicecatalog

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package devicecatalog reads explicitly selected, offline device catalogues. Admission/signature verification belongs to the optional-catalogue installer.

Index

Constants

View Source
const MaxBytes = 16 << 20

Variables

This section is empty.

Functions

func NormalizeMAC

func NormalizeMAC(mac string) string

NormalizeMAC accepts complete 48-bit colon, hyphen or compact notation. Local/randomized and group addresses do not identify registered organizations.

func ParameterKey

func ParameterKey(options []Option, file, sname []byte) string

ParameterKey implements RFC 2132 option 55 and RFC 3396 concatenation, including RFC 2132 option-overloaded file then sname fields.

func Read

func Read(path string) ([]byte, error)

func ValidKey

func ValidKey(key string) bool

Types

type Candidate

type Candidate struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

type DHCP

type DHCP struct {
	Format       string      `json:"format"`
	Schema       int         `json:"schema"`
	Version      string      `json:"version"`
	License      string      `json:"license"`
	SourceSHA256 string      `json:"source_sha256"`
	Entries      []DHCPEntry `json:"entries"`
	// contains filtered or unexported fields
}

func ParseDHCP

func ParseDHCP(b []byte) (*DHCP, error)

func (*DHCP) Candidates

func (c *DHCP) Candidates(key string) []Candidate

func (*DHCP) Lookup

func (c *DHCP) Lookup(key string) string

Lookup refuses collisions rather than choosing an arbitrary historical label.

type DHCPEntry

type DHCPEntry struct {
	Key        string      `json:"key"`
	Candidates []Candidate `json:"candidates"`
}

type MAC

type MAC struct {
	Format  string     `json:"format"`
	Schema  int        `json:"schema"`
	Version string     `json:"version"`
	License string     `json:"license"`
	Entries []MACEntry `json:"entries"`
	// contains filtered or unexported fields
}

func ParseMAC

func ParseMAC(b []byte) (*MAC, error)

func (*MAC) Lookup

func (c *MAC) Lookup(mac string) string

type MACEntry

type MACEntry struct {
	Prefix       string `json:"prefix"`
	Bits         int    `json:"bits"`
	Organization string `json:"organization"`
}

type Option

type Option struct {
	Code, Length int
	Data         []byte
}

Jump to

Keyboard shortcuts

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