forked from layeh/radius
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerated.go
116 lines (99 loc) · 3.55 KB
/
generated.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Code generated by radius-dict-gen. DO NOT EDIT.
package rfc3576
import (
"strconv"
radius "github.com/inverse-inc/go-radius"
. "github.com/inverse-inc/go-radius/rfc2865"
)
const (
ErrorCause_Type radius.Type = 101
)
func init() {
ServiceType_Strings[ServiceType_Value_AuthorizeOnly] = "Authorize-Only"
}
const (
ServiceType_Value_AuthorizeOnly ServiceType = 17
)
type ErrorCause uint32
const (
ErrorCause_Value_ResidualContextRemoved ErrorCause = 201
ErrorCause_Value_InvalidEAPPacket ErrorCause = 202
ErrorCause_Value_UnsupportedAttribute ErrorCause = 401
ErrorCause_Value_MissingAttribute ErrorCause = 402
ErrorCause_Value_NASIdentificationMismatch ErrorCause = 403
ErrorCause_Value_InvalidRequest ErrorCause = 404
ErrorCause_Value_UnsupportedService ErrorCause = 405
ErrorCause_Value_UnsupportedExtension ErrorCause = 406
ErrorCause_Value_AdministrativelyProhibited ErrorCause = 501
ErrorCause_Value_ProxyRequestNotRoutable ErrorCause = 502
ErrorCause_Value_SessionContextNotFound ErrorCause = 503
ErrorCause_Value_SessionContextNotRemovable ErrorCause = 504
ErrorCause_Value_ProxyProcessingError ErrorCause = 505
ErrorCause_Value_ResourcesUnavailable ErrorCause = 506
ErrorCause_Value_RequestInitiated ErrorCause = 507
)
var ErrorCause_Strings = map[ErrorCause]string{
ErrorCause_Value_ResidualContextRemoved: "Residual-Context-Removed",
ErrorCause_Value_InvalidEAPPacket: "Invalid-EAP-Packet",
ErrorCause_Value_UnsupportedAttribute: "Unsupported-Attribute",
ErrorCause_Value_MissingAttribute: "Missing-Attribute",
ErrorCause_Value_NASIdentificationMismatch: "NAS-Identification-Mismatch",
ErrorCause_Value_InvalidRequest: "Invalid-Request",
ErrorCause_Value_UnsupportedService: "Unsupported-Service",
ErrorCause_Value_UnsupportedExtension: "Unsupported-Extension",
ErrorCause_Value_AdministrativelyProhibited: "Administratively-Prohibited",
ErrorCause_Value_ProxyRequestNotRoutable: "Proxy-Request-Not-Routable",
ErrorCause_Value_SessionContextNotFound: "Session-Context-Not-Found",
ErrorCause_Value_SessionContextNotRemovable: "Session-Context-Not-Removable",
ErrorCause_Value_ProxyProcessingError: "Proxy-Processing-Error",
ErrorCause_Value_ResourcesUnavailable: "Resources-Unavailable",
ErrorCause_Value_RequestInitiated: "Request-Initiated",
}
func (a ErrorCause) String() string {
if str, ok := ErrorCause_Strings[a]; ok {
return str
}
return "ErrorCause(" + strconv.FormatUint(uint64(a), 10) + ")"
}
func ErrorCause_Add(p *radius.Packet, value ErrorCause) (err error) {
a := radius.NewInteger(uint32(value))
p.Add(ErrorCause_Type, a)
return
}
func ErrorCause_Get(p *radius.Packet) (value ErrorCause) {
value, _ = ErrorCause_Lookup(p)
return
}
func ErrorCause_Gets(p *radius.Packet) (values []ErrorCause, err error) {
var i uint32
for _, attr := range p.Attributes[ErrorCause_Type] {
i, err = radius.Integer(attr)
if err != nil {
return
}
values = append(values, ErrorCause(i))
}
return
}
func ErrorCause_Lookup(p *radius.Packet) (value ErrorCause, err error) {
a, ok := p.Lookup(ErrorCause_Type)
if !ok {
err = radius.ErrNoAttribute
return
}
var i uint32
i, err = radius.Integer(a)
if err != nil {
return
}
value = ErrorCause(i)
return
}
func ErrorCause_Set(p *radius.Packet, value ErrorCause) (err error) {
a := radius.NewInteger(uint32(value))
p.Set(ErrorCause_Type, a)
return
}
func ErrorCause_Del(p *radius.Packet) {
p.Attributes.Del(ErrorCause_Type)
}