github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/socket/netlink/netlink_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package netlink
     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/netlink.Socket"
    13  }
    14  
    15  func (s *Socket) StateFields() []string {
    16  	return []string{
    17  		"vfsfd",
    18  		"FileDescriptionDefaultImpl",
    19  		"DentryMetadataFileDescriptionImpl",
    20  		"LockFD",
    21  		"SendReceiveTimeout",
    22  		"ports",
    23  		"protocol",
    24  		"skType",
    25  		"ep",
    26  		"connection",
    27  		"bound",
    28  		"portID",
    29  		"sendBufferSize",
    30  		"filter",
    31  	}
    32  }
    33  
    34  func (s *Socket) beforeSave() {}
    35  
    36  // +checklocksignore
    37  func (s *Socket) StateSave(stateSinkObject state.Sink) {
    38  	s.beforeSave()
    39  	stateSinkObject.Save(0, &s.vfsfd)
    40  	stateSinkObject.Save(1, &s.FileDescriptionDefaultImpl)
    41  	stateSinkObject.Save(2, &s.DentryMetadataFileDescriptionImpl)
    42  	stateSinkObject.Save(3, &s.LockFD)
    43  	stateSinkObject.Save(4, &s.SendReceiveTimeout)
    44  	stateSinkObject.Save(5, &s.ports)
    45  	stateSinkObject.Save(6, &s.protocol)
    46  	stateSinkObject.Save(7, &s.skType)
    47  	stateSinkObject.Save(8, &s.ep)
    48  	stateSinkObject.Save(9, &s.connection)
    49  	stateSinkObject.Save(10, &s.bound)
    50  	stateSinkObject.Save(11, &s.portID)
    51  	stateSinkObject.Save(12, &s.sendBufferSize)
    52  	stateSinkObject.Save(13, &s.filter)
    53  }
    54  
    55  func (s *Socket) afterLoad(context.Context) {}
    56  
    57  // +checklocksignore
    58  func (s *Socket) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    59  	stateSourceObject.Load(0, &s.vfsfd)
    60  	stateSourceObject.Load(1, &s.FileDescriptionDefaultImpl)
    61  	stateSourceObject.Load(2, &s.DentryMetadataFileDescriptionImpl)
    62  	stateSourceObject.Load(3, &s.LockFD)
    63  	stateSourceObject.Load(4, &s.SendReceiveTimeout)
    64  	stateSourceObject.Load(5, &s.ports)
    65  	stateSourceObject.Load(6, &s.protocol)
    66  	stateSourceObject.Load(7, &s.skType)
    67  	stateSourceObject.Load(8, &s.ep)
    68  	stateSourceObject.Load(9, &s.connection)
    69  	stateSourceObject.Load(10, &s.bound)
    70  	stateSourceObject.Load(11, &s.portID)
    71  	stateSourceObject.Load(12, &s.sendBufferSize)
    72  	stateSourceObject.Load(13, &s.filter)
    73  }
    74  
    75  func (k *kernelSCM) StateTypeName() string {
    76  	return "pkg/sentry/socket/netlink.kernelSCM"
    77  }
    78  
    79  func (k *kernelSCM) StateFields() []string {
    80  	return []string{}
    81  }
    82  
    83  func (k *kernelSCM) beforeSave() {}
    84  
    85  // +checklocksignore
    86  func (k *kernelSCM) StateSave(stateSinkObject state.Sink) {
    87  	k.beforeSave()
    88  }
    89  
    90  func (k *kernelSCM) afterLoad(context.Context) {}
    91  
    92  // +checklocksignore
    93  func (k *kernelSCM) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    94  }
    95  
    96  func init() {
    97  	state.Register((*Socket)(nil))
    98  	state.Register((*kernelSCM)(nil))
    99  }