// automatically generated by stateify.

package nested

import (
	"context"

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

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

func (e *Endpoint) StateFields() []string {
	return []string{
		"child",
		"embedder",
		"dispatcher",
	}
}

func (e *Endpoint) beforeSave() {}

// +checklocksignore
func (e *Endpoint) StateSave(stateSinkObject state.Sink) {
	e.beforeSave()
	stateSinkObject.Save(0, &e.child)
	stateSinkObject.Save(1, &e.embedder)
	stateSinkObject.Save(2, &e.dispatcher)
}

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

// +checklocksignore
func (e *Endpoint) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &e.child)
	stateSourceObject.Load(1, &e.embedder)
	stateSourceObject.Load(2, &e.dispatcher)
}

func init() {
	state.Register((*Endpoint)(nil))
}
