From 006f7d3a741d770b70c8e09c2f4a589513a2b9bc Mon Sep 17 00:00:00 2001 From: Dalya Dickstein Date: Wed, 7 Oct 2020 17:30:40 -0400 Subject: [PATCH] Adding 6 new vendors and generated files --- vendors/ciena/dictionary.ciena | 17 + vendors/ciena/generate.go | 3 + vendors/ciena/generated.go | 401 +++ vendors/ciena6500/dictionary.ciena6500 | 25 + vendors/ciena6500/generate.go | 3 + vendors/ciena6500/generated.go | 611 +++++ vendors/cyan/dictionary.cyan | 16 + vendors/cyan/generate.go | 3 + vendors/cyan/generated.go | 330 +++ vendors/infinera/dictionary.infinera | 89 + vendors/infinera/generate.go | 3 + vendors/infinera/generated.go | 2532 ++++++++++++++++++ vendors/nokiapss1830/dictionary.nokiapss1830 | 15 + vendors/nokiapss1830/generate.go | 3 + vendors/nokiapss1830/generated.go | 213 ++ vendors/transmode/dictionary.transmode | 16 + vendors/transmode/generate.go | 3 + vendors/transmode/generated.go | 330 +++ 18 files changed, 4613 insertions(+) create mode 100644 vendors/ciena/dictionary.ciena create mode 100644 vendors/ciena/generate.go create mode 100644 vendors/ciena/generated.go create mode 100644 vendors/ciena6500/dictionary.ciena6500 create mode 100644 vendors/ciena6500/generate.go create mode 100644 vendors/ciena6500/generated.go create mode 100644 vendors/cyan/dictionary.cyan create mode 100644 vendors/cyan/generate.go create mode 100644 vendors/cyan/generated.go create mode 100644 vendors/infinera/dictionary.infinera create mode 100644 vendors/infinera/generate.go create mode 100644 vendors/infinera/generated.go create mode 100644 vendors/nokiapss1830/dictionary.nokiapss1830 create mode 100644 vendors/nokiapss1830/generate.go create mode 100644 vendors/nokiapss1830/generated.go create mode 100644 vendors/transmode/dictionary.transmode create mode 100644 vendors/transmode/generate.go create mode 100644 vendors/transmode/generated.go diff --git a/vendors/ciena/dictionary.ciena b/vendors/ciena/dictionary.ciena new file mode 100644 index 0000000..35d960f --- /dev/null +++ b/vendors/ciena/dictionary.ciena @@ -0,0 +1,17 @@ +# Vendor-specific RADIUS dictionary for Ciena +# +VENDOR Ciena 1271 +BEGIN-VENDOR Ciena +# +# Authentication attributes and values +# +ATTRIBUTE Ciena-1C-Role 200 string +ATTRIBUTE Ciena-BPMCP-Role 220 string +ATTRIBUTE Ciena-WS-User-Priv 10 integer + +VALUE Ciena-WS-User-Priv Waveserver-Priv-Limited 1 +VALUE Ciena-WS-User-Priv Waveserver-Priv-Admin 2 +VALUE Ciena-WS-User-Priv Waveserver-Priv-Super 3 +VALUE Ciena-WS-User-Priv Waveserver-Priv-Diag 4 + +END-VENDOR Ciena diff --git a/vendors/ciena/generate.go b/vendors/ciena/generate.go new file mode 100644 index 0000000..00b87ff --- /dev/null +++ b/vendors/ciena/generate.go @@ -0,0 +1,3 @@ +//go:generate go run ../../cmd/radius-dict-gen/main.go -package ciena -output generated.go dictionary.ciena + +package ciena diff --git a/vendors/ciena/generated.go b/vendors/ciena/generated.go new file mode 100644 index 0000000..d2d3244 --- /dev/null +++ b/vendors/ciena/generated.go @@ -0,0 +1,401 @@ +// Code generated by radius-dict-gen. DO NOT EDIT. + +package ciena + +import ( + "strconv" + + "layeh.com/radius" + "layeh.com/radius/rfc2865" +) + +const ( + _Ciena_VendorID = 1271 +) + +func _Ciena_AddVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + var vsa radius.Attribute + vendor := make(radius.Attribute, 2+len(attr)) + vendor[0] = typ + vendor[1] = byte(len(vendor)) + copy(vendor[2:], attr) + vsa, err = radius.NewVendorSpecific(_Ciena_VendorID, vendor) + if err != nil { + return + } + p.Add(rfc2865.VendorSpecific_Type, vsa) + return +} + +func _Ciena_GetsVendor(p *radius.Packet, typ byte) (values []radius.Attribute) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _Ciena_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + values = append(values, vsa[2:int(vsaLen)]) + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _Ciena_LookupVendor(p *radius.Packet, typ byte) (attr radius.Attribute, ok bool) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _Ciena_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + return vsa[2:int(vsaLen)], true + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _Ciena_SetVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _Ciena_VendorID { + i++ + continue + } + for j := 0; len(vsa[j:]) >= 3; { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa[j:]) || vsaLen < 3 { + i++ + break + } + if vsaTyp == typ { + vsa = append(vsa[:j], vsa[j+int(vsaLen):]...) + } + j += int(vsaLen) + } + if len(vsa) > 0 { + copy(avp.Attribute[4:], vsa) + i++ + } else { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+i:]...) + } + } + return _Ciena_AddVendor(p, typ, attr) +} + +func _Ciena_DelVendor(p *radius.Packet, typ byte) { +vsaLoop: + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _Ciena_VendorID { + i++ + continue + } + offset := 0 + for len(vsa[offset:]) >= 3 { + vsaTyp, vsaLen := vsa[offset], vsa[offset+1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + continue vsaLoop + } + if vsaTyp == typ { + copy(vsa[offset:], vsa[offset+int(vsaLen):]) + vsa = vsa[:len(vsa)-int(vsaLen)] + } else { + offset += int(vsaLen) + } + } + if offset == 0 { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+1:]...) + } else { + i++ + } + } + return +} + +func Ciena1CRole_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena_AddVendor(p, 200, a) +} + +func Ciena1CRole_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena_AddVendor(p, 200, a) +} + +func Ciena1CRole_Get(p *radius.Packet) (value []byte) { + value, _ = Ciena1CRole_Lookup(p) + return +} + +func Ciena1CRole_GetString(p *radius.Packet) (value string) { + value, _ = Ciena1CRole_LookupString(p) + return +} + +func Ciena1CRole_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Ciena_GetsVendor(p, 200) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func Ciena1CRole_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Ciena_GetsVendor(p, 200) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func Ciena1CRole_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Ciena_LookupVendor(p, 200) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func Ciena1CRole_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Ciena_LookupVendor(p, 200) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func Ciena1CRole_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena_SetVendor(p, 200, a) +} + +func Ciena1CRole_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena_SetVendor(p, 200, a) +} + +func Ciena1CRole_Del(p *radius.Packet) { + _Ciena_DelVendor(p, 200) +} + +func CienaBPMCPRole_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena_AddVendor(p, 220, a) +} + +func CienaBPMCPRole_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena_AddVendor(p, 220, a) +} + +func CienaBPMCPRole_Get(p *radius.Packet) (value []byte) { + value, _ = CienaBPMCPRole_Lookup(p) + return +} + +func CienaBPMCPRole_GetString(p *radius.Packet) (value string) { + value, _ = CienaBPMCPRole_LookupString(p) + return +} + +func CienaBPMCPRole_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Ciena_GetsVendor(p, 220) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func CienaBPMCPRole_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Ciena_GetsVendor(p, 220) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func CienaBPMCPRole_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Ciena_LookupVendor(p, 220) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func CienaBPMCPRole_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Ciena_LookupVendor(p, 220) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func CienaBPMCPRole_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena_SetVendor(p, 220, a) +} + +func CienaBPMCPRole_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena_SetVendor(p, 220, a) +} + +func CienaBPMCPRole_Del(p *radius.Packet) { + _Ciena_DelVendor(p, 220) +} + +type CienaWSUserPriv uint32 + +const ( + CienaWSUserPriv_Value_WaveserverPrivLimited CienaWSUserPriv = 1 + CienaWSUserPriv_Value_WaveserverPrivAdmin CienaWSUserPriv = 2 + CienaWSUserPriv_Value_WaveserverPrivSuper CienaWSUserPriv = 3 + CienaWSUserPriv_Value_WaveserverPrivDiag CienaWSUserPriv = 4 +) + +var CienaWSUserPriv_Strings = map[CienaWSUserPriv]string{ + CienaWSUserPriv_Value_WaveserverPrivLimited: "Waveserver-Priv-Limited", + CienaWSUserPriv_Value_WaveserverPrivAdmin: "Waveserver-Priv-Admin", + CienaWSUserPriv_Value_WaveserverPrivSuper: "Waveserver-Priv-Super", + CienaWSUserPriv_Value_WaveserverPrivDiag: "Waveserver-Priv-Diag", +} + +func (a CienaWSUserPriv) String() string { + if str, ok := CienaWSUserPriv_Strings[a]; ok { + return str + } + return "CienaWSUserPriv(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func CienaWSUserPriv_Add(p *radius.Packet, value CienaWSUserPriv) (err error) { + a := radius.NewInteger(uint32(value)) + return _Ciena_AddVendor(p, 10, a) +} + +func CienaWSUserPriv_Get(p *radius.Packet) (value CienaWSUserPriv) { + value, _ = CienaWSUserPriv_Lookup(p) + return +} + +func CienaWSUserPriv_Gets(p *radius.Packet) (values []CienaWSUserPriv, err error) { + var i uint32 + for _, attr := range _Ciena_GetsVendor(p, 10) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, CienaWSUserPriv(i)) + } + return +} + +func CienaWSUserPriv_Lookup(p *radius.Packet) (value CienaWSUserPriv, err error) { + a, ok := _Ciena_LookupVendor(p, 10) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = CienaWSUserPriv(i) + return +} + +func CienaWSUserPriv_Set(p *radius.Packet, value CienaWSUserPriv) (err error) { + a := radius.NewInteger(uint32(value)) + return _Ciena_SetVendor(p, 10, a) +} + +func CienaWSUserPriv_Del(p *radius.Packet) { + _Ciena_DelVendor(p, 10) +} diff --git a/vendors/ciena6500/dictionary.ciena6500 b/vendors/ciena6500/dictionary.ciena6500 new file mode 100644 index 0000000..333f9a9 --- /dev/null +++ b/vendors/ciena6500/dictionary.ciena6500 @@ -0,0 +1,25 @@ +# Vendor-specific RADIUS dictionary for Ciena6500 +# +VENDOR Ciena6500 562 +BEGIN-VENDOR Ciena6500 +# +# Authentication attributes and values +# + +# We may want these if we enable RADIUS accounting at some point... +ATTRIBUTE Ciena-6500-Last-Login-Time 3 string +ATTRIBUTE Ciena-6500-Last-Login-Location 4 string +ATTRIBUTE Ciena-6500-Failed-Login-Attempts 5 integer +ATTRIBUTE Ciena-6500-Last-Failed-Login-Location 6 string +ATTRIBUTE Ciena-6500-Pwd-Exp-Warn 7 integer + +# Access-Accept Attribute +ATTRIBUTE Ciena-6500-User-Priv-Code 216 integer + +VALUE Ciena-6500-User-Priv-Code UPC-L1-MONITOR 1 +VALUE Ciena-6500-User-Priv-Code UPC-L2-MAINT 2 +VALUE Ciena-6500-User-Priv-Code UPC-L3-PROV 3 +VALUE Ciena-6500-User-Priv-Code UPC-L4-ADMIN 4 +VALUE Ciena-6500-User-Priv-Code UPC-L5-SURVEIL 5 + +END-VENDOR Ciena6500 diff --git a/vendors/ciena6500/generate.go b/vendors/ciena6500/generate.go new file mode 100644 index 0000000..f3bb046 --- /dev/null +++ b/vendors/ciena6500/generate.go @@ -0,0 +1,3 @@ +//go:generate go run ../../cmd/radius-dict-gen/main.go -package ciena6500 -output generated.go dictionary.ciena6500 + +package ciena6500 diff --git a/vendors/ciena6500/generated.go b/vendors/ciena6500/generated.go new file mode 100644 index 0000000..1dd866e --- /dev/null +++ b/vendors/ciena6500/generated.go @@ -0,0 +1,611 @@ +// Code generated by radius-dict-gen. DO NOT EDIT. + +package ciena6500 + +import ( + "strconv" + + "layeh.com/radius" + "layeh.com/radius/rfc2865" +) + +const ( + _Ciena6500_VendorID = 562 +) + +func _Ciena6500_AddVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + var vsa radius.Attribute + vendor := make(radius.Attribute, 2+len(attr)) + vendor[0] = typ + vendor[1] = byte(len(vendor)) + copy(vendor[2:], attr) + vsa, err = radius.NewVendorSpecific(_Ciena6500_VendorID, vendor) + if err != nil { + return + } + p.Add(rfc2865.VendorSpecific_Type, vsa) + return +} + +func _Ciena6500_GetsVendor(p *radius.Packet, typ byte) (values []radius.Attribute) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _Ciena6500_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + values = append(values, vsa[2:int(vsaLen)]) + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _Ciena6500_LookupVendor(p *radius.Packet, typ byte) (attr radius.Attribute, ok bool) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _Ciena6500_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + return vsa[2:int(vsaLen)], true + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _Ciena6500_SetVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _Ciena6500_VendorID { + i++ + continue + } + for j := 0; len(vsa[j:]) >= 3; { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa[j:]) || vsaLen < 3 { + i++ + break + } + if vsaTyp == typ { + vsa = append(vsa[:j], vsa[j+int(vsaLen):]...) + } + j += int(vsaLen) + } + if len(vsa) > 0 { + copy(avp.Attribute[4:], vsa) + i++ + } else { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+i:]...) + } + } + return _Ciena6500_AddVendor(p, typ, attr) +} + +func _Ciena6500_DelVendor(p *radius.Packet, typ byte) { +vsaLoop: + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _Ciena6500_VendorID { + i++ + continue + } + offset := 0 + for len(vsa[offset:]) >= 3 { + vsaTyp, vsaLen := vsa[offset], vsa[offset+1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + continue vsaLoop + } + if vsaTyp == typ { + copy(vsa[offset:], vsa[offset+int(vsaLen):]) + vsa = vsa[:len(vsa)-int(vsaLen)] + } else { + offset += int(vsaLen) + } + } + if offset == 0 { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+1:]...) + } else { + i++ + } + } + return +} + +func Ciena6500LastLoginTime_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena6500_AddVendor(p, 3, a) +} + +func Ciena6500LastLoginTime_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena6500_AddVendor(p, 3, a) +} + +func Ciena6500LastLoginTime_Get(p *radius.Packet) (value []byte) { + value, _ = Ciena6500LastLoginTime_Lookup(p) + return +} + +func Ciena6500LastLoginTime_GetString(p *radius.Packet) (value string) { + value, _ = Ciena6500LastLoginTime_LookupString(p) + return +} + +func Ciena6500LastLoginTime_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Ciena6500_GetsVendor(p, 3) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func Ciena6500LastLoginTime_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Ciena6500_GetsVendor(p, 3) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func Ciena6500LastLoginTime_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Ciena6500_LookupVendor(p, 3) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func Ciena6500LastLoginTime_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Ciena6500_LookupVendor(p, 3) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func Ciena6500LastLoginTime_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena6500_SetVendor(p, 3, a) +} + +func Ciena6500LastLoginTime_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena6500_SetVendor(p, 3, a) +} + +func Ciena6500LastLoginTime_Del(p *radius.Packet) { + _Ciena6500_DelVendor(p, 3) +} + +func Ciena6500LastLoginLocation_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena6500_AddVendor(p, 4, a) +} + +func Ciena6500LastLoginLocation_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena6500_AddVendor(p, 4, a) +} + +func Ciena6500LastLoginLocation_Get(p *radius.Packet) (value []byte) { + value, _ = Ciena6500LastLoginLocation_Lookup(p) + return +} + +func Ciena6500LastLoginLocation_GetString(p *radius.Packet) (value string) { + value, _ = Ciena6500LastLoginLocation_LookupString(p) + return +} + +func Ciena6500LastLoginLocation_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Ciena6500_GetsVendor(p, 4) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func Ciena6500LastLoginLocation_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Ciena6500_GetsVendor(p, 4) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func Ciena6500LastLoginLocation_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Ciena6500_LookupVendor(p, 4) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func Ciena6500LastLoginLocation_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Ciena6500_LookupVendor(p, 4) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func Ciena6500LastLoginLocation_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena6500_SetVendor(p, 4, a) +} + +func Ciena6500LastLoginLocation_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena6500_SetVendor(p, 4, a) +} + +func Ciena6500LastLoginLocation_Del(p *radius.Packet) { + _Ciena6500_DelVendor(p, 4) +} + +type Ciena6500FailedLoginAttempts uint32 + +var Ciena6500FailedLoginAttempts_Strings = map[Ciena6500FailedLoginAttempts]string{} + +func (a Ciena6500FailedLoginAttempts) String() string { + if str, ok := Ciena6500FailedLoginAttempts_Strings[a]; ok { + return str + } + return "Ciena6500FailedLoginAttempts(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func Ciena6500FailedLoginAttempts_Add(p *radius.Packet, value Ciena6500FailedLoginAttempts) (err error) { + a := radius.NewInteger(uint32(value)) + return _Ciena6500_AddVendor(p, 5, a) +} + +func Ciena6500FailedLoginAttempts_Get(p *radius.Packet) (value Ciena6500FailedLoginAttempts) { + value, _ = Ciena6500FailedLoginAttempts_Lookup(p) + return +} + +func Ciena6500FailedLoginAttempts_Gets(p *radius.Packet) (values []Ciena6500FailedLoginAttempts, err error) { + var i uint32 + for _, attr := range _Ciena6500_GetsVendor(p, 5) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, Ciena6500FailedLoginAttempts(i)) + } + return +} + +func Ciena6500FailedLoginAttempts_Lookup(p *radius.Packet) (value Ciena6500FailedLoginAttempts, err error) { + a, ok := _Ciena6500_LookupVendor(p, 5) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = Ciena6500FailedLoginAttempts(i) + return +} + +func Ciena6500FailedLoginAttempts_Set(p *radius.Packet, value Ciena6500FailedLoginAttempts) (err error) { + a := radius.NewInteger(uint32(value)) + return _Ciena6500_SetVendor(p, 5, a) +} + +func Ciena6500FailedLoginAttempts_Del(p *radius.Packet) { + _Ciena6500_DelVendor(p, 5) +} + +func Ciena6500LastFailedLoginLocation_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena6500_AddVendor(p, 6, a) +} + +func Ciena6500LastFailedLoginLocation_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena6500_AddVendor(p, 6, a) +} + +func Ciena6500LastFailedLoginLocation_Get(p *radius.Packet) (value []byte) { + value, _ = Ciena6500LastFailedLoginLocation_Lookup(p) + return +} + +func Ciena6500LastFailedLoginLocation_GetString(p *radius.Packet) (value string) { + value, _ = Ciena6500LastFailedLoginLocation_LookupString(p) + return +} + +func Ciena6500LastFailedLoginLocation_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Ciena6500_GetsVendor(p, 6) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func Ciena6500LastFailedLoginLocation_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Ciena6500_GetsVendor(p, 6) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func Ciena6500LastFailedLoginLocation_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Ciena6500_LookupVendor(p, 6) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func Ciena6500LastFailedLoginLocation_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Ciena6500_LookupVendor(p, 6) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func Ciena6500LastFailedLoginLocation_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Ciena6500_SetVendor(p, 6, a) +} + +func Ciena6500LastFailedLoginLocation_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Ciena6500_SetVendor(p, 6, a) +} + +func Ciena6500LastFailedLoginLocation_Del(p *radius.Packet) { + _Ciena6500_DelVendor(p, 6) +} + +type Ciena6500PwdExpWarn uint32 + +var Ciena6500PwdExpWarn_Strings = map[Ciena6500PwdExpWarn]string{} + +func (a Ciena6500PwdExpWarn) String() string { + if str, ok := Ciena6500PwdExpWarn_Strings[a]; ok { + return str + } + return "Ciena6500PwdExpWarn(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func Ciena6500PwdExpWarn_Add(p *radius.Packet, value Ciena6500PwdExpWarn) (err error) { + a := radius.NewInteger(uint32(value)) + return _Ciena6500_AddVendor(p, 7, a) +} + +func Ciena6500PwdExpWarn_Get(p *radius.Packet) (value Ciena6500PwdExpWarn) { + value, _ = Ciena6500PwdExpWarn_Lookup(p) + return +} + +func Ciena6500PwdExpWarn_Gets(p *radius.Packet) (values []Ciena6500PwdExpWarn, err error) { + var i uint32 + for _, attr := range _Ciena6500_GetsVendor(p, 7) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, Ciena6500PwdExpWarn(i)) + } + return +} + +func Ciena6500PwdExpWarn_Lookup(p *radius.Packet) (value Ciena6500PwdExpWarn, err error) { + a, ok := _Ciena6500_LookupVendor(p, 7) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = Ciena6500PwdExpWarn(i) + return +} + +func Ciena6500PwdExpWarn_Set(p *radius.Packet, value Ciena6500PwdExpWarn) (err error) { + a := radius.NewInteger(uint32(value)) + return _Ciena6500_SetVendor(p, 7, a) +} + +func Ciena6500PwdExpWarn_Del(p *radius.Packet) { + _Ciena6500_DelVendor(p, 7) +} + +type Ciena6500UserPrivCode uint32 + +const ( + Ciena6500UserPrivCode_Value_UPCL1MONITOR Ciena6500UserPrivCode = 1 + Ciena6500UserPrivCode_Value_UPCL2MAINT Ciena6500UserPrivCode = 2 + Ciena6500UserPrivCode_Value_UPCL3PROV Ciena6500UserPrivCode = 3 + Ciena6500UserPrivCode_Value_UPCL4ADMIN Ciena6500UserPrivCode = 4 + Ciena6500UserPrivCode_Value_UPCL5SURVEIL Ciena6500UserPrivCode = 5 +) + +var Ciena6500UserPrivCode_Strings = map[Ciena6500UserPrivCode]string{ + Ciena6500UserPrivCode_Value_UPCL1MONITOR: "UPC-L1-MONITOR", + Ciena6500UserPrivCode_Value_UPCL2MAINT: "UPC-L2-MAINT", + Ciena6500UserPrivCode_Value_UPCL3PROV: "UPC-L3-PROV", + Ciena6500UserPrivCode_Value_UPCL4ADMIN: "UPC-L4-ADMIN", + Ciena6500UserPrivCode_Value_UPCL5SURVEIL: "UPC-L5-SURVEIL", +} + +func (a Ciena6500UserPrivCode) String() string { + if str, ok := Ciena6500UserPrivCode_Strings[a]; ok { + return str + } + return "Ciena6500UserPrivCode(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func Ciena6500UserPrivCode_Add(p *radius.Packet, value Ciena6500UserPrivCode) (err error) { + a := radius.NewInteger(uint32(value)) + return _Ciena6500_AddVendor(p, 216, a) +} + +func Ciena6500UserPrivCode_Get(p *radius.Packet) (value Ciena6500UserPrivCode) { + value, _ = Ciena6500UserPrivCode_Lookup(p) + return +} + +func Ciena6500UserPrivCode_Gets(p *radius.Packet) (values []Ciena6500UserPrivCode, err error) { + var i uint32 + for _, attr := range _Ciena6500_GetsVendor(p, 216) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, Ciena6500UserPrivCode(i)) + } + return +} + +func Ciena6500UserPrivCode_Lookup(p *radius.Packet) (value Ciena6500UserPrivCode, err error) { + a, ok := _Ciena6500_LookupVendor(p, 216) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = Ciena6500UserPrivCode(i) + return +} + +func Ciena6500UserPrivCode_Set(p *radius.Packet, value Ciena6500UserPrivCode) (err error) { + a := radius.NewInteger(uint32(value)) + return _Ciena6500_SetVendor(p, 216, a) +} + +func Ciena6500UserPrivCode_Del(p *radius.Packet) { + _Ciena6500_DelVendor(p, 216) +} diff --git a/vendors/cyan/dictionary.cyan b/vendors/cyan/dictionary.cyan new file mode 100644 index 0000000..46a163f --- /dev/null +++ b/vendors/cyan/dictionary.cyan @@ -0,0 +1,16 @@ +# Vendor-specific RADIUS dictionary for Cyan Inc. +# +VENDOR CyanInc 28533 +BEGIN-VENDOR CyanInc +# +# Authentication attributes and values +# +ATTRIBUTE CyanInc-User-Roles 1 string +# +# Accounting attributes and values +# +ATTRIBUTE CyanInc-Acct-Event-Text 100 string +# +# This line must be last +# +END-VENDOR CyanInc diff --git a/vendors/cyan/generate.go b/vendors/cyan/generate.go new file mode 100644 index 0000000..b07338a --- /dev/null +++ b/vendors/cyan/generate.go @@ -0,0 +1,3 @@ +//go:generate go run ../../cmd/radius-dict-gen/main.go -package cyan -output generated.go dictionary.cyan + +package cyan diff --git a/vendors/cyan/generated.go b/vendors/cyan/generated.go new file mode 100644 index 0000000..9865132 --- /dev/null +++ b/vendors/cyan/generated.go @@ -0,0 +1,330 @@ +// Code generated by radius-dict-gen. DO NOT EDIT. + +package cyan + +import ( + "layeh.com/radius" + "layeh.com/radius/rfc2865" +) + +const ( + _CyanInc_VendorID = 28533 +) + +func _CyanInc_AddVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + var vsa radius.Attribute + vendor := make(radius.Attribute, 2+len(attr)) + vendor[0] = typ + vendor[1] = byte(len(vendor)) + copy(vendor[2:], attr) + vsa, err = radius.NewVendorSpecific(_CyanInc_VendorID, vendor) + if err != nil { + return + } + p.Add(rfc2865.VendorSpecific_Type, vsa) + return +} + +func _CyanInc_GetsVendor(p *radius.Packet, typ byte) (values []radius.Attribute) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _CyanInc_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + values = append(values, vsa[2:int(vsaLen)]) + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _CyanInc_LookupVendor(p *radius.Packet, typ byte) (attr radius.Attribute, ok bool) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _CyanInc_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + return vsa[2:int(vsaLen)], true + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _CyanInc_SetVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _CyanInc_VendorID { + i++ + continue + } + for j := 0; len(vsa[j:]) >= 3; { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa[j:]) || vsaLen < 3 { + i++ + break + } + if vsaTyp == typ { + vsa = append(vsa[:j], vsa[j+int(vsaLen):]...) + } + j += int(vsaLen) + } + if len(vsa) > 0 { + copy(avp.Attribute[4:], vsa) + i++ + } else { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+i:]...) + } + } + return _CyanInc_AddVendor(p, typ, attr) +} + +func _CyanInc_DelVendor(p *radius.Packet, typ byte) { +vsaLoop: + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _CyanInc_VendorID { + i++ + continue + } + offset := 0 + for len(vsa[offset:]) >= 3 { + vsaTyp, vsaLen := vsa[offset], vsa[offset+1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + continue vsaLoop + } + if vsaTyp == typ { + copy(vsa[offset:], vsa[offset+int(vsaLen):]) + vsa = vsa[:len(vsa)-int(vsaLen)] + } else { + offset += int(vsaLen) + } + } + if offset == 0 { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+1:]...) + } else { + i++ + } + } + return +} + +func CyanIncUserRoles_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _CyanInc_AddVendor(p, 1, a) +} + +func CyanIncUserRoles_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _CyanInc_AddVendor(p, 1, a) +} + +func CyanIncUserRoles_Get(p *radius.Packet) (value []byte) { + value, _ = CyanIncUserRoles_Lookup(p) + return +} + +func CyanIncUserRoles_GetString(p *radius.Packet) (value string) { + value, _ = CyanIncUserRoles_LookupString(p) + return +} + +func CyanIncUserRoles_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _CyanInc_GetsVendor(p, 1) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func CyanIncUserRoles_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _CyanInc_GetsVendor(p, 1) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func CyanIncUserRoles_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _CyanInc_LookupVendor(p, 1) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func CyanIncUserRoles_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _CyanInc_LookupVendor(p, 1) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func CyanIncUserRoles_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _CyanInc_SetVendor(p, 1, a) +} + +func CyanIncUserRoles_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _CyanInc_SetVendor(p, 1, a) +} + +func CyanIncUserRoles_Del(p *radius.Packet) { + _CyanInc_DelVendor(p, 1) +} + +func CyanIncAcctEventText_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _CyanInc_AddVendor(p, 100, a) +} + +func CyanIncAcctEventText_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _CyanInc_AddVendor(p, 100, a) +} + +func CyanIncAcctEventText_Get(p *radius.Packet) (value []byte) { + value, _ = CyanIncAcctEventText_Lookup(p) + return +} + +func CyanIncAcctEventText_GetString(p *radius.Packet) (value string) { + value, _ = CyanIncAcctEventText_LookupString(p) + return +} + +func CyanIncAcctEventText_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _CyanInc_GetsVendor(p, 100) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func CyanIncAcctEventText_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _CyanInc_GetsVendor(p, 100) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func CyanIncAcctEventText_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _CyanInc_LookupVendor(p, 100) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func CyanIncAcctEventText_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _CyanInc_LookupVendor(p, 100) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func CyanIncAcctEventText_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _CyanInc_SetVendor(p, 100, a) +} + +func CyanIncAcctEventText_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _CyanInc_SetVendor(p, 100, a) +} + +func CyanIncAcctEventText_Del(p *radius.Packet) { + _CyanInc_DelVendor(p, 100) +} diff --git a/vendors/infinera/dictionary.infinera b/vendors/infinera/dictionary.infinera new file mode 100644 index 0000000..b601db5 --- /dev/null +++ b/vendors/infinera/dictionary.infinera @@ -0,0 +1,89 @@ +# +# Infinera Attributes File +# + +ATTRIBUTE User-Name 1 string +ATTRIBUTE User-Password 2 string encrypt=1 +ATTRIBUTE Reply-Message 18 string + +VENDOR Infinera 21296 +BEGIN-VENDOR Infinera + +ATTRIBUTE Infinera-User-Priv-SA 1 integer +ATTRIBUTE Infinera-User-Priv-NA 2 integer +ATTRIBUTE Infinera-User-Priv-NE 3 integer +ATTRIBUTE Infinera-User-Priv-PR 4 integer +ATTRIBUTE Infinera-User-Priv-TT 5 integer +ATTRIBUTE Infinera-User-Priv-MA 6 integer +ATTRIBUTE Infinera-User-Priv-RA 7 integer +ATTRIBUTE Infinera-User-Priv-EA 8 integer +ATTRIBUTE Infinera-User-AdminDomain 100 string +ATTRIBUTE Infinera-User-Max-Concurrent-Session 101 integer +ATTRIBUTE Infinera-User-Allowed-Timezone-Config 102 integer +ATTRIBUTE Infinera-User-TimeZone 103 string + +ATTRIBUTE Infinera-User-Email-ID 110 string +ATTRIBUTE Infinera-User-Email-Notification 111 integer +ATTRIBUTE Infinera-User-Email-Alarm-Type 112 integer +ATTRIBUTE Infinera-User-Email-Filter-Name 113 string +ATTRIBUTE Infinera-User-Email-AdminDomain 114 string + +ATTRIBUTE Infinera-User-SessionTimeout 17 integer +ATTRIBUTE Infinera-User-LockedOut 19 integer +ATTRIBUTE Infinera-User-CanUseResSession 20 integer + +ATTRIBUTE Infinera-User-MgmtType-EMS 33 integer +ATTRIBUTE Infinera-User-MgmtType-GNM 34 integer +ATTRIBUTE Infinera-User-MgmtType-TL1 35 integer +ATTRIBUTE Infinera-User-MgmtType-CLI 36 integer +ATTRIBUTE Infinera-User-MgmtType-NETCONF 37 integer + +ATTRIBUTE Infinera-Rsvd-Str-Attribute1 240 string +ATTRIBUTE Infinera-Rsvd-Str-Attribute2 241 string +ATTRIBUTE Infinera-Rsvd-Int-Attribute1 249 integer +ATTRIBUTE Infinera-Rsvd-Int-Attribute2 250 integer + +VALUE Infinera-User-Priv-SA SA-NONPRIVILEGED 0 +VALUE Infinera-User-Priv-SA SA-PRIVILEGED 1 +VALUE Infinera-User-Priv-NA NA-NONPRIVILEGED 0 +VALUE Infinera-User-Priv-NA NA-PRIVILEGED 1 +VALUE Infinera-User-Priv-NE NE-NONPRIVILEGED 0 +VALUE Infinera-User-Priv-NE NE-PRIVILEGED 1 +VALUE Infinera-User-Priv-PR PR-NONPRIVILEGED 0 +VALUE Infinera-User-Priv-PR PR-PRIVILEGED 1 +VALUE Infinera-User-Priv-TT TT-NONPRIVILEGED 0 +VALUE Infinera-User-Priv-TT TT-PRIVILEGED 1 +VALUE Infinera-User-Priv-MA MA-NONPRIVILEGED 0 +VALUE Infinera-User-Priv-MA MA-PRIVILEGED 1 +VALUE Infinera-User-Priv-RA RA-NONPRIVILEGED 0 +VALUE Infinera-User-Priv-RA RA-PRIVILEGED 1 +VALUE Infinera-User-Priv-EA EA-NONPRIVILEGED 0 +VALUE Infinera-User-Priv-EA EA-PRIVILEGED 1 + + +VALUE Infinera-User-Allowed-Timezone-Config TIMEZONE-CONFIG-ALLOW 1 +VALUE Infinera-User-Allowed-Timezone-Config TIMEZONE-CONFIG-NOT-ALLOW 0 + +VALUE Infinera-User-Email-Notification EMAIL-NOTIFICATION-ENABLE 1 +VALUE Infinera-User-Email-Notification EMAIL-NOTIFICATION-DISABLE 0 +VALUE Infinera-User-Email-Alarm-Type EMAIL-ALARM-TYPE-ALL 0 +VALUE Infinera-User-Email-Alarm-Type EMAIL-ALARM-TYPE-NEW 1 +VALUE Infinera-User-Email-Alarm-Type EMAIL-ALARM-TYPE-CLEAR 2 + +VALUE Infinera-User-CanUseResSession CANNOT-USE-RES-SESSION 0 +VALUE Infinera-User-CanUseResSession CAN-USE-RES-SESSION 1 + +VALUE Infinera-User-MgmtType-EMS MGMTTYPE-EMS-DISALLOWED 0 +VALUE Infinera-User-MgmtType-EMS MGMTTYPE-EMS-ALLOWED 1 +VALUE Infinera-User-MgmtType-TL1 MGMTTYPE-TL1-DISALLOWED 0 +VALUE Infinera-User-MgmtType-TL1 MGMTTYPE-TL1-ALLOWED 1 +VALUE Infinera-User-MgmtType-GNM MGMTTYPE-GNM-DISALLOWED 0 +VALUE Infinera-User-MgmtType-GNM MGMTTYPE-GNM-ALLOWED 1 +VALUE Infinera-User-MgmtType-CLI MGMTTYPE-CLI-DISALLOWED 0 +VALUE Infinera-User-MgmtType-CLI MGMTTYPE-CLI-ALLOWED 1 +VALUE Infinera-User-MgmtType-NETCONF MGMTTYPE-NETCONF-DISALLOWED 0 +VALUE Infinera-User-MgmtType-NETCONF MGMTTYPE-NETCONF-ALLOWED 1 + +VALUE Infinera-Rsvd-Int-Attribute1 INFINERA 1 + +END-VENDOR Infinera diff --git a/vendors/infinera/generate.go b/vendors/infinera/generate.go new file mode 100644 index 0000000..359c2f6 --- /dev/null +++ b/vendors/infinera/generate.go @@ -0,0 +1,3 @@ +//go:generate go run ../../cmd/radius-dict-gen/main.go -package infinera -output generated.go dictionary.infinera + +package infinera diff --git a/vendors/infinera/generated.go b/vendors/infinera/generated.go new file mode 100644 index 0000000..2828040 --- /dev/null +++ b/vendors/infinera/generated.go @@ -0,0 +1,2532 @@ +// Code generated by radius-dict-gen. DO NOT EDIT. + +package infinera + +import ( + "strconv" + + "layeh.com/radius" + "layeh.com/radius/rfc2865" +) + +const ( + UserName_Type radius.Type = 1 + UserPassword_Type radius.Type = 2 + ReplyMessage_Type radius.Type = 18 +) + +const ( + _Infinera_VendorID = 21296 +) + +func UserName_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + p.Add(UserName_Type, a) + return +} + +func UserName_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + p.Add(UserName_Type, a) + return +} + +func UserName_Get(p *radius.Packet) (value []byte) { + value, _ = UserName_Lookup(p) + return +} + +func UserName_GetString(p *radius.Packet) (value string) { + value, _ = UserName_LookupString(p) + return +} + +func UserName_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, avp := range p.Attributes { + if avp.Type != UserName_Type { + continue + } + attr := avp.Attribute + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func UserName_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, avp := range p.Attributes { + if avp.Type != UserName_Type { + continue + } + attr := avp.Attribute + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func UserName_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := p.Lookup(UserName_Type) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func UserName_LookupString(p *radius.Packet) (value string, err error) { + a, ok := p.Lookup(UserName_Type) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func UserName_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + p.Set(UserName_Type, a) + return +} + +func UserName_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + p.Set(UserName_Type, a) + return +} + +func UserName_Del(p *radius.Packet) { + p.Attributes.Del(UserName_Type) +} + +func UserPassword_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewUserPassword(value, p.Secret, p.Authenticator[:]) + if err != nil { + return + } + p.Add(UserPassword_Type, a) + return +} + +func UserPassword_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewUserPassword([]byte(value), p.Secret, p.Authenticator[:]) + if err != nil { + return + } + p.Add(UserPassword_Type, a) + return +} + +func UserPassword_Get(p *radius.Packet) (value []byte) { + value, _ = UserPassword_Lookup(p) + return +} + +func UserPassword_GetString(p *radius.Packet) (value string) { + value, _ = UserPassword_LookupString(p) + return +} + +func UserPassword_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, avp := range p.Attributes { + if avp.Type != UserPassword_Type { + continue + } + attr := avp.Attribute + i, err = radius.UserPassword(attr, p.Secret, p.Authenticator[:]) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func UserPassword_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, avp := range p.Attributes { + if avp.Type != UserPassword_Type { + continue + } + attr := avp.Attribute + var up []byte + up, err = radius.UserPassword(attr, p.Secret, p.Authenticator[:]) + if err == nil { + i = string(up) + } + if err != nil { + return + } + values = append(values, i) + } + return +} + +func UserPassword_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := p.Lookup(UserPassword_Type) + if !ok { + err = radius.ErrNoAttribute + return + } + value, err = radius.UserPassword(a, p.Secret, p.Authenticator[:]) + return +} + +func UserPassword_LookupString(p *radius.Packet) (value string, err error) { + a, ok := p.Lookup(UserPassword_Type) + if !ok { + err = radius.ErrNoAttribute + return + } + var b []byte + b, err = radius.UserPassword(a, p.Secret, p.Authenticator[:]) + if err == nil { + value = string(b) + } + return +} + +func UserPassword_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewUserPassword(value, p.Secret, p.Authenticator[:]) + if err != nil { + return + } + p.Set(UserPassword_Type, a) + return +} + +func UserPassword_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewUserPassword([]byte(value), p.Secret, p.Authenticator[:]) + if err != nil { + return + } + p.Set(UserPassword_Type, a) + return +} + +func UserPassword_Del(p *radius.Packet) { + p.Attributes.Del(UserPassword_Type) +} + +func ReplyMessage_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + p.Add(ReplyMessage_Type, a) + return +} + +func ReplyMessage_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + p.Add(ReplyMessage_Type, a) + return +} + +func ReplyMessage_Get(p *radius.Packet) (value []byte) { + value, _ = ReplyMessage_Lookup(p) + return +} + +func ReplyMessage_GetString(p *radius.Packet) (value string) { + value, _ = ReplyMessage_LookupString(p) + return +} + +func ReplyMessage_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, avp := range p.Attributes { + if avp.Type != ReplyMessage_Type { + continue + } + attr := avp.Attribute + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func ReplyMessage_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, avp := range p.Attributes { + if avp.Type != ReplyMessage_Type { + continue + } + attr := avp.Attribute + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func ReplyMessage_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := p.Lookup(ReplyMessage_Type) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func ReplyMessage_LookupString(p *radius.Packet) (value string, err error) { + a, ok := p.Lookup(ReplyMessage_Type) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func ReplyMessage_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + p.Set(ReplyMessage_Type, a) + return +} + +func ReplyMessage_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + p.Set(ReplyMessage_Type, a) + return +} + +func ReplyMessage_Del(p *radius.Packet) { + p.Attributes.Del(ReplyMessage_Type) +} + +func _Infinera_AddVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + var vsa radius.Attribute + vendor := make(radius.Attribute, 2+len(attr)) + vendor[0] = typ + vendor[1] = byte(len(vendor)) + copy(vendor[2:], attr) + vsa, err = radius.NewVendorSpecific(_Infinera_VendorID, vendor) + if err != nil { + return + } + p.Add(rfc2865.VendorSpecific_Type, vsa) + return +} + +func _Infinera_GetsVendor(p *radius.Packet, typ byte) (values []radius.Attribute) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _Infinera_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + values = append(values, vsa[2:int(vsaLen)]) + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _Infinera_LookupVendor(p *radius.Packet, typ byte) (attr radius.Attribute, ok bool) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _Infinera_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + return vsa[2:int(vsaLen)], true + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _Infinera_SetVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _Infinera_VendorID { + i++ + continue + } + for j := 0; len(vsa[j:]) >= 3; { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa[j:]) || vsaLen < 3 { + i++ + break + } + if vsaTyp == typ { + vsa = append(vsa[:j], vsa[j+int(vsaLen):]...) + } + j += int(vsaLen) + } + if len(vsa) > 0 { + copy(avp.Attribute[4:], vsa) + i++ + } else { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+i:]...) + } + } + return _Infinera_AddVendor(p, typ, attr) +} + +func _Infinera_DelVendor(p *radius.Packet, typ byte) { +vsaLoop: + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _Infinera_VendorID { + i++ + continue + } + offset := 0 + for len(vsa[offset:]) >= 3 { + vsaTyp, vsaLen := vsa[offset], vsa[offset+1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + continue vsaLoop + } + if vsaTyp == typ { + copy(vsa[offset:], vsa[offset+int(vsaLen):]) + vsa = vsa[:len(vsa)-int(vsaLen)] + } else { + offset += int(vsaLen) + } + } + if offset == 0 { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+1:]...) + } else { + i++ + } + } + return +} + +type InfineraUserPrivSA uint32 + +const ( + InfineraUserPrivSA_Value_SANONPRIVILEGED InfineraUserPrivSA = 0 + InfineraUserPrivSA_Value_SAPRIVILEGED InfineraUserPrivSA = 1 +) + +var InfineraUserPrivSA_Strings = map[InfineraUserPrivSA]string{ + InfineraUserPrivSA_Value_SANONPRIVILEGED: "SA-NONPRIVILEGED", + InfineraUserPrivSA_Value_SAPRIVILEGED: "SA-PRIVILEGED", +} + +func (a InfineraUserPrivSA) String() string { + if str, ok := InfineraUserPrivSA_Strings[a]; ok { + return str + } + return "InfineraUserPrivSA(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserPrivSA_Add(p *radius.Packet, value InfineraUserPrivSA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 1, a) +} + +func InfineraUserPrivSA_Get(p *radius.Packet) (value InfineraUserPrivSA) { + value, _ = InfineraUserPrivSA_Lookup(p) + return +} + +func InfineraUserPrivSA_Gets(p *radius.Packet) (values []InfineraUserPrivSA, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 1) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserPrivSA(i)) + } + return +} + +func InfineraUserPrivSA_Lookup(p *radius.Packet) (value InfineraUserPrivSA, err error) { + a, ok := _Infinera_LookupVendor(p, 1) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserPrivSA(i) + return +} + +func InfineraUserPrivSA_Set(p *radius.Packet, value InfineraUserPrivSA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 1, a) +} + +func InfineraUserPrivSA_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 1) +} + +type InfineraUserPrivNA uint32 + +const ( + InfineraUserPrivNA_Value_NANONPRIVILEGED InfineraUserPrivNA = 0 + InfineraUserPrivNA_Value_NAPRIVILEGED InfineraUserPrivNA = 1 +) + +var InfineraUserPrivNA_Strings = map[InfineraUserPrivNA]string{ + InfineraUserPrivNA_Value_NANONPRIVILEGED: "NA-NONPRIVILEGED", + InfineraUserPrivNA_Value_NAPRIVILEGED: "NA-PRIVILEGED", +} + +func (a InfineraUserPrivNA) String() string { + if str, ok := InfineraUserPrivNA_Strings[a]; ok { + return str + } + return "InfineraUserPrivNA(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserPrivNA_Add(p *radius.Packet, value InfineraUserPrivNA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 2, a) +} + +func InfineraUserPrivNA_Get(p *radius.Packet) (value InfineraUserPrivNA) { + value, _ = InfineraUserPrivNA_Lookup(p) + return +} + +func InfineraUserPrivNA_Gets(p *radius.Packet) (values []InfineraUserPrivNA, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 2) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserPrivNA(i)) + } + return +} + +func InfineraUserPrivNA_Lookup(p *radius.Packet) (value InfineraUserPrivNA, err error) { + a, ok := _Infinera_LookupVendor(p, 2) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserPrivNA(i) + return +} + +func InfineraUserPrivNA_Set(p *radius.Packet, value InfineraUserPrivNA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 2, a) +} + +func InfineraUserPrivNA_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 2) +} + +type InfineraUserPrivNE uint32 + +const ( + InfineraUserPrivNE_Value_NENONPRIVILEGED InfineraUserPrivNE = 0 + InfineraUserPrivNE_Value_NEPRIVILEGED InfineraUserPrivNE = 1 +) + +var InfineraUserPrivNE_Strings = map[InfineraUserPrivNE]string{ + InfineraUserPrivNE_Value_NENONPRIVILEGED: "NE-NONPRIVILEGED", + InfineraUserPrivNE_Value_NEPRIVILEGED: "NE-PRIVILEGED", +} + +func (a InfineraUserPrivNE) String() string { + if str, ok := InfineraUserPrivNE_Strings[a]; ok { + return str + } + return "InfineraUserPrivNE(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserPrivNE_Add(p *radius.Packet, value InfineraUserPrivNE) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 3, a) +} + +func InfineraUserPrivNE_Get(p *radius.Packet) (value InfineraUserPrivNE) { + value, _ = InfineraUserPrivNE_Lookup(p) + return +} + +func InfineraUserPrivNE_Gets(p *radius.Packet) (values []InfineraUserPrivNE, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 3) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserPrivNE(i)) + } + return +} + +func InfineraUserPrivNE_Lookup(p *radius.Packet) (value InfineraUserPrivNE, err error) { + a, ok := _Infinera_LookupVendor(p, 3) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserPrivNE(i) + return +} + +func InfineraUserPrivNE_Set(p *radius.Packet, value InfineraUserPrivNE) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 3, a) +} + +func InfineraUserPrivNE_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 3) +} + +type InfineraUserPrivPR uint32 + +const ( + InfineraUserPrivPR_Value_PRNONPRIVILEGED InfineraUserPrivPR = 0 + InfineraUserPrivPR_Value_PRPRIVILEGED InfineraUserPrivPR = 1 +) + +var InfineraUserPrivPR_Strings = map[InfineraUserPrivPR]string{ + InfineraUserPrivPR_Value_PRNONPRIVILEGED: "PR-NONPRIVILEGED", + InfineraUserPrivPR_Value_PRPRIVILEGED: "PR-PRIVILEGED", +} + +func (a InfineraUserPrivPR) String() string { + if str, ok := InfineraUserPrivPR_Strings[a]; ok { + return str + } + return "InfineraUserPrivPR(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserPrivPR_Add(p *radius.Packet, value InfineraUserPrivPR) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 4, a) +} + +func InfineraUserPrivPR_Get(p *radius.Packet) (value InfineraUserPrivPR) { + value, _ = InfineraUserPrivPR_Lookup(p) + return +} + +func InfineraUserPrivPR_Gets(p *radius.Packet) (values []InfineraUserPrivPR, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 4) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserPrivPR(i)) + } + return +} + +func InfineraUserPrivPR_Lookup(p *radius.Packet) (value InfineraUserPrivPR, err error) { + a, ok := _Infinera_LookupVendor(p, 4) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserPrivPR(i) + return +} + +func InfineraUserPrivPR_Set(p *radius.Packet, value InfineraUserPrivPR) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 4, a) +} + +func InfineraUserPrivPR_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 4) +} + +type InfineraUserPrivTT uint32 + +const ( + InfineraUserPrivTT_Value_TTNONPRIVILEGED InfineraUserPrivTT = 0 + InfineraUserPrivTT_Value_TTPRIVILEGED InfineraUserPrivTT = 1 +) + +var InfineraUserPrivTT_Strings = map[InfineraUserPrivTT]string{ + InfineraUserPrivTT_Value_TTNONPRIVILEGED: "TT-NONPRIVILEGED", + InfineraUserPrivTT_Value_TTPRIVILEGED: "TT-PRIVILEGED", +} + +func (a InfineraUserPrivTT) String() string { + if str, ok := InfineraUserPrivTT_Strings[a]; ok { + return str + } + return "InfineraUserPrivTT(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserPrivTT_Add(p *radius.Packet, value InfineraUserPrivTT) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 5, a) +} + +func InfineraUserPrivTT_Get(p *radius.Packet) (value InfineraUserPrivTT) { + value, _ = InfineraUserPrivTT_Lookup(p) + return +} + +func InfineraUserPrivTT_Gets(p *radius.Packet) (values []InfineraUserPrivTT, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 5) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserPrivTT(i)) + } + return +} + +func InfineraUserPrivTT_Lookup(p *radius.Packet) (value InfineraUserPrivTT, err error) { + a, ok := _Infinera_LookupVendor(p, 5) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserPrivTT(i) + return +} + +func InfineraUserPrivTT_Set(p *radius.Packet, value InfineraUserPrivTT) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 5, a) +} + +func InfineraUserPrivTT_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 5) +} + +type InfineraUserPrivMA uint32 + +const ( + InfineraUserPrivMA_Value_MANONPRIVILEGED InfineraUserPrivMA = 0 + InfineraUserPrivMA_Value_MAPRIVILEGED InfineraUserPrivMA = 1 +) + +var InfineraUserPrivMA_Strings = map[InfineraUserPrivMA]string{ + InfineraUserPrivMA_Value_MANONPRIVILEGED: "MA-NONPRIVILEGED", + InfineraUserPrivMA_Value_MAPRIVILEGED: "MA-PRIVILEGED", +} + +func (a InfineraUserPrivMA) String() string { + if str, ok := InfineraUserPrivMA_Strings[a]; ok { + return str + } + return "InfineraUserPrivMA(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserPrivMA_Add(p *radius.Packet, value InfineraUserPrivMA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 6, a) +} + +func InfineraUserPrivMA_Get(p *radius.Packet) (value InfineraUserPrivMA) { + value, _ = InfineraUserPrivMA_Lookup(p) + return +} + +func InfineraUserPrivMA_Gets(p *radius.Packet) (values []InfineraUserPrivMA, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 6) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserPrivMA(i)) + } + return +} + +func InfineraUserPrivMA_Lookup(p *radius.Packet) (value InfineraUserPrivMA, err error) { + a, ok := _Infinera_LookupVendor(p, 6) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserPrivMA(i) + return +} + +func InfineraUserPrivMA_Set(p *radius.Packet, value InfineraUserPrivMA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 6, a) +} + +func InfineraUserPrivMA_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 6) +} + +type InfineraUserPrivRA uint32 + +const ( + InfineraUserPrivRA_Value_RANONPRIVILEGED InfineraUserPrivRA = 0 + InfineraUserPrivRA_Value_RAPRIVILEGED InfineraUserPrivRA = 1 +) + +var InfineraUserPrivRA_Strings = map[InfineraUserPrivRA]string{ + InfineraUserPrivRA_Value_RANONPRIVILEGED: "RA-NONPRIVILEGED", + InfineraUserPrivRA_Value_RAPRIVILEGED: "RA-PRIVILEGED", +} + +func (a InfineraUserPrivRA) String() string { + if str, ok := InfineraUserPrivRA_Strings[a]; ok { + return str + } + return "InfineraUserPrivRA(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserPrivRA_Add(p *radius.Packet, value InfineraUserPrivRA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 7, a) +} + +func InfineraUserPrivRA_Get(p *radius.Packet) (value InfineraUserPrivRA) { + value, _ = InfineraUserPrivRA_Lookup(p) + return +} + +func InfineraUserPrivRA_Gets(p *radius.Packet) (values []InfineraUserPrivRA, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 7) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserPrivRA(i)) + } + return +} + +func InfineraUserPrivRA_Lookup(p *radius.Packet) (value InfineraUserPrivRA, err error) { + a, ok := _Infinera_LookupVendor(p, 7) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserPrivRA(i) + return +} + +func InfineraUserPrivRA_Set(p *radius.Packet, value InfineraUserPrivRA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 7, a) +} + +func InfineraUserPrivRA_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 7) +} + +type InfineraUserPrivEA uint32 + +const ( + InfineraUserPrivEA_Value_EANONPRIVILEGED InfineraUserPrivEA = 0 + InfineraUserPrivEA_Value_EAPRIVILEGED InfineraUserPrivEA = 1 +) + +var InfineraUserPrivEA_Strings = map[InfineraUserPrivEA]string{ + InfineraUserPrivEA_Value_EANONPRIVILEGED: "EA-NONPRIVILEGED", + InfineraUserPrivEA_Value_EAPRIVILEGED: "EA-PRIVILEGED", +} + +func (a InfineraUserPrivEA) String() string { + if str, ok := InfineraUserPrivEA_Strings[a]; ok { + return str + } + return "InfineraUserPrivEA(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserPrivEA_Add(p *radius.Packet, value InfineraUserPrivEA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 8, a) +} + +func InfineraUserPrivEA_Get(p *radius.Packet) (value InfineraUserPrivEA) { + value, _ = InfineraUserPrivEA_Lookup(p) + return +} + +func InfineraUserPrivEA_Gets(p *radius.Packet) (values []InfineraUserPrivEA, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 8) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserPrivEA(i)) + } + return +} + +func InfineraUserPrivEA_Lookup(p *radius.Packet) (value InfineraUserPrivEA, err error) { + a, ok := _Infinera_LookupVendor(p, 8) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserPrivEA(i) + return +} + +func InfineraUserPrivEA_Set(p *radius.Packet, value InfineraUserPrivEA) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 8, a) +} + +func InfineraUserPrivEA_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 8) +} + +func InfineraUserAdminDomain_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 100, a) +} + +func InfineraUserAdminDomain_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 100, a) +} + +func InfineraUserAdminDomain_Get(p *radius.Packet) (value []byte) { + value, _ = InfineraUserAdminDomain_Lookup(p) + return +} + +func InfineraUserAdminDomain_GetString(p *radius.Packet) (value string) { + value, _ = InfineraUserAdminDomain_LookupString(p) + return +} + +func InfineraUserAdminDomain_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Infinera_GetsVendor(p, 100) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserAdminDomain_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Infinera_GetsVendor(p, 100) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserAdminDomain_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Infinera_LookupVendor(p, 100) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func InfineraUserAdminDomain_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Infinera_LookupVendor(p, 100) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func InfineraUserAdminDomain_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 100, a) +} + +func InfineraUserAdminDomain_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 100, a) +} + +func InfineraUserAdminDomain_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 100) +} + +type InfineraUserMaxConcurrentSession uint32 + +var InfineraUserMaxConcurrentSession_Strings = map[InfineraUserMaxConcurrentSession]string{} + +func (a InfineraUserMaxConcurrentSession) String() string { + if str, ok := InfineraUserMaxConcurrentSession_Strings[a]; ok { + return str + } + return "InfineraUserMaxConcurrentSession(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserMaxConcurrentSession_Add(p *radius.Packet, value InfineraUserMaxConcurrentSession) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 101, a) +} + +func InfineraUserMaxConcurrentSession_Get(p *radius.Packet) (value InfineraUserMaxConcurrentSession) { + value, _ = InfineraUserMaxConcurrentSession_Lookup(p) + return +} + +func InfineraUserMaxConcurrentSession_Gets(p *radius.Packet) (values []InfineraUserMaxConcurrentSession, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 101) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserMaxConcurrentSession(i)) + } + return +} + +func InfineraUserMaxConcurrentSession_Lookup(p *radius.Packet) (value InfineraUserMaxConcurrentSession, err error) { + a, ok := _Infinera_LookupVendor(p, 101) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserMaxConcurrentSession(i) + return +} + +func InfineraUserMaxConcurrentSession_Set(p *radius.Packet, value InfineraUserMaxConcurrentSession) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 101, a) +} + +func InfineraUserMaxConcurrentSession_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 101) +} + +type InfineraUserAllowedTimezoneConfig uint32 + +const ( + InfineraUserAllowedTimezoneConfig_Value_TIMEZONECONFIGNOTALLOW InfineraUserAllowedTimezoneConfig = 0 + InfineraUserAllowedTimezoneConfig_Value_TIMEZONECONFIGALLOW InfineraUserAllowedTimezoneConfig = 1 +) + +var InfineraUserAllowedTimezoneConfig_Strings = map[InfineraUserAllowedTimezoneConfig]string{ + InfineraUserAllowedTimezoneConfig_Value_TIMEZONECONFIGNOTALLOW: "TIMEZONE-CONFIG-NOT-ALLOW", + InfineraUserAllowedTimezoneConfig_Value_TIMEZONECONFIGALLOW: "TIMEZONE-CONFIG-ALLOW", +} + +func (a InfineraUserAllowedTimezoneConfig) String() string { + if str, ok := InfineraUserAllowedTimezoneConfig_Strings[a]; ok { + return str + } + return "InfineraUserAllowedTimezoneConfig(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserAllowedTimezoneConfig_Add(p *radius.Packet, value InfineraUserAllowedTimezoneConfig) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 102, a) +} + +func InfineraUserAllowedTimezoneConfig_Get(p *radius.Packet) (value InfineraUserAllowedTimezoneConfig) { + value, _ = InfineraUserAllowedTimezoneConfig_Lookup(p) + return +} + +func InfineraUserAllowedTimezoneConfig_Gets(p *radius.Packet) (values []InfineraUserAllowedTimezoneConfig, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 102) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserAllowedTimezoneConfig(i)) + } + return +} + +func InfineraUserAllowedTimezoneConfig_Lookup(p *radius.Packet) (value InfineraUserAllowedTimezoneConfig, err error) { + a, ok := _Infinera_LookupVendor(p, 102) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserAllowedTimezoneConfig(i) + return +} + +func InfineraUserAllowedTimezoneConfig_Set(p *radius.Packet, value InfineraUserAllowedTimezoneConfig) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 102, a) +} + +func InfineraUserAllowedTimezoneConfig_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 102) +} + +func InfineraUserTimeZone_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 103, a) +} + +func InfineraUserTimeZone_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 103, a) +} + +func InfineraUserTimeZone_Get(p *radius.Packet) (value []byte) { + value, _ = InfineraUserTimeZone_Lookup(p) + return +} + +func InfineraUserTimeZone_GetString(p *radius.Packet) (value string) { + value, _ = InfineraUserTimeZone_LookupString(p) + return +} + +func InfineraUserTimeZone_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Infinera_GetsVendor(p, 103) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserTimeZone_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Infinera_GetsVendor(p, 103) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserTimeZone_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Infinera_LookupVendor(p, 103) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func InfineraUserTimeZone_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Infinera_LookupVendor(p, 103) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func InfineraUserTimeZone_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 103, a) +} + +func InfineraUserTimeZone_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 103, a) +} + +func InfineraUserTimeZone_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 103) +} + +func InfineraUserEmailID_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 110, a) +} + +func InfineraUserEmailID_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 110, a) +} + +func InfineraUserEmailID_Get(p *radius.Packet) (value []byte) { + value, _ = InfineraUserEmailID_Lookup(p) + return +} + +func InfineraUserEmailID_GetString(p *radius.Packet) (value string) { + value, _ = InfineraUserEmailID_LookupString(p) + return +} + +func InfineraUserEmailID_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Infinera_GetsVendor(p, 110) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserEmailID_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Infinera_GetsVendor(p, 110) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserEmailID_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Infinera_LookupVendor(p, 110) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func InfineraUserEmailID_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Infinera_LookupVendor(p, 110) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func InfineraUserEmailID_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 110, a) +} + +func InfineraUserEmailID_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 110, a) +} + +func InfineraUserEmailID_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 110) +} + +type InfineraUserEmailNotification uint32 + +const ( + InfineraUserEmailNotification_Value_EMAILNOTIFICATIONDISABLE InfineraUserEmailNotification = 0 + InfineraUserEmailNotification_Value_EMAILNOTIFICATIONENABLE InfineraUserEmailNotification = 1 +) + +var InfineraUserEmailNotification_Strings = map[InfineraUserEmailNotification]string{ + InfineraUserEmailNotification_Value_EMAILNOTIFICATIONDISABLE: "EMAIL-NOTIFICATION-DISABLE", + InfineraUserEmailNotification_Value_EMAILNOTIFICATIONENABLE: "EMAIL-NOTIFICATION-ENABLE", +} + +func (a InfineraUserEmailNotification) String() string { + if str, ok := InfineraUserEmailNotification_Strings[a]; ok { + return str + } + return "InfineraUserEmailNotification(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserEmailNotification_Add(p *radius.Packet, value InfineraUserEmailNotification) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 111, a) +} + +func InfineraUserEmailNotification_Get(p *radius.Packet) (value InfineraUserEmailNotification) { + value, _ = InfineraUserEmailNotification_Lookup(p) + return +} + +func InfineraUserEmailNotification_Gets(p *radius.Packet) (values []InfineraUserEmailNotification, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 111) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserEmailNotification(i)) + } + return +} + +func InfineraUserEmailNotification_Lookup(p *radius.Packet) (value InfineraUserEmailNotification, err error) { + a, ok := _Infinera_LookupVendor(p, 111) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserEmailNotification(i) + return +} + +func InfineraUserEmailNotification_Set(p *radius.Packet, value InfineraUserEmailNotification) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 111, a) +} + +func InfineraUserEmailNotification_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 111) +} + +type InfineraUserEmailAlarmType uint32 + +const ( + InfineraUserEmailAlarmType_Value_EMAILALARMTYPEALL InfineraUserEmailAlarmType = 0 + InfineraUserEmailAlarmType_Value_EMAILALARMTYPENEW InfineraUserEmailAlarmType = 1 + InfineraUserEmailAlarmType_Value_EMAILALARMTYPECLEAR InfineraUserEmailAlarmType = 2 +) + +var InfineraUserEmailAlarmType_Strings = map[InfineraUserEmailAlarmType]string{ + InfineraUserEmailAlarmType_Value_EMAILALARMTYPEALL: "EMAIL-ALARM-TYPE-ALL", + InfineraUserEmailAlarmType_Value_EMAILALARMTYPENEW: "EMAIL-ALARM-TYPE-NEW", + InfineraUserEmailAlarmType_Value_EMAILALARMTYPECLEAR: "EMAIL-ALARM-TYPE-CLEAR", +} + +func (a InfineraUserEmailAlarmType) String() string { + if str, ok := InfineraUserEmailAlarmType_Strings[a]; ok { + return str + } + return "InfineraUserEmailAlarmType(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserEmailAlarmType_Add(p *radius.Packet, value InfineraUserEmailAlarmType) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 112, a) +} + +func InfineraUserEmailAlarmType_Get(p *radius.Packet) (value InfineraUserEmailAlarmType) { + value, _ = InfineraUserEmailAlarmType_Lookup(p) + return +} + +func InfineraUserEmailAlarmType_Gets(p *radius.Packet) (values []InfineraUserEmailAlarmType, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 112) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserEmailAlarmType(i)) + } + return +} + +func InfineraUserEmailAlarmType_Lookup(p *radius.Packet) (value InfineraUserEmailAlarmType, err error) { + a, ok := _Infinera_LookupVendor(p, 112) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserEmailAlarmType(i) + return +} + +func InfineraUserEmailAlarmType_Set(p *radius.Packet, value InfineraUserEmailAlarmType) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 112, a) +} + +func InfineraUserEmailAlarmType_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 112) +} + +func InfineraUserEmailFilterName_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 113, a) +} + +func InfineraUserEmailFilterName_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 113, a) +} + +func InfineraUserEmailFilterName_Get(p *radius.Packet) (value []byte) { + value, _ = InfineraUserEmailFilterName_Lookup(p) + return +} + +func InfineraUserEmailFilterName_GetString(p *radius.Packet) (value string) { + value, _ = InfineraUserEmailFilterName_LookupString(p) + return +} + +func InfineraUserEmailFilterName_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Infinera_GetsVendor(p, 113) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserEmailFilterName_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Infinera_GetsVendor(p, 113) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserEmailFilterName_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Infinera_LookupVendor(p, 113) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func InfineraUserEmailFilterName_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Infinera_LookupVendor(p, 113) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func InfineraUserEmailFilterName_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 113, a) +} + +func InfineraUserEmailFilterName_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 113, a) +} + +func InfineraUserEmailFilterName_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 113) +} + +func InfineraUserEmailAdminDomain_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 114, a) +} + +func InfineraUserEmailAdminDomain_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 114, a) +} + +func InfineraUserEmailAdminDomain_Get(p *radius.Packet) (value []byte) { + value, _ = InfineraUserEmailAdminDomain_Lookup(p) + return +} + +func InfineraUserEmailAdminDomain_GetString(p *radius.Packet) (value string) { + value, _ = InfineraUserEmailAdminDomain_LookupString(p) + return +} + +func InfineraUserEmailAdminDomain_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Infinera_GetsVendor(p, 114) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserEmailAdminDomain_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Infinera_GetsVendor(p, 114) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraUserEmailAdminDomain_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Infinera_LookupVendor(p, 114) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func InfineraUserEmailAdminDomain_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Infinera_LookupVendor(p, 114) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func InfineraUserEmailAdminDomain_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 114, a) +} + +func InfineraUserEmailAdminDomain_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 114, a) +} + +func InfineraUserEmailAdminDomain_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 114) +} + +type InfineraUserSessionTimeout uint32 + +var InfineraUserSessionTimeout_Strings = map[InfineraUserSessionTimeout]string{} + +func (a InfineraUserSessionTimeout) String() string { + if str, ok := InfineraUserSessionTimeout_Strings[a]; ok { + return str + } + return "InfineraUserSessionTimeout(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserSessionTimeout_Add(p *radius.Packet, value InfineraUserSessionTimeout) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 17, a) +} + +func InfineraUserSessionTimeout_Get(p *radius.Packet) (value InfineraUserSessionTimeout) { + value, _ = InfineraUserSessionTimeout_Lookup(p) + return +} + +func InfineraUserSessionTimeout_Gets(p *radius.Packet) (values []InfineraUserSessionTimeout, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 17) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserSessionTimeout(i)) + } + return +} + +func InfineraUserSessionTimeout_Lookup(p *radius.Packet) (value InfineraUserSessionTimeout, err error) { + a, ok := _Infinera_LookupVendor(p, 17) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserSessionTimeout(i) + return +} + +func InfineraUserSessionTimeout_Set(p *radius.Packet, value InfineraUserSessionTimeout) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 17, a) +} + +func InfineraUserSessionTimeout_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 17) +} + +type InfineraUserLockedOut uint32 + +var InfineraUserLockedOut_Strings = map[InfineraUserLockedOut]string{} + +func (a InfineraUserLockedOut) String() string { + if str, ok := InfineraUserLockedOut_Strings[a]; ok { + return str + } + return "InfineraUserLockedOut(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserLockedOut_Add(p *radius.Packet, value InfineraUserLockedOut) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 19, a) +} + +func InfineraUserLockedOut_Get(p *radius.Packet) (value InfineraUserLockedOut) { + value, _ = InfineraUserLockedOut_Lookup(p) + return +} + +func InfineraUserLockedOut_Gets(p *radius.Packet) (values []InfineraUserLockedOut, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 19) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserLockedOut(i)) + } + return +} + +func InfineraUserLockedOut_Lookup(p *radius.Packet) (value InfineraUserLockedOut, err error) { + a, ok := _Infinera_LookupVendor(p, 19) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserLockedOut(i) + return +} + +func InfineraUserLockedOut_Set(p *radius.Packet, value InfineraUserLockedOut) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 19, a) +} + +func InfineraUserLockedOut_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 19) +} + +type InfineraUserCanUseResSession uint32 + +const ( + InfineraUserCanUseResSession_Value_CANNOTUSERESSESSION InfineraUserCanUseResSession = 0 + InfineraUserCanUseResSession_Value_CANUSERESSESSION InfineraUserCanUseResSession = 1 +) + +var InfineraUserCanUseResSession_Strings = map[InfineraUserCanUseResSession]string{ + InfineraUserCanUseResSession_Value_CANNOTUSERESSESSION: "CANNOT-USE-RES-SESSION", + InfineraUserCanUseResSession_Value_CANUSERESSESSION: "CAN-USE-RES-SESSION", +} + +func (a InfineraUserCanUseResSession) String() string { + if str, ok := InfineraUserCanUseResSession_Strings[a]; ok { + return str + } + return "InfineraUserCanUseResSession(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserCanUseResSession_Add(p *radius.Packet, value InfineraUserCanUseResSession) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 20, a) +} + +func InfineraUserCanUseResSession_Get(p *radius.Packet) (value InfineraUserCanUseResSession) { + value, _ = InfineraUserCanUseResSession_Lookup(p) + return +} + +func InfineraUserCanUseResSession_Gets(p *radius.Packet) (values []InfineraUserCanUseResSession, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 20) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserCanUseResSession(i)) + } + return +} + +func InfineraUserCanUseResSession_Lookup(p *radius.Packet) (value InfineraUserCanUseResSession, err error) { + a, ok := _Infinera_LookupVendor(p, 20) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserCanUseResSession(i) + return +} + +func InfineraUserCanUseResSession_Set(p *radius.Packet, value InfineraUserCanUseResSession) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 20, a) +} + +func InfineraUserCanUseResSession_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 20) +} + +type InfineraUserMgmtTypeEMS uint32 + +const ( + InfineraUserMgmtTypeEMS_Value_MGMTTYPEEMSDISALLOWED InfineraUserMgmtTypeEMS = 0 + InfineraUserMgmtTypeEMS_Value_MGMTTYPEEMSALLOWED InfineraUserMgmtTypeEMS = 1 +) + +var InfineraUserMgmtTypeEMS_Strings = map[InfineraUserMgmtTypeEMS]string{ + InfineraUserMgmtTypeEMS_Value_MGMTTYPEEMSDISALLOWED: "MGMTTYPE-EMS-DISALLOWED", + InfineraUserMgmtTypeEMS_Value_MGMTTYPEEMSALLOWED: "MGMTTYPE-EMS-ALLOWED", +} + +func (a InfineraUserMgmtTypeEMS) String() string { + if str, ok := InfineraUserMgmtTypeEMS_Strings[a]; ok { + return str + } + return "InfineraUserMgmtTypeEMS(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserMgmtTypeEMS_Add(p *radius.Packet, value InfineraUserMgmtTypeEMS) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 33, a) +} + +func InfineraUserMgmtTypeEMS_Get(p *radius.Packet) (value InfineraUserMgmtTypeEMS) { + value, _ = InfineraUserMgmtTypeEMS_Lookup(p) + return +} + +func InfineraUserMgmtTypeEMS_Gets(p *radius.Packet) (values []InfineraUserMgmtTypeEMS, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 33) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserMgmtTypeEMS(i)) + } + return +} + +func InfineraUserMgmtTypeEMS_Lookup(p *radius.Packet) (value InfineraUserMgmtTypeEMS, err error) { + a, ok := _Infinera_LookupVendor(p, 33) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserMgmtTypeEMS(i) + return +} + +func InfineraUserMgmtTypeEMS_Set(p *radius.Packet, value InfineraUserMgmtTypeEMS) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 33, a) +} + +func InfineraUserMgmtTypeEMS_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 33) +} + +type InfineraUserMgmtTypeGNM uint32 + +const ( + InfineraUserMgmtTypeGNM_Value_MGMTTYPEGNMDISALLOWED InfineraUserMgmtTypeGNM = 0 + InfineraUserMgmtTypeGNM_Value_MGMTTYPEGNMALLOWED InfineraUserMgmtTypeGNM = 1 +) + +var InfineraUserMgmtTypeGNM_Strings = map[InfineraUserMgmtTypeGNM]string{ + InfineraUserMgmtTypeGNM_Value_MGMTTYPEGNMDISALLOWED: "MGMTTYPE-GNM-DISALLOWED", + InfineraUserMgmtTypeGNM_Value_MGMTTYPEGNMALLOWED: "MGMTTYPE-GNM-ALLOWED", +} + +func (a InfineraUserMgmtTypeGNM) String() string { + if str, ok := InfineraUserMgmtTypeGNM_Strings[a]; ok { + return str + } + return "InfineraUserMgmtTypeGNM(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserMgmtTypeGNM_Add(p *radius.Packet, value InfineraUserMgmtTypeGNM) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 34, a) +} + +func InfineraUserMgmtTypeGNM_Get(p *radius.Packet) (value InfineraUserMgmtTypeGNM) { + value, _ = InfineraUserMgmtTypeGNM_Lookup(p) + return +} + +func InfineraUserMgmtTypeGNM_Gets(p *radius.Packet) (values []InfineraUserMgmtTypeGNM, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 34) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserMgmtTypeGNM(i)) + } + return +} + +func InfineraUserMgmtTypeGNM_Lookup(p *radius.Packet) (value InfineraUserMgmtTypeGNM, err error) { + a, ok := _Infinera_LookupVendor(p, 34) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserMgmtTypeGNM(i) + return +} + +func InfineraUserMgmtTypeGNM_Set(p *radius.Packet, value InfineraUserMgmtTypeGNM) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 34, a) +} + +func InfineraUserMgmtTypeGNM_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 34) +} + +type InfineraUserMgmtTypeTL1 uint32 + +const ( + InfineraUserMgmtTypeTL1_Value_MGMTTYPETL1DISALLOWED InfineraUserMgmtTypeTL1 = 0 + InfineraUserMgmtTypeTL1_Value_MGMTTYPETL1ALLOWED InfineraUserMgmtTypeTL1 = 1 +) + +var InfineraUserMgmtTypeTL1_Strings = map[InfineraUserMgmtTypeTL1]string{ + InfineraUserMgmtTypeTL1_Value_MGMTTYPETL1DISALLOWED: "MGMTTYPE-TL1-DISALLOWED", + InfineraUserMgmtTypeTL1_Value_MGMTTYPETL1ALLOWED: "MGMTTYPE-TL1-ALLOWED", +} + +func (a InfineraUserMgmtTypeTL1) String() string { + if str, ok := InfineraUserMgmtTypeTL1_Strings[a]; ok { + return str + } + return "InfineraUserMgmtTypeTL1(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserMgmtTypeTL1_Add(p *radius.Packet, value InfineraUserMgmtTypeTL1) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 35, a) +} + +func InfineraUserMgmtTypeTL1_Get(p *radius.Packet) (value InfineraUserMgmtTypeTL1) { + value, _ = InfineraUserMgmtTypeTL1_Lookup(p) + return +} + +func InfineraUserMgmtTypeTL1_Gets(p *radius.Packet) (values []InfineraUserMgmtTypeTL1, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 35) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserMgmtTypeTL1(i)) + } + return +} + +func InfineraUserMgmtTypeTL1_Lookup(p *radius.Packet) (value InfineraUserMgmtTypeTL1, err error) { + a, ok := _Infinera_LookupVendor(p, 35) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserMgmtTypeTL1(i) + return +} + +func InfineraUserMgmtTypeTL1_Set(p *radius.Packet, value InfineraUserMgmtTypeTL1) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 35, a) +} + +func InfineraUserMgmtTypeTL1_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 35) +} + +type InfineraUserMgmtTypeCLI uint32 + +const ( + InfineraUserMgmtTypeCLI_Value_MGMTTYPECLIDISALLOWED InfineraUserMgmtTypeCLI = 0 + InfineraUserMgmtTypeCLI_Value_MGMTTYPECLIALLOWED InfineraUserMgmtTypeCLI = 1 +) + +var InfineraUserMgmtTypeCLI_Strings = map[InfineraUserMgmtTypeCLI]string{ + InfineraUserMgmtTypeCLI_Value_MGMTTYPECLIDISALLOWED: "MGMTTYPE-CLI-DISALLOWED", + InfineraUserMgmtTypeCLI_Value_MGMTTYPECLIALLOWED: "MGMTTYPE-CLI-ALLOWED", +} + +func (a InfineraUserMgmtTypeCLI) String() string { + if str, ok := InfineraUserMgmtTypeCLI_Strings[a]; ok { + return str + } + return "InfineraUserMgmtTypeCLI(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserMgmtTypeCLI_Add(p *radius.Packet, value InfineraUserMgmtTypeCLI) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 36, a) +} + +func InfineraUserMgmtTypeCLI_Get(p *radius.Packet) (value InfineraUserMgmtTypeCLI) { + value, _ = InfineraUserMgmtTypeCLI_Lookup(p) + return +} + +func InfineraUserMgmtTypeCLI_Gets(p *radius.Packet) (values []InfineraUserMgmtTypeCLI, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 36) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserMgmtTypeCLI(i)) + } + return +} + +func InfineraUserMgmtTypeCLI_Lookup(p *radius.Packet) (value InfineraUserMgmtTypeCLI, err error) { + a, ok := _Infinera_LookupVendor(p, 36) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserMgmtTypeCLI(i) + return +} + +func InfineraUserMgmtTypeCLI_Set(p *radius.Packet, value InfineraUserMgmtTypeCLI) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 36, a) +} + +func InfineraUserMgmtTypeCLI_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 36) +} + +type InfineraUserMgmtTypeNETCONF uint32 + +const ( + InfineraUserMgmtTypeNETCONF_Value_MGMTTYPENETCONFDISALLOWED InfineraUserMgmtTypeNETCONF = 0 + InfineraUserMgmtTypeNETCONF_Value_MGMTTYPENETCONFALLOWED InfineraUserMgmtTypeNETCONF = 1 +) + +var InfineraUserMgmtTypeNETCONF_Strings = map[InfineraUserMgmtTypeNETCONF]string{ + InfineraUserMgmtTypeNETCONF_Value_MGMTTYPENETCONFDISALLOWED: "MGMTTYPE-NETCONF-DISALLOWED", + InfineraUserMgmtTypeNETCONF_Value_MGMTTYPENETCONFALLOWED: "MGMTTYPE-NETCONF-ALLOWED", +} + +func (a InfineraUserMgmtTypeNETCONF) String() string { + if str, ok := InfineraUserMgmtTypeNETCONF_Strings[a]; ok { + return str + } + return "InfineraUserMgmtTypeNETCONF(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraUserMgmtTypeNETCONF_Add(p *radius.Packet, value InfineraUserMgmtTypeNETCONF) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 37, a) +} + +func InfineraUserMgmtTypeNETCONF_Get(p *radius.Packet) (value InfineraUserMgmtTypeNETCONF) { + value, _ = InfineraUserMgmtTypeNETCONF_Lookup(p) + return +} + +func InfineraUserMgmtTypeNETCONF_Gets(p *radius.Packet) (values []InfineraUserMgmtTypeNETCONF, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 37) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraUserMgmtTypeNETCONF(i)) + } + return +} + +func InfineraUserMgmtTypeNETCONF_Lookup(p *radius.Packet) (value InfineraUserMgmtTypeNETCONF, err error) { + a, ok := _Infinera_LookupVendor(p, 37) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraUserMgmtTypeNETCONF(i) + return +} + +func InfineraUserMgmtTypeNETCONF_Set(p *radius.Packet, value InfineraUserMgmtTypeNETCONF) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 37, a) +} + +func InfineraUserMgmtTypeNETCONF_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 37) +} + +func InfineraRsvdStrAttribute1_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 240, a) +} + +func InfineraRsvdStrAttribute1_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 240, a) +} + +func InfineraRsvdStrAttribute1_Get(p *radius.Packet) (value []byte) { + value, _ = InfineraRsvdStrAttribute1_Lookup(p) + return +} + +func InfineraRsvdStrAttribute1_GetString(p *radius.Packet) (value string) { + value, _ = InfineraRsvdStrAttribute1_LookupString(p) + return +} + +func InfineraRsvdStrAttribute1_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Infinera_GetsVendor(p, 240) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraRsvdStrAttribute1_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Infinera_GetsVendor(p, 240) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraRsvdStrAttribute1_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Infinera_LookupVendor(p, 240) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func InfineraRsvdStrAttribute1_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Infinera_LookupVendor(p, 240) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func InfineraRsvdStrAttribute1_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 240, a) +} + +func InfineraRsvdStrAttribute1_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 240, a) +} + +func InfineraRsvdStrAttribute1_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 240) +} + +func InfineraRsvdStrAttribute2_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 241, a) +} + +func InfineraRsvdStrAttribute2_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_AddVendor(p, 241, a) +} + +func InfineraRsvdStrAttribute2_Get(p *radius.Packet) (value []byte) { + value, _ = InfineraRsvdStrAttribute2_Lookup(p) + return +} + +func InfineraRsvdStrAttribute2_GetString(p *radius.Packet) (value string) { + value, _ = InfineraRsvdStrAttribute2_LookupString(p) + return +} + +func InfineraRsvdStrAttribute2_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Infinera_GetsVendor(p, 241) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraRsvdStrAttribute2_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Infinera_GetsVendor(p, 241) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func InfineraRsvdStrAttribute2_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Infinera_LookupVendor(p, 241) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func InfineraRsvdStrAttribute2_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Infinera_LookupVendor(p, 241) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func InfineraRsvdStrAttribute2_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 241, a) +} + +func InfineraRsvdStrAttribute2_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Infinera_SetVendor(p, 241, a) +} + +func InfineraRsvdStrAttribute2_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 241) +} + +type InfineraRsvdIntAttribute1 uint32 + +const ( + InfineraRsvdIntAttribute1_Value_INFINERA InfineraRsvdIntAttribute1 = 1 +) + +var InfineraRsvdIntAttribute1_Strings = map[InfineraRsvdIntAttribute1]string{ + InfineraRsvdIntAttribute1_Value_INFINERA: "INFINERA", +} + +func (a InfineraRsvdIntAttribute1) String() string { + if str, ok := InfineraRsvdIntAttribute1_Strings[a]; ok { + return str + } + return "InfineraRsvdIntAttribute1(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraRsvdIntAttribute1_Add(p *radius.Packet, value InfineraRsvdIntAttribute1) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 249, a) +} + +func InfineraRsvdIntAttribute1_Get(p *radius.Packet) (value InfineraRsvdIntAttribute1) { + value, _ = InfineraRsvdIntAttribute1_Lookup(p) + return +} + +func InfineraRsvdIntAttribute1_Gets(p *radius.Packet) (values []InfineraRsvdIntAttribute1, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 249) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraRsvdIntAttribute1(i)) + } + return +} + +func InfineraRsvdIntAttribute1_Lookup(p *radius.Packet) (value InfineraRsvdIntAttribute1, err error) { + a, ok := _Infinera_LookupVendor(p, 249) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraRsvdIntAttribute1(i) + return +} + +func InfineraRsvdIntAttribute1_Set(p *radius.Packet, value InfineraRsvdIntAttribute1) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 249, a) +} + +func InfineraRsvdIntAttribute1_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 249) +} + +type InfineraRsvdIntAttribute2 uint32 + +var InfineraRsvdIntAttribute2_Strings = map[InfineraRsvdIntAttribute2]string{} + +func (a InfineraRsvdIntAttribute2) String() string { + if str, ok := InfineraRsvdIntAttribute2_Strings[a]; ok { + return str + } + return "InfineraRsvdIntAttribute2(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func InfineraRsvdIntAttribute2_Add(p *radius.Packet, value InfineraRsvdIntAttribute2) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_AddVendor(p, 250, a) +} + +func InfineraRsvdIntAttribute2_Get(p *radius.Packet) (value InfineraRsvdIntAttribute2) { + value, _ = InfineraRsvdIntAttribute2_Lookup(p) + return +} + +func InfineraRsvdIntAttribute2_Gets(p *radius.Packet) (values []InfineraRsvdIntAttribute2, err error) { + var i uint32 + for _, attr := range _Infinera_GetsVendor(p, 250) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, InfineraRsvdIntAttribute2(i)) + } + return +} + +func InfineraRsvdIntAttribute2_Lookup(p *radius.Packet) (value InfineraRsvdIntAttribute2, err error) { + a, ok := _Infinera_LookupVendor(p, 250) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = InfineraRsvdIntAttribute2(i) + return +} + +func InfineraRsvdIntAttribute2_Set(p *radius.Packet, value InfineraRsvdIntAttribute2) (err error) { + a := radius.NewInteger(uint32(value)) + return _Infinera_SetVendor(p, 250, a) +} + +func InfineraRsvdIntAttribute2_Del(p *radius.Packet) { + _Infinera_DelVendor(p, 250) +} diff --git a/vendors/nokiapss1830/dictionary.nokiapss1830 b/vendors/nokiapss1830/dictionary.nokiapss1830 new file mode 100644 index 0000000..cf1bbdf --- /dev/null +++ b/vendors/nokiapss1830/dictionary.nokiapss1830 @@ -0,0 +1,15 @@ +# Vendor-specific RADIUS dictionary for Nokia (formerly Tropic Networks) +# For emailed info from Nokia see P59299613 + +VENDOR NokiaPSS1830 7483 +BEGIN-VENDOR NokiaPSS1830 + +# Authentication attributes and values + +ATTRIBUTE Nokia-Role 1 integer +VALUE Nokia-Role Nokia-Observer 0 +VALUE Nokia-Role Nokia-Provisioner 1 +VALUE Nokia-Role Nokia-Administrator 2 +VALUE Nokia-Role Nokia-Crypto 4 + +END-VENDOR NokiaPSS1830 diff --git a/vendors/nokiapss1830/generate.go b/vendors/nokiapss1830/generate.go new file mode 100644 index 0000000..d9b638c --- /dev/null +++ b/vendors/nokiapss1830/generate.go @@ -0,0 +1,3 @@ +//go:generate go run ../../cmd/radius-dict-gen/main.go -package nokiapss1830 -output generated.go dictionary.nokiapss1830 + +package nokiapss1830 diff --git a/vendors/nokiapss1830/generated.go b/vendors/nokiapss1830/generated.go new file mode 100644 index 0000000..400b7f5 --- /dev/null +++ b/vendors/nokiapss1830/generated.go @@ -0,0 +1,213 @@ +// Code generated by radius-dict-gen. DO NOT EDIT. + +package nokiapss1830 + +import ( + "strconv" + + "layeh.com/radius" + "layeh.com/radius/rfc2865" +) + +const ( + _NokiaPSS1830_VendorID = 7483 +) + +func _NokiaPSS1830_AddVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + var vsa radius.Attribute + vendor := make(radius.Attribute, 2+len(attr)) + vendor[0] = typ + vendor[1] = byte(len(vendor)) + copy(vendor[2:], attr) + vsa, err = radius.NewVendorSpecific(_NokiaPSS1830_VendorID, vendor) + if err != nil { + return + } + p.Add(rfc2865.VendorSpecific_Type, vsa) + return +} + +func _NokiaPSS1830_GetsVendor(p *radius.Packet, typ byte) (values []radius.Attribute) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _NokiaPSS1830_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + values = append(values, vsa[2:int(vsaLen)]) + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _NokiaPSS1830_LookupVendor(p *radius.Packet, typ byte) (attr radius.Attribute, ok bool) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _NokiaPSS1830_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + return vsa[2:int(vsaLen)], true + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _NokiaPSS1830_SetVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _NokiaPSS1830_VendorID { + i++ + continue + } + for j := 0; len(vsa[j:]) >= 3; { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa[j:]) || vsaLen < 3 { + i++ + break + } + if vsaTyp == typ { + vsa = append(vsa[:j], vsa[j+int(vsaLen):]...) + } + j += int(vsaLen) + } + if len(vsa) > 0 { + copy(avp.Attribute[4:], vsa) + i++ + } else { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+i:]...) + } + } + return _NokiaPSS1830_AddVendor(p, typ, attr) +} + +func _NokiaPSS1830_DelVendor(p *radius.Packet, typ byte) { +vsaLoop: + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _NokiaPSS1830_VendorID { + i++ + continue + } + offset := 0 + for len(vsa[offset:]) >= 3 { + vsaTyp, vsaLen := vsa[offset], vsa[offset+1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + continue vsaLoop + } + if vsaTyp == typ { + copy(vsa[offset:], vsa[offset+int(vsaLen):]) + vsa = vsa[:len(vsa)-int(vsaLen)] + } else { + offset += int(vsaLen) + } + } + if offset == 0 { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+1:]...) + } else { + i++ + } + } + return +} + +type NokiaRole uint32 + +const ( + NokiaRole_Value_NokiaObserver NokiaRole = 0 + NokiaRole_Value_NokiaProvisioner NokiaRole = 1 + NokiaRole_Value_NokiaAdministrator NokiaRole = 2 + NokiaRole_Value_NokiaCrypto NokiaRole = 4 +) + +var NokiaRole_Strings = map[NokiaRole]string{ + NokiaRole_Value_NokiaObserver: "Nokia-Observer", + NokiaRole_Value_NokiaProvisioner: "Nokia-Provisioner", + NokiaRole_Value_NokiaAdministrator: "Nokia-Administrator", + NokiaRole_Value_NokiaCrypto: "Nokia-Crypto", +} + +func (a NokiaRole) String() string { + if str, ok := NokiaRole_Strings[a]; ok { + return str + } + return "NokiaRole(" + strconv.FormatUint(uint64(a), 10) + ")" +} + +func NokiaRole_Add(p *radius.Packet, value NokiaRole) (err error) { + a := radius.NewInteger(uint32(value)) + return _NokiaPSS1830_AddVendor(p, 1, a) +} + +func NokiaRole_Get(p *radius.Packet) (value NokiaRole) { + value, _ = NokiaRole_Lookup(p) + return +} + +func NokiaRole_Gets(p *radius.Packet) (values []NokiaRole, err error) { + var i uint32 + for _, attr := range _NokiaPSS1830_GetsVendor(p, 1) { + i, err = radius.Integer(attr) + if err != nil { + return + } + values = append(values, NokiaRole(i)) + } + return +} + +func NokiaRole_Lookup(p *radius.Packet) (value NokiaRole, err error) { + a, ok := _NokiaPSS1830_LookupVendor(p, 1) + if !ok { + err = radius.ErrNoAttribute + return + } + var i uint32 + i, err = radius.Integer(a) + if err != nil { + return + } + value = NokiaRole(i) + return +} + +func NokiaRole_Set(p *radius.Packet, value NokiaRole) (err error) { + a := radius.NewInteger(uint32(value)) + return _NokiaPSS1830_SetVendor(p, 1, a) +} + +func NokiaRole_Del(p *radius.Packet) { + _NokiaPSS1830_DelVendor(p, 1) +} diff --git a/vendors/transmode/dictionary.transmode b/vendors/transmode/dictionary.transmode new file mode 100644 index 0000000..b6d7ad3 --- /dev/null +++ b/vendors/transmode/dictionary.transmode @@ -0,0 +1,16 @@ +# Vendor-specific RADIUS dictionary for Transmode +# +VENDOR Transmode 8708 +BEGIN-VENDOR Transmode +# +# Authentication attributes and values + +# Used for both DNA-M and ENM user privileges +# "readonly", "operator", and "administrator" +ATTRIBUTE Transmode-User-Category 1 string + +# Used for ENM only (not DNA-M) +# "readonly", "operator", and "administrator" +ATTRIBUTE Transmode-ENM-User-Category 2 string + +END-VENDOR Transmode diff --git a/vendors/transmode/generate.go b/vendors/transmode/generate.go new file mode 100644 index 0000000..55369cd --- /dev/null +++ b/vendors/transmode/generate.go @@ -0,0 +1,3 @@ +//go:generate go run ../../cmd/radius-dict-gen/main.go -package transmode -output generated.go dictionary.transmode + +package transmode diff --git a/vendors/transmode/generated.go b/vendors/transmode/generated.go new file mode 100644 index 0000000..4184e0e --- /dev/null +++ b/vendors/transmode/generated.go @@ -0,0 +1,330 @@ +// Code generated by radius-dict-gen. DO NOT EDIT. + +package transmode + +import ( + "layeh.com/radius" + "layeh.com/radius/rfc2865" +) + +const ( + _Transmode_VendorID = 8708 +) + +func _Transmode_AddVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + var vsa radius.Attribute + vendor := make(radius.Attribute, 2+len(attr)) + vendor[0] = typ + vendor[1] = byte(len(vendor)) + copy(vendor[2:], attr) + vsa, err = radius.NewVendorSpecific(_Transmode_VendorID, vendor) + if err != nil { + return + } + p.Add(rfc2865.VendorSpecific_Type, vsa) + return +} + +func _Transmode_GetsVendor(p *radius.Packet, typ byte) (values []radius.Attribute) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _Transmode_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + values = append(values, vsa[2:int(vsaLen)]) + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _Transmode_LookupVendor(p *radius.Packet, typ byte) (attr radius.Attribute, ok bool) { + for _, avp := range p.Attributes { + if avp.Type != rfc2865.VendorSpecific_Type { + continue + } + attr := avp.Attribute + vendorID, vsa, err := radius.VendorSpecific(attr) + if err != nil || vendorID != _Transmode_VendorID { + continue + } + for len(vsa) >= 3 { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + break + } + if vsaTyp == typ { + return vsa[2:int(vsaLen)], true + } + vsa = vsa[int(vsaLen):] + } + } + return +} + +func _Transmode_SetVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) { + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _Transmode_VendorID { + i++ + continue + } + for j := 0; len(vsa[j:]) >= 3; { + vsaTyp, vsaLen := vsa[0], vsa[1] + if int(vsaLen) > len(vsa[j:]) || vsaLen < 3 { + i++ + break + } + if vsaTyp == typ { + vsa = append(vsa[:j], vsa[j+int(vsaLen):]...) + } + j += int(vsaLen) + } + if len(vsa) > 0 { + copy(avp.Attribute[4:], vsa) + i++ + } else { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+i:]...) + } + } + return _Transmode_AddVendor(p, typ, attr) +} + +func _Transmode_DelVendor(p *radius.Packet, typ byte) { +vsaLoop: + for i := 0; i < len(p.Attributes); { + avp := p.Attributes[i] + if avp.Type != rfc2865.VendorSpecific_Type { + i++ + continue + } + vendorID, vsa, err := radius.VendorSpecific(avp.Attribute) + if err != nil || vendorID != _Transmode_VendorID { + i++ + continue + } + offset := 0 + for len(vsa[offset:]) >= 3 { + vsaTyp, vsaLen := vsa[offset], vsa[offset+1] + if int(vsaLen) > len(vsa) || vsaLen < 3 { + continue vsaLoop + } + if vsaTyp == typ { + copy(vsa[offset:], vsa[offset+int(vsaLen):]) + vsa = vsa[:len(vsa)-int(vsaLen)] + } else { + offset += int(vsaLen) + } + } + if offset == 0 { + p.Attributes = append(p.Attributes[:i], p.Attributes[i+1:]...) + } else { + i++ + } + } + return +} + +func TransmodeUserCategory_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Transmode_AddVendor(p, 1, a) +} + +func TransmodeUserCategory_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Transmode_AddVendor(p, 1, a) +} + +func TransmodeUserCategory_Get(p *radius.Packet) (value []byte) { + value, _ = TransmodeUserCategory_Lookup(p) + return +} + +func TransmodeUserCategory_GetString(p *radius.Packet) (value string) { + value, _ = TransmodeUserCategory_LookupString(p) + return +} + +func TransmodeUserCategory_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Transmode_GetsVendor(p, 1) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func TransmodeUserCategory_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Transmode_GetsVendor(p, 1) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func TransmodeUserCategory_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Transmode_LookupVendor(p, 1) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func TransmodeUserCategory_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Transmode_LookupVendor(p, 1) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func TransmodeUserCategory_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Transmode_SetVendor(p, 1, a) +} + +func TransmodeUserCategory_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Transmode_SetVendor(p, 1, a) +} + +func TransmodeUserCategory_Del(p *radius.Packet) { + _Transmode_DelVendor(p, 1) +} + +func TransmodeENMUserCategory_Add(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Transmode_AddVendor(p, 2, a) +} + +func TransmodeENMUserCategory_AddString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Transmode_AddVendor(p, 2, a) +} + +func TransmodeENMUserCategory_Get(p *radius.Packet) (value []byte) { + value, _ = TransmodeENMUserCategory_Lookup(p) + return +} + +func TransmodeENMUserCategory_GetString(p *radius.Packet) (value string) { + value, _ = TransmodeENMUserCategory_LookupString(p) + return +} + +func TransmodeENMUserCategory_Gets(p *radius.Packet) (values [][]byte, err error) { + var i []byte + for _, attr := range _Transmode_GetsVendor(p, 2) { + i = radius.Bytes(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func TransmodeENMUserCategory_GetStrings(p *radius.Packet) (values []string, err error) { + var i string + for _, attr := range _Transmode_GetsVendor(p, 2) { + i = radius.String(attr) + if err != nil { + return + } + values = append(values, i) + } + return +} + +func TransmodeENMUserCategory_Lookup(p *radius.Packet) (value []byte, err error) { + a, ok := _Transmode_LookupVendor(p, 2) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.Bytes(a) + return +} + +func TransmodeENMUserCategory_LookupString(p *radius.Packet) (value string, err error) { + a, ok := _Transmode_LookupVendor(p, 2) + if !ok { + err = radius.ErrNoAttribute + return + } + value = radius.String(a) + return +} + +func TransmodeENMUserCategory_Set(p *radius.Packet, value []byte) (err error) { + var a radius.Attribute + a, err = radius.NewBytes(value) + if err != nil { + return + } + return _Transmode_SetVendor(p, 2, a) +} + +func TransmodeENMUserCategory_SetString(p *radius.Packet, value string) (err error) { + var a radius.Attribute + a, err = radius.NewString(value) + if err != nil { + return + } + return _Transmode_SetVendor(p, 2, a) +} + +func TransmodeENMUserCategory_Del(p *radius.Packet) { + _Transmode_DelVendor(p, 2) +}