github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/pkg/tcpip/internal/tcp/tcp_state_autogen.go (about)

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