timwhitez starred ouiparser
2023-1-17 19:10:48 Author: github.com(查看原文) 阅读量:21 收藏

IEEE OUI data parser

You can download oui.txt here: http://standards-oui.ieee.org/oui/oui.txt

Install

go get github.com/dfkdream/ouiparser

Example Code

package main

import (
    "log"
    "fmt"
    "net"
    "github.com/dfkdream/ouiparser"
)

func main(){
    oui,err:=ouiparser.ParseOUI("oui.txt")
    if err!=nil{
        log.Fatal(err)
    }

    mac,err:=net.ParseMAC("d4:38:9c:00:00:00")
    if err!=nil{
        log.Fatal(err)
    }

    result:=ouiparser.SearchOUI(oui,mac)
    fmt.Println(result.Organization)
}

Output

Sony Mobile Communications Inc

文章来源: https://github.com/dfkdream/ouiparser
如有侵权请联系:admin#unsafe.sh