// automatically generated by stateify.

package tcp

import (
	"context"

	"gvisor.dev/gvisor/pkg/state"
)

func (a *acceptQueue) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.acceptQueue"
}

func (a *acceptQueue) StateFields() []string {
	return []string{
		"endpoints",
		"pendingEndpoints",
		"capacity",
	}
}

func (a *acceptQueue) beforeSave() {}

// +checklocksignore
func (a *acceptQueue) StateSave(stateSinkObject state.Sink) {
	a.beforeSave()
	var endpointsValue []*Endpoint
	endpointsValue = a.saveEndpoints()
	stateSinkObject.SaveValue(0, endpointsValue)
	stateSinkObject.Save(1, &a.pendingEndpoints)
	stateSinkObject.Save(2, &a.capacity)
}

func (a *acceptQueue) afterLoad(context.Context) {}

// +checklocksignore
func (a *acceptQueue) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(1, &a.pendingEndpoints)
	stateSourceObject.Load(2, &a.capacity)
	stateSourceObject.LoadValue(0, new([]*Endpoint), func(y any) { a.loadEndpoints(ctx, y.([]*Endpoint)) })
}

func (h *handshake) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.handshake"
}

func (h *handshake) StateFields() []string {
	return []string{
		"ep",
		"listenEP",
		"state",
		"active",
		"flags",
		"ackNum",
		"iss",
		"rcvWnd",
		"sndWnd",
		"mss",
		"sndWndScale",
		"rcvWndScale",
		"startTime",
		"deferAccept",
		"acked",
		"sendSYNOpts",
		"sampleRTTWithTSOnly",
	}
}

func (h *handshake) beforeSave() {}

// +checklocksignore
func (h *handshake) StateSave(stateSinkObject state.Sink) {
	h.beforeSave()
	stateSinkObject.Save(0, &h.ep)
	stateSinkObject.Save(1, &h.listenEP)
	stateSinkObject.Save(2, &h.state)
	stateSinkObject.Save(3, &h.active)
	stateSinkObject.Save(4, &h.flags)
	stateSinkObject.Save(5, &h.ackNum)
	stateSinkObject.Save(6, &h.iss)
	stateSinkObject.Save(7, &h.rcvWnd)
	stateSinkObject.Save(8, &h.sndWnd)
	stateSinkObject.Save(9, &h.mss)
	stateSinkObject.Save(10, &h.sndWndScale)
	stateSinkObject.Save(11, &h.rcvWndScale)
	stateSinkObject.Save(12, &h.startTime)
	stateSinkObject.Save(13, &h.deferAccept)
	stateSinkObject.Save(14, &h.acked)
	stateSinkObject.Save(15, &h.sendSYNOpts)
	stateSinkObject.Save(16, &h.sampleRTTWithTSOnly)
}

func (h *handshake) afterLoad(context.Context) {}

// +checklocksignore
func (h *handshake) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &h.ep)
	stateSourceObject.Load(1, &h.listenEP)
	stateSourceObject.Load(2, &h.state)
	stateSourceObject.Load(3, &h.active)
	stateSourceObject.Load(4, &h.flags)
	stateSourceObject.Load(5, &h.ackNum)
	stateSourceObject.Load(6, &h.iss)
	stateSourceObject.Load(7, &h.rcvWnd)
	stateSourceObject.Load(8, &h.sndWnd)
	stateSourceObject.Load(9, &h.mss)
	stateSourceObject.Load(10, &h.sndWndScale)
	stateSourceObject.Load(11, &h.rcvWndScale)
	stateSourceObject.Load(12, &h.startTime)
	stateSourceObject.Load(13, &h.deferAccept)
	stateSourceObject.Load(14, &h.acked)
	stateSourceObject.Load(15, &h.sendSYNOpts)
	stateSourceObject.Load(16, &h.sampleRTTWithTSOnly)
}

func (c *cubicState) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.cubicState"
}

func (c *cubicState) StateFields() []string {
	return []string{
		"TCPCubicState",
		"numCongestionEvents",
		"s",
	}
}

func (c *cubicState) beforeSave() {}

// +checklocksignore
func (c *cubicState) StateSave(stateSinkObject state.Sink) {
	c.beforeSave()
	stateSinkObject.Save(0, &c.TCPCubicState)
	stateSinkObject.Save(1, &c.numCongestionEvents)
	stateSinkObject.Save(2, &c.s)
}

func (c *cubicState) afterLoad(context.Context) {}

// +checklocksignore
func (c *cubicState) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &c.TCPCubicState)
	stateSourceObject.Load(1, &c.numCongestionEvents)
	stateSourceObject.Load(2, &c.s)
}

func (q *epQueue) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.epQueue"
}

func (q *epQueue) StateFields() []string {
	return []string{
		"list",
	}
}

func (q *epQueue) beforeSave() {}

// +checklocksignore
func (q *epQueue) StateSave(stateSinkObject state.Sink) {
	q.beforeSave()
	stateSinkObject.Save(0, &q.list)
}

func (q *epQueue) afterLoad(context.Context) {}

