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

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