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

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