// +checklocksignore
func (q *epQueue) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &q.list)
}

func (p *processor) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.processor"
}

func (p *processor) StateFields() []string {
	return []string{
		"epQ",
		"sleeper",
	}
}

func (p *processor) beforeSave() {}

// +checklocksignore
func (p *processor) StateSave(stateSinkObject state.Sink) {
	p.beforeSave()
	stateSinkObject.Save(0, &p.epQ)
	stateSinkObject.Save(1, &p.sleeper)
}

func (p *processor) afterLoad(context.Context) {}

// +checklocksignore
func (p *processor) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &p.epQ)
	stateSourceObject.Load(1, &p.sleeper)
}

func (d *dispatcher) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.dispatcher"
}

func (d *dispatcher) StateFields() []string {
	return []string{
		"processors",
		"hasher",
		"paused",
		"closed",
	}
}

func (d *dispatcher) beforeSave() {}

// +checklocksignore
func (d *dispatcher) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	stateSinkObject.Save(0, &d.processors)
	stateSinkObject.Save(1, &d.hasher)
	stateSinkObject.Save(2, &d.paused)
	stateSinkObject.Save(3, &d.closed)
}

func (d *dispatcher) afterLoad(context.Context) {}

// +checklocksignore
func (d *dispatcher) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.processors)
	stateSourceObject.Load(1, &d.hasher)
	stateSourceObject.Load(2, &d.paused)
	stateSourceObject.Load(3, &d.closed)
}

func (j *jenkinsHasher) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.jenkinsHasher"
}

func (j *jenkinsHasher) StateFields() []string {
	return []string{
		"seed",
	}
}

func (j *jenkinsHasher) beforeSave() {}

// +checklocksignore
func (j *jenkinsHasher) StateSave(stateSinkObject state.Sink) {
	j.beforeSave()
	stateSinkObject.Save(0, &j.seed)
}

func (j *jenkinsHasher) afterLoad(context.Context) {}

// +checklocksignore
func (j *jenkinsHasher) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &j.seed)
}

func (s *SACKInfo) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.SACKInfo"
}

func (s *SACKInfo) StateFields() []string {
	return []string{
		"Blocks",
		"NumBlocks",
	}
}

func (s *SACKInfo) beforeSave() {}

// +checklocksignore
func (s *SACKInfo) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.Blocks)
	stateSinkObject.Save(1, &s.NumBlocks)
}

func (s *SACKInfo) afterLoad(context.Context) {}

// +checklocksignore
func (s *SACKInfo) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.Blocks)
	stateSourceObject.Load(1, &s.NumBlocks)
}

func (r *ReceiveErrors) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.ReceiveErrors"
}

func (r *ReceiveErrors) StateFields() []string {
	return []string{
		"ReceiveErrors",
		"SegmentQueueDropped",
		"ChecksumErrors",
		"ListenOverflowSynDrop",
		"ListenOverflowAckDrop",
		"ZeroRcvWindowState",
		"WantZeroRcvWindow",
	}
}

func (r *ReceiveErrors) beforeSave() {}

// +checklocksignore
func (r *ReceiveErrors) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.ReceiveErrors)
	stateSinkObject.Save(1, &r.SegmentQueueDropped)
	stateSinkObject.Save(2, &r.ChecksumErrors)
	stateSinkObject.Save(3, &r.ListenOverflowSynDrop)
	stateSinkObject.Save(4, &r.ListenOverflowAckDrop)
	stateSinkObject.Save(5, &r.ZeroRcvWindowState)
	stateSinkObject.Save(6, &r.WantZeroRcvWindow)
}

func (r *ReceiveErrors) afterLoad(context.Context) {}

// +checklocksignore
func (r *ReceiveErrors) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.ReceiveErrors)
	stateSourceObject.Load(1, &r.SegmentQueueDropped)
	stateSourceObject.Load(2, &r.ChecksumErrors)
	stateSourceObject.Load(3, &r.ListenOverflowSynDrop)
	stateSourceObject.Load(4, &r.ListenOverflowAckDrop)
	stateSourceObject.Load(5, &r.ZeroRcvWindowState)
	stateSourceObject.Load(6, &r.WantZeroRcvWindow)
}

func (s *SendErrors) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.SendErrors"
}

func (s *SendErrors) StateFields() []string {
	return []string{
		"SendErrors",
		"SegmentSendToNetworkFailed",
		"SynSendToNetworkFailed",
		"Retransmits",
		"FastRetransmit",
		"Timeouts",
	}
}

func (s *SendErrors) beforeSave() {}

// +checklocksignore
func (s *SendErrors) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.SendErrors)
	stateSinkObject.Save(1, &s.SegmentSendToNetworkFailed)
	stateSinkObject.Save(2, &s.SynSendToNetworkFailed)
	stateSinkObject.Save(3, &s.Retransmits)
	stateSinkObject.Save(4, &s.FastRetransmit)
	stateSinkObject.Save(5, &s.Timeouts)
}

func (s *SendErrors) afterLoad(context.Context) {}

