summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/udp/udp_state_autogen.go
blob: 9f78f44f1615e56b38f67b8ca4dfbdd14cb16061 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// automatically generated by stateify.

package udp

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

func (x *udpPacket) beforeSave() {}
func (x *udpPacket) save(m state.Map) {
	x.beforeSave()
	var data buffer.VectorisedView = x.saveData()
	m.SaveValue("data", data)
	m.Save("udpPacketEntry", &x.udpPacketEntry)
	m.Save("senderAddress", &x.senderAddress)
	m.Save("timestamp", &x.timestamp)
	m.Save("tos", &x.tos)
}

func (x *udpPacket) afterLoad() {}
func (x *udpPacket) load(m state.Map) {
	m.Load("udpPacketEntry", &x.udpPacketEntry)
	m.Load("senderAddress", &x.senderAddress)
	m.Load("timestamp", &x.timestamp)
	m.Load("tos", &x.tos)
	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("waiterQueue", &x.waiterQueue)
	m.Save("uniqueID", &x.uniqueID)
	m.Save("rcvReady", &x.rcvReady)
	m.Save("rcvList", &x.rcvList)
	m.Save("rcvBufSize", &x.rcvBufSize)
	m.Save("rcvClosed", &x.rcvClosed)
	m.Save("sndBufSize", &x.sndBufSize)
	m.Save("state", &x.state)
	m.Save("dstPort", &x.dstPort)
	m.Save("v6only", &x.v6only)
	m.Save("ttl", &x.ttl)
	m.Save("multicastTTL", &x.multicastTTL)
	m.Save("multicastAddr", &x.multicastAddr)
	m.Save("multicastNICID", &x.multicastNICID)
	m.Save("multicastLoop", &x.multicastLoop)
	m.Save("reusePort", &x.reusePort)
	m.Save("bindToDevice", &x.bindToDevice)
	m.Save("broadcast", &x.broadcast)
	m.Save("boundBindToDevice", &x.boundBindToDevice)
	m.Save("boundPortFlags", &x.boundPortFlags)
	m.Save("sendTOS", &x.sendTOS)
	m.Save("receiveTOS", &x.receiveTOS)
	m.Save("shutdownFlags", &x.shutdownFlags)
	m.Save("multicastMemberships", &x.multicastMemberships)
	m.Save("effectiveNetProtos", &x.effectiveNetProtos)
}

func (x *endpoint) load(m state.Map) {
	m.Load("TransportEndpointInfo", &x.TransportEndpointInfo)
	m.Load("waiterQueue", &x.waiterQueue)
	m.Load("uniqueID", &x.uniqueID)
	m.Load("rcvReady", &x.rcvReady)
	m.Load("rcvList", &x.rcvList)
	m.Load("rcvBufSize", &x.rcvBufSize)
	m.Load("rcvClosed", &x.rcvClosed)
	m.Load("sndBufSize", &x.sndBufSize)
	m.Load("state", &x.state)
	m.Load("dstPort", &x.dstPort)
	m.Load("v6only", &x.v6only)
	m.Load("ttl", &x.ttl)
	m.Load("multicastTTL", &x.multicastTTL)
	m.Load("multicastAddr", &x.multicastAddr)
	m.Load("multicastNICID", &x.multicastNICID)
	m.Load("multicastLoop", &x.multicastLoop)
	m.Load("reusePort", &x.reusePort)
	m.Load("bindToDevice", &x.bindToDevice)
	m.Load("broadcast", &x.broadcast)
	m.Load("boundBindToDevice", &x.boundBindToDevice)
	m.Load("boundPortFlags", &x.boundPortFlags)
	m.Load("sendTOS", &x.sendTOS)
	m.Load("receiveTOS", &x.receiveTOS)
	m.Load("shutdownFlags", &x.shutdownFlags)
	m.Load("multicastMemberships", &x.multicastMemberships)
	m.Load("effectiveNetProtos", &x.effectiveNetProtos)
	m.LoadValue("rcvBufSizeMax", new(int), func(y interface{}) { x.loadRcvBufSizeMax(y.(int)) })
	m.AfterLoad(x.afterLoad)
}

func (x *multicastMembership) beforeSave() {}
func (x *multicastMembership) save(m state.Map) {
	x.beforeSave()
	m.Save("nicID", &x.nicID)
	m.Save("multicastAddr", &x.multicastAddr)
}

func (x *multicastMembership) afterLoad() {}
func (x *multicastMembership) load(m state.Map) {
	m.Load("nicID", &x.nicID)
	m.Load("multicastAddr", &x.multicastAddr)
}

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

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

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

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

func init() {
	state.Register("pkg/tcpip/transport/udp.udpPacket", (*udpPacket)(nil), state.Fns{Save: (*udpPacket).save, Load: (*udpPacket).load})
	state.Register("pkg/tcpip/transport/udp.endpoint", (*endpoint)(nil), state.Fns{Save: (*endpoint).save, Load: (*endpoint).load})
	state.Register("pkg/tcpip/transport/udp.multicastMembership", (*multicastMembership)(nil), state.Fns{Save: (*multicastMembership).save, Load: (*multicastMembership).load})
	state.Register("pkg/tcpip/transport/udp.udpPacketList", (*udpPacketList)(nil), state.Fns{Save: (*udpPacketList).save, Load: (*udpPacketList).load})
	state.Register("pkg/tcpip/transport/udp.udpPacketEntry", (*udpPacketEntry)(nil), state.Fns{Save: (*udpPacketEntry).save, Load: (*udpPacketEntry).load})
}