File: entid.go

package info (click to toggle)
golang-github-insomniacslk-dhcp 0.0~git20220915.043f172-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,168 kB
  • sloc: makefile: 6
file content (23 lines) | stat: -rw-r--r-- 649 bytes parent folder | download
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"
}