// +checklocksignore
func (s *SendErrors) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.SendErrors)
	stateSourceObject.Load(1, &s.SegmentSendToNetworkFailed)
	stateSourceObject.Load(2, &s.SynSendToNetworkFailed)
	stateSourceObject.Load(3, &s.Retransmits)
	stateSourceObject.Load(4, &s.FastRetransmit)
	stateSourceObject.Load(5, &s.Timeouts)
}

func (s *Stats) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.Stats"
}

func (s *Stats) StateFields() []string {
	return []string{
		"SegmentsReceived",
		"SegmentsSent",
		"FailedConnectionAttempts",
		"ReceiveErrors",
		"ReadErrors",
		"SendErrors",
		"WriteErrors",
	}
}

func (s *Stats) beforeSave() {}

// +checklocksignore
func (s *Stats) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.SegmentsReceived)
	stateSinkObject.Save(1, &s.SegmentsSent)
	stateSinkObject.Save(2, &s.FailedConnectionAttempts)
	stateSinkObject.Save(3, &s.ReceiveErrors)
	stateSinkObject.Save(4, &s.ReadErrors)
	stateSinkObject.Save(5, &s.SendErrors)
	stateSinkObject.Save(6, &s.WriteErrors)
}

func (s *Stats) afterLoad(context.Context) {}

// +checklocksignore
func (s *Stats) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.SegmentsReceived)
	stateSourceObject.Load(1, &s.SegmentsSent)
	stateSourceObject.Load(2, &s.FailedConnectionAttempts)
	stateSourceObject.Load(3, &s.ReceiveErrors)
	stateSourceObject.Load(4, &s.ReadErrors)
	stateSourceObject.Load(5, &s.SendErrors)
	stateSourceObject.Load(6, &s.WriteErrors)
}

func (sq *sndQueueInfo) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.sndQueueInfo"
}

func (sq *sndQueueInfo) StateFields() []string {
	return []string{
		"TCPSndBufState",
	}
}

func (sq *sndQueueInfo) beforeSave() {}

// +checklocksignore
func (sq *sndQueueInfo) StateSave(stateSinkObject state.Sink) {
	sq.beforeSave()
	stateSinkObject.Save(0, &sq.TCPSndBufState)
}

func (sq *sndQueueInfo) afterLoad(context.Context) {}

// +checklocksignore
func (sq *sndQueueInfo) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &sq.TCPSndBufState)
}

func (e *Endpoint) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.Endpoint"
}

func (e *Endpoint) StateFields() []string {
	return []string{
		"TCPEndpointStateInner",
		"TransportEndpointInfo",
		"DefaultSocketOptionsHandler",
		"waiterQueue",
		"hardError",
		"lastError",
		"TCPRcvBufState",
		"rcvMemUsed",
		"ownedByUser",
		"rcvQueue",
		"state",
		"connectionDirectionState",
		"boundNICID",
		"ipv4TTL",
		"ipv6HopLimit",
		"isConnectNotified",
		"h",
		"portFlags",
		"boundBindToDevice",
		"boundPortFlags",
		"boundDest",
		"effectiveNetProtos",
		"recentTSTime",
		"shutdownFlags",
		"tcpRecovery",
		"sack",
		"delay",
		"scoreboard",
		"segmentQueue",
		"userMSS",
		"maxSynRetries",
		"windowClamp",
		"sndQueueInfo",
		"cc",
		"keepalive",
		"userTimeout",
		"deferAccept",
		"acceptQueue",
		"rcv",
		"snd",
		"connectingAddress",
		"amss",
		"sendTOS",
		"gso",
		"stats",
		"tcpLingerTimeout",
		"closed",
		"txHash",
		"owner",
		"ops",
		"lastOutOfWindowAckTime",
		"pmtud",
	}
}

