summaryrefslogtreecommitdiffhomepage
path: root/iana/entid.go
blob: 8703b79cdd9ec1aa8cb27f4b5019abc55ef9cdbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package iana

// EnterpriseID represents the Enterprise IDs as set by IANA
type EnterpriseID int

// See https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers for values
const (
	EnterpriseIDCiscoSystems     EnterpriseID = 9
	EnterpriseIDCienaCorporation EnterpriseID = 1271
)

var enterpriseIDToStringMap = map[EnterpriseID]string{
	EnterpriseIDCiscoSystems:     "Cisco Systems",
	EnterpriseIDCienaCorporation: "Ciena Corporation",
}

// String returns the vendor name for a given Enterprise ID
func (e EnterpriseID) String() string {
	if vendor := enterpriseIDToStringMap[e]; vendor != "" {
		return vendor
	}
	return "Unknown"
}