github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/tcpip/transport/raw/raw_state_autogen.go (about)

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