// +checklocksignore
func (e *Endpoint) StateSave(stateSinkObject state.Sink) {
	e.beforeSave()
	var stateValue EndpointState
	stateValue = e.saveState()
	stateSinkObject.SaveValue(10, stateValue)
	stateSinkObject.Save(0, &e.TCPEndpointStateInner)
	stateSinkObject.Save(1, &e.TransportEndpointInfo)
	stateSinkObject.Save(2, &e.DefaultSocketOptionsHandler)
	stateSinkObject.Save(3, &e.waiterQueue)
	stateSinkObject.Save(4, &e.hardError)
	stateSinkObject.Save(5, &e.lastError)
	stateSinkObject.Save(6, &e.TCPRcvBufState)
	stateSinkObject.Save(7, &e.rcvMemUsed)
	stateSinkObject.Save(8, &e.ownedByUser)
	stateSinkObject.Save(9, &e.rcvQueue)
	stateSinkObject.Save(11, &e.connectionDirectionState)
	stateSinkObject.Save(12, &e.boundNICID)
	stateSinkObject.Save(13, &e.ipv4TTL)
	stateSinkObject.Save(14, &e.ipv6HopLimit)
	stateSinkObject.Save(15, &e.isConnectNotified)
	stateSinkObject.Save(16, &e.h)
	stateSinkObject.Save(17, &e.portFlags)
	stateSinkObject.Save(18, &e.boundBindToDevice)
	stateSinkObject.Save(19, &e.boundPortFlags)
	stateSinkObject.Save(20, &e.boundDest)
	stateSinkObject.Save(21, &e.effectiveNetProtos)
	stateSinkObject.Save(22, &e.recentTSTime)
	stateSinkObject.Save(23, &e.shutdownFlags)
	stateSinkObject.Save(24, &e.tcpRecovery)
	stateSinkObject.Save(25, &e.sack)
	stateSinkObject.Save(26, &e.delay)
	stateSinkObject.Save(27, &e.scoreboard)
	stateSinkObject.Save(28, &e.segmentQueue)
	stateSinkObject.Save(29, &e.userMSS)
	stateSinkObject.Save(30, &e.maxSynRetries)
	stateSinkObject.Save(31, &e.windowClamp)
	stateSinkObject.Save(32, &e.sndQueueInfo)
	stateSinkObject.Save(33, &e.cc)
	stateSinkObject.Save(34, &e.keepalive)
	stateSinkObject.Save(35, &e.userTimeout)
	stateSinkObject.Save(36, &e.deferAccept)
	stateSinkObject.Save(37, &e.acceptQueue)
	stateSinkObject.Save(38, &e.rcv)
	stateSinkObject.Save(39, &e.snd)
	stateSinkObject.Save(40, &e.connectingAddress)
	stateSinkObject.Save(41, &e.amss)
	stateSinkObject.Save(42, &e.sendTOS)
	stateSinkObject.Save(43, &e.gso)
	stateSinkObject.Save(44, &e.stats)
	stateSinkObject.Save(45, &e.tcpLingerTimeout)
	stateSinkObject.Save(46, &e.closed)
	stateSinkObject.Save(47, &e.txHash)
	stateSinkObject.Save(48, &e.owner)
	stateSinkObject.Save(49, &e.ops)
	stateSinkObject.Save(50, &e.lastOutOfWindowAckTime)
	stateSinkObject.Save(51, &e.pmtud)
}

// +checklocksignore
func (e *Endpoint) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &e.TCPEndpointStateInner)
	stateSourceObject.Load(1, &e.TransportEndpointInfo)
	stateSourceObject.Load(2, &e.DefaultSocketOptionsHandler)
	stateSourceObject.LoadWait(3, &e.waiterQueue)
	stateSourceObject.Load(4, &e.hardError)
	stateSourceObject.Load(5, &e.lastError)
	stateSourceObject.Load(6, &e.TCPRcvBufState)
	stateSourceObject.Load(7, &e.rcvMemUsed)
	stateSourceObject.Load(8, &e.ownedByUser)
	stateSourceObject.LoadWait(9, &e.rcvQueue)
	stateSourceObject.Load(11, &e.connectionDirectionState)
	stateSourceObject.Load(12, &e.boundNICID)
	stateSourceObject.Load(13, &e.ipv4TTL)
	stateSourceObject.Load(14, &e.ipv6HopLimit)
	stateSourceObject.Load(15, &e.isConnectNotified)
	stateSourceObject.Load(16, &e.h)
	stateSourceObject.Load(17, &e.portFlags)
	stateSourceObject.Load(18, &e.boundBindToDevice)
	stateSourceObject.Load(19, &e.boundPortFlags)
	stateSourceObject.Load(20, &e.boundDest)
	stateSourceObject.Load(21, &e.effectiveNetProtos)
	stateSourceObject.Load(22, &e.recentTSTime)
	stateSourceObject.Load(23, &e.shutdownFlags)
	stateSourceObject.Load(24, &e.tcpRecovery)
	stateSourceObject.Load(25, &e.sack)
	stateSourceObject.Load(26, &e.delay)
	stateSourceObject.Load(27, &e.scoreboard)
	stateSourceObject.LoadWait(28, &e.segmentQueue)
	stateSourceObject.Load(29, &e.userMSS)
	stateSourceObject.Load(30, &e.maxSynRetries)
	stateSourceObject.Load(31, &e.windowClamp)
	stateSourceObject.Load(32, &e.sndQueueInfo)
	stateSourceObject.Load(33, &e.cc)
	stateSourceObject.Load(34, &e.keepalive)
	stateSourceObject.Load(35, &e.userTimeout)
	stateSourceObject.Load(36, &e.deferAccept)
	stateSourceObject.Load(37, &e.acceptQueue)
	stateSourceObject.LoadWait(38, &e.rcv)
	stateSourceObject.LoadWait(39, &e.snd)
	stateSourceObject.Load(40, &e.connectingAddress)
	stateSourceObject.Load(41, &e.amss)
	stateSourceObject.Load(42, &e.sendTOS)
	stateSourceObject.Load(43, &e.gso)
	stateSourceObject.Load(44, &e.stats)
	stateSourceObject.Load(45, &e.tcpLingerTimeout)
	stateSourceObject.Load(46, &e.closed)
	stateSourceObject.Load(47, &e.txHash)
	stateSourceObject.Load(48, &e.owner)
	stateSourceObject.Load(49, &e.ops)
	stateSourceObject.Load(50, &e.lastOutOfWindowAckTime)
	stateSourceObject.Load(51, &e.pmtud)
	stateSourceObject.LoadValue(10, new(EndpointState), func(y any) { e.loadState(ctx, y.(EndpointState)) })
	stateSourceObject.AfterLoad(func() { e.afterLoad(ctx) })
}

