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

     1  // automatically generated by stateify.
     2  
     3  package netstack
     4  
     5  import (
     6  	"github.com/MerlinKodo/gvisor/pkg/state"
     7  )
     8  
     9  func (s *sock) StateTypeName() string {
    10  	return "pkg/sentry/socket/netstack.sock"
    11  }
    12  
    13  func (s *sock) StateFields() []string {
    14  	return []string{
    15  		"vfsfd",
    16  		"FileDescriptionDefaultImpl",
    17  		"DentryMetadataFileDescriptionImpl",
    18  		"LockFD",
    19  		"SendReceiveTimeout",
    20  		"Queue",
    21  		"family",
    22  		"Endpoint",
    23  		"skType",
    24  		"protocol",
    25  		"namespace",
    26  		"sockOptTimestamp",
    27  		"timestampValid",
    28  		"timestamp",
    29  		"sockOptInq",
    30  	}
    31  }
    32  
    33  func (s *sock) beforeSave() {}
    34  
    35  // +checklocksignore
    36  func (s *sock) StateSave(stateSinkObject state.Sink) {
    37  	s.beforeSave()
    38  	var timestampValue int64
    39  	timestampValue = s.saveTimestamp()
    40  	stateSinkObject.SaveValue(13, timestampValue)
    41  	stateSinkObject.Save(0, &s.vfsfd)
    42  	stateSinkObject.Save(1, &s.FileDescriptionDefaultImpl)
    43  	stateSinkObject.Save(2, &s.DentryMetadataFileDescriptionImpl)
    44  	stateSinkObject.Save(3, &s.LockFD)
    45  	stateSinkObject.Save(4, &s.SendReceiveTimeout)
    46  	stateSinkObject.Save(5, &s.Queue)
    47  	stateSinkObject.Save(6, &s.family)
    48  	stateSinkObject.Save(7, &s.Endpoint)
    49  	stateSinkObject.Save(8, &s.skType)
    50  	stateSinkObject.Save(9, &s.protocol)
    51  	stateSinkObject.Save(10, &s.namespace)
    52  	stateSinkObject.Save(11, &s.sockOptTimestamp)
    53  	stateSinkObject.Save(12, &s.timestampValid)
    54  	stateSinkObject.Save(14, &s.sockOptInq)
    55  }
    56  
    57  func (s *sock) afterLoad() {}
    58  
    59  // +checklocksignore
    60  func (s *sock) StateLoad(stateSourceObject state.Source) {
    61  	stateSourceObject.Load(0, &s.vfsfd)
    62  	stateSourceObject.Load(1, &s.FileDescriptionDefaultImpl)
    63  	stateSourceObject.Load(2, &s.DentryMetadataFileDescriptionImpl)
    64  	stateSourceObject.Load(3, &s.LockFD)
    65  	stateSourceObject.Load(4, &s.SendReceiveTimeout)
    66  	stateSourceObject.Load(5, &s.Queue)
    67  	stateSourceObject.Load(6, &s.family)
    68  	stateSourceObject.Load(7, &s.Endpoint)
    69  	stateSourceObject.Load(8, &s.skType)
    70  	stateSourceObject.Load(9, &s.protocol)
    71  	stateSourceObject.Load(10, &s.namespace)
    72  	stateSourceObject.Load(11, &s.sockOptTimestamp)
    73  	stateSourceObject.Load(12, &s.timestampValid)
    74  	stateSourceObject.Load(14, &s.sockOptInq)
    75  	stateSourceObject.LoadValue(13, new(int64), func(y any) { s.loadTimestamp(y.(int64)) })
    76  }
    77  
    78  func (s *Stack) StateTypeName() string {
    79  	return "pkg/sentry/socket/netstack.Stack"
    80  }
    81  
    82  func (s *Stack) StateFields() []string {
    83  	return []string{}
    84  }
    85  
    86  func (s *Stack) beforeSave() {}
    87  
    88  // +checklocksignore
    89  func (s *Stack) StateSave(stateSinkObject state.Sink) {
    90  	s.beforeSave()
    91  }
    92  
    93  // +checklocksignore
    94  func (s *Stack) StateLoad(stateSourceObject state.Source) {
    95  	stateSourceObject.AfterLoad(s.afterLoad)
    96  }
    97  
    98  func init() {
    99  	state.Register((*sock)(nil))
   100  	state.Register((*Stack)(nil))
   101  }