oui

package
v0.0.0-...-58fa19b Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	sync.Mutex
	// contains filtered or unexported fields
}

DB is a IEEE MA-L (MAC Address Block Large, formerly known as OUI) database.

func NewDB

func NewDB(dir string, opts ...option) *DB

NewDB loads a database from the cached version in dir, if any, and asynchronously triggers an update. Use WaitUntilLoaded() to ensure Lookup() will work, or use Lookup() opportunistically at any time.

func (*DB) Lookup

func (d *DB) Lookup(assignment string) string

Lookup returns the organization name for the specified assignment, if found. Assignment is a large MAC address block assignment, e.g. f0:9f:c2.

func (*DB) WaitUntilLoaded

func (d *DB) WaitUntilLoaded() error

WaitUntilLoaded blocks until the database was loaded.

Jump to

Keyboard shortcuts

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