forked from bronze1man/radius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPacketCode.go
43 lines (39 loc) · 954 Bytes
/
PacketCode.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
package radius
import (
"strconv"
)
type PacketCode uint8
const (
AccessRequest PacketCode = 1
AccessAccept PacketCode = 2
AccessReject PacketCode = 3
AccountingRequest PacketCode = 4
AccountingResponse PacketCode = 5
AccessChallenge PacketCode = 11
StatusServer PacketCode = 12 //(experimental)
StatusClient PacketCode = 13 //(experimental)
Reserved PacketCode = 255
)
func (p PacketCode) String() string {
switch p {
case AccessRequest:
return "AccessRequest"
case AccessAccept:
return "AccessAccept"
case AccessReject:
return "AccessReject"
case AccountingRequest:
return "AccountingRequest"
case AccountingResponse:
return "AccountingResponse"
case AccessChallenge:
return "AccessChallenge"
case StatusServer:
return "StatusServer"
case StatusClient:
return "StatusClient"
case Reserved:
return "Reserved"
}
return "unknown packet code " + strconv.Itoa(int(p))
}