oui

command module
v0.0.0-...-b305ae4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 9 Imported by: 0

README

oui

When you executed go generate, this library download the latest oui list from http://standards-oui.ieee.org.

Usage

downloaad library
$ go get github.com/HayatoDoi/oui
example
code

main.go

package main

import (
	"fmt"
	"strings"
)

//go:generate oui -p main -o oui.go
func main(){
	mac := "902e1c000000"
	oui := strings.ToUpper(mac[:6])
	organization, ok := MacAndOrganization[oui]
	if ok != true{
		organization = "unknown"
	}
	fmt.Printf("%s : %s\n", mac, organization)
}
make oui.go

this take about 10-20 seconds.

$ go generate
exec
$ go run main.go oui.go
out put
$ go run example.go oui.go 
902e1c000000 : Intel Corporate

Licence

These codes are licensed under MIT.

Author

HayatoDoi

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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