github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/sentry/socket/unix/transport/transport_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package transport
     4  
     5  import (
     6  	"github.com/nicocha30/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (e *connectionedEndpoint) StateTypeName() string {
    10  	return "pkg/sentry/socket/unix/transport.connectionedEndpoint"
    11  }
    12  
    13  func (e *connectionedEndpoint) StateFields() []string {
    14  	return []string{
    15  		"baseEndpoint",
    16  		"id",
    17  		"idGenerator",
    18  		"stype",
    19  		"acceptedChan",
    20  		"boundSocketFD",
    21  	}
    22  }
    23  
    24  // +checklocksignore
    25  func (e *connectionedEndpoint) StateSave(stateSinkObject state.Sink) {
    26  	e.beforeSave()
    27  	var acceptedChanValue []*connectionedEndpoint
    28  	acceptedChanValue = e.saveAcceptedChan()
    29  	stateSinkObject.SaveValue(4, acceptedChanValue)
    30  	stateSinkObject.Save(0, &e.baseEndpoint)
    31  	stateSinkObject.Save(1, &e.id)
    32  	stateSinkObject.Save(2, &e.idGenerator)
    33  	stateSinkObject.Save(3, &e.stype)
    34  	stateSinkObject.Save(5, &e.boundSocketFD)
    35  }
    36  
    37  // +checklocksignore
    38  func (e *connectionedEndpoint) StateLoad(stateSourceObject state.Source) {
    39  	stateSourceObject.Load(0, &e.baseEndpoint)
    40  	stateSourceObject.Load(1, &e.id)
    41  	stateSourceObject.Load(2, &e.idGenerator)
    42  	stateSourceObject.Load(3, &e.stype)
    43  	stateSourceObject.Load(5, &e.boundSocketFD)
    44  	stateSourceObject.LoadValue(4, new([]*connectionedEndpoint), func(y any) { e.loadAcceptedChan(y.([]*connectionedEndpoint)) })
    45  	stateSourceObject.AfterLoad(e.afterLoad)
    46  }
    47  
    48  func (e *connectionlessEndpoint) StateTypeName() string {
    49  	return "pkg/sentry/socket/unix/transport.connectionlessEndpoint"
    50  }
    51  
    52  func (e *connectionlessEndpoint) StateFields() []string {
    53  	return []string{
    54  		"baseEndpoint",
    55  	}
    56  }
    57  
    58  func (e *connectionlessEndpoint) beforeSave() {}
    59  
    60  // +checklocksignore
    61  func (e *connectionlessEndpoint) StateSave(stateSinkObject state.Sink) {
    62  	e.beforeSave()
    63  	stateSinkObject.Save(0, &e.baseEndpoint)
    64  }
    65  
    66  // +checklocksignore
    67  func (e *connectionlessEndpoint) StateLoad(stateSourceObject state.Source) {
    68  	stateSourceObject.Load(0, &e.baseEndpoint)
    69  	stateSourceObject.AfterLoad(e.afterLoad)
    70  }
    71  
    72  func (c *HostConnectedEndpoint) StateTypeName() string {
    73  	return "pkg/sentry/socket/unix/transport.HostConnectedEndpoint"
    74  }
    75  
    76  func (c *HostConnectedEndpoint) StateFields() []string {
    77  	return []string{
    78  		"HostConnectedEndpointRefs",
    79  		"fd",
    80  		"addr",
    81  		"stype",
    82  	}
    83  }
    84  
    85  func (c *HostConnectedEndpoint) beforeSave() {}
    86  
    87  // +checklocksignore
    88  func (c *HostConnectedEndpoint) StateSave(stateSinkObject state.Sink) {
    89  	c.beforeSave()
    90  	stateSinkObject.Save(0, &c.HostConnectedEndpointRefs)
    91  	stateSinkObject.Save(1, &c.fd)
    92  	stateSinkObject.Save(2, &c.addr)
    93  	stateSinkObject.Save(3, &c.stype)
    94  }
    95  
    96  // +checklocksignore
    97  func (c *HostConnectedEndpoint) StateLoad(stateSourceObject state.Source) {
    98  	stateSourceObject.Load(0, &c.HostConnectedEndpointRefs)
    99  	stateSourceObject.Load(1, &c.fd)
   100  	stateSourceObject.Load(2, &c.addr)
   101  	stateSourceObject.Load(3, &c.stype)
   102  	stateSourceObject.AfterLoad(c.afterLoad)
   103  }
   104  
   105  func (r *HostConnectedEndpointRefs) StateTypeName() string {
   106  	return "pkg/sentry/socket/unix/transport.HostConnectedEndpointRefs"
   107  }
   108  
   109  func (r *HostConnectedEndpointRefs) StateFields() []string {
   110  	return []string{
   111  		"refCount",
   112  	}
   113  }
   114  
   115  func (r *HostConnectedEndpointRefs) beforeSave() {}
   116  
   117  // +checklocksignore
   118  func (r *HostConnectedEndpointRefs) StateSave(stateSinkObject state.Sink) {
   119  	r.beforeSave()
   120  	stateSinkObject.Save(0, &r.refCount)
   121  }
   122  
   123  // +checklocksignore
   124  func (r *HostConnectedEndpointRefs) StateLoad(stateSourceObject state.Source) {
   125  	stateSourceObject.Load(0, &r.refCount)
   126  	stateSourceObject.AfterLoad(r.afterLoad)
   127  }
   128  
   129  func (q *queue) StateTypeName() string {
   130  	return "pkg/sentry/socket/unix/transport.queue"
   131  }
   132  
   133  func (q *queue) StateFields() []string {
   134  	return []string{
   135  		"queueRefs",
   136  		"ReaderQueue",
   137  		"WriterQueue",
   138  		"closed",
   139  		"unread",
   140  		"used",
   141  		"limit",
   142  		"dataList",
   143  	}
   144  }
   145  
   146  func (q *queue) beforeSave() {}
   147  
   148  // +checklocksignore
   149  func (q *queue) StateSave(stateSinkObject state.Sink) {
   150  	q.beforeSave()
   151  	stateSinkObject.Save(0, &q.queueRefs)
   152  	stateSinkObject.Save(1, &q.ReaderQueue)
   153  	stateSinkObject.Save(2, &q.WriterQueue)
   154  	stateSinkObject.Save(3, &q.closed)
   155  	stateSinkObject.Save(4, &q.unread)
   156  	stateSinkObject.Save(5, &q.used)
   157  	stateSinkObject.Save(6, &q.limit)
   158  	stateSinkObject.Save(7, &q.dataList)
   159  }
   160  
   161  func (q *queue) afterLoad() {}
   162  
   163  // +checklocksignore
   164  func (q *queue) StateLoad(stateSourceObject state.Source) {
   165  	stateSourceObject.Load(0, &q.queueRefs)
   166  	stateSourceObject.Load(1, &q.ReaderQueue)
   167  	stateSourceObject.Load(2, &q.WriterQueue)
   168  	stateSourceObject.Load(3, &q.closed)
   169  	stateSourceObject.Load(4, &q.unread)
   170  	stateSourceObject.Load(5, &q.used)
   171  	stateSourceObject.Load(6, &q.limit)
   172  	stateSourceObject.Load(7, &q.dataList)
   173  }
   174  
   175  func (r *queueRefs) StateTypeName() string {
   176  	return "pkg/sentry/socket/unix/transport.queueRefs"
   177  }
   178  
   179  func (r *queueRefs) StateFields() []string {
   180  	return []string{
   181  		"refCount",
   182  	}
   183  }
   184  
   185  func (r *queueRefs) beforeSave() {}
   186  
   187  // +checklocksignore
   188  func (r *queueRefs) StateSave(stateSinkObject state.Sink) {
   189  	r.beforeSave()
   190  	stateSinkObject.Save(0, &r.refCount)
   191  }
   192  
   193  // +checklocksignore
   194  func (r *queueRefs) StateLoad(stateSourceObject state.Source) {
   195  	stateSourceObject.Load(0, &r.refCount)
   196  	stateSourceObject.AfterLoad(r.afterLoad)
   197  }
   198  
   199  func (l *messageList) StateTypeName() string {
   200  	return "pkg/sentry/socket/unix/transport.messageList"
   201  }
   202  
   203  func (l *messageList) StateFields() []string {
   204  	return []string{
   205  		"head",
   206  		"tail",
   207  	}
   208  }
   209  
   210  func (l *messageList) beforeSave() {}
   211  
   212  // +checklocksignore
   213  func (l *messageList) StateSave(stateSinkObject state.Sink) {
   214  	l.beforeSave()
   215  	stateSinkObject.Save(0, &l.head)
   216  	stateSinkObject.Save(1, &l.tail)
   217  }
   218  
   219  func (l *messageList) afterLoad() {}
   220  
   221  // +checklocksignore
   222  func (l *messageList) StateLoad(stateSourceObject state.Source) {
   223  	stateSourceObject.Load(0, &l.head)
   224  	stateSourceObject.Load(1, &l.tail)
   225  }
   226  
   227  func (e *messageEntry) StateTypeName() string {
   228  	return "pkg/sentry/socket/unix/transport.messageEntry"
   229  }
   230  
   231  func (e *messageEntry) StateFields() []string {
   232  	return []string{
   233  		"next",
   234  		"prev",
   235  	}
   236  }
   237  
   238  func (e *messageEntry) beforeSave() {}
   239  
   240  // +checklocksignore
   241  func (e *messageEntry) StateSave(stateSinkObject state.Sink) {
   242  	e.beforeSave()
   243  	stateSinkObject.Save(0, &e.next)
   244  	stateSinkObject.Save(1, &e.prev)
   245  }
   246  
   247  func (e *messageEntry) afterLoad() {}
   248  
   249  // +checklocksignore
   250  func (e *messageEntry) StateLoad(stateSourceObject state.Source) {
   251  	stateSourceObject.Load(0, &e.next)
   252  	stateSourceObject.Load(1, &e.prev)
   253  }
   254  
   255  func (c *ControlMessages) StateTypeName() string {
   256  	return "pkg/sentry/socket/unix/transport.ControlMessages"
   257  }
   258  
   259  func (c *ControlMessages) StateFields() []string {
   260  	return []string{
   261  		"Rights",
   262  		"Credentials",
   263  	}
   264  }
   265  
   266  func (c *ControlMessages) beforeSave() {}
   267  
   268  // +checklocksignore
   269  func (c *ControlMessages) StateSave(stateSinkObject state.Sink) {
   270  	c.beforeSave()
   271  	stateSinkObject.Save(0, &c.Rights)
   272  	stateSinkObject.Save(1, &c.Credentials)
   273  }
   274  
   275  func (c *ControlMessages) afterLoad() {}
   276  
   277  // +checklocksignore
   278  func (c *ControlMessages) StateLoad(stateSourceObject state.Source) {
   279  	stateSourceObject.Load(0, &c.Rights)
   280  	stateSourceObject.Load(1, &c.Credentials)
   281  }
   282  
   283  func (m *message) StateTypeName() string {
   284  	return "pkg/sentry/socket/unix/transport.message"
   285  }
   286  
   287  func (m *message) StateFields() []string {
   288  	return []string{
   289  		"messageEntry",
   290  		"Data",
   291  		"Control",
   292  		"Address",
   293  	}
   294  }
   295  
   296  func (m *message) beforeSave() {}
   297  
   298  // +checklocksignore
   299  func (m *message) StateSave(stateSinkObject state.Sink) {
   300  	m.beforeSave()
   301  	stateSinkObject.Save(0, &m.messageEntry)
   302  	stateSinkObject.Save(1, &m.Data)
   303  	stateSinkObject.Save(2, &m.Control)
   304  	stateSinkObject.Save(3, &m.Address)
   305  }
   306  
   307  func (m *message) afterLoad() {}
   308  
   309  // +checklocksignore
   310  func (m *message) StateLoad(stateSourceObject state.Source) {
   311  	stateSourceObject.Load(0, &m.messageEntry)
   312  	stateSourceObject.Load(1, &m.Data)
   313  	stateSourceObject.Load(2, &m.Control)
   314  	stateSourceObject.Load(3, &m.Address)
   315  }
   316  
   317  func (a *Address) StateTypeName() string {
   318  	return "pkg/sentry/socket/unix/transport.Address"
   319  }
   320  
   321  func (a *Address) StateFields() []string {
   322  	return []string{
   323  		"Addr",
   324  	}
   325  }
   326  
   327  func (a *Address) beforeSave() {}
   328  
   329  // +checklocksignore
   330  func (a *Address) StateSave(stateSinkObject state.Sink) {
   331  	a.beforeSave()
   332  	stateSinkObject.Save(0, &a.Addr)
   333  }
   334  
   335  func (a *Address) afterLoad() {}
   336  
   337  // +checklocksignore
   338  func (a *Address) StateLoad(stateSourceObject state.Source) {
   339  	stateSourceObject.Load(0, &a.Addr)
   340  }
   341  
   342  func (q *queueReceiver) StateTypeName() string {
   343  	return "pkg/sentry/socket/unix/transport.queueReceiver"
   344  }
   345  
   346  func (q *queueReceiver) StateFields() []string {
   347  	return []string{
   348  		"readQueue",
   349  	}
   350  }
   351  
   352  func (q *queueReceiver) beforeSave() {}
   353  
   354  // +checklocksignore
   355  func (q *queueReceiver) StateSave(stateSinkObject state.Sink) {
   356  	q.beforeSave()
   357  	stateSinkObject.Save(0, &q.readQueue)
   358  }
   359  
   360  func (q *queueReceiver) afterLoad() {}
   361  
   362  // +checklocksignore
   363  func (q *queueReceiver) StateLoad(stateSourceObject state.Source) {
   364  	stateSourceObject.Load(0, &q.readQueue)
   365  }
   366  
   367  func (q *streamQueueReceiver) StateTypeName() string {
   368  	return "pkg/sentry/socket/unix/transport.streamQueueReceiver"
   369  }
   370  
   371  func (q *streamQueueReceiver) StateFields() []string {
   372  	return []string{
   373  		"queueReceiver",
   374  		"buffer",
   375  		"control",
   376  		"addr",
   377  	}
   378  }
   379  
   380  func (q *streamQueueReceiver) beforeSave() {}
   381  
   382  // +checklocksignore
   383  func (q *streamQueueReceiver) StateSave(stateSinkObject state.Sink) {
   384  	q.beforeSave()
   385  	stateSinkObject.Save(0, &q.queueReceiver)
   386  	stateSinkObject.Save(1, &q.buffer)
   387  	stateSinkObject.Save(2, &q.control)
   388  	stateSinkObject.Save(3, &q.addr)
   389  }
   390  
   391  func (q *streamQueueReceiver) afterLoad() {}
   392  
   393  // +checklocksignore
   394  func (q *streamQueueReceiver) StateLoad(stateSourceObject state.Source) {
   395  	stateSourceObject.Load(0, &q.queueReceiver)
   396  	stateSourceObject.Load(1, &q.buffer)
   397  	stateSourceObject.Load(2, &q.control)
   398  	stateSourceObject.Load(3, &q.addr)
   399  }
   400  
   401  func (e *connectedEndpoint) StateTypeName() string {
   402  	return "pkg/sentry/socket/unix/transport.connectedEndpoint"
   403  }
   404  
   405  func (e *connectedEndpoint) StateFields() []string {
   406  	return []string{
   407  		"endpoint",
   408  		"writeQueue",
   409  	}
   410  }
   411  
   412  func (e *connectedEndpoint) beforeSave() {}
   413  
   414  // +checklocksignore
   415  func (e *connectedEndpoint) StateSave(stateSinkObject state.Sink) {
   416  	e.beforeSave()
   417  	stateSinkObject.Save(0, &e.endpoint)
   418  	stateSinkObject.Save(1, &e.writeQueue)
   419  }
   420  
   421  func (e *connectedEndpoint) afterLoad() {}
   422  
   423  // +checklocksignore
   424  func (e *connectedEndpoint) StateLoad(stateSourceObject state.Source) {
   425  	stateSourceObject.Load(0, &e.endpoint)
   426  	stateSourceObject.Load(1, &e.writeQueue)
   427  }
   428  
   429  func (e *baseEndpoint) StateTypeName() string {
   430  	return "pkg/sentry/socket/unix/transport.baseEndpoint"
   431  }
   432  
   433  func (e *baseEndpoint) StateFields() []string {
   434  	return []string{
   435  		"Queue",
   436  		"DefaultSocketOptionsHandler",
   437  		"receiver",
   438  		"connected",
   439  		"path",
   440  		"ops",
   441  	}
   442  }
   443  
   444  func (e *baseEndpoint) beforeSave() {}
   445  
   446  // +checklocksignore
   447  func (e *baseEndpoint) StateSave(stateSinkObject state.Sink) {
   448  	e.beforeSave()
   449  	stateSinkObject.Save(0, &e.Queue)
   450  	stateSinkObject.Save(1, &e.DefaultSocketOptionsHandler)
   451  	stateSinkObject.Save(2, &e.receiver)
   452  	stateSinkObject.Save(3, &e.connected)
   453  	stateSinkObject.Save(4, &e.path)
   454  	stateSinkObject.Save(5, &e.ops)
   455  }
   456  
   457  func (e *baseEndpoint) afterLoad() {}
   458  
   459  // +checklocksignore
   460  func (e *baseEndpoint) StateLoad(stateSourceObject state.Source) {
   461  	stateSourceObject.Load(0, &e.Queue)
   462  	stateSourceObject.Load(1, &e.DefaultSocketOptionsHandler)
   463  	stateSourceObject.Load(2, &e.receiver)
   464  	stateSourceObject.Load(3, &e.connected)
   465  	stateSourceObject.Load(4, &e.path)
   466  	stateSourceObject.Load(5, &e.ops)
   467  }
   468  
   469  func init() {
   470  	state.Register((*connectionedEndpoint)(nil))
   471  	state.Register((*connectionlessEndpoint)(nil))
   472  	state.Register((*HostConnectedEndpoint)(nil))
   473  	state.Register((*HostConnectedEndpointRefs)(nil))
   474  	state.Register((*queue)(nil))
   475  	state.Register((*queueRefs)(nil))
   476  	state.Register((*messageList)(nil))
   477  	state.Register((*messageEntry)(nil))
   478  	state.Register((*ControlMessages)(nil))
   479  	state.Register((*message)(nil))
   480  	state.Register((*Address)(nil))
   481  	state.Register((*queueReceiver)(nil))
   482  	state.Register((*streamQueueReceiver)(nil))
   483  	state.Register((*connectedEndpoint)(nil))
   484  	state.Register((*baseEndpoint)(nil))
   485  }