Skip to content
When you executed go generate, this library download the latest oui list from http://standards-oui.ieee.org.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
vendor/github.com/jessevdk/go-flags
.gitignore
Gopkg.lock
Gopkg.toml
LICENSE
README.md
main.go

README.md

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

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.