github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/tcpip/transport/packet/packet_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package packet
     4  
     5  import (
     6  	"github.com/nicocha30/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (p *packet) StateTypeName() string {
    10  	return "pkg/tcpip/transport/packet.packet"
    11  }
    12  
    13  func (p *packet) StateFields() []string {
    14  	return []string{
    15  		"packetEntry",
    16  		"data",
    17  		"receivedAt",
    18  		"senderAddr",
    19  		"packetInfo",
    20  	}
    21  }
    22  
    23  func (p *packet) beforeSave() {}
    24  
    25  // +checklocksignore
    26  func (p *packet) StateSave(stateSinkObject state.Sink) {
    27  	p.beforeSave()
    28  	var receivedAtValue int64
    29  	receivedAtValue = p.saveReceivedAt()
    30  	stateSinkObject.SaveValue(2, receivedAtValue)
    31  	stateSinkObject.Save(0, &p.packetEntry)
    32  	stateSinkObject.Save(1, &p.data)
    33  	stateSinkObject.Save(3, &p.senderAddr)
    34  	stateSinkObject.Save(4, &p.packetInfo)
    35  }
    36  
    37  func (p *packet) afterLoad() {}
    38  
    39  // +checklocksignore
    40  func (p *packet) StateLoad(stateSourceObject state.Source) {
    41  	stateSourceObject.Load(0, &p.packetEntry)
    42  	stateSourceObject.Load(1, &p.data)
    43  	stateSourceObject.Load(3, &p.senderAddr)
    44  	stateSourceObject.Load(4, &p.packetInfo)
    45  	stateSourceObject.LoadValue(2, new(int64), func(y any) { p.loadReceivedAt(y.(int64)) })
    46  }
    47  
    48  func (ep *endpoint) StateTypeName() string {
    49  	return "pkg/tcpip/transport/packet.endpoint"
    50  }
    51  
    52  func (ep *endpoint) StateFields() []string {
    53  	return []string{
    54  		"DefaultSocketOptionsHandler",
    55  		"waiterQueue",
    56  		"cooked",
    57  		"ops",
    58  		"stats",
    59  		"rcvList",
    60  		"rcvBufSize",
    61  		"rcvClosed",
    62  		"rcvDisabled",
    63  		"closed",
    64  		"boundNetProto",
    65  		"boundNIC",
    66  		"lastError",
    67  	}
    68  }
    69  
    70  // +checklocksignore
    71  func (ep *endpoint) StateSave(stateSinkObject state.Sink) {
    72  	ep.beforeSave()
    73  	stateSinkObject.Save(0, &ep.DefaultSocketOptionsHandler)
    74  	stateSinkObject.Save(1, &ep.waiterQueue)
    75  	stateSinkObject.Save(2, &ep.cooked)
    76  	stateSinkObject.Save(3, &ep.ops)
    77  	stateSinkObject.Save(4, &ep.stats)
    78  	stateSinkObject.Save(5, &ep.rcvList)
    79  	stateSinkObject.Save(6, &ep.rcvBufSize)
    80  	stateSinkObject.Save(7, &ep.rcvClosed)
    81  	stateSinkObject.Save(8, &ep.rcvDisabled)
    82  	stateSinkObject.Save(9, &ep.closed)
    83  	stateSinkObject.Save(10, &ep.boundNetProto)
    84  	stateSinkObject.Save(11, &ep.boundNIC)
    85  	stateSinkObject.Save(12, &ep.lastError)
    86  }
    87  
    88  // +checklocksignore
    89  func (ep *endpoint) StateLoad(stateSourceObject state.Source) {
    90  	stateSourceObject.Load(0, &ep.DefaultSocketOptionsHandler)
    91  	stateSourceObject.Load(1, &ep.waiterQueue)
    92  	stateSourceObject.Load(2, &ep.cooked)
    93  	stateSourceObject.Load(3, &ep.ops)
    94  	stateSourceObject.Load(4, &ep.stats)
    95  	stateSourceObject.Load(5, &ep.rcvList)
    96  	stateSourceObject.Load(6, &ep.rcvBufSize)
    97  	stateSourceObject.Load(7, &ep.rcvClosed)
    98  	stateSourceObject.Load(8, &ep.rcvDisabled)
    99  	stateSourceObject.Load(9, &ep.closed)
   100  	stateSourceObject.Load(10, &ep.boundNetProto)
   101  	stateSourceObject.Load(11, &ep.boundNIC)
   102  	stateSourceObject.Load(12, &ep.lastError)
   103  	stateSourceObject.AfterLoad(ep.afterLoad)
   104  }
   105  
   106  func (l *packetList) StateTypeName() string {
   107  	return "pkg/tcpip/transport/packet.packetList"
   108  }
   109  
   110  func (l *packetList) StateFields() []string {
   111  	return []string{
   112  		"head",
   113  		"tail",
   114  	}
   115  }
   116  
   117  func (l *packetList) beforeSave() {}
   118  
   119  // +checklocksignore
   120  func (l *packetList) StateSave(stateSinkObject state.Sink) {
   121  	l.beforeSave()
   122  	stateSinkObject.Save(0, &l.head)
   123  	stateSinkObject.Save(1, &l.tail)
   124  }
   125  
   126  func (l *packetList) afterLoad() {}
   127  
   128  // +checklocksignore
   129  func (l *packetList) StateLoad(stateSourceObject state.Source) {
   130  	stateSourceObject.Load(0, &l.head)
   131  	stateSourceObject.Load(1, &l.tail)
   132  }
   133  
   134  func (e *packetEntry) StateTypeName() string {
   135  	return "pkg/tcpip/transport/packet.packetEntry"
   136  }
   137  
   138  func (e *packetEntry) StateFields() []string {
   139  	return []string{
   140  		"next",
   141  		"prev",
   142  	}
   143  }
   144  
   145  func (e *packetEntry) beforeSave() {}
   146  
   147  // +checklocksignore
   148  func (e *packetEntry) StateSave(stateSinkObject state.Sink) {
   149  	e.beforeSave()
   150  	stateSinkObject.Save(0, &e.next)
   151  	stateSinkObject.Save(1, &e.prev)
   152  }
   153  
   154  func (e *packetEntry) afterLoad() {}
   155  
   156  // +checklocksignore
   157  func (e *packetEntry) StateLoad(stateSourceObject state.Source) {
   158  	stateSourceObject.Load(0, &e.next)
   159  	stateSourceObject.Load(1, &e.prev)
   160  }
   161  
   162  func init() {
   163  	state.Register((*packet)(nil))
   164  	state.Register((*endpoint)(nil))
   165  	state.Register((*packetList)(nil))
   166  	state.Register((*packetEntry)(nil))
   167  }