/
NAS_SelectedEPSNASSecurityAlgorithms.go
51 lines (43 loc) · 1.96 KB
/
NAS_SelectedEPSNASSecurityAlgorithms.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
// SelectedEPSNASSecurityAlgorithms 9.11.3.25
// TypeOfCipheringAlgorithm Row, sBit, len = [0, 0], 7 , 3
// TypeOfIntegrityProtectionAlgorithm Row, sBit, len = [0, 0], 3 , 3
type SelectedEPSNASSecurityAlgorithms struct {
Iei uint8
Octet uint8
}
func NewSelectedEPSNASSecurityAlgorithms(iei uint8) (selectedEPSNASSecurityAlgorithms *SelectedEPSNASSecurityAlgorithms) {
selectedEPSNASSecurityAlgorithms = &SelectedEPSNASSecurityAlgorithms{}
selectedEPSNASSecurityAlgorithms.SetIei(iei)
return selectedEPSNASSecurityAlgorithms
}
// SelectedEPSNASSecurityAlgorithms 9.11.3.25
// Iei Row, sBit, len = [], 8, 8
func (a *SelectedEPSNASSecurityAlgorithms) GetIei() (iei uint8) {
return a.Iei
}
// SelectedEPSNASSecurityAlgorithms 9.11.3.25
// Iei Row, sBit, len = [], 8, 8
func (a *SelectedEPSNASSecurityAlgorithms) SetIei(iei uint8) {
a.Iei = iei
}
// SelectedEPSNASSecurityAlgorithms 9.11.3.25
// TypeOfCipheringAlgorithm Row, sBit, len = [0, 0], 7 , 3
func (a *SelectedEPSNASSecurityAlgorithms) GetTypeOfCipheringAlgorithm() (typeOfCipheringAlgorithm uint8) {
return a.Octet & GetBitMask(7, 4) >> (4)
}
// SelectedEPSNASSecurityAlgorithms 9.11.3.25
// TypeOfCipheringAlgorithm Row, sBit, len = [0, 0], 7 , 3
func (a *SelectedEPSNASSecurityAlgorithms) SetTypeOfCipheringAlgorithm(typeOfCipheringAlgorithm uint8) {
a.Octet = (a.Octet & 143) + ((typeOfCipheringAlgorithm & 7) << 4)
}
// SelectedEPSNASSecurityAlgorithms 9.11.3.25
// TypeOfIntegrityProtectionAlgorithm Row, sBit, len = [0, 0], 3 , 3
func (a *SelectedEPSNASSecurityAlgorithms) GetTypeOfIntegrityProtectionAlgorithm() (typeOfIntegrityProtectionAlgorithm uint8) {
return a.Octet & GetBitMask(3, 0)
}
// SelectedEPSNASSecurityAlgorithms 9.11.3.25
// TypeOfIntegrityProtectionAlgorithm Row, sBit, len = [0, 0], 3 , 3
func (a *SelectedEPSNASSecurityAlgorithms) SetTypeOfIntegrityProtectionAlgorithm(typeOfIntegrityProtectionAlgorithm uint8) {
a.Octet = (a.Octet & 248) + (typeOfIntegrityProtectionAlgorithm & 7)
}