-
Notifications
You must be signed in to change notification settings - Fork 37
/
NAS_PDUSessionType.go
51 lines (43 loc) · 1.42 KB
/
NAS_PDUSessionType.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
package nasType
// PDUSessionType 9.11.4.11
// Iei Row, sBit, len = [0, 0], 8 , 4
// Spare Row, sBit, len = [0, 0], 4 , 1
// PDUSessionTypeValue Row, sBit, len = [0, 0], 3 , 3
type PDUSessionType struct {
Octet uint8
}
func NewPDUSessionType(iei uint8) (pDUSessionType *PDUSessionType) {
pDUSessionType = &PDUSessionType{}
pDUSessionType.SetIei(iei)
return pDUSessionType
}
// PDUSessionType 9.11.4.11
// Iei Row, sBit, len = [0, 0], 8 , 4
func (a *PDUSessionType) GetIei() (iei uint8) {
return a.Octet & GetBitMask(8, 4) >> (4)
}
// PDUSessionType 9.11.4.11
// Iei Row, sBit, len = [0, 0], 8 , 4
func (a *PDUSessionType) SetIei(iei uint8) {
a.Octet = (a.Octet & 15) + ((iei & 15) << 4)
}
// PDUSessionType 9.11.4.11
// Spare Row, sBit, len = [0, 0], 4 , 1
func (a *PDUSessionType) GetSpare() (spare uint8) {
return a.Octet & GetBitMask(4, 3) >> (3)
}
// PDUSessionType 9.11.4.11
// Spare Row, sBit, len = [0, 0], 4 , 1
func (a *PDUSessionType) SetSpare(spare uint8) {
a.Octet = (a.Octet & 247) + ((spare & 1) << 3)
}
// PDUSessionType 9.11.4.11
// PDUSessionTypeValue Row, sBit, len = [0, 0], 3 , 3
func (a *PDUSessionType) GetPDUSessionTypeValue() (pDUSessionTypeValue uint8) {
return a.Octet & GetBitMask(3, 0)
}
// PDUSessionType 9.11.4.11
// PDUSessionTypeValue Row, sBit, len = [0, 0], 3 , 3
func (a *PDUSessionType) SetPDUSessionTypeValue(pDUSessionTypeValue uint8) {
a.Octet = (a.Octet & 248) + (pDUSessionTypeValue & 7)
}