github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/inet/inet_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package inet
     4  
     5  import (
     6  	"github.com/MerlinKodo/gvisor/pkg/state"
     7  )
     8  
     9  func (t *TCPBufferSize) StateTypeName() string {
    10  	return "pkg/sentry/inet.TCPBufferSize"
    11  }
    12  
    13  func (t *TCPBufferSize) StateFields() []string {
    14  	return []string{
    15  		"Min",
    16  		"Default",
    17  		"Max",
    18  	}
    19  }
    20  
    21  func (t *TCPBufferSize) beforeSave() {}
    22  
    23  // +checklocksignore
    24  func (t *TCPBufferSize) StateSave(stateSinkObject state.Sink) {
    25  	t.beforeSave()
    26  	stateSinkObject.Save(0, &t.Min)
    27  	stateSinkObject.Save(1, &t.Default)
    28  	stateSinkObject.Save(2, &t.Max)
    29  }
    30  
    31  func (t *TCPBufferSize) afterLoad() {}
    32  
    33  // +checklocksignore
    34  func (t *TCPBufferSize) StateLoad(stateSourceObject state.Source) {
    35  	stateSourceObject.Load(0, &t.Min)
    36  	stateSourceObject.Load(1, &t.Default)
    37  	stateSourceObject.Load(2, &t.Max)
    38  }
    39  
    40  func (n *Namespace) StateTypeName() string {
    41  	return "pkg/sentry/inet.Namespace"
    42  }
    43  
    44  func (n *Namespace) StateFields() []string {
    45  	return []string{
    46  		"inode",
    47  		"creator",
    48  		"isRoot",
    49  		"userNS",
    50  	}
    51  }
    52  
    53  func (n *Namespace) beforeSave() {}
    54  
    55  // +checklocksignore
    56  func (n *Namespace) StateSave(stateSinkObject state.Sink) {
    57  	n.beforeSave()
    58  	stateSinkObject.Save(0, &n.inode)
    59  	stateSinkObject.Save(1, &n.creator)
    60  	stateSinkObject.Save(2, &n.isRoot)
    61  	stateSinkObject.Save(3, &n.userNS)
    62  }
    63  
    64  // +checklocksignore
    65  func (n *Namespace) StateLoad(stateSourceObject state.Source) {
    66  	stateSourceObject.Load(0, &n.inode)
    67  	stateSourceObject.LoadWait(1, &n.creator)
    68  	stateSourceObject.Load(2, &n.isRoot)
    69  	stateSourceObject.Load(3, &n.userNS)
    70  	stateSourceObject.AfterLoad(n.afterLoad)
    71  }
    72  
    73  func (r *namespaceRefs) StateTypeName() string {
    74  	return "pkg/sentry/inet.namespaceRefs"
    75  }
    76  
    77  func (r *namespaceRefs) StateFields() []string {
    78  	return []string{
    79  		"refCount",
    80  	}
    81  }
    82  
    83  func (r *namespaceRefs) beforeSave() {}
    84  
    85  // +checklocksignore
    86  func (r *namespaceRefs) StateSave(stateSinkObject state.Sink) {
    87  	r.beforeSave()
    88  	stateSinkObject.Save(0, &r.refCount)
    89  }
    90  
    91  // +checklocksignore
    92  func (r *namespaceRefs) StateLoad(stateSourceObject state.Source) {
    93  	stateSourceObject.Load(0, &r.refCount)
    94  	stateSourceObject.AfterLoad(r.afterLoad)
    95  }
    96  
    97  func init() {
    98  	state.Register((*TCPBufferSize)(nil))
    99  	state.Register((*Namespace)(nil))
   100  	state.Register((*namespaceRefs)(nil))
   101  }