oui

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: BSD-3-Clause-Clear Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REGISTRY_OUI   string = "MA-L"
	REGISTRY_OUI36 string = "MA-S"
	REGISTRY_OUI28 string = "MA-M"
	REGISTRY_IAB   string = "IAB"
	REGISTRY_CID   string = "CID"
)

Variables

This section is empty.

Functions

func DownloadCSV

func DownloadCSV(registry *Registry) (fileName string, err error)

Types

type Formats

type Formats struct {
	Hex    string
	Dotted string
	Dashed string
	Int    int64
	Bytes  string
}

func Convert

func Convert(i string) (fmts *Formats, err error)

type OUIDB

type OUIDB struct {
	Directory  string
	FileName   string
	Connection *sql.DB
	Version    string
}

func New

func New(version string) (ouidb *OUIDB, err error)

func (*OUIDB) Clear

func (ouidb *OUIDB) Clear() (err error)

func (*OUIDB) Close

func (ouidb *OUIDB) Close() error

func (*OUIDB) Count

func (ouidb *OUIDB) Count() (count int64, err error)

func (*OUIDB) Find

func (ouidb *OUIDB) Find(search string) (matches []*VendorDef, err error)

func (*OUIDB) Insert

func (ouidb *OUIDB) Insert(d *VendorDef) (res sql.Result, err error)

func (*OUIDB) Populate

func (ouidb *OUIDB) Populate(p *progress.Progress) (records int64, err error)

type Registry

type Registry struct {
	Name          string
	BaseURL       string
	FilePrefix    string
	FileExtension string
}

func Registries

func Registries() []*Registry

func (*Registry) FileName

func (reg *Registry) FileName() string

func (*Registry) TempFilePattern

func (reg *Registry) TempFilePattern() string

func (*Registry) URL

func (reg *Registry) URL() *url.URL

type VendorDef

type VendorDef struct {
	Prefix   string
	Length   int
	Org      string
	Registry string
}

func CollectAll

func CollectAll(p *progress.Progress, logger *logger.Logger) (results []*VendorDef)

func ReadCSV

func ReadCSV(registry *Registry, fileName string, logger *logger.Logger) (results []*VendorDef)

func (*VendorDef) PrefixString

func (v *VendorDef) PrefixString() string

Jump to

Keyboard shortcuts

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