github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/pkg/tcpip/transport/tcp/tcp_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package tcp 4 5 import ( 6 "context" 7 8 "github.com/sagernet/gvisor/pkg/state" 9 ) 10 11 func (a *acceptQueue) StateTypeName() string { 12 return "pkg/tcpip/transport/tcp.acceptQueue" 13 } 14 15 func (a *acceptQueue) StateFields() []string { 16 return []string{ 17 "endpoints", 18 "pendingEndpoints", 19 "capacity", 20 } 21 } 22 23 func (a *acceptQueue) beforeSave() {} 24 25 // +checklocksignore 26 func (a *acceptQueue) StateSave(stateSinkObject state.Sink) { 27 a.beforeSave() 28 var endpointsValue []*Endpoint 29 endpointsValue = a.saveEndpoints() 30 stateSinkObject.SaveValue(0, endpointsValue) 31 stateSinkObject.Save(1, &a.pendingEndpoints) 32 stateSinkObject.Save(2, &a.capacity) 33 } 34 35 func (a *acceptQueue) afterLoad(context.Context) {} 36 37 // +checklocksignore 38 func (a *acceptQueue) StateLoad(ctx context.Context, stateSourceObject state.Source) { 39 stateSourceObject.Load(1, &a.pendingEndpoints) 40 stateSourceObject.Load(2, &a.capacity) 41 stateSourceObject.LoadValue(0, new([]*Endpoint), func(y any) { a.loadEndpoints(ctx, y.([]*Endpoint)) }) 42 } 43 44 func (h *handshake) StateTypeName() string { 45 return "pkg/tcpip/transport/tcp.handshake" 46 } 47 48 func (h *handshake) StateFields() []string { 49 return []string{ 50 "ep", 51 "listenEP", 52 "state", 53 "active", 54 "flags", 55 "ackNum", 56 "iss", 57 "rcvWnd", 58 "sndWnd", 59 "mss", 60 "sndWndScale", 61 "rcvWndScale", 62 "startTime", 63 "deferAccept", 64 "acked", 65 "sendSYNOpts", 66 "sampleRTTWithTSOnly", 67 } 68 } 69 70 func (h *handshake) beforeSave() {} 71 72 // +checklocksignore 73 func (h *handshake) StateSave(stateSinkObject state.Sink) { 74 h.beforeSave() 75 stateSinkObject.Save(0, &h.ep) 76 stateSinkObject.Save(1, &h.listenEP) 77 stateSinkObject.Save(2, &h.state) 78 stateSinkObject.Save(3, &h.active) 79 stateSinkObject.Save(4, &h.flags) 80 stateSinkObject.Save(5, &h.ackNum) 81 stateSinkObject.Save(6, &h.iss) 82 stateSinkObject.Save(7, &h.rcvWnd) 83 stateSinkObject.Save(8, &h.sndWnd) 84 stateSinkObject.Save(9, &h.mss) 85 stateSinkObject.Save(10, &h.sndWndScale) 86 stateSinkObject.Save(11, &h.rcvWndScale) 87 stateSinkObject.Save(12, &h.startTime) 88 stateSinkObject.Save(13, &h.deferAccept) 89 stateSinkObject.Save(14, &h.acked) 90 stateSinkObject.Save(15, &h.sendSYNOpts) 91 stateSinkObject.Save(16, &h.sampleRTTWithTSOnly) 92 } 93 94 func (h *handshake) afterLoad(context.Context) {} 95 96 // +checklocksignore 97 func (h *handshake) StateLoad(ctx context.Context, stateSourceObject state.Source) { 98 stateSourceObject.Load(0, &h.ep) 99 stateSourceObject.Load(1, &h.listenEP) 100 stateSourceObject.Load(2, &h.state) 101 stateSourceObject.Load(3, &h.active) 102 stateSourceObject.Load(4, &h.flags) 103 stateSourceObject.Load(5, &h.ackNum) 104 stateSourceObject.Load(6, &h.iss) 105 stateSourceObject.Load(7, &h.rcvWnd) 106 stateSourceObject.Load(8, &h.sndWnd) 107 stateSourceObject.Load(9, &h.mss) 108 stateSourceObject.Load(10, &h.sndWndScale) 109 stateSourceObject.Load(11, &h.rcvWndScale) 110 stateSourceObject.Load(12, &h.startTime) 111 stateSourceObject.Load(13, &h.deferAccept) 112 stateSourceObject.Load(14, &h.acked) 113 stateSourceObject.Load(15, &h.sendSYNOpts) 114 stateSourceObject.Load(16, &h.sampleRTTWithTSOnly) 115 } 116 117 func (c *cubicState) StateTypeName() string { 118 return "pkg/tcpip/transport/tcp.cubicState" 119 } 120 121 func (c *cubicState) StateFields() []string { 122 return []string{ 123 "TCPCubicState", 124 "numCongestionEvents", 125 "s", 126 } 127 } 128 129 func (c *cubicState) beforeSave() {} 130 131 // +checklocksignore 132 func (c *cubicState) StateSave(stateSinkObject state.Sink) { 133 c.beforeSave() 134 stateSinkObject.Save(0, &c.TCPCubicState) 135 stateSinkObject.Save(1, &c.numCongestionEvents) 136 stateSinkObject.Save(2, &c.s) 137 } 138 139 func (c *cubicState) afterLoad(context.Context) {} 140 141 // +checklocksignore 142 func (c *cubicState) StateLoad(ctx context.Context, stateSourceObject state.Source) { 143 stateSourceObject.Load(0, &c.TCPCubicState) 144 stateSourceObject.Load(1, &c.numCongestionEvents) 145 stateSourceObject.Load(2, &c.s) 146 } 147 148 func (s *SACKInfo) StateTypeName() string { 149 return "pkg/tcpip/transport/tcp.SACKInfo" 150 } 151 152 func (s *SACKInfo) StateFields() []string { 153 return []string{ 154 "Blocks", 155 "NumBlocks", 156 } 157 } 158 159 func (s *SACKInfo) beforeSave() {} 160 161 // +checklocksignore 162 func (s *SACKInfo) StateSave(stateSinkObject state.Sink) { 163 s.beforeSave() 164 stateSinkObject.Save(0, &s.Blocks) 165 stateSinkObject.Save(1, &s.NumBlocks) 166 } 167 168 func (s *SACKInfo) afterLoad(context.Context) {} 169 170 // +checklocksignore 171 func (s *SACKInfo) StateLoad(ctx context.Context, stateSourceObject state.Source) { 172 stateSourceObject.Load(0, &s.Blocks) 173 stateSourceObject.Load(1, &s.NumBlocks) 174 } 175 176 func (r *ReceiveErrors) StateTypeName() string { 177 return "pkg/tcpip/transport/tcp.ReceiveErrors" 178 } 179 180 func (r *ReceiveErrors) StateFields() []string { 181 return []string{ 182 "ReceiveErrors", 183 "SegmentQueueDropped", 184 "ChecksumErrors", 185 "ListenOverflowSynDrop", 186 "ListenOverflowAckDrop", 187 "ZeroRcvWindowState", 188 "WantZeroRcvWindow", 189 } 190 } 191 192 func (r *ReceiveErrors) beforeSave() {} 193 194 // +checklocksignore 195 func (r *ReceiveErrors) StateSave(stateSinkObject state.Sink) { 196 r.beforeSave() 197 stateSinkObject.Save(0, &r.ReceiveErrors) 198 stateSinkObject.Save(1, &r.SegmentQueueDropped) 199 stateSinkObject.Save(2, &r.ChecksumErrors) 200 stateSinkObject.Save(3, &r.ListenOverflowSynDrop) 201 stateSinkObject.Save(4, &r.ListenOverflowAckDrop) 202 stateSinkObject.Save(5, &r.ZeroRcvWindowState) 203 stateSinkObject.Save(6, &r.WantZeroRcvWindow) 204 } 205 206 func (r *ReceiveErrors) afterLoad(context.Context) {} 207 208 // +checklocksignore 209 func (r *ReceiveErrors) StateLoad(ctx context.Context, stateSourceObject state.Source) { 210 stateSourceObject.Load(0, &r.ReceiveErrors) 211 stateSourceObject.Load(1, &r.SegmentQueueDropped) 212 stateSourceObject.Load(2, &r.ChecksumErrors) 213 stateSourceObject.Load(3, &r.ListenOverflowSynDrop) 214 stateSourceObject.Load(4, &r.ListenOverflowAckDrop) 215 stateSourceObject.Load(5, &r.ZeroRcvWindowState) 216 stateSourceObject.Load(6, &r.WantZeroRcvWindow) 217 } 218 219 func (s *SendErrors) StateTypeName() string { 220 return "pkg/tcpip/transport/tcp.SendErrors" 221 } 222 223 func (s *SendErrors) StateFields() []string { 224 return []string{ 225 "SendErrors", 226 "SegmentSendToNetworkFailed", 227 "SynSendToNetworkFailed", 228 "Retransmits", 229 "FastRetransmit", 230 "Timeouts", 231 } 232 } 233 234 func (s *SendErrors) beforeSave() {} 235 236 // +checklocksignore 237 func (s *SendErrors) StateSave(stateSinkObject state.Sink) { 238 s.beforeSave() 239 stateSinkObject.Save(0, &s.SendErrors) 240 stateSinkObject.Save(1, &s.SegmentSendToNetworkFailed) 241 stateSinkObject.Save(2, &s.SynSendToNetworkFailed) 242 stateSinkObject.Save(3, &s.Retransmits) 243 stateSinkObject.Save(4, &s.FastRetransmit) 244 stateSinkObject.Save(5, &s.Timeouts) 245 } 246 247 func (s *SendErrors) afterLoad(context.Context) {} 248 249 // +checklocksignore 250 func (s *SendErrors) StateLoad(ctx context.Context, stateSourceObject state.Source) { 251 stateSourceObject.Load(0, &s.SendErrors) 252 stateSourceObject.Load(1, &s.SegmentSendToNetworkFailed) 253 stateSourceObject.Load(2, &s.SynSendToNetworkFailed) 254 stateSourceObject.Load(3, &s.Retransmits) 255 stateSourceObject.Load(4, &s.FastRetransmit) 256 stateSourceObject.Load(5, &s.Timeouts) 257 } 258 259 func (s *Stats) StateTypeName() string { 260 return "pkg/tcpip/transport/tcp.Stats" 261 } 262 263 func (s *Stats) StateFields() []string { 264 return []string{ 265 "SegmentsReceived", 266 "SegmentsSent", 267 "FailedConnectionAttempts", 268 "ReceiveErrors", 269 "ReadErrors", 270 "SendErrors", 271 "WriteErrors", 272 } 273 } 274 275 func (s *Stats) beforeSave() {} 276 277 // +checklocksignore 278 func (s *Stats) StateSave(stateSinkObject state.Sink) { 279 s.beforeSave() 280 stateSinkObject.Save(0, &s.SegmentsReceived) 281 stateSinkObject.Save(1, &s.SegmentsSent) 282 stateSinkObject.Save(2, &s.FailedConnectionAttempts) 283 stateSinkObject.Save(3, &s.ReceiveErrors) 284 stateSinkObject.Save(4, &s.ReadErrors) 285 stateSinkObject.Save(5, &s.SendErrors) 286 stateSinkObject.Save(6, &s.WriteErrors) 287 } 288 289 func (s *Stats) afterLoad(context.Context) {} 290 291 // +checklocksignore 292 func (s *Stats) StateLoad(ctx context.Context, stateSourceObject state.Source) { 293 stateSourceObject.Load(0, &s.SegmentsReceived) 294 stateSourceObject.Load(1, &s.SegmentsSent) 295 stateSourceObject.Load(2, &s.FailedConnectionAttempts) 296 stateSourceObject.Load(3, &s.ReceiveErrors) 297 stateSourceObject.Load(4, &s.ReadErrors) 298 stateSourceObject.Load(5, &s.SendErrors) 299 stateSourceObject.Load(6, &s.WriteErrors) 300 } 301 302 func (sq *sndQueueInfo) StateTypeName() string { 303 return "pkg/tcpip/transport/tcp.sndQueueInfo" 304 } 305 306 func (sq *sndQueueInfo) StateFields() []string { 307 return []string{ 308 "TCPSndBufState", 309 } 310 } 311 312 func (sq *sndQueueInfo) beforeSave() {} 313 314 // +checklocksignore 315 func (sq *sndQueueInfo) StateSave(stateSinkObject state.Sink) { 316 sq.beforeSave() 317 stateSinkObject.Save(0, &sq.TCPSndBufState) 318 } 319 320 func (sq *sndQueueInfo) afterLoad(context.Context) {} 321 322 // +checklocksignore 323 func (sq *sndQueueInfo) StateLoad(ctx context.Context, stateSourceObject state.Source) { 324 stateSourceObject.Load(0, &sq.TCPSndBufState) 325 } 326 327 func (e *Endpoint) StateTypeName() string { 328 return "pkg/tcpip/transport/tcp.Endpoint" 329 } 330 331 func (e *Endpoint) StateFields() []string { 332 return []string{ 333 "TCPEndpointStateInner", 334 "TransportEndpointInfo", 335 "DefaultSocketOptionsHandler", 336 "waiterQueue", 337 "uniqueID", 338 "hardError", 339 "lastError", 340 "TCPRcvBufState", 341 "rcvMemUsed", 342 "ownedByUser", 343 "rcvQueue", 344 "state", 345 "connectionDirectionState", 346 "boundNICID", 347 "ipv4TTL", 348 "ipv6HopLimit", 349 "isConnectNotified", 350 "h", 351 "portFlags", 352 "boundBindToDevice", 353 "boundPortFlags", 354 "boundDest", 355 "effectiveNetProtos", 356 "recentTSTime", 357 "shutdownFlags", 358 "tcpRecovery", 359 "sack", 360 "delay", 361 "scoreboard", 362 "segmentQueue", 363 "userMSS", 364 "maxSynRetries", 365 "windowClamp", 366 "sndQueueInfo", 367 "cc", 368 "keepalive", 369 "userTimeout", 370 "deferAccept", 371 "acceptQueue", 372 "rcv", 373 "snd", 374 "connectingAddress", 375 "amss", 376 "sendTOS", 377 "gso", 378 "stats", 379 "tcpLingerTimeout", 380 "closed", 381 "txHash", 382 "owner", 383 "ops", 384 "lastOutOfWindowAckTime", 385 } 386 } 387 388 // +checklocksignore 389 func (e *Endpoint) StateSave(stateSinkObject state.Sink) { 390 e.beforeSave() 391 var stateValue EndpointState 392 stateValue = e.saveState() 393 stateSinkObject.SaveValue(11, stateValue) 394 stateSinkObject.Save(0, &e.TCPEndpointStateInner) 395 stateSinkObject.Save(1, &e.TransportEndpointInfo) 396 stateSinkObject.Save(2, &e.DefaultSocketOptionsHandler) 397 stateSinkObject.Save(3, &e.waiterQueue) 398 stateSinkObject.Save(4, &e.uniqueID) 399 stateSinkObject.Save(5, &e.hardError) 400 stateSinkObject.Save(6, &e.lastError) 401 stateSinkObject.Save(7, &e.TCPRcvBufState) 402 stateSinkObject.Save(8, &e.rcvMemUsed) 403 stateSinkObject.Save(9, &e.ownedByUser) 404 stateSinkObject.Save(10, &e.rcvQueue) 405 stateSinkObject.Save(12, &e.connectionDirectionState) 406 stateSinkObject.Save(13, &e.boundNICID) 407 stateSinkObject.Save(14, &e.ipv4TTL) 408 stateSinkObject.Save(15, &e.ipv6HopLimit) 409 stateSinkObject.Save(16, &e.isConnectNotified) 410 stateSinkObject.Save(17, &e.h) 411 stateSinkObject.Save(18, &e.portFlags) 412 stateSinkObject.Save(19, &e.boundBindToDevice) 413 stateSinkObject.Save(20, &e.boundPortFlags) 414 stateSinkObject.Save(21, &e.boundDest) 415 stateSinkObject.Save(22, &e.effectiveNetProtos) 416 stateSinkObject.Save(23, &e.recentTSTime) 417 stateSinkObject.Save(24, &e.shutdownFlags) 418 stateSinkObject.Save(25, &e.tcpRecovery) 419 stateSinkObject.Save(26, &e.sack) 420 stateSinkObject.Save(27, &e.delay) 421 stateSinkObject.Save(28, &e.scoreboard) 422 stateSinkObject.Save(29, &e.segmentQueue) 423 stateSinkObject.Save(30, &e.userMSS) 424 stateSinkObject.Save(31, &e.maxSynRetries) 425 stateSinkObject.Save(32, &e.windowClamp) 426 stateSinkObject.Save(33, &e.sndQueueInfo) 427 stateSinkObject.Save(34, &e.cc) 428 stateSinkObject.Save(35, &e.keepalive) 429 stateSinkObject.Save(36, &e.userTimeout) 430 stateSinkObject.Save(37, &e.deferAccept) 431 stateSinkObject.Save(38, &e.acceptQueue) 432 stateSinkObject.Save(39, &e.rcv) 433 stateSinkObject.Save(40, &e.snd) 434 stateSinkObject.Save(41, &e.connectingAddress) 435 stateSinkObject.Save(42, &e.amss) 436 stateSinkObject.Save(43, &e.sendTOS) 437 stateSinkObject.Save(44, &e.gso) 438 stateSinkObject.Save(45, &e.stats) 439 stateSinkObject.Save(46, &e.tcpLingerTimeout) 440 stateSinkObject.Save(47, &e.closed) 441 stateSinkObject.Save(48, &e.txHash) 442 stateSinkObject.Save(49, &e.owner) 443 stateSinkObject.Save(50, &e.ops) 444 stateSinkObject.Save(51, &e.lastOutOfWindowAckTime) 445 } 446 447 // +checklocksignore 448 func (e *Endpoint) StateLoad(ctx context.Context, stateSourceObject state.Source) { 449 stateSourceObject.Load(0, &e.TCPEndpointStateInner) 450 stateSourceObject.Load(1, &e.TransportEndpointInfo) 451 stateSourceObject.Load(2, &e.DefaultSocketOptionsHandler) 452 stateSourceObject.LoadWait(3, &e.waiterQueue) 453 stateSourceObject.Load(4, &e.uniqueID) 454 stateSourceObject.Load(5, &e.hardError) 455 stateSourceObject.Load(6, &e.lastError) 456 stateSourceObject.Load(7, &e.TCPRcvBufState) 457 stateSourceObject.Load(8, &e.rcvMemUsed) 458 stateSourceObject.Load(9, &e.ownedByUser) 459 stateSourceObject.LoadWait(10, &e.rcvQueue) 460 stateSourceObject.Load(12, &e.connectionDirectionState) 461 stateSourceObject.Load(13, &e.boundNICID) 462 stateSourceObject.Load(14, &e.ipv4TTL) 463 stateSourceObject.Load(15, &e.ipv6HopLimit) 464 stateSourceObject.Load(16, &e.isConnectNotified) 465 stateSourceObject.Load(17, &e.h) 466 stateSourceObject.Load(18, &e.portFlags) 467 stateSourceObject.Load(19, &e.boundBindToDevice) 468 stateSourceObject.Load(20, &e.boundPortFlags) 469 stateSourceObject.Load(21, &e.boundDest) 470 stateSourceObject.Load(22, &e.effectiveNetProtos) 471 stateSourceObject.Load(23, &e.recentTSTime) 472 stateSourceObject.Load(24, &e.shutdownFlags) 473 stateSourceObject.Load(25, &e.tcpRecovery) 474 stateSourceObject.Load(26, &e.sack) 475 stateSourceObject.Load(27, &e.delay) 476 stateSourceObject.Load(28, &e.scoreboard) 477 stateSourceObject.LoadWait(29, &e.segmentQueue) 478 stateSourceObject.Load(30, &e.userMSS) 479 stateSourceObject.Load(31, &e.maxSynRetries) 480 stateSourceObject.Load(32, &e.windowClamp) 481 stateSourceObject.Load(33, &e.sndQueueInfo) 482 stateSourceObject.Load(34, &e.cc) 483 stateSourceObject.Load(35, &e.keepalive) 484 stateSourceObject.Load(36, &e.userTimeout) 485 stateSourceObject.Load(37, &e.deferAccept) 486 stateSourceObject.Load(38, &e.acceptQueue) 487 stateSourceObject.LoadWait(39, &e.rcv) 488 stateSourceObject.LoadWait(40, &e.snd) 489 stateSourceObject.Load(41, &e.connectingAddress) 490 stateSourceObject.Load(42, &e.amss) 491 stateSourceObject.Load(43, &e.sendTOS) 492 stateSourceObject.Load(44, &e.gso) 493 stateSourceObject.Load(45, &e.stats) 494 stateSourceObject.Load(46, &e.tcpLingerTimeout) 495 stateSourceObject.Load(47, &e.closed) 496 stateSourceObject.Load(48, &e.txHash) 497 stateSourceObject.Load(49, &e.owner) 498 stateSourceObject.Load(50, &e.ops) 499 stateSourceObject.Load(51, &e.lastOutOfWindowAckTime) 500 stateSourceObject.LoadValue(11, new(EndpointState), func(y any) { e.loadState(ctx, y.(EndpointState)) }) 501 stateSourceObject.AfterLoad(func() { e.afterLoad(ctx) }) 502 } 503 504 func (k *keepalive) StateTypeName() string { 505 return "pkg/tcpip/transport/tcp.keepalive" 506 } 507 508 func (k *keepalive) StateFields() []string { 509 return []string{ 510 "idle", 511 "interval", 512 "count", 513 "unacked", 514 } 515 } 516 517 func (k *keepalive) beforeSave() {} 518 519 // +checklocksignore 520 func (k *keepalive) StateSave(stateSinkObject state.Sink) { 521 k.beforeSave() 522 stateSinkObject.Save(0, &k.idle) 523 stateSinkObject.Save(1, &k.interval) 524 stateSinkObject.Save(2, &k.count) 525 stateSinkObject.Save(3, &k.unacked) 526 } 527 528 func (k *keepalive) afterLoad(context.Context) {} 529 530 // +checklocksignore 531 func (k *keepalive) StateLoad(ctx context.Context, stateSourceObject state.Source) { 532 stateSourceObject.Load(0, &k.idle) 533 stateSourceObject.Load(1, &k.interval) 534 stateSourceObject.Load(2, &k.count) 535 stateSourceObject.Load(3, &k.unacked) 536 } 537 538 func (rc *rackControl) StateTypeName() string { 539 return "pkg/tcpip/transport/tcp.rackControl" 540 } 541 542 func (rc *rackControl) StateFields() []string { 543 return []string{ 544 "TCPRACKState", 545 "exitedRecovery", 546 "minRTT", 547 "tlpRxtOut", 548 "tlpHighRxt", 549 "snd", 550 } 551 } 552 553 func (rc *rackControl) beforeSave() {} 554 555 // +checklocksignore 556 func (rc *rackControl) StateSave(stateSinkObject state.Sink) { 557 rc.beforeSave() 558 stateSinkObject.Save(0, &rc.TCPRACKState) 559 stateSinkObject.Save(1, &rc.exitedRecovery) 560 stateSinkObject.Save(2, &rc.minRTT) 561 stateSinkObject.Save(3, &rc.tlpRxtOut) 562 stateSinkObject.Save(4, &rc.tlpHighRxt) 563 stateSinkObject.Save(5, &rc.snd) 564 } 565 566 func (rc *rackControl) afterLoad(context.Context) {} 567 568 // +checklocksignore 569 func (rc *rackControl) StateLoad(ctx context.Context, stateSourceObject state.Source) { 570 stateSourceObject.Load(0, &rc.TCPRACKState) 571 stateSourceObject.Load(1, &rc.exitedRecovery) 572 stateSourceObject.Load(2, &rc.minRTT) 573 stateSourceObject.Load(3, &rc.tlpRxtOut) 574 stateSourceObject.Load(4, &rc.tlpHighRxt) 575 stateSourceObject.Load(5, &rc.snd) 576 } 577 578 func (r *receiver) StateTypeName() string { 579 return "pkg/tcpip/transport/tcp.receiver" 580 } 581 582 func (r *receiver) StateFields() []string { 583 return []string{ 584 "TCPReceiverState", 585 "ep", 586 "rcvWnd", 587 "rcvWUP", 588 "prevBufUsed", 589 "closed", 590 "pendingRcvdSegments", 591 "lastRcvdAckTime", 592 } 593 } 594 595 func (r *receiver) beforeSave() {} 596 597 // +checklocksignore 598 func (r *receiver) StateSave(stateSinkObject state.Sink) { 599 r.beforeSave() 600 stateSinkObject.Save(0, &r.TCPReceiverState) 601 stateSinkObject.Save(1, &r.ep) 602 stateSinkObject.Save(2, &r.rcvWnd) 603 stateSinkObject.Save(3, &r.rcvWUP) 604 stateSinkObject.Save(4, &r.prevBufUsed) 605 stateSinkObject.Save(5, &r.closed) 606 stateSinkObject.Save(6, &r.pendingRcvdSegments) 607 stateSinkObject.Save(7, &r.lastRcvdAckTime) 608 } 609 610 func (r *receiver) afterLoad(context.Context) {} 611 612 // +checklocksignore 613 func (r *receiver) StateLoad(ctx context.Context, stateSourceObject state.Source) { 614 stateSourceObject.Load(0, &r.TCPReceiverState) 615 stateSourceObject.Load(1, &r.ep) 616 stateSourceObject.Load(2, &r.rcvWnd) 617 stateSourceObject.Load(3, &r.rcvWUP) 618 stateSourceObject.Load(4, &r.prevBufUsed) 619 stateSourceObject.Load(5, &r.closed) 620 stateSourceObject.Load(6, &r.pendingRcvdSegments) 621 stateSourceObject.Load(7, &r.lastRcvdAckTime) 622 } 623 624 func (r *renoState) StateTypeName() string { 625 return "pkg/tcpip/transport/tcp.renoState" 626 } 627 628 func (r *renoState) StateFields() []string { 629 return []string{ 630 "s", 631 } 632 } 633 634 func (r *renoState) beforeSave() {} 635 636 // +checklocksignore 637 func (r *renoState) StateSave(stateSinkObject state.Sink) { 638 r.beforeSave() 639 stateSinkObject.Save(0, &r.s) 640 } 641 642 func (r *renoState) afterLoad(context.Context) {} 643 644 // +checklocksignore 645 func (r *renoState) StateLoad(ctx context.Context, stateSourceObject state.Source) { 646 stateSourceObject.Load(0, &r.s) 647 } 648 649 func (rr *renoRecovery) StateTypeName() string { 650 return "pkg/tcpip/transport/tcp.renoRecovery" 651 } 652 653 func (rr *renoRecovery) StateFields() []string { 654 return []string{ 655 "s", 656 } 657 } 658 659 func (rr *renoRecovery) beforeSave() {} 660 661 // +checklocksignore 662 func (rr *renoRecovery) StateSave(stateSinkObject state.Sink) { 663 rr.beforeSave() 664 stateSinkObject.Save(0, &rr.s) 665 } 666 667 func (rr *renoRecovery) afterLoad(context.Context) {} 668 669 // +checklocksignore 670 func (rr *renoRecovery) StateLoad(ctx context.Context, stateSourceObject state.Source) { 671 stateSourceObject.Load(0, &rr.s) 672 } 673 674 func (sr *sackRecovery) StateTypeName() string { 675 return "pkg/tcpip/transport/tcp.sackRecovery" 676 } 677 678 func (sr *sackRecovery) StateFields() []string { 679 return []string{ 680 "s", 681 } 682 } 683 684 func (sr *sackRecovery) beforeSave() {} 685 686 // +checklocksignore 687 func (sr *sackRecovery) StateSave(stateSinkObject state.Sink) { 688 sr.beforeSave() 689 stateSinkObject.Save(0, &sr.s) 690 } 691 692 func (sr *sackRecovery) afterLoad(context.Context) {} 693 694 // +checklocksignore 695 func (sr *sackRecovery) StateLoad(ctx context.Context, stateSourceObject state.Source) { 696 stateSourceObject.Load(0, &sr.s) 697 } 698 699 func (s *SACKScoreboard) StateTypeName() string { 700 return "pkg/tcpip/transport/tcp.SACKScoreboard" 701 } 702 703 func (s *SACKScoreboard) StateFields() []string { 704 return []string{ 705 "smss", 706 "maxSACKED", 707 } 708 } 709 710 func (s *SACKScoreboard) beforeSave() {} 711 712 // +checklocksignore 713 func (s *SACKScoreboard) StateSave(stateSinkObject state.Sink) { 714 s.beforeSave() 715 stateSinkObject.Save(0, &s.smss) 716 stateSinkObject.Save(1, &s.maxSACKED) 717 } 718 719 func (s *SACKScoreboard) afterLoad(context.Context) {} 720 721 // +checklocksignore 722 func (s *SACKScoreboard) StateLoad(ctx context.Context, stateSourceObject state.Source) { 723 stateSourceObject.Load(0, &s.smss) 724 stateSourceObject.Load(1, &s.maxSACKED) 725 } 726 727 func (s *segment) StateTypeName() string { 728 return "pkg/tcpip/transport/tcp.segment" 729 } 730 731 func (s *segment) StateFields() []string { 732 return []string{ 733 "segmentEntry", 734 "segmentRefs", 735 "ep", 736 "qFlags", 737 "pkt", 738 "sequenceNumber", 739 "ackNumber", 740 "flags", 741 "window", 742 "csum", 743 "csumValid", 744 "parsedOptions", 745 "options", 746 "hasNewSACKInfo", 747 "rcvdTime", 748 "xmitTime", 749 "xmitCount", 750 "acked", 751 "dataMemSize", 752 "lost", 753 } 754 } 755 756 func (s *segment) beforeSave() {} 757 758 // +checklocksignore 759 func (s *segment) StateSave(stateSinkObject state.Sink) { 760 s.beforeSave() 761 var optionsValue []byte 762 optionsValue = s.saveOptions() 763 stateSinkObject.SaveValue(12, optionsValue) 764 stateSinkObject.Save(0, &s.segmentEntry) 765 stateSinkObject.Save(1, &s.segmentRefs) 766 stateSinkObject.Save(2, &s.ep) 767 stateSinkObject.Save(3, &s.qFlags) 768 stateSinkObject.Save(4, &s.pkt) 769 stateSinkObject.Save(5, &s.sequenceNumber) 770 stateSinkObject.Save(6, &s.ackNumber) 771 stateSinkObject.Save(7, &s.flags) 772 stateSinkObject.Save(8, &s.window) 773 stateSinkObject.Save(9, &s.csum) 774 stateSinkObject.Save(10, &s.csumValid) 775 stateSinkObject.Save(11, &s.parsedOptions) 776 stateSinkObject.Save(13, &s.hasNewSACKInfo) 777 stateSinkObject.Save(14, &s.rcvdTime) 778 stateSinkObject.Save(15, &s.xmitTime) 779 stateSinkObject.Save(16, &s.xmitCount) 780 stateSinkObject.Save(17, &s.acked) 781 stateSinkObject.Save(18, &s.dataMemSize) 782 stateSinkObject.Save(19, &s.lost) 783 } 784 785 func (s *segment) afterLoad(context.Context) {} 786 787 // +checklocksignore 788 func (s *segment) StateLoad(ctx context.Context, stateSourceObject state.Source) { 789 stateSourceObject.Load(0, &s.segmentEntry) 790 stateSourceObject.Load(1, &s.segmentRefs) 791 stateSourceObject.Load(2, &s.ep) 792 stateSourceObject.Load(3, &s.qFlags) 793 stateSourceObject.Load(4, &s.pkt) 794 stateSourceObject.Load(5, &s.sequenceNumber) 795 stateSourceObject.Load(6, &s.ackNumber) 796 stateSourceObject.Load(7, &s.flags) 797 stateSourceObject.Load(8, &s.window) 798 stateSourceObject.Load(9, &s.csum) 799 stateSourceObject.Load(10, &s.csumValid) 800 stateSourceObject.Load(11, &s.parsedOptions) 801 stateSourceObject.Load(13, &s.hasNewSACKInfo) 802 stateSourceObject.Load(14, &s.rcvdTime) 803 stateSourceObject.Load(15, &s.xmitTime) 804 stateSourceObject.Load(16, &s.xmitCount) 805 stateSourceObject.Load(17, &s.acked) 806 stateSourceObject.Load(18, &s.dataMemSize) 807 stateSourceObject.Load(19, &s.lost) 808 stateSourceObject.LoadValue(12, new([]byte), func(y any) { s.loadOptions(ctx, y.([]byte)) }) 809 } 810 811 func (q *segmentQueue) StateTypeName() string { 812 return "pkg/tcpip/transport/tcp.segmentQueue" 813 } 814 815 func (q *segmentQueue) StateFields() []string { 816 return []string{ 817 "list", 818 "ep", 819 "frozen", 820 } 821 } 822 823 func (q *segmentQueue) beforeSave() {} 824 825 // +checklocksignore 826 func (q *segmentQueue) StateSave(stateSinkObject state.Sink) { 827 q.beforeSave() 828 stateSinkObject.Save(0, &q.list) 829 stateSinkObject.Save(1, &q.ep) 830 stateSinkObject.Save(2, &q.frozen) 831 } 832 833 func (q *segmentQueue) afterLoad(context.Context) {} 834 835 // +checklocksignore 836 func (q *segmentQueue) StateLoad(ctx context.Context, stateSourceObject state.Source) { 837 stateSourceObject.LoadWait(0, &q.list) 838 stateSourceObject.Load(1, &q.ep) 839 stateSourceObject.Load(2, &q.frozen) 840 } 841 842 func (s *sender) StateTypeName() string { 843 return "pkg/tcpip/transport/tcp.sender" 844 } 845 846 func (s *sender) StateFields() []string { 847 return []string{ 848 "TCPSenderState", 849 "ep", 850 "lr", 851 "firstRetransmittedSegXmitTime", 852 "writeNext", 853 "writeList", 854 "rtt", 855 "minRTO", 856 "maxRTO", 857 "maxRetries", 858 "gso", 859 "state", 860 "cc", 861 "rc", 862 "spuriousRecovery", 863 "retransmitTS", 864 "startCork", 865 } 866 } 867 868 func (s *sender) beforeSave() {} 869 870 // +checklocksignore 871 func (s *sender) StateSave(stateSinkObject state.Sink) { 872 s.beforeSave() 873 stateSinkObject.Save(0, &s.TCPSenderState) 874 stateSinkObject.Save(1, &s.ep) 875 stateSinkObject.Save(2, &s.lr) 876 stateSinkObject.Save(3, &s.firstRetransmittedSegXmitTime) 877 stateSinkObject.Save(4, &s.writeNext) 878 stateSinkObject.Save(5, &s.writeList) 879 stateSinkObject.Save(6, &s.rtt) 880 stateSinkObject.Save(7, &s.minRTO) 881 stateSinkObject.Save(8, &s.maxRTO) 882 stateSinkObject.Save(9, &s.maxRetries) 883 stateSinkObject.Save(10, &s.gso) 884 stateSinkObject.Save(11, &s.state) 885 stateSinkObject.Save(12, &s.cc) 886 stateSinkObject.Save(13, &s.rc) 887 stateSinkObject.Save(14, &s.spuriousRecovery) 888 stateSinkObject.Save(15, &s.retransmitTS) 889 stateSinkObject.Save(16, &s.startCork) 890 } 891 892 func (s *sender) afterLoad(context.Context) {} 893 894 // +checklocksignore 895 func (s *sender) StateLoad(ctx context.Context, stateSourceObject state.Source) { 896 stateSourceObject.Load(0, &s.TCPSenderState) 897 stateSourceObject.Load(1, &s.ep) 898 stateSourceObject.Load(2, &s.lr) 899 stateSourceObject.Load(3, &s.firstRetransmittedSegXmitTime) 900 stateSourceObject.Load(4, &s.writeNext) 901 stateSourceObject.Load(5, &s.writeList) 902 stateSourceObject.Load(6, &s.rtt) 903 stateSourceObject.Load(7, &s.minRTO) 904 stateSourceObject.Load(8, &s.maxRTO) 905 stateSourceObject.Load(9, &s.maxRetries) 906 stateSourceObject.Load(10, &s.gso) 907 stateSourceObject.Load(11, &s.state) 908 stateSourceObject.Load(12, &s.cc) 909 stateSourceObject.Load(13, &s.rc) 910 stateSourceObject.Load(14, &s.spuriousRecovery) 911 stateSourceObject.Load(15, &s.retransmitTS) 912 stateSourceObject.Load(16, &s.startCork) 913 } 914 915 func (r *rtt) StateTypeName() string { 916 return "pkg/tcpip/transport/tcp.rtt" 917 } 918 919 func (r *rtt) StateFields() []string { 920 return []string{ 921 "TCPRTTState", 922 } 923 } 924 925 func (r *rtt) beforeSave() {} 926 927 // +checklocksignore 928 func (r *rtt) StateSave(stateSinkObject state.Sink) { 929 r.beforeSave() 930 stateSinkObject.Save(0, &r.TCPRTTState) 931 } 932 933 func (r *rtt) afterLoad(context.Context) {} 934 935 // +checklocksignore 936 func (r *rtt) StateLoad(ctx context.Context, stateSourceObject state.Source) { 937 stateSourceObject.Load(0, &r.TCPRTTState) 938 } 939 940 func (l *endpointList) StateTypeName() string { 941 return "pkg/tcpip/transport/tcp.endpointList" 942 } 943 944 func (l *endpointList) StateFields() []string { 945 return []string{ 946 "head", 947 "tail", 948 } 949 } 950 951 func (l *endpointList) beforeSave() {} 952 953 // +checklocksignore 954 func (l *endpointList) StateSave(stateSinkObject state.Sink) { 955 l.beforeSave() 956 stateSinkObject.Save(0, &l.head) 957 stateSinkObject.Save(1, &l.tail) 958 } 959 960 func (l *endpointList) afterLoad(context.Context) {} 961 962 // +checklocksignore 963 func (l *endpointList) StateLoad(ctx context.Context, stateSourceObject state.Source) { 964 stateSourceObject.Load(0, &l.head) 965 stateSourceObject.Load(1, &l.tail) 966 } 967 968 func (e *endpointEntry) StateTypeName() string { 969 return "pkg/tcpip/transport/tcp.endpointEntry" 970 } 971 972 func (e *endpointEntry) StateFields() []string { 973 return []string{ 974 "next", 975 "prev", 976 } 977 } 978 979 func (e *endpointEntry) beforeSave() {} 980 981 // +checklocksignore 982 func (e *endpointEntry) StateSave(stateSinkObject state.Sink) { 983 e.beforeSave() 984 stateSinkObject.Save(0, &e.next) 985 stateSinkObject.Save(1, &e.prev) 986 } 987 988 func (e *endpointEntry) afterLoad(context.Context) {} 989 990 // +checklocksignore 991 func (e *endpointEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) { 992 stateSourceObject.Load(0, &e.next) 993 stateSourceObject.Load(1, &e.prev) 994 } 995 996 func (l *segmentList) StateTypeName() string { 997 return "pkg/tcpip/transport/tcp.segmentList" 998 } 999 1000 func (l *segmentList) StateFields() []string { 1001 return []string{ 1002 "head", 1003 "tail", 1004 } 1005 } 1006 1007 func (l *segmentList) beforeSave() {} 1008 1009 // +checklocksignore 1010 func (l *segmentList) StateSave(stateSinkObject state.Sink) { 1011 l.beforeSave() 1012 stateSinkObject.Save(0, &l.head) 1013 stateSinkObject.Save(1, &l.tail) 1014 } 1015 1016 func (l *segmentList) afterLoad(context.Context) {} 1017 1018 // +checklocksignore 1019 func (l *segmentList) StateLoad(ctx context.Context, stateSourceObject state.Source) { 1020 stateSourceObject.Load(0, &l.head) 1021 stateSourceObject.Load(1, &l.tail) 1022 } 1023 1024 func (e *segmentEntry) StateTypeName() string { 1025 return "pkg/tcpip/transport/tcp.segmentEntry" 1026 } 1027 1028 func (e *segmentEntry) StateFields() []string { 1029 return []string{ 1030 "next", 1031 "prev", 1032 } 1033 } 1034 1035 func (e *segmentEntry) beforeSave() {} 1036 1037 // +checklocksignore 1038 func (e *segmentEntry) StateSave(stateSinkObject state.Sink) { 1039 e.beforeSave() 1040 stateSinkObject.Save(0, &e.next) 1041 stateSinkObject.Save(1, &e.prev) 1042 } 1043 1044 func (e *segmentEntry) afterLoad(context.Context) {} 1045 1046 // +checklocksignore 1047 func (e *segmentEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) { 1048 stateSourceObject.Load(0, &e.next) 1049 stateSourceObject.Load(1, &e.prev) 1050 } 1051 1052 func (r *segmentRefs) StateTypeName() string { 1053 return "pkg/tcpip/transport/tcp.segmentRefs" 1054 } 1055 1056 func (r *segmentRefs) StateFields() []string { 1057 return []string{ 1058 "refCount", 1059 } 1060 } 1061 1062 func (r *segmentRefs) beforeSave() {} 1063 1064 // +checklocksignore 1065 func (r *segmentRefs) StateSave(stateSinkObject state.Sink) { 1066 r.beforeSave() 1067 stateSinkObject.Save(0, &r.refCount) 1068 } 1069 1070 // +checklocksignore 1071 func (r *segmentRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 1072 stateSourceObject.Load(0, &r.refCount) 1073 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 1074 } 1075 1076 func init() { 1077 state.Register((*acceptQueue)(nil)) 1078 state.Register((*handshake)(nil)) 1079 state.Register((*cubicState)(nil)) 1080 state.Register((*SACKInfo)(nil)) 1081 state.Register((*ReceiveErrors)(nil)) 1082 state.Register((*SendErrors)(nil)) 1083 state.Register((*Stats)(nil)) 1084 state.Register((*sndQueueInfo)(nil)) 1085 state.Register((*Endpoint)(nil)) 1086 state.Register((*keepalive)(nil)) 1087 state.Register((*rackControl)(nil)) 1088 state.Register((*receiver)(nil)) 1089 state.Register((*renoState)(nil)) 1090 state.Register((*renoRecovery)(nil)) 1091 state.Register((*sackRecovery)(nil)) 1092 state.Register((*SACKScoreboard)(nil)) 1093 state.Register((*segment)(nil)) 1094 state.Register((*segmentQueue)(nil)) 1095 state.Register((*sender)(nil)) 1096 state.Register((*rtt)(nil)) 1097 state.Register((*endpointList)(nil)) 1098 state.Register((*endpointEntry)(nil)) 1099 state.Register((*segmentList)(nil)) 1100 state.Register((*segmentEntry)(nil)) 1101 state.Register((*segmentRefs)(nil)) 1102 }