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

     1  // automatically generated by stateify.
     2  
     3  package socket
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (i *IPControlMessages) StateTypeName() string {
    12  	return "pkg/sentry/socket.IPControlMessages"
    13  }
    14  
    15  func (i *IPControlMessages) StateFields() []string {
    16  	return []string{
    17  		"HasTimestamp",
    18  		"Timestamp",
    19  		"HasInq",
    20  		"Inq",
    21  		"HasTOS",
    22  		"TOS",
    23  		"HasTTL",
    24  		"TTL",
    25  		"HasHopLimit",
    26  		"HopLimit",
    27  		"HasTClass",
    28  		"TClass",
    29  		"HasIPPacketInfo",
    30  		"PacketInfo",
    31  		"HasIPv6PacketInfo",
    32  		"IPv6PacketInfo",
    33  		"OriginalDstAddress",
    34  		"SockErr",
    35  	}
    36  }
    37  
    38  func (i *IPControlMessages) beforeSave() {}
    39  
    40  // +checklocksignore
    41  func (i *IPControlMessages) StateSave(stateSinkObject state.Sink) {
    42  	i.beforeSave()
    43  	var TimestampValue int64
    44  	TimestampValue = i.saveTimestamp()
    45  	stateSinkObject.SaveValue(1, TimestampValue)
    46  	stateSinkObject.Save(0, &i.HasTimestamp)
    47  	stateSinkObject.Save(2, &i.HasInq)
    48  	stateSinkObject.Save(3, &i.Inq)
    49  	stateSinkObject.Save(4, &i.HasTOS)
    50  	stateSinkObject.Save(5, &i.TOS)
    51  	stateSinkObject.Save(6, &i.HasTTL)
    52  	stateSinkObject.Save(7, &i.TTL)
    53  	stateSinkObject.Save(8, &i.HasHopLimit)
    54  	stateSinkObject.Save(9, &i.HopLimit)
    55  	stateSinkObject.Save(10, &i.HasTClass)
    56  	stateSinkObject.Save(11, &i.TClass)
    57  	stateSinkObject.Save(12, &i.HasIPPacketInfo)
    58  	stateSinkObject.Save(13, &i.PacketInfo)
    59  	stateSinkObject.Save(14, &i.HasIPv6PacketInfo)
    60  	stateSinkObject.Save(15, &i.IPv6PacketInfo)
    61  	stateSinkObject.Save(16, &i.OriginalDstAddress)
    62  	stateSinkObject.Save(17, &i.SockErr)
    63  }
    64  
    65  func (i *IPControlMessages) afterLoad(context.Context) {}
    66  
    67  // +checklocksignore
    68  func (i *IPControlMessages) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    69  	stateSourceObject.Load(0, &i.HasTimestamp)
    70  	stateSourceObject.Load(2, &i.HasInq)
    71  	stateSourceObject.Load(3, &i.Inq)
    72  	stateSourceObject.Load(4, &i.HasTOS)
    73  	stateSourceObject.Load(5, &i.TOS)
    74  	stateSourceObject.Load(6, &i.HasTTL)
    75  	stateSourceObject.Load(7, &i.TTL)
    76  	stateSourceObject.Load(8, &i.HasHopLimit)
    77  	stateSourceObject.Load(9, &i.HopLimit)
    78  	stateSourceObject.Load(10, &i.HasTClass)
    79  	stateSourceObject.Load(11, &i.TClass)
    80  	stateSourceObject.Load(12, &i.HasIPPacketInfo)
    81  	stateSourceObject.Load(13, &i.PacketInfo)
    82  	stateSourceObject.Load(14, &i.HasIPv6PacketInfo)
    83  	stateSourceObject.Load(15, &i.IPv6PacketInfo)
    84  	stateSourceObject.Load(16, &i.OriginalDstAddress)
    85  	stateSourceObject.Load(17, &i.SockErr)
    86  	stateSourceObject.LoadValue(1, new(int64), func(y any) { i.loadTimestamp(ctx, y.(int64)) })
    87  }
    88  
    89  func (to *SendReceiveTimeout) StateTypeName() string {
    90  	return "pkg/sentry/socket.SendReceiveTimeout"
    91  }
    92  
    93  func (to *SendReceiveTimeout) StateFields() []string {
    94  	return []string{
    95  		"send",
    96  		"recv",
    97  	}
    98  }
    99  
   100  func (to *SendReceiveTimeout) beforeSave() {}
   101  
   102  // +checklocksignore
   103  func (to *SendReceiveTimeout) StateSave(stateSinkObject state.Sink) {
   104  	to.beforeSave()
   105  	stateSinkObject.Save(0, &to.send)
   106  	stateSinkObject.Save(1, &to.recv)
   107  }
   108  
   109  func (to *SendReceiveTimeout) afterLoad(context.Context) {}
   110  
   111  // +checklocksignore
   112  func (to *SendReceiveTimeout) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   113  	stateSourceObject.Load(0, &to.send)
   114  	stateSourceObject.Load(1, &to.recv)
   115  }
   116  
   117  func init() {
   118  	state.Register((*IPControlMessages)(nil))
   119  	state.Register((*SendReceiveTimeout)(nil))
   120  }