func (k *keepalive) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.keepalive"
}

func (k *keepalive) StateFields() []string {
	return []string{
		"idle",
		"interval",
		"count",
		"unacked",
	}
}

func (k *keepalive) beforeSave() {}

// +checklocksignore
func (k *keepalive) StateSave(stateSinkObject state.Sink) {
	k.beforeSave()
	stateSinkObject.Save(0, &k.idle)
	stateSinkObject.Save(1, &k.interval)
	stateSinkObject.Save(2, &k.count)
	stateSinkObject.Save(3, &k.unacked)
}

func (k *keepalive) afterLoad(context.Context) {}

// +checklocksignore
func (k *keepalive) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &k.idle)
	stateSourceObject.Load(1, &k.interval)
	stateSourceObject.Load(2, &k.count)
	stateSourceObject.Load(3, &k.unacked)
}

func (p *protocol) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.protocol"
}

func (p *protocol) StateFields() []string {
	return []string{
		"stack",
		"sackEnabled",
		"recovery",
		"delayEnabled",
		"alwaysUseSynCookies",
		"sendBufferSize",
		"recvBufferSize",
		"congestionControl",
		"availableCongestionControl",
		"moderateReceiveBuffer",
		"lingerTimeout",
		"timeWaitTimeout",
		"timeWaitReuse",
		"minRTO",
		"maxRTO",
		"maxRetries",
		"synRetries",
		"dispatcher",
		"seqnumSecret",
		"tsOffsetSecret",
	}
}

func (p *protocol) beforeSave() {}

// +checklocksignore
func (p *protocol) StateSave(stateSinkObject state.Sink) {
	p.beforeSave()
	stateSinkObject.Save(0, &p.stack)
	stateSinkObject.Save(1, &p.sackEnabled)
	stateSinkObject.Save(2, &p.recovery)
	stateSinkObject.Save(3, &p.delayEnabled)
	stateSinkObject.Save(4, &p.alwaysUseSynCookies)
	stateSinkObject.Save(5, &p.sendBufferSize)
	stateSinkObject.Save(6, &p.recvBufferSize)
	stateSinkObject.Save(7, &p.congestionControl)
	stateSinkObject.Save(8, &p.availableCongestionControl)
	stateSinkObject.Save(9, &p.moderateReceiveBuffer)
	stateSinkObject.Save(10, &p.lingerTimeout)
	stateSinkObject.Save(11, &p.timeWaitTimeout)
	stateSinkObject.Save(12, &p.timeWaitReuse)
	stateSinkObject.Save(13, &p.minRTO)
	stateSinkObject.Save(14, &p.maxRTO)
	stateSinkObject.Save(15, &p.maxRetries)
	stateSinkObject.Save(16, &p.synRetries)
	stateSinkObject.Save(17, &p.dispatcher)
	stateSinkObject.Save(18, &p.seqnumSecret)
	stateSinkObject.Save(19, &p.tsOffsetSecret)
}

func (p *protocol) afterLoad(context.Context) {}

// +checklocksignore
func (p *protocol) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &p.stack)
	stateSourceObject.Load(1, &p.sackEnabled)
	stateSourceObject.Load(2, &p.recovery)
	stateSourceObject.Load(3, &p.delayEnabled)
	stateSourceObject.Load(4, &p.alwaysUseSynCookies)
	stateSourceObject.Load(5, &p.sendBufferSize)
	stateSourceObject.Load(6, &p.recvBufferSize)
	stateSourceObject.Load(7, &p.congestionControl)
	stateSourceObject.Load(8, &p.availableCongestionControl)
	stateSourceObject.Load(9, &p.moderateReceiveBuffer)
	stateSourceObject.Load(10, &p.lingerTimeout)
	stateSourceObject.Load(11, &p.timeWaitTimeout)
	stateSourceObject.Load(12, &p.timeWaitReuse)
	stateSourceObject.Load(13, &p.minRTO)
	stateSourceObject.Load(14, &p.maxRTO)
	stateSourceObject.Load(15, &p.maxRetries)
	stateSourceObject.Load(16, &p.synRetries)
	stateSourceObject.Load(17, &p.dispatcher)
	stateSourceObject.Load(18, &p.seqnumSecret)
	stateSourceObject.Load(19, &p.tsOffsetSecret)
}

func (rc *rackControl) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.rackControl"
}

func (rc *rackControl) StateFields() []string {
	return []string{
		"TCPRACKState",
		"exitedRecovery",
		"minRTT",
		"tlpRxtOut",
		"tlpHighRxt",
		"snd",
	}
}

func (rc *rackControl) beforeSave() {}

