github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/sentry/kernel/auth/auth_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package auth
     4  
     5  import (
     6  	"github.com/nicocha30/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (c *Credentials) StateTypeName() string {
    10  	return "pkg/sentry/kernel/auth.Credentials"
    11  }
    12  
    13  func (c *Credentials) StateFields() []string {
    14  	return []string{
    15  		"RealKUID",
    16  		"EffectiveKUID",
    17  		"SavedKUID",
    18  		"RealKGID",
    19  		"EffectiveKGID",
    20  		"SavedKGID",
    21  		"ExtraKGIDs",
    22  		"PermittedCaps",
    23  		"InheritableCaps",
    24  		"EffectiveCaps",
    25  		"BoundingCaps",
    26  		"KeepCaps",
    27  		"UserNamespace",
    28  	}
    29  }
    30  
    31  func (c *Credentials) beforeSave() {}
    32  
    33  // +checklocksignore
    34  func (c *Credentials) StateSave(stateSinkObject state.Sink) {
    35  	c.beforeSave()
    36  	stateSinkObject.Save(0, &c.RealKUID)
    37  	stateSinkObject.Save(1, &c.EffectiveKUID)
    38  	stateSinkObject.Save(2, &c.SavedKUID)
    39  	stateSinkObject.Save(3, &c.RealKGID)
    40  	stateSinkObject.Save(4, &c.EffectiveKGID)
    41  	stateSinkObject.Save(5, &c.SavedKGID)
    42  	stateSinkObject.Save(6, &c.ExtraKGIDs)
    43  	stateSinkObject.Save(7, &c.PermittedCaps)
    44  	stateSinkObject.Save(8, &c.InheritableCaps)
    45  	stateSinkObject.Save(9, &c.EffectiveCaps)
    46  	stateSinkObject.Save(10, &c.BoundingCaps)
    47  	stateSinkObject.Save(11, &c.KeepCaps)
    48  	stateSinkObject.Save(12, &c.UserNamespace)
    49  }
    50  
    51  func (c *Credentials) afterLoad() {}
    52  
    53  // +checklocksignore
    54  func (c *Credentials) StateLoad(stateSourceObject state.Source) {
    55  	stateSourceObject.Load(0, &c.RealKUID)
    56  	stateSourceObject.Load(1, &c.EffectiveKUID)
    57  	stateSourceObject.Load(2, &c.SavedKUID)
    58  	stateSourceObject.Load(3, &c.RealKGID)
    59  	stateSourceObject.Load(4, &c.EffectiveKGID)
    60  	stateSourceObject.Load(5, &c.SavedKGID)
    61  	stateSourceObject.Load(6, &c.ExtraKGIDs)
    62  	stateSourceObject.Load(7, &c.PermittedCaps)
    63  	stateSourceObject.Load(8, &c.InheritableCaps)
    64  	stateSourceObject.Load(9, &c.EffectiveCaps)
    65  	stateSourceObject.Load(10, &c.BoundingCaps)
    66  	stateSourceObject.Load(11, &c.KeepCaps)
    67  	stateSourceObject.Load(12, &c.UserNamespace)
    68  }
    69  
    70  func (i *IDMapEntry) StateTypeName() string {
    71  	return "pkg/sentry/kernel/auth.IDMapEntry"
    72  }
    73  
    74  func (i *IDMapEntry) StateFields() []string {
    75  	return []string{
    76  		"FirstID",
    77  		"FirstParentID",
    78  		"Length",
    79  	}
    80  }
    81  
    82  func (i *IDMapEntry) beforeSave() {}
    83  
    84  // +checklocksignore
    85  func (i *IDMapEntry) StateSave(stateSinkObject state.Sink) {
    86  	i.beforeSave()
    87  	stateSinkObject.Save(0, &i.FirstID)
    88  	stateSinkObject.Save(1, &i.FirstParentID)
    89  	stateSinkObject.Save(2, &i.Length)
    90  }
    91  
    92  func (i *IDMapEntry) afterLoad() {}
    93  
    94  // +checklocksignore
    95  func (i *IDMapEntry) StateLoad(stateSourceObject state.Source) {
    96  	stateSourceObject.Load(0, &i.FirstID)
    97  	stateSourceObject.Load(1, &i.FirstParentID)
    98  	stateSourceObject.Load(2, &i.Length)
    99  }
   100  
   101  func (r *idMapRange) StateTypeName() string {
   102  	return "pkg/sentry/kernel/auth.idMapRange"
   103  }
   104  
   105  func (r *idMapRange) StateFields() []string {
   106  	return []string{
   107  		"Start",
   108  		"End",
   109  	}
   110  }
   111  
   112  func (r *idMapRange) beforeSave() {}
   113  
   114  // +checklocksignore
   115  func (r *idMapRange) StateSave(stateSinkObject state.Sink) {
   116  	r.beforeSave()
   117  	stateSinkObject.Save(0, &r.Start)
   118  	stateSinkObject.Save(1, &r.End)
   119  }
   120  
   121  func (r *idMapRange) afterLoad() {}
   122  
   123  // +checklocksignore
   124  func (r *idMapRange) StateLoad(stateSourceObject state.Source) {
   125  	stateSourceObject.Load(0, &r.Start)
   126  	stateSourceObject.Load(1, &r.End)
   127  }
   128  
   129  func (s *idMapSet) StateTypeName() string {
   130  	return "pkg/sentry/kernel/auth.idMapSet"
   131  }
   132  
   133  func (s *idMapSet) StateFields() []string {
   134  	return []string{
   135  		"root",
   136  	}
   137  }
   138  
   139  func (s *idMapSet) beforeSave() {}
   140  
   141  // +checklocksignore
   142  func (s *idMapSet) StateSave(stateSinkObject state.Sink) {
   143  	s.beforeSave()
   144  	var rootValue *idMapSegmentDataSlices
   145  	rootValue = s.saveRoot()
   146  	stateSinkObject.SaveValue(0, rootValue)
   147  }
   148  
   149  func (s *idMapSet) afterLoad() {}
   150  
   151  // +checklocksignore
   152  func (s *idMapSet) StateLoad(stateSourceObject state.Source) {
   153  	stateSourceObject.LoadValue(0, new(*idMapSegmentDataSlices), func(y any) { s.loadRoot(y.(*idMapSegmentDataSlices)) })
   154  }
   155  
   156  func (n *idMapnode) StateTypeName() string {
   157  	return "pkg/sentry/kernel/auth.idMapnode"
   158  }
   159  
   160  func (n *idMapnode) StateFields() []string {
   161  	return []string{
   162  		"nrSegments",
   163  		"parent",
   164  		"parentIndex",
   165  		"hasChildren",
   166  		"maxGap",
   167  		"keys",
   168  		"values",
   169  		"children",
   170  	}
   171  }
   172  
   173  func (n *idMapnode) beforeSave() {}
   174  
   175  // +checklocksignore
   176  func (n *idMapnode) StateSave(stateSinkObject state.Sink) {
   177  	n.beforeSave()
   178  	stateSinkObject.Save(0, &n.nrSegments)
   179  	stateSinkObject.Save(1, &n.parent)
   180  	stateSinkObject.Save(2, &n.parentIndex)
   181  	stateSinkObject.Save(3, &n.hasChildren)
   182  	stateSinkObject.Save(4, &n.maxGap)
   183  	stateSinkObject.Save(5, &n.keys)
   184  	stateSinkObject.Save(6, &n.values)
   185  	stateSinkObject.Save(7, &n.children)
   186  }
   187  
   188  func (n *idMapnode) afterLoad() {}
   189  
   190  // +checklocksignore
   191  func (n *idMapnode) StateLoad(stateSourceObject state.Source) {
   192  	stateSourceObject.Load(0, &n.nrSegments)
   193  	stateSourceObject.Load(1, &n.parent)
   194  	stateSourceObject.Load(2, &n.parentIndex)
   195  	stateSourceObject.Load(3, &n.hasChildren)
   196  	stateSourceObject.Load(4, &n.maxGap)
   197  	stateSourceObject.Load(5, &n.keys)
   198  	stateSourceObject.Load(6, &n.values)
   199  	stateSourceObject.Load(7, &n.children)
   200  }
   201  
   202  func (i *idMapSegmentDataSlices) StateTypeName() string {
   203  	return "pkg/sentry/kernel/auth.idMapSegmentDataSlices"
   204  }
   205  
   206  func (i *idMapSegmentDataSlices) StateFields() []string {
   207  	return []string{
   208  		"Start",
   209  		"End",
   210  		"Values",
   211  	}
   212  }
   213  
   214  func (i *idMapSegmentDataSlices) beforeSave() {}
   215  
   216  // +checklocksignore
   217  func (i *idMapSegmentDataSlices) StateSave(stateSinkObject state.Sink) {
   218  	i.beforeSave()
   219  	stateSinkObject.Save(0, &i.Start)
   220  	stateSinkObject.Save(1, &i.End)
   221  	stateSinkObject.Save(2, &i.Values)
   222  }
   223  
   224  func (i *idMapSegmentDataSlices) afterLoad() {}
   225  
   226  // +checklocksignore
   227  func (i *idMapSegmentDataSlices) StateLoad(stateSourceObject state.Source) {
   228  	stateSourceObject.Load(0, &i.Start)
   229  	stateSourceObject.Load(1, &i.End)
   230  	stateSourceObject.Load(2, &i.Values)
   231  }
   232  
   233  func (ns *UserNamespace) StateTypeName() string {
   234  	return "pkg/sentry/kernel/auth.UserNamespace"
   235  }
   236  
   237  func (ns *UserNamespace) StateFields() []string {
   238  	return []string{
   239  		"parent",
   240  		"owner",
   241  		"uidMapFromParent",
   242  		"uidMapToParent",
   243  		"gidMapFromParent",
   244  		"gidMapToParent",
   245  	}
   246  }
   247  
   248  func (ns *UserNamespace) beforeSave() {}
   249  
   250  // +checklocksignore
   251  func (ns *UserNamespace) StateSave(stateSinkObject state.Sink) {
   252  	ns.beforeSave()
   253  	stateSinkObject.Save(0, &ns.parent)
   254  	stateSinkObject.Save(1, &ns.owner)
   255  	stateSinkObject.Save(2, &ns.uidMapFromParent)
   256  	stateSinkObject.Save(3, &ns.uidMapToParent)
   257  	stateSinkObject.Save(4, &ns.gidMapFromParent)
   258  	stateSinkObject.Save(5, &ns.gidMapToParent)
   259  }
   260  
   261  func (ns *UserNamespace) afterLoad() {}
   262  
   263  // +checklocksignore
   264  func (ns *UserNamespace) StateLoad(stateSourceObject state.Source) {
   265  	stateSourceObject.Load(0, &ns.parent)
   266  	stateSourceObject.Load(1, &ns.owner)
   267  	stateSourceObject.Load(2, &ns.uidMapFromParent)
   268  	stateSourceObject.Load(3, &ns.uidMapToParent)
   269  	stateSourceObject.Load(4, &ns.gidMapFromParent)
   270  	stateSourceObject.Load(5, &ns.gidMapToParent)
   271  }
   272  
   273  func init() {
   274  	state.Register((*Credentials)(nil))
   275  	state.Register((*IDMapEntry)(nil))
   276  	state.Register((*idMapRange)(nil))
   277  	state.Register((*idMapSet)(nil))
   278  	state.Register((*idMapnode)(nil))
   279  	state.Register((*idMapSegmentDataSlices)(nil))
   280  	state.Register((*UserNamespace)(nil))
   281  }