forked from bronze1man/radius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAttributeType.go
376 lines (368 loc) · 18.9 KB
/
AttributeType.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
package radius
import (
"strconv"
)
type AttributeType uint8
const (
//start rfc2865
_ = iota //drop the zero
UserName AttributeType = iota //1
UserPassword AttributeType = iota //2
CHAPPassword AttributeType = iota //3
NASIPAddress AttributeType = iota //4
NASPort AttributeType = iota //5
ServiceType AttributeType = iota //6
FramedProtocol AttributeType = iota //7
FramedIPAddress AttributeType = iota //8
FramedIPNetmask AttributeType = iota //9
FramedRouting AttributeType = iota //10
FilterId AttributeType = iota //11
FramedMTU AttributeType = iota //12
FramedCompression AttributeType = iota //13
LoginIPHost AttributeType = iota //14
LoginService AttributeType = iota //15
LoginTCPPort AttributeType = iota //16
_ = iota //17 unassigned
ReplyMessage AttributeType = iota //18
CallbackNumber AttributeType = iota //19
CallbackId AttributeType = iota //20
_ = iota //21 unassigned
FramedRoute AttributeType = iota //22
FramedIPXNetwork AttributeType = iota //23
State AttributeType = iota //24
Class AttributeType = iota //25
VendorSpecific AttributeType = iota
SessionTimeout AttributeType = iota
IdleTimeout AttributeType = iota
TerminationAction AttributeType = iota
CalledStationId AttributeType = iota
CallingStationId AttributeType = iota
NASIdentifier AttributeType = iota
ProxyState AttributeType = iota
LoginLATService AttributeType = iota
LoginLATNode AttributeType = iota
LoginLATGroup AttributeType = iota
FramedAppleTalkLink AttributeType = iota
FramedAppleTalkNetwork AttributeType = iota
FramedAppleTalkZone AttributeType = iota
AcctStatusType AttributeType = iota
AcctDelayTime AttributeType = iota
AcctInputOctets AttributeType = iota
AcctOutputOctets AttributeType = iota
AcctSessionId AttributeType = iota
AcctAuthentic AttributeType = iota
AcctSessionTime AttributeType = iota
AcctInputPackets AttributeType = iota
AcctOutputPackets AttributeType = iota
AcctTerminateCause AttributeType = iota
AcctMultiSessionId AttributeType = iota
AcctLinkCount AttributeType = iota
AcctInputGigawords AttributeType = iota //52
AcctOutputGigawords AttributeType = iota
Unassigned1 AttributeType = iota
EventTimestamp AttributeType = iota
EgressVLANID AttributeType = iota
IngressFilters AttributeType = iota
EgressVLANName AttributeType = iota
UserPriorityTable AttributeType = iota //59
CHAPChallenge AttributeType = 60
NASPortType AttributeType = 61
PortLimit AttributeType = 62
LoginLATPort AttributeType = 63
//end rfc2865 rfc 2866
TunnelType AttributeType = iota
TunnelMediumType AttributeType = iota
TunnelClientEndpoint AttributeType = iota
TunnelServerEndpoint AttributeType = iota
AcctTunnelConnection AttributeType = iota
TunnelPassword AttributeType = iota
ARAPPassword AttributeType = iota
ARAPFeatures AttributeType = iota
ARAPZoneAccess AttributeType = iota
ARAPSecurity AttributeType = iota
ARAPSecurityData AttributeType = iota
PasswordRetry AttributeType = iota
Prompt AttributeType = iota
ConnectInfo AttributeType = iota
ConfigurationToken AttributeType = iota
EAPMessage AttributeType = iota
MessageAuthenticator AttributeType = iota
TunnelPrivateGroupID AttributeType = iota
TunnelAssignmentID AttributeType = iota
TunnelPreference AttributeType = iota
ARAPChallengeResponse AttributeType = iota
AcctInterimInterval AttributeType = iota
AcctTunnelPacketsLost AttributeType = iota
NASPortId AttributeType = iota
FramedPool AttributeType = iota
CUI AttributeType = iota
TunnelClientAuthID AttributeType = iota
TunnelServerAuthID AttributeType = iota
NASFilterRule AttributeType = iota
Unassigned AttributeType = iota
OriginatingLineInfo AttributeType = iota
NASIPv6Address AttributeType = iota
FramedInterfaceId AttributeType = iota
FramedIPv6Prefix AttributeType = iota
LoginIPv6Host AttributeType = iota
FramedIPv6Route AttributeType = iota
FramedIPv6Pool AttributeType = iota
ErrorCause AttributeType = iota
EAPKeyName AttributeType = iota
DigestResponse AttributeType = iota
DigestRealm AttributeType = iota
DigestNonce AttributeType = iota
DigestResponseAuth AttributeType = iota
DigestNextnonce AttributeType = iota
DigestMethod AttributeType = iota
DigestURI AttributeType = iota
DigestQop AttributeType = iota
DigestAlgorithm AttributeType = iota
DigestEntityBodyHash AttributeType = iota
DigestCNonce AttributeType = iota
DigestNonceCount AttributeType = iota
DigestUsername AttributeType = iota
DigestOpaque AttributeType = iota
DigestAuthParam AttributeType = iota
DigestAKAAuts AttributeType = iota
DigestDomain AttributeType = iota
DigestStale AttributeType = iota
DigestHA1 AttributeType = iota
SIPAOR AttributeType = iota
DelegatedIPv6Prefix AttributeType = iota
MIP6FeatureVector AttributeType = iota
MIP6HomeLinkPrefix AttributeType = iota
OperatorName AttributeType = iota
LocationInformation AttributeType = iota
LocationData AttributeType = iota
BasicLocationPolicyRules AttributeType = iota
ExtendedLocationPolicyRules AttributeType = iota
LocationCapable AttributeType = iota
RequestedLocationInfo AttributeType = iota
FramedManagementProtocol AttributeType = iota
ManagementTransportProtectio AttributeType = iota
ManagementPolicyId AttributeType = iota
ManagementPrivilegeLevel AttributeType = iota
PKMSSCert AttributeType = iota
PKMCACert AttributeType = iota
PKMConfigSettings AttributeType = iota
PKMCryptosuiteList AttributeType = iota
PKMSAID AttributeType = iota
PKMSADescriptor AttributeType = iota
PKMAuthKey AttributeType = iota
DSLiteTunnelName AttributeType = iota
MobileNodeIdentifier AttributeType = iota
ServiceSelection AttributeType = iota
PMIP6HomeLMAIPv6Address AttributeType = iota
PMIP6VisitedLMAIPv6Address AttributeType = iota
PMIP6HomeLMAIPv4Address AttributeType = iota
PMIP6VisitedLMAIPv4Address AttributeType = iota
PMIP6HomeHNPrefix AttributeType = iota
PMIP6VisitedHNPrefix AttributeType = iota
PMIP6HomeInterfaceID AttributeType = iota
PMIP6VisitedInterfaceID AttributeType = iota
PMIP6HomeIPv4HoA AttributeType = iota
PMIP6VisitedIPv4HoA AttributeType = iota
PMIP6HomeDHCP4ServerAddress AttributeType = iota
PMIP6VisitedDHCP4ServerAddre AttributeType = iota
PMIP6HomeDHCP6ServerAddress AttributeType = iota
PMIP6VisitedDHCP6ServerAddre AttributeType = iota
UnassignedStart AttributeType = 161
UnassignedEnd AttributeType = 191
ExperimentalStart AttributeType = 192
ExperimentalEnd AttributeType = 223
ImplementationSpecificStart AttributeType = 224
ImplementationSpecificEnd AttributeType = 240
ReservedStart AttributeType = 241
ReservedEnd AttributeType = 254
)
func getAttributeTypeDesc(t AttributeType) attributeTypeDesc {
desc := attributeTypeMap[int(t)]
if desc.dataType == nil {
desc.dataType = avpBinary
}
if desc.name == "" {
desc.name = "Unknow " + strconv.Itoa(int(t))
}
return desc
}
type attributeTypeDesc struct {
name string
dataType avpDataType
}
var attributeTypeMap = [256]attributeTypeDesc{
0: {"Unassigned 0", avpBinary},
UserName: {"UserName", avpString},
UserPassword: {"UserPassword", avpPassword},
CHAPPassword: {"CHAPPassword", avpBinary},
NASIPAddress: {"NASIPAddress", avpIP},
NASPort: {"NASPort", avpUint32},
ServiceType: {"ServiceType", avpUint32Enum{ServiceTypeEnum(0)}},
FramedProtocol: {"FramedProtocol", avpUint32},
FramedIPAddress: {"FramedIPAddress", avpIP},
FramedIPNetmask: {"FramedIPNetmask", avpIP},
FramedRouting: {"FramedRouting", avpUint32},
FilterId: {"FilterId", avpString},
FramedMTU: {"FramedMTU", avpUint32},
FramedCompression: {"FramedCompression", avpUint32},
LoginIPHost: {"LoginIPHost", avpIP},
LoginService: {"LoginService", avpUint32},
LoginTCPPort: {"LoginTCPPort", avpUint32},
17: {"Unassigned 17", avpBinary},
ReplyMessage: {"ReplyMessage", avpString},
CallbackNumber: {"CallbackNumber", avpString},
CallbackId: {"CallbackId", avpString},
21: {"Unassigned 21", avpBinary},
FramedRoute: {"FramedRoute", avpString},
FramedIPXNetwork: {"FramedIPXNetwork", avpIP},
State: {"State", avpString},
Class: {"Class", avpString},
VendorSpecific: {"VendorSpecific", avpBinary},
SessionTimeout: {"SessionTimeout", avpUint32},
IdleTimeout: {"IdleTimeout", avpUint32},
TerminationAction: {"TerminationAction", avpUint32},
CalledStationId: {"CalledStationId", avpString},
CallingStationId: {"CallingStationId", avpString},
NASIdentifier: {"NASIdentifier", avpString},
ProxyState: {"ProxyState", avpString},
LoginLATService: {"LoginLATService", avpString},
LoginLATNode: {"LoginLATNode", avpString},
LoginLATGroup: {"LoginLATGroup", avpString},
FramedAppleTalkLink: {"FramedAppleTalkLink", avpUint32},
FramedAppleTalkNetwork: {"FramedAppleTalkNetwork", avpUint32},
FramedAppleTalkZone: {"FramedAppleTalkZone", avpUint32},
AcctStatusType: {"AcctStatusType", avpUint32Enum{AcctStatusTypeEnum(0)}},
AcctDelayTime: {"AcctDelayTime", avpUint32},
AcctInputOctets: {"AcctInputOctets", avpUint32},
AcctOutputOctets: {"AcctOutputOctets", avpUint32},
AcctSessionId: {"AcctSessionId", avpString},
AcctAuthentic: {"AcctAuthentic", avpUint32},
AcctSessionTime: {"AcctSessionTime", avpUint32},
AcctInputPackets: {"AcctInputPackets", avpUint32},
AcctOutputPackets: {"AcctOutputPackets", avpUint32},
AcctTerminateCause: {"AcctTerminateCause", avpUint32Enum{AcctTerminateCauseEnum(0)}},
AcctMultiSessionId: {"AcctMultiSessionId", avpString},
AcctLinkCount: {"AcctLinkCount", avpUint32},
AcctInputGigawords: {"AcctInputGigawords", avpUint32},
AcctOutputGigawords: {"AcctOutputGigawords", avpUint32},
Unassigned1: {"Unassigned1", avpBinary},
EventTimestamp: {"EventTimestamp", avpBinary},
EgressVLANID: {"EgressVLANID", avpBinary},
IngressFilters: {"IngressFilters", avpBinary},
EgressVLANName: {"EgressVLANName", avpBinary},
UserPriorityTable: {"UserPriorityTable", avpBinary},
CHAPChallenge: {"CHAPChallenge", avpBinary},
NASPortType: {"NASPortType", avpUint32Enum{NASPortTypeEnum(0)}},
PortLimit: {"PortLimit", avpBinary},
LoginLATPort: {"LoginLATPort", avpBinary},
//end rfc2865://end rfc2865
TunnelType: {"TunnelType", avpBinary},
TunnelMediumType: {"TunnelMediumType", avpBinary},
TunnelClientEndpoint: {"TunnelClientEndpoint", avpBinary},
TunnelServerEndpoint: {"TunnelServerEndpoint", avpBinary},
AcctTunnelConnection: {"AcctTunnelConnection", avpBinary},
TunnelPassword: {"TunnelPassword", avpBinary},
ARAPPassword: {"ARAPPassword", avpBinary},
ARAPFeatures: {"ARAPFeatures", avpBinary},
ARAPZoneAccess: {"ARAPZoneAccess", avpBinary},
ARAPSecurity: {"ARAPSecurity", avpBinary},
ARAPSecurityData: {"ARAPSecurityData", avpBinary},
PasswordRetry: {"PasswordRetry", avpBinary},
Prompt: {"Prompt", avpBinary},
ConnectInfo: {"ConnectInfo", avpBinary},
ConfigurationToken: {"ConfigurationToken", avpString},
EAPMessage: {"EAPMessage", avpEapMessage},
MessageAuthenticator: {"MessageAuthenticator", avpBinary},
TunnelPrivateGroupID: {"TunnelPrivateGroupID", avpBinary},
TunnelAssignmentID: {"TunnelAssignmentID", avpBinary},
TunnelPreference: {"TunnelPreference", avpBinary},
ARAPChallengeResponse: {"ARAPChallengeResponse", avpBinary},
AcctInterimInterval: {"AcctInterimInterval", avpBinary},
AcctTunnelPacketsLost: {"AcctTunnelPacketsLost", avpBinary},
NASPortId: {"NASPortId", avpString},
FramedPool: {"FramedPool", avpBinary},
CUI: {"CUI", avpBinary},
TunnelClientAuthID: {"TunnelClientAuthID", avpBinary},
TunnelServerAuthID: {"TunnelServerAuthID", avpBinary},
NASFilterRule: {"NASFilterRule", avpBinary},
Unassigned: {"Unassigned", avpBinary},
OriginatingLineInfo: {"OriginatingLineInfo", avpBinary},
NASIPv6Address: {"NASIPv6Address", avpBinary},
FramedInterfaceId: {"FramedInterfaceId", avpBinary},
FramedIPv6Prefix: {"FramedIPv6Prefix", avpBinary},
LoginIPv6Host: {"LoginIPv6Host", avpBinary},
FramedIPv6Route: {"FramedIPv6Route", avpBinary},
FramedIPv6Pool: {"FramedIPv6Pool", avpBinary},
ErrorCause: {"ErrorCause", avpBinary},
EAPKeyName: {"EAPKeyName", avpBinary},
DigestResponse: {"DigestResponse", avpBinary},
DigestRealm: {"DigestRealm", avpBinary},
DigestNonce: {"DigestNonce", avpBinary},
DigestResponseAuth: {"DigestResponseAuth", avpBinary},
DigestNextnonce: {"DigestNextnonce", avpBinary},
DigestMethod: {"DigestMethod", avpBinary},
DigestURI: {"DigestURI", avpBinary},
DigestQop: {"DigestQop", avpBinary},
DigestAlgorithm: {"DigestAlgorithm", avpBinary},
DigestEntityBodyHash: {"DigestEntityBodyHash", avpBinary},
DigestCNonce: {"DigestCNonce", avpBinary},
DigestNonceCount: {"DigestNonceCount", avpBinary},
DigestUsername: {"DigestUsername", avpBinary},
DigestOpaque: {"DigestOpaque", avpBinary},
DigestAuthParam: {"DigestAuthParam", avpBinary},
DigestAKAAuts: {"DigestAKAAuts", avpBinary},
DigestDomain: {"DigestDomain", avpBinary},
DigestStale: {"DigestStale", avpBinary},
DigestHA1: {"DigestHA1", avpBinary},
SIPAOR: {"SIPAOR", avpBinary},
DelegatedIPv6Prefix: {"DelegatedIPv6Prefix", avpBinary},
MIP6FeatureVector: {"MIP6FeatureVector", avpBinary},
MIP6HomeLinkPrefix: {"MIP6HomeLinkPrefix", avpBinary},
OperatorName: {"OperatorName", avpBinary},
LocationInformation: {"LocationInformation", avpBinary},
LocationData: {"LocationData", avpBinary},
BasicLocationPolicyRules: {"BasicLocationPolicyRules", avpBinary},
ExtendedLocationPolicyRules: {"ExtendedLocationPolicyRules", avpBinary},
LocationCapable: {"LocationCapable", avpBinary},
RequestedLocationInfo: {"RequestedLocationInfo", avpBinary},
FramedManagementProtocol: {"FramedManagementProtocol", avpBinary},
ManagementTransportProtectio: {"ManagementTransportProtection", avpBinary},
ManagementPolicyId: {"ManagementPolicyId", avpBinary},
ManagementPrivilegeLevel: {"ManagementPrivilegeLevel", avpBinary},
PKMSSCert: {"PKMSSCert", avpBinary},
PKMCACert: {"PKMCACert", avpBinary},
PKMConfigSettings: {"PKMConfigSettings", avpBinary},
PKMCryptosuiteList: {"PKMCryptosuiteList", avpBinary},
PKMSAID: {"PKMSAID", avpBinary},
PKMSADescriptor: {"PKMSADescriptor", avpBinary},
PKMAuthKey: {"PKMAuthKey", avpBinary},
DSLiteTunnelName: {"DSLiteTunnelName", avpBinary},
MobileNodeIdentifier: {"MobileNodeIdentifier", avpBinary},
ServiceSelection: {"ServiceSelection", avpBinary},
PMIP6HomeLMAIPv6Address: {"PMIP6HomeLMAIPv6Address", avpBinary},
PMIP6VisitedLMAIPv6Address: {"PMIP6VisitedLMAIPv6Address", avpBinary},
PMIP6HomeLMAIPv4Address: {"PMIP6HomeLMAIPv4Address", avpBinary},
PMIP6VisitedLMAIPv4Address: {"PMIP6VisitedLMAIPv4Address", avpBinary},
PMIP6HomeHNPrefix: {"PMIP6HomeHNPrefix", avpBinary},
PMIP6VisitedHNPrefix: {"PMIP6VisitedHNPrefix", avpBinary},
PMIP6HomeInterfaceID: {"PMIP6HomeInterfaceID", avpBinary},
PMIP6VisitedInterfaceID: {"PMIP6VisitedInterfaceID", avpBinary},
PMIP6HomeIPv4HoA: {"PMIP6HomeIPv4HoA", avpBinary},
PMIP6VisitedIPv4HoA: {"PMIP6VisitedIPv4HoA", avpBinary},
PMIP6HomeDHCP4ServerAddress: {"PMIP6HomeDHCP4ServerAddress", avpBinary},
PMIP6VisitedDHCP4ServerAddre: {"PMIP6VisitedDHCP4ServerAddress", avpBinary},
PMIP6HomeDHCP6ServerAddress: {"PMIP6HomeDHCP6ServerAddress", avpBinary},
PMIP6VisitedDHCP6ServerAddre: {"PMIP6VisitedDHCP6ServerAddress", avpBinary},
UnassignedStart: {"UnassignedStart", avpBinary}, //161
//Unassigned
UnassignedEnd: {"UnassignedEnd", avpBinary},
ExperimentalStart: {"ExperimentalStart", avpBinary},
ExperimentalEnd: {"ExperimentalEnd", avpBinary},
ImplementationSpecificStart: {"ImplementationSpecificStart", avpBinary},
ImplementationSpecificEnd: {"ImplementationSpecificEnd", avpBinary},
ReservedStart: {"ReservedStart", avpBinary},
ReservedEnd: {"ReservedEnd", avpBinary},
}
func (a AttributeType) String() string {
return getAttributeTypeDesc(a).name
}