// automatically generated by stateify. package icmp import ( "gvisor.dev/gvisor/pkg/state" "gvisor.dev/gvisor/pkg/tcpip/buffer" ) func (p *icmpPacket) StateTypeName() string { return "pkg/tcpip/transport/icmp.icmpPacket" } func (p *icmpPacket) StateFields() []string { return []string{ "icmpPacketEntry", "senderAddress", "data", "timestamp", } } func (p *icmpPacket) beforeSave() {} func (p *icmpPacket) StateSave(stateSinkObject state.Sink) { p.beforeSave() var dataValue buffer.VectorisedView = p.saveData() stateSinkObject.SaveValue(2, dataValue) stateSinkObject.Save(0, &p.icmpPacketEntry) stateSinkObject.Save(1, &p.senderAddress) stateSinkObject.Save(3, &p.timestamp) } func (p *icmpPacket) afterLoad() {} func (p *icmpPacket) StateLoad(stateSourceObject state.Source) { stateSourceObject.Load(0, &p.icmpPacketEntry) stateSourceObject.Load(1, &p.senderAddress) stateSourceObject.Load(3, &p.timestamp) stateSourceObject.LoadValue(2, new(buffer.VectorisedView), func(y interface{}) { p.loadData(y.(buffer.VectorisedView)) }) } func (e *endpoint) StateTypeName() string { return "pkg/tcpip/transport/icmp.endpoint" } func (e *endpoint) StateFields() []string { return []string{ "TransportEndpointInfo", "DefaultSocketOptionsHandler", "waiterQueue", "uniqueID", "rcvReady", "rcvList", "rcvBufSizeMax", "rcvBufSize", "rcvClosed", "sndBufSize", "shutdownFlags", "state", "ttl", "owner", "ops", } } func (e *endpoint) StateSave(stateSinkObject state.Sink) { e.beforeSave() var rcvBufSizeMaxValue int = e.saveRcvBufSizeMax() stateSinkObject.SaveValue(6, rcvBufSizeMaxValue) stateSinkObject.Save(0, &e.TransportEndpointInfo) stateSinkObject.Save(1, &e.DefaultSocketOptionsHandler) stateSinkObject.Save(2, &e.waiterQueue) stateSinkObject.Save(3, &e.uniqueID) stateSinkObject.Save(4, &e.rcvReady) stateSinkObject.Save(5, &e.rcvList) stateSinkObject.Save(7, &e.rcvBufSize) stateSinkObject.Save(8, &e.rcvClosed) stateSinkObject.Save(9, &e.sndBufSize) stateSinkObject.Save(10, &e.shutdownFlags) stateSinkObject.Save(11, &e.state) stateSinkObject.Save(12, &e.ttl) stateSinkObject.Save(13, &e.owner) stateSinkObject.Save(14, &e.ops) } func (e *endpoint) StateLoad(stateSourceObject state.Source) { stateSourceObject.Load(0, &e.TransportEndpointInfo) stateSourceObject.Load(1, &e.DefaultSocketOptionsHandler) stateSourceObject.Load(2, &e.waiterQueue) stateSourceObject.Load(3, &e.uniqueID) stateSourceObject.Load(4, &e.rcvReady) stateSourceObject.Load(5, &e.rcvList) stateSourceObject.Load(7, &e.rcvBufSize) stateSourceObject.Load(8, &e.rcvClosed) stateSourceObject.Load(9, &e.sndBufSize) stateSourceObject.Load(10, &e.shutdownFlags) stateSourceObject.Load(11, &e.state) stateSourceObject.Load(12, &e.ttl) stateSourceObject.Load(13, &e.owner) stateSourceObject.Load(14, &e.ops) stateSourceObject.LoadValue(6, new(int), func(y interface{}) { e.loadRcvBufSizeMax(y.(int)) }) stateSourceObject.AfterLoad(e.afterLoad) } func (l *icmpPacketList) StateTypeName() string { return "pkg/tcpip/transport/icmp.icmpPacketList" } func (l *icmpPacketList) StateFields() []string { return []string{ "head", "tail", } } func (l *icmpPacketList) beforeSave() {} func (l *icmpPacketList) StateSave(stateSinkObject state.Sink) { l.beforeSave() stateSinkObject.Save(0, &l.head) stateSinkObject.Save(1, &l.tail) } func (l *icmpPacketList) afterLoad() {} func (l *icmpPacketList) StateLoad(stateSourceObject state.Source) { stateSourceObject.Load(0, &l.head) stateSourceObject.Load(1, &l.tail) } func (e *icmpPacketEntry) StateTypeName() string { return "pkg/tcpip/transport/icmp.icmpPacketEntry" } func (e *icmpPacketEntry) StateFields() []string { return []string{ "next", "prev", } } func (e *icmpPacketEntry) beforeSave() {} func (e *icmpPacketEntry) StateSave(stateSinkObject state.Sink) { e.beforeSave() stateSinkObject.Save(0, &e.next) stateSinkObject.Save(1, &e.prev) } func (e *icmpPacketEntry) afterLoad() {} func (e *icmpPacketEntry) StateLoad(stateSourceObject state.Source) { stateSourceObject.Load(0, &e.next) stateSourceObject.Load(1, &e.prev) } func init() { state.Register((*icmpPacket)(nil)) state.Register((*endpoint)(nil)) state.Register((*icmpPacketList)(nil)) state.Register((*icmpPacketEntry)(nil)) }