Debian Codegraph @

network/manuf.go.template

raw
1 package network
2
3 import (
4 "strings"
5 )
6
7 var manuf = #MAP#
8
9 func ManufLookup(mac string) string {
10 macHex := strings.ToUpper(strings.Replace(mac, ":", "", -1))
11 macLen := len(macHex)
12
13 for offset := macLen; offset >= 2; offset -= 2 {
14 part := macHex[0:offset]
15 if vendor, found := manuf[part]; found {
16 return vendor
17 }
18 }
19
20 return ""
21 }