// +checklocksignore
func (rc *rackControl) StateSave(stateSinkObject state.Sink) {
	rc.beforeSave()
	stateSinkObject.Save(0, &rc.TCPRACKState)
	stateSinkObject.Save(1, &rc.exitedRecovery)
	stateSinkObject.Save(2, &rc.minRTT)
	stateSinkObject.Save(3, &rc.tlpRxtOut)
	stateSinkObject.Save(4, &rc.tlpHighRxt)
	stateSinkObject.Save(5, &rc.snd)
}

func (rc *rackControl) afterLoad(context.Context) {}

// +checklocksignore
func (rc *rackControl) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &rc.TCPRACKState)
	stateSourceObject.Load(1, &rc.exitedRecovery)
	stateSourceObject.Load(2, &rc.minRTT)
	stateSourceObject.Load(3, &rc.tlpRxtOut)
	stateSourceObject.Load(4, &rc.tlpHighRxt)
	stateSourceObject.Load(5, &rc.snd)
}

func (r *receiver) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.receiver"
}

func (r *receiver) StateFields() []string {
	return []string{
		"TCPReceiverState",
		"ep",
		"rcvWnd",
		"rcvWUP",
		"prevBufUsed",
		"closed",
		"pendingRcvdSegments",
		"lastRcvdAckTime",
	}
}

func (r *receiver) beforeSave() {}

// +checklocksignore
func (r *receiver) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.TCPReceiverState)
	stateSinkObject.Save(1, &r.ep)
	stateSinkObject.Save(2, &r.rcvWnd)
	stateSinkObject.Save(3, &r.rcvWUP)
	stateSinkObject.Save(4, &r.prevBufUsed)
	stateSinkObject.Save(5, &r.closed)
	stateSinkObject.Save(6, &r.pendingRcvdSegments)
	stateSinkObject.Save(7, &r.lastRcvdAckTime)
}

func (r *receiver) afterLoad(context.Context) {}

// +checklocksignore
func (r *receiver) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.TCPReceiverState)
	stateSourceObject.Load(1, &r.ep)
	stateSourceObject.Load(2, &r.rcvWnd)
	stateSourceObject.Load(3, &r.rcvWUP)
	stateSourceObject.Load(4, &r.prevBufUsed)
	stateSourceObject.Load(5, &r.closed)
	stateSourceObject.Load(6, &r.pendingRcvdSegments)
	stateSourceObject.Load(7, &r.lastRcvdAckTime)
}

func (r *renoState) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.renoState"
}

func (r *renoState) StateFields() []string {
	return []string{
		"s",
	}
}

func (r *renoState) beforeSave() {}

// +checklocksignore
func (r *renoState) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.s)
}

func (r *renoState) afterLoad(context.Context) {}

// +checklocksignore
func (r *renoState) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.s)
}

func (rr *renoRecovery) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.renoRecovery"
}

func (rr *renoRecovery) StateFields() []string {
	return []string{
		"s",
	}
}

func (rr *renoRecovery) beforeSave() {}

// +checklocksignore
func (rr *renoRecovery) StateSave(stateSinkObject state.Sink) {
	rr.beforeSave()
	stateSinkObject.Save(0, &rr.s)
}

func (rr *renoRecovery) afterLoad(context.Context) {}

// +checklocksignore
func (rr *renoRecovery) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &rr.s)
}

func (sr *sackRecovery) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.sackRecovery"
}

func (sr *sackRecovery) StateFields() []string {
	return []string{
		"s",
	}
}

func (sr *sackRecovery) beforeSave() {}

// +checklocksignore
func (sr *sackRecovery) StateSave(stateSinkObject state.Sink) {
	sr.beforeSave()
	stateSinkObject.Save(0, &sr.s)
}

func (sr *sackRecovery) afterLoad(context.Context) {}

// +checklocksignore
func (sr *sackRecovery) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &sr.s)
}

func (s *SACKScoreboard) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.SACKScoreboard"
}

func (s *SACKScoreboard) StateFields() []string {
	return []string{
		"smss",
		"maxSACKED",
	}
}

func (s *SACKScoreboard) beforeSave() {}

// +checklocksignore
func (s *SACKScoreboard) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.smss)
	stateSinkObject.Save(1, &s.maxSACKED)
}

func (s *SACKScoreboard) afterLoad(context.Context) {}

// +checklocksignore
func (s *SACKScoreboard) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.smss)
	stateSourceObject.Load(1, &s.maxSACKED)
}

func (s *segment) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.segment"
}

func (s *segment) StateFields() []string {
	return []string{
		"segmentEntry",
		"segmentRefs",
		"ep",
		"qFlags",
		"pkt",
		"sequenceNumber",
		"ackNumber",
		"flags",
		"window",
		"csum",
		"csumValid",
		"parsedOptions",
		"options",
		"hasNewSACKInfo",
		"rcvdTime",
		"xmitTime",
		"xmitCount",
		"acked",
		"dataMemSize",
		"lost",
	}
}

func (s *segment) beforeSave() {}

