-
Notifications
You must be signed in to change notification settings - Fork 38
/
NAS_SelectedNASSecurityAlgorithms.go
51 lines (43 loc) · 1.9 KB
/
NAS_SelectedNASSecurityAlgorithms.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
// SelectedNASSecurityAlgorithms 9.11.3.34
// TypeOfCipheringAlgorithm Row, sBit, len = [0, 0], 8 , 4
// TypeOfIntegrityProtectionAlgorithm Row, sBit, len = [0, 0], 4 , 4
type SelectedNASSecurityAlgorithms struct {
Iei uint8
Octet uint8
}
func NewSelectedNASSecurityAlgorithms(iei uint8) (selectedNASSecurityAlgorithms *SelectedNASSecurityAlgorithms) {
selectedNASSecurityAlgorithms = &SelectedNASSecurityAlgorithms{}
selectedNASSecurityAlgorithms.SetIei(iei)
return selectedNASSecurityAlgorithms
}
// SelectedNASSecurityAlgorithms 9.11.3.34
// Iei Row, sBit, len = [], 8, 8
func (a *SelectedNASSecurityAlgorithms) GetIei() (iei uint8) {
return a.Iei
}
// SelectedNASSecurityAlgorithms 9.11.3.34
// Iei Row, sBit, len = [], 8, 8
func (a *SelectedNASSecurityAlgorithms) SetIei(iei uint8) {
a.Iei = iei
}
// SelectedNASSecurityAlgorithms 9.11.3.34
// TypeOfCipheringAlgorithm Row, sBit, len = [0, 0], 8 , 4
func (a *SelectedNASSecurityAlgorithms) GetTypeOfCipheringAlgorithm() (typeOfCipheringAlgorithm uint8) {
return a.Octet & GetBitMask(8, 4) >> (4)
}
// SelectedNASSecurityAlgorithms 9.11.3.34
// TypeOfCipheringAlgorithm Row, sBit, len = [0, 0], 8 , 4
func (a *SelectedNASSecurityAlgorithms) SetTypeOfCipheringAlgorithm(typeOfCipheringAlgorithm uint8) {
a.Octet = (a.Octet & 15) + ((typeOfCipheringAlgorithm & 15) << 4)
}
// SelectedNASSecurityAlgorithms 9.11.3.34
// TypeOfIntegrityProtectionAlgorithm Row, sBit, len = [0, 0], 4 , 4
func (a *SelectedNASSecurityAlgorithms) GetTypeOfIntegrityProtectionAlgorithm() (typeOfIntegrityProtectionAlgorithm uint8) {
return a.Octet & GetBitMask(4, 0)
}
// SelectedNASSecurityAlgorithms 9.11.3.34
// TypeOfIntegrityProtectionAlgorithm Row, sBit, len = [0, 0], 4 , 4
func (a *SelectedNASSecurityAlgorithms) SetTypeOfIntegrityProtectionAlgorithm(typeOfIntegrityProtectionAlgorithm uint8) {
a.Octet = (a.Octet & 240) + (typeOfIntegrityProtectionAlgorithm & 15)
}