inet.af/netstack@v0.0.0-20220214151720-7585b01ddccf/tcpip/transport/packet/packet_state_autogen.go (about)

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