github.com/noisysockets/netstack@v0.6.0/pkg/tcpip/transport/icmp/icmp_state_autogen.go (about)

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