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

     1  // automatically generated by stateify.
     2  
     3  package raw
     4  
     5  import (
     6  	"inet.af/netstack/state"
     7  	"inet.af/netstack/tcpip/buffer"
     8  )
     9  
    10  func (p *rawPacket) StateTypeName() string {
    11  	return "pkg/tcpip/transport/raw.rawPacket"
    12  }
    13  
    14  func (p *rawPacket) StateFields() []string {
    15  	return []string{
    16  		"rawPacketEntry",
    17  		"data",
    18  		"receivedAt",
    19  		"senderAddr",
    20  		"packetInfo",
    21  	}
    22  }
    23  
    24  func (p *rawPacket) beforeSave() {}
    25  
    26  // +checklocksignore
    27  func (p *rawPacket) 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.rawPacketEntry)
    36  	stateSinkObject.Save(3, &p.senderAddr)
    37  	stateSinkObject.Save(4, &p.packetInfo)
    38  }
    39  
    40  func (p *rawPacket) afterLoad() {}
    41  
    42  // +checklocksignore
    43  func (p *rawPacket) StateLoad(stateSourceObject state.Source) {
    44  	stateSourceObject.Load(0, &p.rawPacketEntry)
    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 (e *endpoint) StateTypeName() string {
    52  	return "pkg/tcpip/transport/raw.endpoint"
    53  }
    54  
    55  func (e *endpoint) StateFields() []string {
    56  	return []string{
    57  		"DefaultSocketOptionsHandler",
    58  		"transProto",
    59  		"waiterQueue",
    60  		"associated",
    61  		"net",
    62  		"stats",
    63  		"ops",
    64  		"rcvList",
    65  		"rcvBufSize",
    66  		"rcvClosed",
    67  		"frozen",
    68  	}
    69  }
    70  
    71  // +checklocksignore
    72  func (e *endpoint) StateSave(stateSinkObject state.Sink) {
    73  	e.beforeSave()
    74  	stateSinkObject.Save(0, &e.DefaultSocketOptionsHandler)
    75  	stateSinkObject.Save(1, &e.transProto)
    76  	stateSinkObject.Save(2, &e.waiterQueue)
    77  	stateSinkObject.Save(3, &e.associated)
    78  	stateSinkObject.Save(4, &e.net)
    79  	stateSinkObject.Save(5, &e.stats)
    80  	stateSinkObject.Save(6, &e.ops)
    81  	stateSinkObject.Save(7, &e.rcvList)
    82  	stateSinkObject.Save(8, &e.rcvBufSize)
    83  	stateSinkObject.Save(9, &e.rcvClosed)
    84  	stateSinkObject.Save(10, &e.frozen)
    85  }
    86  
    87  // +checklocksignore
    88  func (e *endpoint) StateLoad(stateSourceObject state.Source) {
    89  	stateSourceObject.Load(0, &e.DefaultSocketOptionsHandler)
    90  	stateSourceObject.Load(1, &e.transProto)
    91  	stateSourceObject.Load(2, &e.waiterQueue)
    92  	stateSourceObject.Load(3, &e.associated)
    93  	stateSourceObject.Load(4, &e.net)
    94  	stateSourceObject.Load(5, &e.stats)
    95  	stateSourceObject.Load(6, &e.ops)
    96  	stateSourceObject.Load(7, &e.rcvList)
    97  	stateSourceObject.Load(8, &e.rcvBufSize)
    98  	stateSourceObject.Load(9, &e.rcvClosed)
    99  	stateSourceObject.Load(10, &e.frozen)
   100  	stateSourceObject.AfterLoad(e.afterLoad)
   101  }
   102  
   103  func (l *rawPacketList) StateTypeName() string {
   104  	return "pkg/tcpip/transport/raw.rawPacketList"
   105  }
   106  
   107  func (l *rawPacketList) StateFields() []string {
   108  	return []string{
   109  		"head",
   110  		"tail",
   111  	}
   112  }
   113  
   114  func (l *rawPacketList) beforeSave() {}
   115  
   116  // +checklocksignore
   117  func (l *rawPacketList) StateSave(stateSinkObject state.Sink) {
   118  	l.beforeSave()
   119  	stateSinkObject.Save(0, &l.head)
   120  	stateSinkObject.Save(1, &l.tail)
   121  }
   122  
   123  func (l *rawPacketList) afterLoad() {}
   124  
   125  // +checklocksignore
   126  func (l *rawPacketList) StateLoad(stateSourceObject state.Source) {
   127  	stateSourceObject.Load(0, &l.head)
   128  	stateSourceObject.Load(1, &l.tail)
   129  }
   130  
   131  func (e *rawPacketEntry) StateTypeName() string {
   132  	return "pkg/tcpip/transport/raw.rawPacketEntry"
   133  }
   134  
   135  func (e *rawPacketEntry) StateFields() []string {
   136  	return []string{
   137  		"next",
   138  		"prev",
   139  	}
   140  }
   141  
   142  func (e *rawPacketEntry) beforeSave() {}
   143  
   144  // +checklocksignore
   145  func (e *rawPacketEntry) StateSave(stateSinkObject state.Sink) {
   146  	e.beforeSave()
   147  	stateSinkObject.Save(0, &e.next)
   148  	stateSinkObject.Save(1, &e.prev)
   149  }
   150  
   151  func (e *rawPacketEntry) afterLoad() {}
   152  
   153  // +checklocksignore
   154  func (e *rawPacketEntry) StateLoad(stateSourceObject state.Source) {
   155  	stateSourceObject.Load(0, &e.next)
   156  	stateSourceObject.Load(1, &e.prev)
   157  }
   158  
   159  func init() {
   160  	state.Register((*rawPacket)(nil))
   161  	state.Register((*endpoint)(nil))
   162  	state.Register((*rawPacketList)(nil))
   163  	state.Register((*rawPacketEntry)(nil))
   164  }