// +checklocksignore
func (s *segment) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	var optionsValue []byte
	optionsValue = s.saveOptions()
	stateSinkObject.SaveValue(12, optionsValue)
	stateSinkObject.Save(0, &s.segmentEntry)
	stateSinkObject.Save(1, &s.segmentRefs)
	stateSinkObject.Save(2, &s.ep)
	stateSinkObject.Save(3, &s.qFlags)
	stateSinkObject.Save(4, &s.pkt)
	stateSinkObject.Save(5, &s.sequenceNumber)
	stateSinkObject.Save(6, &s.ackNumber)
	stateSinkObject.Save(7, &s.flags)
	stateSinkObject.Save(8, &s.window)
	stateSinkObject.Save(9, &s.csum)
	stateSinkObject.Save(10, &s.csumValid)
	stateSinkObject.Save(11, &s.parsedOptions)
	stateSinkObject.Save(13, &s.hasNewSACKInfo)
	stateSinkObject.Save(14, &s.rcvdTime)
	stateSinkObject.Save(15, &s.xmitTime)
	stateSinkObject.Save(16, &s.xmitCount)
	stateSinkObject.Save(17, &s.acked)
	stateSinkObject.Save(18, &s.dataMemSize)
	stateSinkObject.Save(19, &s.lost)
}

func (s *segment) afterLoad(context.Context) {}

// +checklocksignore
func (s *segment) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.segmentEntry)
	stateSourceObject.Load(1, &s.segmentRefs)
	stateSourceObject.Load(2, &s.ep)
	stateSourceObject.Load(3, &s.qFlags)
	stateSourceObject.Load(4, &s.pkt)
	stateSourceObject.Load(5, &s.sequenceNumber)
	stateSourceObject.Load(6, &s.ackNumber)
	stateSourceObject.Load(7, &s.flags)
	stateSourceObject.Load(8, &s.window)
	stateSourceObject.Load(9, &s.csum)
	stateSourceObject.Load(10, &s.csumValid)
	stateSourceObject.Load(11, &s.parsedOptions)
	stateSourceObject.Load(13, &s.hasNewSACKInfo)
	stateSourceObject.Load(14, &s.rcvdTime)
	stateSourceObject.Load(15, &s.xmitTime)
	stateSourceObject.Load(16, &s.xmitCount)
	stateSourceObject.Load(17, &s.acked)
	stateSourceObject.Load(18, &s.dataMemSize)
	stateSourceObject.Load(19, &s.lost)
	stateSourceObject.LoadValue(12, new([]byte), func(y any) { s.loadOptions(ctx, y.([]byte)) })
}

func (q *segmentQueue) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.segmentQueue"
}

func (q *segmentQueue) StateFields() []string {
	return []string{
		"list",
		"ep",
		"frozen",
	}
}

func (q *segmentQueue) beforeSave() {}

// +checklocksignore
func (q *segmentQueue) StateSave(stateSinkObject state.Sink) {
	q.beforeSave()
	stateSinkObject.Save(0, &q.list)
	stateSinkObject.Save(1, &q.ep)
	stateSinkObject.Save(2, &q.frozen)
}

func (q *segmentQueue) afterLoad(context.Context) {}

// +checklocksignore
func (q *segmentQueue) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.LoadWait(0, &q.list)
	stateSourceObject.Load(1, &q.ep)
	stateSourceObject.Load(2, &q.frozen)
}

func (s *sender) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.sender"
}

func (s *sender) StateFields() []string {
	return []string{
		"TCPSenderState",
		"ep",
		"lr",
		"firstRetransmittedSegXmitTime",
		"writeNext",
		"writeList",
		"rtt",
		"minRTO",
		"maxRTO",
		"maxRetries",
		"gso",
		"state",
		"cc",
		"rc",
		"spuriousRecovery",
		"retransmitTS",
		"startCork",
	}
}

func (s *sender) beforeSave() {}

// +checklocksignore
func (s *sender) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.TCPSenderState)
	stateSinkObject.Save(1, &s.ep)
	stateSinkObject.Save(2, &s.lr)
	stateSinkObject.Save(3, &s.firstRetransmittedSegXmitTime)
	stateSinkObject.Save(4, &s.writeNext)
	stateSinkObject.Save(5, &s.writeList)
	stateSinkObject.Save(6, &s.rtt)
	stateSinkObject.Save(7, &s.minRTO)
	stateSinkObject.Save(8, &s.maxRTO)
	stateSinkObject.Save(9, &s.maxRetries)
	stateSinkObject.Save(10, &s.gso)
	stateSinkObject.Save(11, &s.state)
	stateSinkObject.Save(12, &s.cc)
	stateSinkObject.Save(13, &s.rc)
	stateSinkObject.Save(14, &s.spuriousRecovery)
	stateSinkObject.Save(15, &s.retransmitTS)
	stateSinkObject.Save(16, &s.startCork)
}

func (s *sender) afterLoad(context.Context) {}

