summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/devices/tundev/tundev_state_autogen.go
blob: 343d5b8e7ff9b84be1ab41a119b3b08ae71a380a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// automatically generated by stateify.

package tundev

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

func (t *tunDevice) StateTypeName() string {
	return "pkg/sentry/devices/tundev.tunDevice"
}

func (t *tunDevice) StateFields() []string {
	return []string{}
}

func (t *tunDevice) beforeSave() {}

func (t *tunDevice) StateSave(stateSinkObject state.Sink) {
	t.beforeSave()
}

func (t *tunDevice) afterLoad() {}

func (t *tunDevice) StateLoad(stateSourceObject state.Source) {
}

func (fd *tunFD) StateTypeName() string {
	return "pkg/sentry/devices/tundev.tunFD"
}

func (fd *tunFD) StateFields() []string {
	return []string{
		"vfsfd",
		"FileDescriptionDefaultImpl",
		"DentryMetadataFileDescriptionImpl",
		"NoLockFD",
		"device",
	}
}

func (fd *tunFD) beforeSave() {}

func (fd *tunFD) StateSave(stateSinkObject state.Sink) {
	fd.beforeSave()
	stateSinkObject.Save(0, &fd.vfsfd)
	stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl)
	stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl)
	stateSinkObject.Save(3, &fd.NoLockFD)
	stateSinkObject.Save(4, &fd.device)
}

func (fd *tunFD) afterLoad() {}

func (fd *tunFD) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &fd.vfsfd)
	stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl)
	stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl)
	stateSourceObject.Load(3, &fd.NoLockFD)
	stateSourceObject.Load(4, &fd.device)
}

func init() {
	state.Register((*tunDevice)(nil))
	state.Register((*tunFD)(nil))
}