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