// automatically generated by stateify.

package gro

import (
	"context"

	"github.com/metacubex/gvisor/pkg/state"
)

func (gb *groBucket) StateTypeName() string {
	return "pkg/tcpip/stack/gro.groBucket"
}

func (gb *groBucket) StateFields() []string {
	return []string{
		"count",
		"packets",
		"packetsPrealloc",
		"allocIdxs",
	}
}

func (gb *groBucket) beforeSave() {}

// +checklocksignore
func (gb *groBucket) StateSave(stateSinkObject state.Sink) {
	gb.beforeSave()
	stateSinkObject.Save(0, &gb.count)
	stateSinkObject.Save(1, &gb.packets)
	stateSinkObject.Save(2, &gb.packetsPrealloc)
	stateSinkObject.Save(3, &gb.allocIdxs)
}

func (gb *groBucket) afterLoad(context.Context) {}

// +checklocksignore
func (gb *groBucket) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &gb.count)
	stateSourceObject.Load(1, &gb.packets)
	stateSourceObject.Load(2, &gb.packetsPrealloc)
	stateSourceObject.Load(3, &gb.allocIdxs)
}

func (pk *groPacket) StateTypeName() string {
	return "pkg/tcpip/stack/gro.groPacket"
}

func (pk *groPacket) StateFields() []string {
	return []string{
		"groPacketEntry",
		"pkt",
		"ipHdr",
		"tcpHdr",
		"initialLength",
		"idx",
	}
}

func (pk *groPacket) beforeSave() {}

// +checklocksignore
func (pk *groPacket) StateSave(stateSinkObject state.Sink) {
	pk.beforeSave()
	stateSinkObject.Save(0, &pk.groPacketEntry)
	stateSinkObject.Save(1, &pk.pkt)
	stateSinkObject.Save(2, &pk.ipHdr)
	stateSinkObject.Save(3, &pk.tcpHdr)
	stateSinkObject.Save(4, &pk.initialLength)
	stateSinkObject.Save(5, &pk.idx)
}

func (pk *groPacket) afterLoad(context.Context) {}

// +checklocksignore
func (pk *groPacket) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &pk.groPacketEntry)
	stateSourceObject.Load(1, &pk.pkt)
	stateSourceObject.Load(2, &pk.ipHdr)
	stateSourceObject.Load(3, &pk.tcpHdr)
	stateSourceObject.Load(4, &pk.initialLength)
	stateSourceObject.Load(5, &pk.idx)
}

func (gd *GRO) StateTypeName() string {
	return "pkg/tcpip/stack/gro.GRO"
}

func (gd *GRO) StateFields() []string {
	return []string{
		"enabled",
		"buckets",
		"Dispatcher",
	}
}

func (gd *GRO) beforeSave() {}

// +checklocksignore
func (gd *GRO) StateSave(stateSinkObject state.Sink) {
	gd.beforeSave()
	stateSinkObject.Save(0, &gd.enabled)
	stateSinkObject.Save(1, &gd.buckets)
	stateSinkObject.Save(2, &gd.Dispatcher)
}

func (gd *GRO) afterLoad(context.Context) {}

// +checklocksignore
func (gd *GRO) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &gd.enabled)
	stateSourceObject.Load(1, &gd.buckets)
	stateSourceObject.Load(2, &gd.Dispatcher)
}

func (l *groPacketList) StateTypeName() string {
	return "pkg/tcpip/stack/gro.groPacketList"
}

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

func (l *groPacketList) beforeSave() {}

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

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

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

func (e *groPacketEntry) StateTypeName() string {
	return "pkg/tcpip/stack/gro.groPacketEntry"
}

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

func (e *groPacketEntry) beforeSave() {}

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

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

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

func init() {
	state.Register((*groBucket)(nil))
	state.Register((*groPacket)(nil))
	state.Register((*GRO)(nil))
	state.Register((*groPacketList)(nil))
	state.Register((*groPacketEntry)(nil))
}
