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