macpack

package
v0.0.0-...-2cee930 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RemoteIeeeMACLarge  string = "http://standards-oui.ieee.org/oui/oui.csv"
	RemoteIeeeMACMedium string = "http://standards-oui.ieee.org/oui28/mam.csv"
	RemoteIeeeMACSmall  string = "http://standards-oui.ieee.org/oui36/oui36.csv"
)

https://regauth.standards.ieee.org/standards-ra-web/pub/view.html#registries

Variables

This section is empty.

Functions

This section is empty.

Types

type MacPack

type MacPack map[string]Organization

MacPack is used to store relations between the vendor part of a physical hardware address and the organization behind it.

func New

func New(opts ...Option) (MacPack, error)

New returns a new MacPack which can be modified with options. If an error occurs, it will be returned.

func (MacPack) Get

func (m MacPack) Get(addr string) *Organization

Get returns the organization that belongs to the given address. If there is no entry for the address nil will be returned. Upper and lower case are accepted as well as the following notations: - FF:FF:FF:FF:FF:FF or ffffffffffff

type Option

type Option func(mp MacPack) error

An Option configures a MacPack at creation time.

func WithLocalSource

func WithLocalSource(path string) Option

WithLocalSource adds entries from a local location to the macpack register. e.g. path: /opt/list.csv The csv source should be formatted represent the following layout: - Registry,Assignment,Organization Name,Organization Address - MA-L, MA-S,AAAAAAAAA, orga1, A street Moscow RU 1234

func WithReaderSource

func WithReaderSource(r io.Reader) Option

WithReaderSource adds entries from a reader to the macpack register. The underlying csv source should be formatted and represent the following layout: - Registry,Assignment,Organization Name,Organization Address - MA-L, MA-S,AAAAAAAAA, orga1, A street Moscow RU 1234

func WithRemoteSource

func WithRemoteSource(path string) Option

WithRemoteSource adds entries from a remote location to the macpack register. e.g. path: http://example.com/list.csv The csv source should be formatted represent the following layout: - Registry,Assignment,Organization Name,Organization Address - MA-L, MA-S,AAAAAAAAA, orga1, A street Moscow RU 1234

type Organization

type Organization struct {
	Name    string
	Address string
}

Organization contains name and address of organization

Jump to

Keyboard shortcuts

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