github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/kernel/auth/auth_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package auth 4 5 import ( 6 "github.com/MerlinKodo/gvisor/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 (k *Key) StateTypeName() string { 234 return "pkg/sentry/kernel/auth.Key" 235 } 236 237 func (k *Key) StateFields() []string { 238 return []string{ 239 "ID", 240 "Description", 241 "kuid", 242 "kgid", 243 "perms", 244 } 245 } 246 247 func (k *Key) beforeSave() {} 248 249 // +checklocksignore 250 func (k *Key) StateSave(stateSinkObject state.Sink) { 251 k.beforeSave() 252 stateSinkObject.Save(0, &k.ID) 253 stateSinkObject.Save(1, &k.Description) 254 stateSinkObject.Save(2, &k.kuid) 255 stateSinkObject.Save(3, &k.kgid) 256 stateSinkObject.Save(4, &k.perms) 257 } 258 259 func (k *Key) afterLoad() {} 260 261 // +checklocksignore 262 func (k *Key) StateLoad(stateSourceObject state.Source) { 263 stateSourceObject.Load(0, &k.ID) 264 stateSourceObject.Load(1, &k.Description) 265 stateSourceObject.Load(2, &k.kuid) 266 stateSourceObject.Load(3, &k.kgid) 267 stateSourceObject.Load(4, &k.perms) 268 } 269 270 func (s *KeySet) StateTypeName() string { 271 return "pkg/sentry/kernel/auth.KeySet" 272 } 273 274 func (s *KeySet) StateFields() []string { 275 return []string{ 276 "keys", 277 } 278 } 279 280 func (s *KeySet) beforeSave() {} 281 282 // +checklocksignore 283 func (s *KeySet) StateSave(stateSinkObject state.Sink) { 284 s.beforeSave() 285 stateSinkObject.Save(0, &s.keys) 286 } 287 288 func (s *KeySet) afterLoad() {} 289 290 // +checklocksignore 291 func (s *KeySet) StateLoad(stateSourceObject state.Source) { 292 stateSourceObject.Load(0, &s.keys) 293 } 294 295 func (ns *UserNamespace) StateTypeName() string { 296 return "pkg/sentry/kernel/auth.UserNamespace" 297 } 298 299 func (ns *UserNamespace) StateFields() []string { 300 return []string{ 301 "parent", 302 "owner", 303 "Keys", 304 "uidMapFromParent", 305 "uidMapToParent", 306 "gidMapFromParent", 307 "gidMapToParent", 308 } 309 } 310 311 func (ns *UserNamespace) beforeSave() {} 312 313 // +checklocksignore 314 func (ns *UserNamespace) StateSave(stateSinkObject state.Sink) { 315 ns.beforeSave() 316 stateSinkObject.Save(0, &ns.parent) 317 stateSinkObject.Save(1, &ns.owner) 318 stateSinkObject.Save(2, &ns.Keys) 319 stateSinkObject.Save(3, &ns.uidMapFromParent) 320 stateSinkObject.Save(4, &ns.uidMapToParent) 321 stateSinkObject.Save(5, &ns.gidMapFromParent) 322 stateSinkObject.Save(6, &ns.gidMapToParent) 323 } 324 325 func (ns *UserNamespace) afterLoad() {} 326 327 // +checklocksignore 328 func (ns *UserNamespace) StateLoad(stateSourceObject state.Source) { 329 stateSourceObject.Load(0, &ns.parent) 330 stateSourceObject.Load(1, &ns.owner) 331 stateSourceObject.Load(2, &ns.Keys) 332 stateSourceObject.Load(3, &ns.uidMapFromParent) 333 stateSourceObject.Load(4, &ns.uidMapToParent) 334 stateSourceObject.Load(5, &ns.gidMapFromParent) 335 stateSourceObject.Load(6, &ns.gidMapToParent) 336 } 337 338 func init() { 339 state.Register((*Credentials)(nil)) 340 state.Register((*IDMapEntry)(nil)) 341 state.Register((*idMapRange)(nil)) 342 state.Register((*idMapSet)(nil)) 343 state.Register((*idMapnode)(nil)) 344 state.Register((*idMapSegmentDataSlices)(nil)) 345 state.Register((*Key)(nil)) 346 state.Register((*KeySet)(nil)) 347 state.Register((*UserNamespace)(nil)) 348 }