-
Notifications
You must be signed in to change notification settings - Fork 39
/
NAS_PayloadContainer.go
54 lines (46 loc) · 1.42 KB
/
NAS_PayloadContainer.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
52
53
54
package nasType
// PayloadContainer 9.11.3.39
// PayloadContainerContents Row, sBit, len = [0, 0], 8 , INF
type PayloadContainer struct {
Iei uint8
Len uint16
Buffer []uint8
}
func NewPayloadContainer(iei uint8) (payloadContainer *PayloadContainer) {
payloadContainer = &PayloadContainer{}
payloadContainer.SetIei(iei)
return payloadContainer
}
// PayloadContainer 9.11.3.39
// Iei Row, sBit, len = [], 8, 8
func (a *PayloadContainer) GetIei() (iei uint8) {
return a.Iei
}
// PayloadContainer 9.11.3.39
// Iei Row, sBit, len = [], 8, 8
func (a *PayloadContainer) SetIei(iei uint8) {
a.Iei = iei
}
// PayloadContainer 9.11.3.39
// Len Row, sBit, len = [], 8, 16
func (a *PayloadContainer) GetLen() (len uint16) {
return a.Len
}
// PayloadContainer 9.11.3.39
// Len Row, sBit, len = [], 8, 16
func (a *PayloadContainer) SetLen(len uint16) {
a.Len = len
a.Buffer = make([]uint8, a.Len)
}
// PayloadContainer 9.11.3.39
// PayloadContainerContents Row, sBit, len = [0, 0], 8 , INF
func (a *PayloadContainer) GetPayloadContainerContents() (payloadContainerContents []uint8) {
payloadContainerContents = make([]uint8, len(a.Buffer))
copy(payloadContainerContents, a.Buffer)
return payloadContainerContents
}
// PayloadContainer 9.11.3.39
// PayloadContainerContents Row, sBit, len = [0, 0], 8 , INF
func (a *PayloadContainer) SetPayloadContainerContents(payloadContainerContents []uint8) {
copy(a.Buffer, payloadContainerContents)
}