Motr  M0
onwire_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from rpc/onwire.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "rpc/onwire.h"
8 #include "rpc/onwire_xc.h"
9 
15 
20  ._type = {
22  .xct_name = "m0_rpc_packet_onwire_header",
23  .xct_sizeof = sizeof (struct m0_rpc_packet_onwire_header),
24  .xct_nr = 4,
25  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
26  }
27 };
28 
31  offsetof(struct m0_xcode_type, xct_child[0]));
32 
37  ._type = {
39  .xct_name = "m0_rpc_packet_onwire_footer",
40  .xct_sizeof = sizeof (struct m0_rpc_packet_onwire_footer),
41  .xct_nr = 1,
42  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
43  }
44 };
45 
48  offsetof(struct m0_xcode_type, xct_child[0]));
49 
50 static struct _m0_rpc_item_header1_s {
54  ._type = {
56  .xct_name = "m0_rpc_item_header1",
57  .xct_sizeof = sizeof (struct m0_rpc_item_header1),
58  .xct_nr = 5,
59  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
60  }
61 };
62 
64 M0_BASSERT(offsetof(struct _m0_rpc_item_header1_s, _child[0]) ==
65  offsetof(struct m0_xcode_type, xct_child[0]));
66 
67 static struct _m0_rpc_item_header2_s {
71  ._type = {
73  .xct_name = "m0_rpc_item_header2",
74  .xct_sizeof = sizeof (struct m0_rpc_item_header2),
75  .xct_nr = 6,
76  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
77  }
78 };
79 
81 M0_BASSERT(offsetof(struct _m0_rpc_item_header2_s, _child[0]) ==
82  offsetof(struct m0_xcode_type, xct_child[0]));
83 
84 static struct _m0_rpc_item_footer_s {
88  ._type = {
90  .xct_name = "m0_rpc_item_footer",
91  .xct_sizeof = sizeof (struct m0_rpc_item_footer),
92  .xct_nr = 1,
93  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
94  }
95 };
96 
98 M0_BASSERT(offsetof(struct _m0_rpc_item_footer_s, _child[0]) ==
99  offsetof(struct m0_xcode_type, xct_child[0]));
100 
101 
102 M0_BASSERT(sizeof(struct m0_rpc_packet_onwire_header) == 32U);
103 
104 M0_BASSERT(sizeof ((struct m0_rpc_packet_onwire_header *)0)->poh_header == 16U);
106 M0_BASSERT(sizeof ((struct m0_rpc_packet_onwire_header *)0)->poh_version == 4U);
108 M0_BASSERT(sizeof ((struct m0_rpc_packet_onwire_header *)0)->poh_nr_items == 4U);
110 M0_BASSERT(sizeof ((struct m0_rpc_packet_onwire_header *)0)->poh_magic == 8U);
112 
113 M0_BASSERT(sizeof(struct m0_rpc_packet_onwire_footer) == 16U);
114 
115 M0_BASSERT(sizeof ((struct m0_rpc_packet_onwire_footer *)0)->pof_footer == 16U);
117 
118 M0_BASSERT(sizeof(struct m0_rpc_item_header1) == 40U);
119 
120 M0_BASSERT(sizeof ((struct m0_rpc_item_header1 *)0)->ioh_header == 16U);
122 M0_BASSERT(sizeof ((struct m0_rpc_item_header1 *)0)->ioh_opcode == 4U);
124 M0_BASSERT(sizeof ((struct m0_rpc_item_header1 *)0)->ioh_flags == 4U);
126 M0_BASSERT(sizeof ((struct m0_rpc_item_header1 *)0)->ioh_ha_epoch == 8U);
128 M0_BASSERT(sizeof ((struct m0_rpc_item_header1 *)0)->ioh_magic == 8U);
130 
131 M0_BASSERT(sizeof(struct m0_rpc_item_header2) == 64U);
132 
133 M0_BASSERT(sizeof ((struct m0_rpc_item_header2 *)0)->osr_uuid == 16U);
135 M0_BASSERT(sizeof ((struct m0_rpc_item_header2 *)0)->osr_sender_id == 8U);
137 M0_BASSERT(sizeof ((struct m0_rpc_item_header2 *)0)->osr_session_id == 8U);
139 M0_BASSERT(sizeof ((struct m0_rpc_item_header2 *)0)->osr_session_xid_min == 8U);
141 M0_BASSERT(sizeof ((struct m0_rpc_item_header2 *)0)->osr_xid == 8U);
143 M0_BASSERT(sizeof ((struct m0_rpc_item_header2 *)0)->osr_cookie == 16U);
145 
146 M0_BASSERT(sizeof(struct m0_rpc_item_footer) == 16U);
147 
148 M0_BASSERT(sizeof ((struct m0_rpc_item_footer *)0)->iof_footer == 16U);
150 
151 
152 
154 {
156  .xf_name = "poh_header",
157 
158  .xf_type = m0_format_header_xc,
159 
160  .xf_tag = 0,
161  .xf_opaque = NULL,
162  .xf_offset = offsetof(struct m0_rpc_packet_onwire_header, poh_header),
163  .xf_read = NULL,
164  .xf_decor = {
166  }
167  };
169 
171  .xf_name = "poh_version",
172 
173  .xf_type = &M0_XT_U32,
174 
175  .xf_tag = 0,
176  .xf_opaque = NULL,
177  .xf_offset = offsetof(struct m0_rpc_packet_onwire_header, poh_version),
178  .xf_read = NULL,
179  .xf_decor = {
181  }
182  };
183  m0_xc_u32_init();
184 
186  .xf_name = "poh_nr_items",
187 
188  .xf_type = &M0_XT_U32,
189 
190  .xf_tag = 0,
191  .xf_opaque = NULL,
192  .xf_offset = offsetof(struct m0_rpc_packet_onwire_header, poh_nr_items),
193  .xf_read = NULL,
194  .xf_decor = {
196  }
197  };
198  m0_xc_u32_init();
199 
201  .xf_name = "poh_magic",
202 
203  .xf_type = &M0_XT_U64,
204 
205  .xf_tag = 0,
206  .xf_opaque = NULL,
207  .xf_offset = offsetof(struct m0_rpc_packet_onwire_header, poh_magic),
208  .xf_read = NULL,
209  .xf_decor = {
211  }
212  };
213  m0_xc_u64_init();
214 
216 }
217 
219 {
221  .xf_name = "pof_footer",
222 
223  .xf_type = m0_format_footer_xc,
224 
225  .xf_tag = 0,
226  .xf_opaque = NULL,
227  .xf_offset = offsetof(struct m0_rpc_packet_onwire_footer, pof_footer),
228  .xf_read = NULL,
229  .xf_decor = {
231  }
232  };
234 
236 }
237 
239 {
241  .xf_name = "ioh_header",
242 
243  .xf_type = m0_format_header_xc,
244 
245  .xf_tag = 0,
246  .xf_opaque = NULL,
247  .xf_offset = offsetof(struct m0_rpc_item_header1, ioh_header),
248  .xf_read = NULL,
249  .xf_decor = {
251  }
252  };
254 
256  .xf_name = "ioh_opcode",
257 
258  .xf_type = &M0_XT_U32,
259 
260  .xf_tag = 0,
261  .xf_opaque = NULL,
262  .xf_offset = offsetof(struct m0_rpc_item_header1, ioh_opcode),
263  .xf_read = NULL,
264  .xf_decor = {
266  }
267  };
268  m0_xc_u32_init();
269 
271  .xf_name = "ioh_flags",
272 
273  .xf_type = &M0_XT_U32,
274 
275  .xf_tag = 0,
276  .xf_opaque = NULL,
277  .xf_offset = offsetof(struct m0_rpc_item_header1, ioh_flags),
278  .xf_read = NULL,
279  .xf_decor = {
281  }
282  };
283  m0_xc_u32_init();
284 
286  .xf_name = "ioh_ha_epoch",
287 
288  .xf_type = &M0_XT_U64,
289 
290  .xf_tag = 0,
291  .xf_opaque = NULL,
292  .xf_offset = offsetof(struct m0_rpc_item_header1, ioh_ha_epoch),
293  .xf_read = NULL,
294  .xf_decor = {
296  }
297  };
298  m0_xc_u64_init();
299 
301  .xf_name = "ioh_magic",
302 
303  .xf_type = &M0_XT_U64,
304 
305  .xf_tag = 0,
306  .xf_opaque = NULL,
307  .xf_offset = offsetof(struct m0_rpc_item_header1, ioh_magic),
308  .xf_read = NULL,
309  .xf_decor = {
311  }
312  };
313  m0_xc_u64_init();
314 
316 }
317 
319 {
321  .xf_name = "osr_uuid",
322 
323  .xf_type = m0_uint128_xc,
324 
325  .xf_tag = 0,
326  .xf_opaque = NULL,
327  .xf_offset = offsetof(struct m0_rpc_item_header2, osr_uuid),
328  .xf_read = NULL,
329  .xf_decor = {
331  }
332  };
334 
336  .xf_name = "osr_sender_id",
337 
338  .xf_type = &M0_XT_U64,
339 
340  .xf_tag = 0,
341  .xf_opaque = NULL,
342  .xf_offset = offsetof(struct m0_rpc_item_header2, osr_sender_id),
343  .xf_read = NULL,
344  .xf_decor = {
346  }
347  };
348  m0_xc_u64_init();
349 
351  .xf_name = "osr_session_id",
352 
353  .xf_type = &M0_XT_U64,
354 
355  .xf_tag = 0,
356  .xf_opaque = NULL,
357  .xf_offset = offsetof(struct m0_rpc_item_header2, osr_session_id),
358  .xf_read = NULL,
359  .xf_decor = {
361  }
362  };
363  m0_xc_u64_init();
364 
366  .xf_name = "osr_session_xid_min",
367 
368  .xf_type = &M0_XT_U64,
369 
370  .xf_tag = 0,
371  .xf_opaque = NULL,
372  .xf_offset = offsetof(struct m0_rpc_item_header2, osr_session_xid_min),
373  .xf_read = NULL,
374  .xf_decor = {
376  }
377  };
378  m0_xc_u64_init();
379 
381  .xf_name = "osr_xid",
382 
383  .xf_type = &M0_XT_U64,
384 
385  .xf_tag = 0,
386  .xf_opaque = NULL,
387  .xf_offset = offsetof(struct m0_rpc_item_header2, osr_xid),
388  .xf_read = NULL,
389  .xf_decor = {
391  }
392  };
393  m0_xc_u64_init();
394 
396  .xf_name = "osr_cookie",
397 
398  .xf_type = m0_cookie_xc,
399 
400  .xf_tag = 0,
401  .xf_opaque = NULL,
402  .xf_offset = offsetof(struct m0_rpc_item_header2, osr_cookie),
403  .xf_read = NULL,
404  .xf_decor = {
406  }
407  };
409 
411 }
412 
414 {
416  .xf_name = "iof_footer",
417 
418  .xf_type = m0_format_footer_xc,
419 
420  .xf_tag = 0,
421  .xf_opaque = NULL,
422  .xf_offset = offsetof(struct m0_rpc_item_footer, iof_footer),
423  .xf_read = NULL,
424  .xf_decor = {
426  }
427  };
429 
431 }
432 
433 M0_INTERNAL void m0_xc_rpc_onwire_init(void)
434 {
440 }
441 
442 M0_INTERNAL void m0_xc_rpc_onwire_fini(void)
443 {
444 }
struct m0_format_header poh_header
Definition: onwire.h:59
struct m0_format_footer iof_footer
Definition: onwire.h:59
#define NULL
Definition: misc.h:38
uint32_t poh_version
Definition: onwire.h:61
M0_INTERNAL void m0_xc_m0_format_footer_struct_init(void)
Definition: format_xc.c:226
struct m0_xcode_type * m0_rpc_packet_onwire_header_xc
Definition: onwire_xc.c:10
M0_INTERNAL void m0_xc_m0_cookie_struct_init(void)
Definition: cookie_xc.c:39
struct m0_xcode_type * m0_uint128_xc
Definition: types_xc.c:10
uint64_t osr_session_xid_min
Definition: onwire.h:68
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
M0_INTERNAL void m0_xc_m0_rpc_item_header1_struct_init(void)
Definition: onwire_xc.c:238
M0_INTERNAL void m0_xc_m0_uint128_struct_init(void)
Definition: types_xc.c:39
struct m0_xcode_type * m0_rpc_packet_onwire_footer_xc
Definition: onwire_xc.c:11
struct m0_xcode_type * m0_rpc_item_footer_xc
Definition: onwire_xc.c:14
uint64_t ioh_ha_epoch
Definition: onwire.h:65
struct m0_xcode_field _child[5]
Definition: onwire_xc.c:52
M0_INTERNAL void m0_xc_m0_rpc_item_header2_struct_init(void)
Definition: onwire_xc.c:318
uint32_t poh_nr_items
Definition: onwire.h:63
struct m0_format_footer pof_footer
Definition: onwire.h:59
static struct _m0_rpc_item_footer_s _m0_rpc_item_footer
M0_INTERNAL void m0_xc_m0_rpc_item_footer_struct_init(void)
Definition: onwire_xc.c:413
struct m0_uint128 osr_uuid
Definition: onwire.h:59
struct m0_xcode_field _child[6]
Definition: onwire_xc.c:69
struct m0_cookie osr_cookie
Definition: onwire.h:70
M0_INTERNAL void m0_xc_rpc_onwire_fini(void)
Definition: onwire_xc.c:442
#define M0_POST(cond)
struct m0_xcode_field _child[4]
Definition: onwire_xc.c:18
static struct _m0_rpc_item_header2_s _m0_rpc_item_header2
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
M0_INTERNAL void m0_xc_m0_format_header_struct_init(void)
Definition: format_xc.c:191
M0_INTERNAL void m0_xc_m0_rpc_packet_onwire_header_struct_init(void)
Definition: onwire_xc.c:153
struct m0_xcode_type _type
Definition: onwire_xc.c:51
void m0_xc_u64_init(void)
Definition: xcode.c:904
M0_BASSERT(offsetof(struct _m0_conf_fetch_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
M0_INTERNAL void m0_xc_rpc_onwire_init(void)
Definition: onwire_xc.c:433
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
struct m0_xcode_type * m0_format_header_xc
Definition: format_xc.c:10
static struct _m0_rpc_packet_onwire_header_s _m0_rpc_packet_onwire_header
uint64_t poh_magic
Definition: onwire.h:64
M0_INTERNAL void m0_xc_m0_rpc_packet_onwire_footer_struct_init(void)
Definition: onwire_xc.c:218
uint64_t osr_sender_id
Definition: onwire.h:60
void m0_xc_u32_init(void)
Definition: xcode.c:900
struct m0_xcode_type * m0_cookie_xc
Definition: cookie_xc.c:10
uint64_t osr_session_id
Definition: onwire.h:61
uint64_t ioh_magic
Definition: onwire.h:66
struct m0_xcode_type * m0_rpc_item_header2_xc
Definition: onwire_xc.c:13
struct m0_xcode_type * m0_rpc_item_header1_xc
Definition: onwire_xc.c:12
uint64_t osr_xid
Definition: onwire.h:69
const char * xf_name
Definition: xcode.h:251
static struct _m0_rpc_item_header1_s _m0_rpc_item_header1
uint32_t ioh_opcode
Definition: onwire.h:61
struct m0_xcode_type _type
Definition: onwire_xc.c:17
struct m0_format_header ioh_header
Definition: onwire.h:59
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
#define offsetof(typ, memb)
Definition: misc.h:29
static struct _m0_rpc_packet_onwire_footer_s _m0_rpc_packet_onwire_footer
uint32_t ioh_flags
Definition: onwire.h:63
struct m0_xcode_type _type
Definition: onwire_xc.c:68
struct m0_xcode_type * m0_format_footer_xc
Definition: format_xc.c:11