github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/socket/hostinet/hostinet_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package hostinet 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (s *Socket) StateTypeName() string { 12 return "pkg/sentry/socket/hostinet.Socket" 13 } 14 15 func (s *Socket) StateFields() []string { 16 return []string{ 17 "vfsfd", 18 "FileDescriptionDefaultImpl", 19 "LockFD", 20 "DentryMetadataFileDescriptionImpl", 21 "SendReceiveTimeout", 22 "family", 23 "stype", 24 "protocol", 25 "queue", 26 "fd", 27 "recvClosed", 28 } 29 } 30 31 func (s *Socket) beforeSave() {} 32 33 // +checklocksignore 34 func (s *Socket) StateSave(stateSinkObject state.Sink) { 35 s.beforeSave() 36 stateSinkObject.Save(0, &s.vfsfd) 37 stateSinkObject.Save(1, &s.FileDescriptionDefaultImpl) 38 stateSinkObject.Save(2, &s.LockFD) 39 stateSinkObject.Save(3, &s.DentryMetadataFileDescriptionImpl) 40 stateSinkObject.Save(4, &s.SendReceiveTimeout) 41 stateSinkObject.Save(5, &s.family) 42 stateSinkObject.Save(6, &s.stype) 43 stateSinkObject.Save(7, &s.protocol) 44 stateSinkObject.Save(8, &s.queue) 45 stateSinkObject.Save(9, &s.fd) 46 stateSinkObject.Save(10, &s.recvClosed) 47 } 48 49 func (s *Socket) afterLoad(context.Context) {} 50 51 // +checklocksignore 52 func (s *Socket) StateLoad(ctx context.Context, stateSourceObject state.Source) { 53 stateSourceObject.Load(0, &s.vfsfd) 54 stateSourceObject.Load(1, &s.FileDescriptionDefaultImpl) 55 stateSourceObject.Load(2, &s.LockFD) 56 stateSourceObject.Load(3, &s.DentryMetadataFileDescriptionImpl) 57 stateSourceObject.Load(4, &s.SendReceiveTimeout) 58 stateSourceObject.Load(5, &s.family) 59 stateSourceObject.Load(6, &s.stype) 60 stateSourceObject.Load(7, &s.protocol) 61 stateSourceObject.Load(8, &s.queue) 62 stateSourceObject.Load(9, &s.fd) 63 stateSourceObject.Load(10, &s.recvClosed) 64 } 65 66 func init() { 67 state.Register((*Socket)(nil)) 68 }