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

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