github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/socket/unix/unix_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package unix
     4  
     5  import (
     6  	"github.com/MerlinKodo/gvisor/pkg/state"
     7  )
     8  
     9  func (r *socketRefs) StateTypeName() string {
    10  	return "pkg/sentry/socket/unix.socketRefs"
    11  }
    12  
    13  func (r *socketRefs) StateFields() []string {
    14  	return []string{
    15  		"refCount",
    16  	}
    17  }
    18  
    19  func (r *socketRefs) beforeSave() {}
    20  
    21  // +checklocksignore
    22  func (r *socketRefs) StateSave(stateSinkObject state.Sink) {
    23  	r.beforeSave()
    24  	stateSinkObject.Save(0, &r.refCount)
    25  }
    26  
    27  // +checklocksignore
    28  func (r *socketRefs) StateLoad(stateSourceObject state.Source) {
    29  	stateSourceObject.Load(0, &r.refCount)
    30  	stateSourceObject.AfterLoad(r.afterLoad)
    31  }
    32  
    33  func (s *Socket) StateTypeName() string {
    34  	return "pkg/sentry/socket/unix.Socket"
    35  }
    36  
    37  func (s *Socket) StateFields() []string {
    38  	return []string{
    39  		"vfsfd",
    40  		"FileDescriptionDefaultImpl",
    41  		"DentryMetadataFileDescriptionImpl",
    42  		"LockFD",
    43  		"SendReceiveTimeout",
    44  		"socketRefs",
    45  		"ep",
    46  		"stype",
    47  		"abstractName",
    48  		"abstractNamespace",
    49  	}
    50  }
    51  
    52  func (s *Socket) beforeSave() {}
    53  
    54  // +checklocksignore
    55  func (s *Socket) StateSave(stateSinkObject state.Sink) {
    56  	s.beforeSave()
    57  	stateSinkObject.Save(0, &s.vfsfd)
    58  	stateSinkObject.Save(1, &s.FileDescriptionDefaultImpl)
    59  	stateSinkObject.Save(2, &s.DentryMetadataFileDescriptionImpl)
    60  	stateSinkObject.Save(3, &s.LockFD)
    61  	stateSinkObject.Save(4, &s.SendReceiveTimeout)
    62  	stateSinkObject.Save(5, &s.socketRefs)
    63  	stateSinkObject.Save(6, &s.ep)
    64  	stateSinkObject.Save(7, &s.stype)
    65  	stateSinkObject.Save(8, &s.abstractName)
    66  	stateSinkObject.Save(9, &s.abstractNamespace)
    67  }
    68  
    69  func (s *Socket) afterLoad() {}
    70  
    71  // +checklocksignore
    72  func (s *Socket) StateLoad(stateSourceObject state.Source) {
    73  	stateSourceObject.Load(0, &s.vfsfd)
    74  	stateSourceObject.Load(1, &s.FileDescriptionDefaultImpl)
    75  	stateSourceObject.Load(2, &s.DentryMetadataFileDescriptionImpl)
    76  	stateSourceObject.Load(3, &s.LockFD)
    77  	stateSourceObject.Load(4, &s.SendReceiveTimeout)
    78  	stateSourceObject.Load(5, &s.socketRefs)
    79  	stateSourceObject.Load(6, &s.ep)
    80  	stateSourceObject.Load(7, &s.stype)
    81  	stateSourceObject.Load(8, &s.abstractName)
    82  	stateSourceObject.Load(9, &s.abstractNamespace)
    83  }
    84  
    85  func init() {
    86  	state.Register((*socketRefs)(nil))
    87  	state.Register((*Socket)(nil))
    88  }