github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/pkg/abi/linux/linux_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package linux
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/sagernet/gvisor/pkg/state"
     9  )
    10  
    11  func (i *IOEvent) StateTypeName() string {
    12  	return "pkg/abi/linux.IOEvent"
    13  }
    14  
    15  func (i *IOEvent) StateFields() []string {
    16  	return []string{
    17  		"Data",
    18  		"Obj",
    19  		"Result",
    20  		"Result2",
    21  	}
    22  }
    23  
    24  func (i *IOEvent) beforeSave() {}
    25  
    26  // +checklocksignore
    27  func (i *IOEvent) StateSave(stateSinkObject state.Sink) {
    28  	i.beforeSave()
    29  	stateSinkObject.Save(0, &i.Data)
    30  	stateSinkObject.Save(1, &i.Obj)
    31  	stateSinkObject.Save(2, &i.Result)
    32  	stateSinkObject.Save(3, &i.Result2)
    33  }
    34  
    35  func (i *IOEvent) afterLoad(context.Context) {}
    36  
    37  // +checklocksignore
    38  func (i *IOEvent) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    39  	stateSourceObject.Load(0, &i.Data)
    40  	stateSourceObject.Load(1, &i.Obj)
    41  	stateSourceObject.Load(2, &i.Result)
    42  	stateSourceObject.Load(3, &i.Result2)
    43  }
    44  
    45  func (b *BPFInstruction) StateTypeName() string {
    46  	return "pkg/abi/linux.BPFInstruction"
    47  }
    48  
    49  func (b *BPFInstruction) StateFields() []string {
    50  	return []string{
    51  		"OpCode",
    52  		"JumpIfTrue",
    53  		"JumpIfFalse",
    54  		"K",
    55  	}
    56  }
    57  
    58  func (b *BPFInstruction) beforeSave() {}
    59  
    60  // +checklocksignore
    61  func (b *BPFInstruction) StateSave(stateSinkObject state.Sink) {
    62  	b.beforeSave()
    63  	stateSinkObject.Save(0, &b.OpCode)
    64  	stateSinkObject.Save(1, &b.JumpIfTrue)
    65  	stateSinkObject.Save(2, &b.JumpIfFalse)
    66  	stateSinkObject.Save(3, &b.K)
    67  }
    68  
    69  func (b *BPFInstruction) afterLoad(context.Context) {}
    70  
    71  // +checklocksignore
    72  func (b *BPFInstruction) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    73  	stateSourceObject.Load(0, &b.OpCode)
    74  	stateSourceObject.Load(1, &b.JumpIfTrue)
    75  	stateSourceObject.Load(2, &b.JumpIfFalse)
    76  	stateSourceObject.Load(3, &b.K)
    77  }
    78  
    79  func (f *FUSEHeaderIn) StateTypeName() string {
    80  	return "pkg/abi/linux.FUSEHeaderIn"
    81  }
    82  
    83  func (f *FUSEHeaderIn) StateFields() []string {
    84  	return []string{
    85  		"Len",
    86  		"Opcode",
    87  		"Unique",
    88  		"NodeID",
    89  		"UID",
    90  		"GID",
    91  		"PID",
    92  	}
    93  }
    94  
    95  func (f *FUSEHeaderIn) beforeSave() {}
    96  
    97  // +checklocksignore
    98  func (f *FUSEHeaderIn) StateSave(stateSinkObject state.Sink) {
    99  	f.beforeSave()
   100  	stateSinkObject.Save(0, &f.Len)
   101  	stateSinkObject.Save(1, &f.Opcode)
   102  	stateSinkObject.Save(2, &f.Unique)
   103  	stateSinkObject.Save(3, &f.NodeID)
   104  	stateSinkObject.Save(4, &f.UID)
   105  	stateSinkObject.Save(5, &f.GID)
   106  	stateSinkObject.Save(6, &f.PID)
   107  }
   108  
   109  func (f *FUSEHeaderIn) afterLoad(context.Context) {}
   110  
   111  // +checklocksignore
   112  func (f *FUSEHeaderIn) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   113  	stateSourceObject.Load(0, &f.Len)
   114  	stateSourceObject.Load(1, &f.Opcode)
   115  	stateSourceObject.Load(2, &f.Unique)
   116  	stateSourceObject.Load(3, &f.NodeID)
   117  	stateSourceObject.Load(4, &f.UID)
   118  	stateSourceObject.Load(5, &f.GID)
   119  	stateSourceObject.Load(6, &f.PID)
   120  }
   121  
   122  func (f *FUSEHeaderOut) StateTypeName() string {
   123  	return "pkg/abi/linux.FUSEHeaderOut"
   124  }
   125  
   126  func (f *FUSEHeaderOut) StateFields() []string {
   127  	return []string{
   128  		"Len",
   129  		"Error",
   130  		"Unique",
   131  	}
   132  }
   133  
   134  func (f *FUSEHeaderOut) beforeSave() {}
   135  
   136  // +checklocksignore
   137  func (f *FUSEHeaderOut) StateSave(stateSinkObject state.Sink) {
   138  	f.beforeSave()
   139  	stateSinkObject.Save(0, &f.Len)
   140  	stateSinkObject.Save(1, &f.Error)
   141  	stateSinkObject.Save(2, &f.Unique)
   142  }
   143  
   144  func (f *FUSEHeaderOut) afterLoad(context.Context) {}
   145  
   146  // +checklocksignore
   147  func (f *FUSEHeaderOut) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   148  	stateSourceObject.Load(0, &f.Len)
   149  	stateSourceObject.Load(1, &f.Error)
   150  	stateSourceObject.Load(2, &f.Unique)
   151  }
   152  
   153  func (i *IOUringCqe) StateTypeName() string {
   154  	return "pkg/abi/linux.IOUringCqe"
   155  }
   156  
   157  func (i *IOUringCqe) StateFields() []string {
   158  	return []string{
   159  		"UserData",
   160  		"Res",
   161  		"Flags",
   162  	}
   163  }
   164  
   165  func (i *IOUringCqe) beforeSave() {}
   166  
   167  // +checklocksignore
   168  func (i *IOUringCqe) StateSave(stateSinkObject state.Sink) {
   169  	i.beforeSave()
   170  	stateSinkObject.Save(0, &i.UserData)
   171  	stateSinkObject.Save(1, &i.Res)
   172  	stateSinkObject.Save(2, &i.Flags)
   173  }
   174  
   175  func (i *IOUringCqe) afterLoad(context.Context) {}
   176  
   177  // +checklocksignore
   178  func (i *IOUringCqe) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   179  	stateSourceObject.Load(0, &i.UserData)
   180  	stateSourceObject.Load(1, &i.Res)
   181  	stateSourceObject.Load(2, &i.Flags)
   182  }
   183  
   184  func (i *IOUring) StateTypeName() string {
   185  	return "pkg/abi/linux.IOUring"
   186  }
   187  
   188  func (i *IOUring) StateFields() []string {
   189  	return []string{
   190  		"Head",
   191  		"Tail",
   192  	}
   193  }
   194  
   195  func (i *IOUring) beforeSave() {}
   196  
   197  // +checklocksignore
   198  func (i *IOUring) StateSave(stateSinkObject state.Sink) {
   199  	i.beforeSave()
   200  	stateSinkObject.Save(0, &i.Head)
   201  	stateSinkObject.Save(1, &i.Tail)
   202  }
   203  
   204  func (i *IOUring) afterLoad(context.Context) {}
   205  
   206  // +checklocksignore
   207  func (i *IOUring) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   208  	stateSourceObject.Load(0, &i.Head)
   209  	stateSourceObject.Load(1, &i.Tail)
   210  }
   211  
   212  func (i *IORings) StateTypeName() string {
   213  	return "pkg/abi/linux.IORings"
   214  }
   215  
   216  func (i *IORings) StateFields() []string {
   217  	return []string{
   218  		"Sq",
   219  		"Cq",
   220  		"SqRingMask",
   221  		"CqRingMask",
   222  		"SqRingEntries",
   223  		"CqRingEntries",
   224  		"sqDropped",
   225  		"sqFlags",
   226  		"cqFlags",
   227  		"CqOverflow",
   228  	}
   229  }
   230  
   231  func (i *IORings) beforeSave() {}
   232  
   233  // +checklocksignore
   234  func (i *IORings) StateSave(stateSinkObject state.Sink) {
   235  	i.beforeSave()
   236  	stateSinkObject.Save(0, &i.Sq)
   237  	stateSinkObject.Save(1, &i.Cq)
   238  	stateSinkObject.Save(2, &i.SqRingMask)
   239  	stateSinkObject.Save(3, &i.CqRingMask)
   240  	stateSinkObject.Save(4, &i.SqRingEntries)
   241  	stateSinkObject.Save(5, &i.CqRingEntries)
   242  	stateSinkObject.Save(6, &i.sqDropped)
   243  	stateSinkObject.Save(7, &i.sqFlags)
   244  	stateSinkObject.Save(8, &i.cqFlags)
   245  	stateSinkObject.Save(9, &i.CqOverflow)
   246  }
   247  
   248  func (i *IORings) afterLoad(context.Context) {}
   249  
   250  // +checklocksignore
   251  func (i *IORings) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   252  	stateSourceObject.Load(0, &i.Sq)
   253  	stateSourceObject.Load(1, &i.Cq)
   254  	stateSourceObject.Load(2, &i.SqRingMask)
   255  	stateSourceObject.Load(3, &i.CqRingMask)
   256  	stateSourceObject.Load(4, &i.SqRingEntries)
   257  	stateSourceObject.Load(5, &i.CqRingEntries)
   258  	stateSourceObject.Load(6, &i.sqDropped)
   259  	stateSourceObject.Load(7, &i.sqFlags)
   260  	stateSourceObject.Load(8, &i.cqFlags)
   261  	stateSourceObject.Load(9, &i.CqOverflow)
   262  }
   263  
   264  func (i *IOUringSqe) StateTypeName() string {
   265  	return "pkg/abi/linux.IOUringSqe"
   266  }
   267  
   268  func (i *IOUringSqe) StateFields() []string {
   269  	return []string{
   270  		"Opcode",
   271  		"Flags",
   272  		"IoPrio",
   273  		"Fd",
   274  		"OffOrAddrOrCmdOp",
   275  		"AddrOrSpliceOff",
   276  		"Len",
   277  		"specialFlags",
   278  		"UserData",
   279  		"BufIndexOrGroup",
   280  		"personality",
   281  		"spliceFDOrFileIndex",
   282  		"addr3",
   283  	}
   284  }
   285  
   286  func (i *IOUringSqe) beforeSave() {}
   287  
   288  // +checklocksignore
   289  func (i *IOUringSqe) StateSave(stateSinkObject state.Sink) {
   290  	i.beforeSave()
   291  	stateSinkObject.Save(0, &i.Opcode)
   292  	stateSinkObject.Save(1, &i.Flags)
   293  	stateSinkObject.Save(2, &i.IoPrio)
   294  	stateSinkObject.Save(3, &i.Fd)
   295  	stateSinkObject.Save(4, &i.OffOrAddrOrCmdOp)
   296  	stateSinkObject.Save(5, &i.AddrOrSpliceOff)
   297  	stateSinkObject.Save(6, &i.Len)
   298  	stateSinkObject.Save(7, &i.specialFlags)
   299  	stateSinkObject.Save(8, &i.UserData)
   300  	stateSinkObject.Save(9, &i.BufIndexOrGroup)
   301  	stateSinkObject.Save(10, &i.personality)
   302  	stateSinkObject.Save(11, &i.spliceFDOrFileIndex)
   303  	stateSinkObject.Save(12, &i.addr3)
   304  }
   305  
   306  func (i *IOUringSqe) afterLoad(context.Context) {}
   307  
   308  // +checklocksignore
   309  func (i *IOUringSqe) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   310  	stateSourceObject.Load(0, &i.Opcode)
   311  	stateSourceObject.Load(1, &i.Flags)
   312  	stateSourceObject.Load(2, &i.IoPrio)
   313  	stateSourceObject.Load(3, &i.Fd)
   314  	stateSourceObject.Load(4, &i.OffOrAddrOrCmdOp)
   315  	stateSourceObject.Load(5, &i.AddrOrSpliceOff)
   316  	stateSourceObject.Load(6, &i.Len)
   317  	stateSourceObject.Load(7, &i.specialFlags)
   318  	stateSourceObject.Load(8, &i.UserData)
   319  	stateSourceObject.Load(9, &i.BufIndexOrGroup)
   320  	stateSourceObject.Load(10, &i.personality)
   321  	stateSourceObject.Load(11, &i.spliceFDOrFileIndex)
   322  	stateSourceObject.Load(12, &i.addr3)
   323  }
   324  
   325  func (s *SigAction) StateTypeName() string {
   326  	return "pkg/abi/linux.SigAction"
   327  }
   328  
   329  func (s *SigAction) StateFields() []string {
   330  	return []string{
   331  		"Handler",
   332  		"Flags",
   333  		"Restorer",
   334  		"Mask",
   335  	}
   336  }
   337  
   338  func (s *SigAction) beforeSave() {}
   339  
   340  // +checklocksignore
   341  func (s *SigAction) StateSave(stateSinkObject state.Sink) {
   342  	s.beforeSave()
   343  	stateSinkObject.Save(0, &s.Handler)
   344  	stateSinkObject.Save(1, &s.Flags)
   345  	stateSinkObject.Save(2, &s.Restorer)
   346  	stateSinkObject.Save(3, &s.Mask)
   347  }
   348  
   349  func (s *SigAction) afterLoad(context.Context) {}
   350  
   351  // +checklocksignore
   352  func (s *SigAction) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   353  	stateSourceObject.Load(0, &s.Handler)
   354  	stateSourceObject.Load(1, &s.Flags)
   355  	stateSourceObject.Load(2, &s.Restorer)
   356  	stateSourceObject.Load(3, &s.Mask)
   357  }
   358  
   359  func (s *SignalStack) StateTypeName() string {
   360  	return "pkg/abi/linux.SignalStack"
   361  }
   362  
   363  func (s *SignalStack) StateFields() []string {
   364  	return []string{
   365  		"Addr",
   366  		"Flags",
   367  		"Size",
   368  	}
   369  }
   370  
   371  func (s *SignalStack) beforeSave() {}
   372  
   373  // +checklocksignore
   374  func (s *SignalStack) StateSave(stateSinkObject state.Sink) {
   375  	s.beforeSave()
   376  	stateSinkObject.Save(0, &s.Addr)
   377  	stateSinkObject.Save(1, &s.Flags)
   378  	stateSinkObject.Save(2, &s.Size)
   379  }
   380  
   381  func (s *SignalStack) afterLoad(context.Context) {}
   382  
   383  // +checklocksignore
   384  func (s *SignalStack) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   385  	stateSourceObject.Load(0, &s.Addr)
   386  	stateSourceObject.Load(1, &s.Flags)
   387  	stateSourceObject.Load(2, &s.Size)
   388  }
   389  
   390  func (s *SignalInfo) StateTypeName() string {
   391  	return "pkg/abi/linux.SignalInfo"
   392  }
   393  
   394  func (s *SignalInfo) StateFields() []string {
   395  	return []string{
   396  		"Signo",
   397  		"Errno",
   398  		"Code",
   399  		"Fields",
   400  	}
   401  }
   402  
   403  func (s *SignalInfo) beforeSave() {}
   404  
   405  // +checklocksignore
   406  func (s *SignalInfo) StateSave(stateSinkObject state.Sink) {
   407  	s.beforeSave()
   408  	stateSinkObject.Save(0, &s.Signo)
   409  	stateSinkObject.Save(1, &s.Errno)
   410  	stateSinkObject.Save(2, &s.Code)
   411  	stateSinkObject.Save(3, &s.Fields)
   412  }
   413  
   414  func (s *SignalInfo) afterLoad(context.Context) {}
   415  
   416  // +checklocksignore
   417  func (s *SignalInfo) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   418  	stateSourceObject.Load(0, &s.Signo)
   419  	stateSourceObject.Load(1, &s.Errno)
   420  	stateSourceObject.Load(2, &s.Code)
   421  	stateSourceObject.Load(3, &s.Fields)
   422  }
   423  
   424  func (c *ControlMessageIPPacketInfo) StateTypeName() string {
   425  	return "pkg/abi/linux.ControlMessageIPPacketInfo"
   426  }
   427  
   428  func (c *ControlMessageIPPacketInfo) StateFields() []string {
   429  	return []string{
   430  		"NIC",
   431  		"LocalAddr",
   432  		"DestinationAddr",
   433  	}
   434  }
   435  
   436  func (c *ControlMessageIPPacketInfo) beforeSave() {}
   437  
   438  // +checklocksignore
   439  func (c *ControlMessageIPPacketInfo) StateSave(stateSinkObject state.Sink) {
   440  	c.beforeSave()
   441  	stateSinkObject.Save(0, &c.NIC)
   442  	stateSinkObject.Save(1, &c.LocalAddr)
   443  	stateSinkObject.Save(2, &c.DestinationAddr)
   444  }
   445  
   446  func (c *ControlMessageIPPacketInfo) afterLoad(context.Context) {}
   447  
   448  // +checklocksignore
   449  func (c *ControlMessageIPPacketInfo) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   450  	stateSourceObject.Load(0, &c.NIC)
   451  	stateSourceObject.Load(1, &c.LocalAddr)
   452  	stateSourceObject.Load(2, &c.DestinationAddr)
   453  }
   454  
   455  func (c *ControlMessageIPv6PacketInfo) StateTypeName() string {
   456  	return "pkg/abi/linux.ControlMessageIPv6PacketInfo"
   457  }
   458  
   459  func (c *ControlMessageIPv6PacketInfo) StateFields() []string {
   460  	return []string{
   461  		"Addr",
   462  		"NIC",
   463  	}
   464  }
   465  
   466  func (c *ControlMessageIPv6PacketInfo) beforeSave() {}
   467  
   468  // +checklocksignore
   469  func (c *ControlMessageIPv6PacketInfo) StateSave(stateSinkObject state.Sink) {
   470  	c.beforeSave()
   471  	stateSinkObject.Save(0, &c.Addr)
   472  	stateSinkObject.Save(1, &c.NIC)
   473  }
   474  
   475  func (c *ControlMessageIPv6PacketInfo) afterLoad(context.Context) {}
   476  
   477  // +checklocksignore
   478  func (c *ControlMessageIPv6PacketInfo) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   479  	stateSourceObject.Load(0, &c.Addr)
   480  	stateSourceObject.Load(1, &c.NIC)
   481  }
   482  
   483  func (i *ICMP6Filter) StateTypeName() string {
   484  	return "pkg/abi/linux.ICMP6Filter"
   485  }
   486  
   487  func (i *ICMP6Filter) StateFields() []string {
   488  	return []string{
   489  		"Filter",
   490  	}
   491  }
   492  
   493  func (i *ICMP6Filter) beforeSave() {}
   494  
   495  // +checklocksignore
   496  func (i *ICMP6Filter) StateSave(stateSinkObject state.Sink) {
   497  	i.beforeSave()
   498  	stateSinkObject.Save(0, &i.Filter)
   499  }
   500  
   501  func (i *ICMP6Filter) afterLoad(context.Context) {}
   502  
   503  // +checklocksignore
   504  func (i *ICMP6Filter) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   505  	stateSourceObject.Load(0, &i.Filter)
   506  }
   507  
   508  func (t *KernelTermios) StateTypeName() string {
   509  	return "pkg/abi/linux.KernelTermios"
   510  }
   511  
   512  func (t *KernelTermios) StateFields() []string {
   513  	return []string{
   514  		"InputFlags",
   515  		"OutputFlags",
   516  		"ControlFlags",
   517  		"LocalFlags",
   518  		"LineDiscipline",
   519  		"ControlCharacters",
   520  		"InputSpeed",
   521  		"OutputSpeed",
   522  	}
   523  }
   524  
   525  func (t *KernelTermios) beforeSave() {}
   526  
   527  // +checklocksignore
   528  func (t *KernelTermios) StateSave(stateSinkObject state.Sink) {
   529  	t.beforeSave()
   530  	stateSinkObject.Save(0, &t.InputFlags)
   531  	stateSinkObject.Save(1, &t.OutputFlags)
   532  	stateSinkObject.Save(2, &t.ControlFlags)
   533  	stateSinkObject.Save(3, &t.LocalFlags)
   534  	stateSinkObject.Save(4, &t.LineDiscipline)
   535  	stateSinkObject.Save(5, &t.ControlCharacters)
   536  	stateSinkObject.Save(6, &t.InputSpeed)
   537  	stateSinkObject.Save(7, &t.OutputSpeed)
   538  }
   539  
   540  func (t *KernelTermios) afterLoad(context.Context) {}
   541  
   542  // +checklocksignore
   543  func (t *KernelTermios) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   544  	stateSourceObject.Load(0, &t.InputFlags)
   545  	stateSourceObject.Load(1, &t.OutputFlags)
   546  	stateSourceObject.Load(2, &t.ControlFlags)
   547  	stateSourceObject.Load(3, &t.LocalFlags)
   548  	stateSourceObject.Load(4, &t.LineDiscipline)
   549  	stateSourceObject.Load(5, &t.ControlCharacters)
   550  	stateSourceObject.Load(6, &t.InputSpeed)
   551  	stateSourceObject.Load(7, &t.OutputSpeed)
   552  }
   553  
   554  func (w *WindowSize) StateTypeName() string {
   555  	return "pkg/abi/linux.WindowSize"
   556  }
   557  
   558  func (w *WindowSize) StateFields() []string {
   559  	return []string{
   560  		"Rows",
   561  		"Cols",
   562  	}
   563  }
   564  
   565  func (w *WindowSize) beforeSave() {}
   566  
   567  // +checklocksignore
   568  func (w *WindowSize) StateSave(stateSinkObject state.Sink) {
   569  	w.beforeSave()
   570  	stateSinkObject.Save(0, &w.Rows)
   571  	stateSinkObject.Save(1, &w.Cols)
   572  }
   573  
   574  func (w *WindowSize) afterLoad(context.Context) {}
   575  
   576  // +checklocksignore
   577  func (w *WindowSize) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   578  	stateSourceObject.Load(0, &w.Rows)
   579  	stateSourceObject.Load(1, &w.Cols)
   580  }
   581  
   582  func init() {
   583  	state.Register((*IOEvent)(nil))
   584  	state.Register((*BPFInstruction)(nil))
   585  	state.Register((*FUSEHeaderIn)(nil))
   586  	state.Register((*FUSEHeaderOut)(nil))
   587  	state.Register((*IOUringCqe)(nil))
   588  	state.Register((*IOUring)(nil))
   589  	state.Register((*IORings)(nil))
   590  	state.Register((*IOUringSqe)(nil))
   591  	state.Register((*SigAction)(nil))
   592  	state.Register((*SignalStack)(nil))
   593  	state.Register((*SignalInfo)(nil))
   594  	state.Register((*ControlMessageIPPacketInfo)(nil))
   595  	state.Register((*ControlMessageIPv6PacketInfo)(nil))
   596  	state.Register((*ICMP6Filter)(nil))
   597  	state.Register((*KernelTermios)(nil))
   598  	state.Register((*WindowSize)(nil))
   599  }