github.com/noisysockets/netstack@v0.6.0/pkg/tcpip/link/qdisc/fifo/fifo_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package fifo
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/noisysockets/netstack/pkg/state"
     9  )
    10  
    11  func (pl *packetBufferCircularList) StateTypeName() string {
    12  	return "pkg/tcpip/link/qdisc/fifo.packetBufferCircularList"
    13  }
    14  
    15  func (pl *packetBufferCircularList) StateFields() []string {
    16  	return []string{
    17  		"pbs",
    18  		"head",
    19  		"size",
    20  	}
    21  }
    22  
    23  func (pl *packetBufferCircularList) beforeSave() {}
    24  
    25  // +checklocksignore
    26  func (pl *packetBufferCircularList) StateSave(stateSinkObject state.Sink) {
    27  	pl.beforeSave()
    28  	stateSinkObject.Save(0, &pl.pbs)
    29  	stateSinkObject.Save(1, &pl.head)
    30  	stateSinkObject.Save(2, &pl.size)
    31  }
    32  
    33  func (pl *packetBufferCircularList) afterLoad(context.Context) {}
    34  
    35  // +checklocksignore
    36  func (pl *packetBufferCircularList) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    37  	stateSourceObject.Load(0, &pl.pbs)
    38  	stateSourceObject.Load(1, &pl.head)
    39  	stateSourceObject.Load(2, &pl.size)
    40  }
    41  
    42  func init() {
    43  	state.Register((*packetBufferCircularList)(nil))
    44  }