github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/tcpip/transport/udp/udp_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package udp 4 5 import ( 6 "github.com/MerlinKodo/gvisor/pkg/state" 7 ) 8 9 func (p *udpPacket) StateTypeName() string { 10 return "pkg/tcpip/transport/udp.udpPacket" 11 } 12 13 func (p *udpPacket) StateFields() []string { 14 return []string{ 15 "udpPacketEntry", 16 "netProto", 17 "senderAddress", 18 "destinationAddress", 19 "packetInfo", 20 "pkt", 21 "receivedAt", 22 "tosOrTClass", 23 "ttlOrHopLimit", 24 } 25 } 26 27 func (p *udpPacket) beforeSave() {} 28 29 // +checklocksignore 30 func (p *udpPacket) StateSave(stateSinkObject state.Sink) { 31 p.beforeSave() 32 var receivedAtValue int64 33 receivedAtValue = p.saveReceivedAt() 34 stateSinkObject.SaveValue(6, receivedAtValue) 35 stateSinkObject.Save(0, &p.udpPacketEntry) 36 stateSinkObject.Save(1, &p.netProto) 37 stateSinkObject.Save(2, &p.senderAddress) 38 stateSinkObject.Save(3, &p.destinationAddress) 39 stateSinkObject.Save(4, &p.packetInfo) 40 stateSinkObject.Save(5, &p.pkt) 41 stateSinkObject.Save(7, &p.tosOrTClass) 42 stateSinkObject.Save(8, &p.ttlOrHopLimit) 43 } 44 45 func (p *udpPacket) afterLoad() {} 46 47 // +checklocksignore 48 func (p *udpPacket) StateLoad(stateSourceObject state.Source) { 49 stateSourceObject.Load(0, &p.udpPacketEntry) 50 stateSourceObject.Load(1, &p.netProto) 51 stateSourceObject.Load(2, &p.senderAddress) 52 stateSourceObject.Load(3, &p.destinationAddress) 53 stateSourceObject.Load(4, &p.packetInfo) 54 stateSourceObject.Load(5, &p.pkt) 55 stateSourceObject.Load(7, &p.tosOrTClass) 56 stateSourceObject.Load(8, &p.ttlOrHopLimit) 57 stateSourceObject.LoadValue(6, new(int64), func(y any) { p.loadReceivedAt(y.(int64)) }) 58 } 59 60 func (e *endpoint) StateTypeName() string { 61 return "pkg/tcpip/transport/udp.endpoint" 62 } 63 64 func (e *endpoint) StateFields() []string { 65 return []string{ 66 "DefaultSocketOptionsHandler", 67 "waiterQueue", 68 "uniqueID", 69 "net", 70 "stats", 71 "ops", 72 "rcvReady", 73 "rcvList", 74 "rcvBufSize", 75 "rcvClosed", 76 "lastError", 77 "portFlags", 78 "boundBindToDevice", 79 "boundPortFlags", 80 "readShutdown", 81 "effectiveNetProtos", 82 "frozen", 83 "localPort", 84 "remotePort", 85 } 86 } 87 88 // +checklocksignore 89 func (e *endpoint) StateSave(stateSinkObject state.Sink) { 90 e.beforeSave() 91 stateSinkObject.Save(0, &e.DefaultSocketOptionsHandler) 92 stateSinkObject.Save(1, &e.waiterQueue) 93 stateSinkObject.Save(2, &e.uniqueID) 94 stateSinkObject.Save(3, &e.net) 95 stateSinkObject.Save(4, &e.stats) 96 stateSinkObject.Save(5, &e.ops) 97 stateSinkObject.Save(6, &e.rcvReady) 98 stateSinkObject.Save(7, &e.rcvList) 99 stateSinkObject.Save(8, &e.rcvBufSize) 100 stateSinkObject.Save(9, &e.rcvClosed) 101 stateSinkObject.Save(10, &e.lastError) 102 stateSinkObject.Save(11, &e.portFlags) 103 stateSinkObject.Save(12, &e.boundBindToDevice) 104 stateSinkObject.Save(13, &e.boundPortFlags) 105 stateSinkObject.Save(14, &e.readShutdown) 106 stateSinkObject.Save(15, &e.effectiveNetProtos) 107 stateSinkObject.Save(16, &e.frozen) 108 stateSinkObject.Save(17, &e.localPort) 109 stateSinkObject.Save(18, &e.remotePort) 110 } 111 112 // +checklocksignore 113 func (e *endpoint) StateLoad(stateSourceObject state.Source) { 114 stateSourceObject.Load(0, &e.DefaultSocketOptionsHandler) 115 stateSourceObject.Load(1, &e.waiterQueue) 116 stateSourceObject.Load(2, &e.uniqueID) 117 stateSourceObject.Load(3, &e.net) 118 stateSourceObject.Load(4, &e.stats) 119 stateSourceObject.Load(5, &e.ops) 120 stateSourceObject.Load(6, &e.rcvReady) 121 stateSourceObject.Load(7, &e.rcvList) 122 stateSourceObject.Load(8, &e.rcvBufSize) 123 stateSourceObject.Load(9, &e.rcvClosed) 124 stateSourceObject.Load(10, &e.lastError) 125 stateSourceObject.Load(11, &e.portFlags) 126 stateSourceObject.Load(12, &e.boundBindToDevice) 127 stateSourceObject.Load(13, &e.boundPortFlags) 128 stateSourceObject.Load(14, &e.readShutdown) 129 stateSourceObject.Load(15, &e.effectiveNetProtos) 130 stateSourceObject.Load(16, &e.frozen) 131 stateSourceObject.Load(17, &e.localPort) 132 stateSourceObject.Load(18, &e.remotePort) 133 stateSourceObject.AfterLoad(e.afterLoad) 134 } 135 136 func (l *udpPacketList) StateTypeName() string { 137 return "pkg/tcpip/transport/udp.udpPacketList" 138 } 139 140 func (l *udpPacketList) StateFields() []string { 141 return []string{ 142 "head", 143 "tail", 144 } 145 } 146 147 func (l *udpPacketList) beforeSave() {} 148 149 // +checklocksignore 150 func (l *udpPacketList) StateSave(stateSinkObject state.Sink) { 151 l.beforeSave() 152 stateSinkObject.Save(0, &l.head) 153 stateSinkObject.Save(1, &l.tail) 154 } 155 156 func (l *udpPacketList) afterLoad() {} 157 158 // +checklocksignore 159 func (l *udpPacketList) StateLoad(stateSourceObject state.Source) { 160 stateSourceObject.Load(0, &l.head) 161 stateSourceObject.Load(1, &l.tail) 162 } 163 164 func (e *udpPacketEntry) StateTypeName() string { 165 return "pkg/tcpip/transport/udp.udpPacketEntry" 166 } 167 168 func (e *udpPacketEntry) StateFields() []string { 169 return []string{ 170 "next", 171 "prev", 172 } 173 } 174 175 func (e *udpPacketEntry) beforeSave() {} 176 177 // +checklocksignore 178 func (e *udpPacketEntry) StateSave(stateSinkObject state.Sink) { 179 e.beforeSave() 180 stateSinkObject.Save(0, &e.next) 181 stateSinkObject.Save(1, &e.prev) 182 } 183 184 func (e *udpPacketEntry) afterLoad() {} 185 186 // +checklocksignore 187 func (e *udpPacketEntry) StateLoad(stateSourceObject state.Source) { 188 stateSourceObject.Load(0, &e.next) 189 stateSourceObject.Load(1, &e.prev) 190 } 191 192 func init() { 193 state.Register((*udpPacket)(nil)) 194 state.Register((*endpoint)(nil)) 195 state.Register((*udpPacketList)(nil)) 196 state.Register((*udpPacketEntry)(nil)) 197 }