2024-09-14 04:21:14 +00:00
|
|
|
package types
|
|
|
|
|
2024-09-24 20:43:54 +00:00
|
|
|
import "strings"
|
2024-09-14 04:21:14 +00:00
|
|
|
|
2024-09-24 20:43:54 +00:00
|
|
|
var types = map[string]int{
|
|
|
|
"macaddr": 0,
|
|
|
|
"hwaddr": 0,
|
|
|
|
"invalid": 255,
|
|
|
|
}
|
|
|
|
|
|
|
|
func Lookup(rtype string) int {
|
|
|
|
rtype = strings.ToLower(rtype)
|
|
|
|
if t, ok := types[rtype]; ok == true {
|
|
|
|
return t
|
|
|
|
}
|
|
|
|
return types["invalid"]
|
|
|
|
}
|