-
Notifications
You must be signed in to change notification settings - Fork 39
/
NAS_RequestType.go
38 lines (32 loc) · 1001 Bytes
/
NAS_RequestType.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
package nasType
// RequestType 9.11.3.47
// Iei Row, sBit, len = [0, 0], 8 , 4
// RequestTypeValue Row, sBit, len = [0, 0], 3 , 3
type RequestType struct {
Octet uint8
}
func NewRequestType(iei uint8) (requestType *RequestType) {
requestType = &RequestType{}
requestType.SetIei(iei)
return requestType
}
// RequestType 9.11.3.47
// Iei Row, sBit, len = [0, 0], 8 , 4
func (a *RequestType) GetIei() (iei uint8) {
return a.Octet & GetBitMask(8, 4) >> (4)
}
// RequestType 9.11.3.47
// Iei Row, sBit, len = [0, 0], 8 , 4
func (a *RequestType) SetIei(iei uint8) {
a.Octet = (a.Octet & 15) + ((iei & 15) << 4)
}
// RequestType 9.11.3.47
// RequestTypeValue Row, sBit, len = [0, 0], 3 , 3
func (a *RequestType) GetRequestTypeValue() (requestTypeValue uint8) {
return a.Octet & GetBitMask(3, 0)
}
// RequestType 9.11.3.47
// RequestTypeValue Row, sBit, len = [0, 0], 3 , 3
func (a *RequestType) SetRequestTypeValue(requestTypeValue uint8) {
a.Octet = (a.Octet & 248) + (requestTypeValue & 7)
}