// +checklocksignore
func (s *sender) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.TCPSenderState)
	stateSourceObject.Load(1, &s.ep)
	stateSourceObject.Load(2, &s.lr)
	stateSourceObject.Load(3, &s.firstRetransmittedSegXmitTime)
	stateSourceObject.Load(4, &s.writeNext)
	stateSourceObject.Load(5, &s.writeList)
	stateSourceObject.Load(6, &s.rtt)
	stateSourceObject.Load(7, &s.minRTO)
	stateSourceObject.Load(8, &s.maxRTO)
	stateSourceObject.Load(9, &s.maxRetries)
	stateSourceObject.Load(10, &s.gso)
	stateSourceObject.Load(11, &s.state)
	stateSourceObject.Load(12, &s.cc)
	stateSourceObject.Load(13, &s.rc)
	stateSourceObject.Load(14, &s.spuriousRecovery)
	stateSourceObject.Load(15, &s.retransmitTS)
	stateSourceObject.Load(16, &s.startCork)
}

func (r *rtt) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.rtt"
}

func (r *rtt) StateFields() []string {
	return []string{
		"TCPRTTState",
	}
}

func (r *rtt) beforeSave() {}

// +checklocksignore
func (r *rtt) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.TCPRTTState)
}

func (r *rtt) afterLoad(context.Context) {}

// +checklocksignore
func (r *rtt) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.TCPRTTState)
}

func (l *endpointList) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.endpointList"
}

func (l *endpointList) StateFields() []string {
	return []string{
		"head",
		"tail",
	}
}

func (l *endpointList) beforeSave() {}

// +checklocksignore
func (l *endpointList) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.head)
	stateSinkObject.Save(1, &l.tail)
}

func (l *endpointList) afterLoad(context.Context) {}

// +checklocksignore
func (l *endpointList) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.head)
	stateSourceObject.Load(1, &l.tail)
}

func (e *endpointEntry) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.endpointEntry"
}

func (e *endpointEntry) StateFields() []string {
	return []string{
		"next",
		"prev",
	}
}

func (e *endpointEntry) beforeSave() {}

// +checklocksignore
func (e *endpointEntry) StateSave(stateSinkObject state.Sink) {
	e.beforeSave()
	stateSinkObject.Save(0, &e.next)
	stateSinkObject.Save(1, &e.prev)
}

func (e *endpointEntry) afterLoad(context.Context) {}

// +checklocksignore
func (e *endpointEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &e.next)
	stateSourceObject.Load(1, &e.prev)
}

func (l *segmentList) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.segmentList"
}

func (l *segmentList) StateFields() []string {
	return []string{
		"head",
		"tail",
	}
}

func (l *segmentList) beforeSave() {}

// +checklocksignore
func (l *segmentList) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.head)
	stateSinkObject.Save(1, &l.tail)
}

func (l *segmentList) afterLoad(context.Context) {}

// +checklocksignore
func (l *segmentList) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.head)
	stateSourceObject.Load(1, &l.tail)
}

func (e *segmentEntry) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.segmentEntry"
}

func (e *segmentEntry) StateFields() []string {
	return []string{
		"next",
		"prev",
	}
}

func (e *segmentEntry) beforeSave() {}

// +checklocksignore
func (e *segmentEntry) StateSave(stateSinkObject state.Sink) {
	e.beforeSave()
	stateSinkObject.Save(0, &e.next)
	stateSinkObject.Save(1, &e.prev)
}

func (e *segmentEntry) afterLoad(context.Context) {}

// +checklocksignore
func (e *segmentEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &e.next)
	stateSourceObject.Load(1, &e.prev)
}

func (r *segmentRefs) StateTypeName() string {
	return "pkg/tcpip/transport/tcp.segmentRefs"
}

func (r *segmentRefs) StateFields() []string {
	return []string{
		"refCount",
	}
}

func (r *segmentRefs) beforeSave() {}

// +checklocksignore
func (r *segmentRefs) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.refCount)
}

// +checklocksignore
func (r *segmentRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.refCount)
	stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) })
}

func init() {
	state.Register((*acceptQueue)(nil))
	state.Register((*handshake)(nil))
	state.Register((*cubicState)(nil))
	state.Register((*epQueue)(nil))
	state.Register((*processor)(nil))
	state.Register((*dispatcher)(nil))
	state.Register((*jenkinsHasher)(nil))
	state.Register((*SACKInfo)(nil))
	state.Register((*ReceiveErrors)(nil))
	state.Register((*SendErrors)(nil))
	state.Register((*Stats)(nil))
	state.Register((*sndQueueInfo)(nil))
	state.Register((*Endpoint)(nil))
	state.Register((*keepalive)(nil))
	state.Register((*protocol)(nil))
	state.Register((*rackControl)(nil))
	state.Register((*receiver)(nil))
	state.Register((*renoState)(nil))
	state.Register((*renoRecovery)(nil))
	state.Register((*sackRecovery)(nil))
	state.Register((*SACKScoreboard)(nil))
	state.Register((*segment)(nil))
	state.Register((*segmentQueue)(nil))
	state.Register((*sender)(nil))
	state.Register((*rtt)(nil))
	state.Register((*endpointList)(nil))
	state.Register((*endpointEntry)(nil))
	state.Register((*segmentList)(nil))
	state.Register((*segmentEntry)(nil))
	state.Register((*segmentRefs)(nil))
}
