summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/packet/packet_state_autogen.go
blob: 1d90a383f9fe8dd3b793577e9ebedf83232f96b3 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// automatically generated by stateify.

package packet

import (
	"gvisor.dev/gvisor/pkg/state"
	"gvisor.dev/gvisor/pkg/tcpip/buffer"
)

func (x *packet) beforeSave() {}
func (x *packet) save(m state.Map) {
	x.beforeSave()
	var data buffer.VectorisedView = x.saveData()
	m.SaveValue("data", data)
	m.Save("packetEntry", &x.packetEntry)
	m.Save("timestampNS", &x.timestampNS)
	m.Save("senderAddr", &x.senderAddr)
}

func (x *packet) afterLoad() {}
func (x *packet) load(m state.Map) {
	m.Load("packetEntry", &x.packetEntry)
	m.Load("timestampNS", &x.timestampNS)
	m.Load("senderAddr", &x.senderAddr)
	m.LoadValue("data", new(buffer.VectorisedView), func(y interface{}) { x.loadData(y.(buffer.VectorisedView)) })
}

func (x *endpoint) save(m state.Map) {
	x.beforeSave()
	var rcvBufSizeMax int = x.saveRcvBufSizeMax()
	m.SaveValue("rcvBufSizeMax", rcvBufSizeMax)
	m.Save("TransportEndpointInfo", &x.TransportEndpointInfo)
	m.Save("netProto", &x.netProto)
	m.Save("waiterQueue", &x.waiterQueue)
	m.Save("cooked", &x.cooked)
	m.Save("rcvList", &x.rcvList)
	m.Save("rcvBufSize", &x.rcvBufSize)
	m.Save("rcvClosed", &x.rcvClosed)
	m.Save("sndBufSize", &x.sndBufSize)
	m.Save("closed", &x.closed)
}

func (x *endpoint) load(m state.Map) {
	m.Load("TransportEndpointInfo", &x.TransportEndpointInfo)
	m.Load("netProto", &x.netProto)
	m.Load("waiterQueue", &x.waiterQueue)
	m.Load("cooked", &x.cooked)
	m.Load("rcvList", &x.rcvList)
	m.Load("rcvBufSize", &x.rcvBufSize)
	m.Load("rcvClosed", &x.rcvClosed)
	m.Load("sndBufSize", &x.sndBufSize)
	m.Load("closed", &x.closed)
	m.LoadValue("rcvBufSizeMax", new(int), func(y interface{}) { x.loadRcvBufSizeMax(y.(int)) })
	m.AfterLoad(x.afterLoad)
}

func (x *packetList) beforeSave() {}
func (x *packetList) save(m state.Map) {
	x.beforeSave()
	m.Save("head", &x.head)
	m.Save("tail", &x.tail)
}

func (x *packetList) afterLoad() {}
func (x *packetList) load(m state.Map) {
	m.Load("head", &x.head)
	m.Load("tail", &x.tail)
}

func (x *packetEntry) beforeSave() {}
func (x *packetEntry) save(m state.Map) {
	x.beforeSave()
	m.Save("next", &x.next)
	m.Save("prev", &x.prev)
}

func (x *packetEntry) afterLoad() {}
func (x *packetEntry) load(m state.Map) {
	m.Load("next", &x.next)
	m.Load("prev", &x.prev)
}

func init() {
	state.Register("pkg/tcpip/transport/packet.packet", (*packet)(nil), state.Fns{Save: (*packet).save, Load: (*packet).load})
	state.Register("pkg/tcpip/transport/packet.endpoint", (*endpoint)(nil), state.Fns{Save: (*endpoint).save, Load: (*endpoint).load})
	state.Register("pkg/tcpip/transport/packet.packetList", (*packetList)(nil), state.Fns{Save: (*packetList).save, Load: (*packetList).load})
	state.Register("pkg/tcpip/transport/packet.packetEntry", (*packetEntry)(nil), state.Fns{Save: (*packetEntry).save, Load: (*packetEntry).load})
}