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

     1  // automatically generated by stateify.
     2  
     3  package mq
     4  
     5  import (
     6  	"github.com/nicocha30/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (l *msgList) StateTypeName() string {
    10  	return "pkg/sentry/kernel/mq.msgList"
    11  }
    12  
    13  func (l *msgList) StateFields() []string {
    14  	return []string{
    15  		"head",
    16  		"tail",
    17  	}
    18  }
    19  
    20  func (l *msgList) beforeSave() {}
    21  
    22  // +checklocksignore
    23  func (l *msgList) StateSave(stateSinkObject state.Sink) {
    24  	l.beforeSave()
    25  	stateSinkObject.Save(0, &l.head)
    26  	stateSinkObject.Save(1, &l.tail)
    27  }
    28  
    29  func (l *msgList) afterLoad() {}
    30  
    31  // +checklocksignore
    32  func (l *msgList) StateLoad(stateSourceObject state.Source) {
    33  	stateSourceObject.Load(0, &l.head)
    34  	stateSourceObject.Load(1, &l.tail)
    35  }
    36  
    37  func (e *msgEntry) StateTypeName() string {
    38  	return "pkg/sentry/kernel/mq.msgEntry"
    39  }
    40  
    41  func (e *msgEntry) StateFields() []string {
    42  	return []string{
    43  		"next",
    44  		"prev",
    45  	}
    46  }
    47  
    48  func (e *msgEntry) beforeSave() {}
    49  
    50  // +checklocksignore
    51  func (e *msgEntry) StateSave(stateSinkObject state.Sink) {
    52  	e.beforeSave()
    53  	stateSinkObject.Save(0, &e.next)
    54  	stateSinkObject.Save(1, &e.prev)
    55  }
    56  
    57  func (e *msgEntry) afterLoad() {}
    58  
    59  // +checklocksignore
    60  func (e *msgEntry) StateLoad(stateSourceObject state.Source) {
    61  	stateSourceObject.Load(0, &e.next)
    62  	stateSourceObject.Load(1, &e.prev)
    63  }
    64  
    65  func (r *Registry) StateTypeName() string {
    66  	return "pkg/sentry/kernel/mq.Registry"
    67  }
    68  
    69  func (r *Registry) StateFields() []string {
    70  	return []string{
    71  		"userNS",
    72  		"impl",
    73  	}
    74  }
    75  
    76  func (r *Registry) beforeSave() {}
    77  
    78  // +checklocksignore
    79  func (r *Registry) StateSave(stateSinkObject state.Sink) {
    80  	r.beforeSave()
    81  	stateSinkObject.Save(0, &r.userNS)
    82  	stateSinkObject.Save(1, &r.impl)
    83  }
    84  
    85  func (r *Registry) afterLoad() {}
    86  
    87  // +checklocksignore
    88  func (r *Registry) StateLoad(stateSourceObject state.Source) {
    89  	stateSourceObject.Load(0, &r.userNS)
    90  	stateSourceObject.Load(1, &r.impl)
    91  }
    92  
    93  func (q *Queue) StateTypeName() string {
    94  	return "pkg/sentry/kernel/mq.Queue"
    95  }
    96  
    97  func (q *Queue) StateFields() []string {
    98  	return []string{
    99  		"ownerUID",
   100  		"ownerGID",
   101  		"mode",
   102  		"queue",
   103  		"messages",
   104  		"subscriber",
   105  		"messageCount",
   106  		"maxMessageCount",
   107  		"maxMessageSize",
   108  		"byteCount",
   109  	}
   110  }
   111  
   112  func (q *Queue) beforeSave() {}
   113  
   114  // +checklocksignore
   115  func (q *Queue) StateSave(stateSinkObject state.Sink) {
   116  	q.beforeSave()
   117  	stateSinkObject.Save(0, &q.ownerUID)
   118  	stateSinkObject.Save(1, &q.ownerGID)
   119  	stateSinkObject.Save(2, &q.mode)
   120  	stateSinkObject.Save(3, &q.queue)
   121  	stateSinkObject.Save(4, &q.messages)
   122  	stateSinkObject.Save(5, &q.subscriber)
   123  	stateSinkObject.Save(6, &q.messageCount)
   124  	stateSinkObject.Save(7, &q.maxMessageCount)
   125  	stateSinkObject.Save(8, &q.maxMessageSize)
   126  	stateSinkObject.Save(9, &q.byteCount)
   127  }
   128  
   129  func (q *Queue) afterLoad() {}
   130  
   131  // +checklocksignore
   132  func (q *Queue) StateLoad(stateSourceObject state.Source) {
   133  	stateSourceObject.Load(0, &q.ownerUID)
   134  	stateSourceObject.Load(1, &q.ownerGID)
   135  	stateSourceObject.Load(2, &q.mode)
   136  	stateSourceObject.Load(3, &q.queue)
   137  	stateSourceObject.Load(4, &q.messages)
   138  	stateSourceObject.Load(5, &q.subscriber)
   139  	stateSourceObject.Load(6, &q.messageCount)
   140  	stateSourceObject.Load(7, &q.maxMessageCount)
   141  	stateSourceObject.Load(8, &q.maxMessageSize)
   142  	stateSourceObject.Load(9, &q.byteCount)
   143  }
   144  
   145  func (m *Message) StateTypeName() string {
   146  	return "pkg/sentry/kernel/mq.Message"
   147  }
   148  
   149  func (m *Message) StateFields() []string {
   150  	return []string{
   151  		"msgEntry",
   152  		"Text",
   153  		"Size",
   154  		"Priority",
   155  	}
   156  }
   157  
   158  func (m *Message) beforeSave() {}
   159  
   160  // +checklocksignore
   161  func (m *Message) StateSave(stateSinkObject state.Sink) {
   162  	m.beforeSave()
   163  	stateSinkObject.Save(0, &m.msgEntry)
   164  	stateSinkObject.Save(1, &m.Text)
   165  	stateSinkObject.Save(2, &m.Size)
   166  	stateSinkObject.Save(3, &m.Priority)
   167  }
   168  
   169  func (m *Message) afterLoad() {}
   170  
   171  // +checklocksignore
   172  func (m *Message) StateLoad(stateSourceObject state.Source) {
   173  	stateSourceObject.Load(0, &m.msgEntry)
   174  	stateSourceObject.Load(1, &m.Text)
   175  	stateSourceObject.Load(2, &m.Size)
   176  	stateSourceObject.Load(3, &m.Priority)
   177  }
   178  
   179  func (s *Subscriber) StateTypeName() string {
   180  	return "pkg/sentry/kernel/mq.Subscriber"
   181  }
   182  
   183  func (s *Subscriber) StateFields() []string {
   184  	return []string{
   185  		"pid",
   186  	}
   187  }
   188  
   189  func (s *Subscriber) beforeSave() {}
   190  
   191  // +checklocksignore
   192  func (s *Subscriber) StateSave(stateSinkObject state.Sink) {
   193  	s.beforeSave()
   194  	stateSinkObject.Save(0, &s.pid)
   195  }
   196  
   197  func (s *Subscriber) afterLoad() {}
   198  
   199  // +checklocksignore
   200  func (s *Subscriber) StateLoad(stateSourceObject state.Source) {
   201  	stateSourceObject.Load(0, &s.pid)
   202  }
   203  
   204  func init() {
   205  	state.Register((*msgList)(nil))
   206  	state.Register((*msgEntry)(nil))
   207  	state.Register((*Registry)(nil))
   208  	state.Register((*Queue)(nil))
   209  	state.Register((*Message)(nil))
   210  	state.Register((*Subscriber)(nil))
   211  }