github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/pkg/tcpip/ports/ports_state_autogen.go (about)

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