github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/sentry/devices/tundev/tundev_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package tundev 4 5 import ( 6 "github.com/nicocha30/gvisor-ligolo/pkg/state" 7 ) 8 9 func (t *tunDevice) StateTypeName() string { 10 return "pkg/sentry/devices/tundev.tunDevice" 11 } 12 13 func (t *tunDevice) StateFields() []string { 14 return []string{} 15 } 16 17 func (t *tunDevice) beforeSave() {} 18 19 // +checklocksignore 20 func (t *tunDevice) StateSave(stateSinkObject state.Sink) { 21 t.beforeSave() 22 } 23 24 func (t *tunDevice) afterLoad() {} 25 26 // +checklocksignore 27 func (t *tunDevice) StateLoad(stateSourceObject state.Source) { 28 } 29 30 func (fd *tunFD) StateTypeName() string { 31 return "pkg/sentry/devices/tundev.tunFD" 32 } 33 34 func (fd *tunFD) StateFields() []string { 35 return []string{ 36 "vfsfd", 37 "FileDescriptionDefaultImpl", 38 "DentryMetadataFileDescriptionImpl", 39 "NoLockFD", 40 "device", 41 } 42 } 43 44 func (fd *tunFD) beforeSave() {} 45 46 // +checklocksignore 47 func (fd *tunFD) StateSave(stateSinkObject state.Sink) { 48 fd.beforeSave() 49 stateSinkObject.Save(0, &fd.vfsfd) 50 stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl) 51 stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl) 52 stateSinkObject.Save(3, &fd.NoLockFD) 53 stateSinkObject.Save(4, &fd.device) 54 } 55 56 func (fd *tunFD) afterLoad() {} 57 58 // +checklocksignore 59 func (fd *tunFD) StateLoad(stateSourceObject state.Source) { 60 stateSourceObject.Load(0, &fd.vfsfd) 61 stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl) 62 stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl) 63 stateSourceObject.Load(3, &fd.NoLockFD) 64 stateSourceObject.Load(4, &fd.device) 65 } 66 67 func init() { 68 state.Register((*tunDevice)(nil)) 69 state.Register((*tunFD)(nil)) 70 }