1 /* Generated by the protocol buffer compiler. DO NOT EDIT! */
2 /* Generated from: sec1.proto */
3
4 /* Do not generate deprecated warnings for self */
5 #ifndef PROTOBUF_C__NO_DEPRECATED
6 #define PROTOBUF_C__NO_DEPRECATED
7 #endif
8
9 #include "sec1.pb-c.h"
session_cmd1__init(SessionCmd1 * message)10 void session_cmd1__init
11 (SessionCmd1 *message)
12 {
13 static const SessionCmd1 init_value = SESSION_CMD1__INIT;
14 *message = init_value;
15 }
session_cmd1__get_packed_size(const SessionCmd1 * message)16 size_t session_cmd1__get_packed_size
17 (const SessionCmd1 *message)
18 {
19 assert(message->base.descriptor == &session_cmd1__descriptor);
20 return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
21 }
session_cmd1__pack(const SessionCmd1 * message,uint8_t * out)22 size_t session_cmd1__pack
23 (const SessionCmd1 *message,
24 uint8_t *out)
25 {
26 assert(message->base.descriptor == &session_cmd1__descriptor);
27 return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
28 }
session_cmd1__pack_to_buffer(const SessionCmd1 * message,ProtobufCBuffer * buffer)29 size_t session_cmd1__pack_to_buffer
30 (const SessionCmd1 *message,
31 ProtobufCBuffer *buffer)
32 {
33 assert(message->base.descriptor == &session_cmd1__descriptor);
34 return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
35 }
36 SessionCmd1 *
session_cmd1__unpack(ProtobufCAllocator * allocator,size_t len,const uint8_t * data)37 session_cmd1__unpack
38 (ProtobufCAllocator *allocator,
39 size_t len,
40 const uint8_t *data)
41 {
42 return (SessionCmd1 *)
43 protobuf_c_message_unpack (&session_cmd1__descriptor,
44 allocator, len, data);
45 }
session_cmd1__free_unpacked(SessionCmd1 * message,ProtobufCAllocator * allocator)46 void session_cmd1__free_unpacked
47 (SessionCmd1 *message,
48 ProtobufCAllocator *allocator)
49 {
50 if(!message)
51 return;
52 assert(message->base.descriptor == &session_cmd1__descriptor);
53 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
54 }
session_resp1__init(SessionResp1 * message)55 void session_resp1__init
56 (SessionResp1 *message)
57 {
58 static const SessionResp1 init_value = SESSION_RESP1__INIT;
59 *message = init_value;
60 }
session_resp1__get_packed_size(const SessionResp1 * message)61 size_t session_resp1__get_packed_size
62 (const SessionResp1 *message)
63 {
64 assert(message->base.descriptor == &session_resp1__descriptor);
65 return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
66 }
session_resp1__pack(const SessionResp1 * message,uint8_t * out)67 size_t session_resp1__pack
68 (const SessionResp1 *message,
69 uint8_t *out)
70 {
71 assert(message->base.descriptor == &session_resp1__descriptor);
72 return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
73 }
session_resp1__pack_to_buffer(const SessionResp1 * message,ProtobufCBuffer * buffer)74 size_t session_resp1__pack_to_buffer
75 (const SessionResp1 *message,
76 ProtobufCBuffer *buffer)
77 {
78 assert(message->base.descriptor == &session_resp1__descriptor);
79 return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
80 }
81 SessionResp1 *
session_resp1__unpack(ProtobufCAllocator * allocator,size_t len,const uint8_t * data)82 session_resp1__unpack
83 (ProtobufCAllocator *allocator,
84 size_t len,
85 const uint8_t *data)
86 {
87 return (SessionResp1 *)
88 protobuf_c_message_unpack (&session_resp1__descriptor,
89 allocator, len, data);
90 }
session_resp1__free_unpacked(SessionResp1 * message,ProtobufCAllocator * allocator)91 void session_resp1__free_unpacked
92 (SessionResp1 *message,
93 ProtobufCAllocator *allocator)
94 {
95 if(!message)
96 return;
97 assert(message->base.descriptor == &session_resp1__descriptor);
98 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
99 }
session_cmd0__init(SessionCmd0 * message)100 void session_cmd0__init
101 (SessionCmd0 *message)
102 {
103 static const SessionCmd0 init_value = SESSION_CMD0__INIT;
104 *message = init_value;
105 }
session_cmd0__get_packed_size(const SessionCmd0 * message)106 size_t session_cmd0__get_packed_size
107 (const SessionCmd0 *message)
108 {
109 assert(message->base.descriptor == &session_cmd0__descriptor);
110 return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
111 }
session_cmd0__pack(const SessionCmd0 * message,uint8_t * out)112 size_t session_cmd0__pack
113 (const SessionCmd0 *message,
114 uint8_t *out)
115 {
116 assert(message->base.descriptor == &session_cmd0__descriptor);
117 return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
118 }
session_cmd0__pack_to_buffer(const SessionCmd0 * message,ProtobufCBuffer * buffer)119 size_t session_cmd0__pack_to_buffer
120 (const SessionCmd0 *message,
121 ProtobufCBuffer *buffer)
122 {
123 assert(message->base.descriptor == &session_cmd0__descriptor);
124 return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
125 }
126 SessionCmd0 *
session_cmd0__unpack(ProtobufCAllocator * allocator,size_t len,const uint8_t * data)127 session_cmd0__unpack
128 (ProtobufCAllocator *allocator,
129 size_t len,
130 const uint8_t *data)
131 {
132 return (SessionCmd0 *)
133 protobuf_c_message_unpack (&session_cmd0__descriptor,
134 allocator, len, data);
135 }
session_cmd0__free_unpacked(SessionCmd0 * message,ProtobufCAllocator * allocator)136 void session_cmd0__free_unpacked
137 (SessionCmd0 *message,
138 ProtobufCAllocator *allocator)
139 {
140 if(!message)
141 return;
142 assert(message->base.descriptor == &session_cmd0__descriptor);
143 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
144 }
session_resp0__init(SessionResp0 * message)145 void session_resp0__init
146 (SessionResp0 *message)
147 {
148 static const SessionResp0 init_value = SESSION_RESP0__INIT;
149 *message = init_value;
150 }
session_resp0__get_packed_size(const SessionResp0 * message)151 size_t session_resp0__get_packed_size
152 (const SessionResp0 *message)
153 {
154 assert(message->base.descriptor == &session_resp0__descriptor);
155 return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
156 }
session_resp0__pack(const SessionResp0 * message,uint8_t * out)157 size_t session_resp0__pack
158 (const SessionResp0 *message,
159 uint8_t *out)
160 {
161 assert(message->base.descriptor == &session_resp0__descriptor);
162 return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
163 }
session_resp0__pack_to_buffer(const SessionResp0 * message,ProtobufCBuffer * buffer)164 size_t session_resp0__pack_to_buffer
165 (const SessionResp0 *message,
166 ProtobufCBuffer *buffer)
167 {
168 assert(message->base.descriptor == &session_resp0__descriptor);
169 return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
170 }
171 SessionResp0 *
session_resp0__unpack(ProtobufCAllocator * allocator,size_t len,const uint8_t * data)172 session_resp0__unpack
173 (ProtobufCAllocator *allocator,
174 size_t len,
175 const uint8_t *data)
176 {
177 return (SessionResp0 *)
178 protobuf_c_message_unpack (&session_resp0__descriptor,
179 allocator, len, data);
180 }
session_resp0__free_unpacked(SessionResp0 * message,ProtobufCAllocator * allocator)181 void session_resp0__free_unpacked
182 (SessionResp0 *message,
183 ProtobufCAllocator *allocator)
184 {
185 if(!message)
186 return;
187 assert(message->base.descriptor == &session_resp0__descriptor);
188 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
189 }
sec1_payload__init(Sec1Payload * message)190 void sec1_payload__init
191 (Sec1Payload *message)
192 {
193 static const Sec1Payload init_value = SEC1_PAYLOAD__INIT;
194 *message = init_value;
195 }
sec1_payload__get_packed_size(const Sec1Payload * message)196 size_t sec1_payload__get_packed_size
197 (const Sec1Payload *message)
198 {
199 assert(message->base.descriptor == &sec1_payload__descriptor);
200 return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
201 }
sec1_payload__pack(const Sec1Payload * message,uint8_t * out)202 size_t sec1_payload__pack
203 (const Sec1Payload *message,
204 uint8_t *out)
205 {
206 assert(message->base.descriptor == &sec1_payload__descriptor);
207 return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
208 }
sec1_payload__pack_to_buffer(const Sec1Payload * message,ProtobufCBuffer * buffer)209 size_t sec1_payload__pack_to_buffer
210 (const Sec1Payload *message,
211 ProtobufCBuffer *buffer)
212 {
213 assert(message->base.descriptor == &sec1_payload__descriptor);
214 return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
215 }
216 Sec1Payload *
sec1_payload__unpack(ProtobufCAllocator * allocator,size_t len,const uint8_t * data)217 sec1_payload__unpack
218 (ProtobufCAllocator *allocator,
219 size_t len,
220 const uint8_t *data)
221 {
222 return (Sec1Payload *)
223 protobuf_c_message_unpack (&sec1_payload__descriptor,
224 allocator, len, data);
225 }
sec1_payload__free_unpacked(Sec1Payload * message,ProtobufCAllocator * allocator)226 void sec1_payload__free_unpacked
227 (Sec1Payload *message,
228 ProtobufCAllocator *allocator)
229 {
230 if(!message)
231 return;
232 assert(message->base.descriptor == &sec1_payload__descriptor);
233 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
234 }
235 static const ProtobufCFieldDescriptor session_cmd1__field_descriptors[1] =
236 {
237 {
238 "client_verify_data",
239 2,
240 PROTOBUF_C_LABEL_NONE,
241 PROTOBUF_C_TYPE_BYTES,
242 0, /* quantifier_offset */
243 offsetof(SessionCmd1, client_verify_data),
244 NULL,
245 NULL,
246 0, /* flags */
247 0,NULL,NULL /* reserved1,reserved2, etc */
248 },
249 };
250 static const unsigned session_cmd1__field_indices_by_name[] = {
251 0, /* field[0] = client_verify_data */
252 };
253 static const ProtobufCIntRange session_cmd1__number_ranges[1 + 1] =
254 {
255 { 2, 0 },
256 { 0, 1 }
257 };
258 const ProtobufCMessageDescriptor session_cmd1__descriptor =
259 {
260 PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
261 "SessionCmd1",
262 "SessionCmd1",
263 "SessionCmd1",
264 "",
265 sizeof(SessionCmd1),
266 1,
267 session_cmd1__field_descriptors,
268 session_cmd1__field_indices_by_name,
269 1, session_cmd1__number_ranges,
270 (ProtobufCMessageInit) session_cmd1__init,
271 NULL,NULL,NULL /* reserved[123] */
272 };
273 static const ProtobufCFieldDescriptor session_resp1__field_descriptors[2] =
274 {
275 {
276 "status",
277 1,
278 PROTOBUF_C_LABEL_NONE,
279 PROTOBUF_C_TYPE_ENUM,
280 0, /* quantifier_offset */
281 offsetof(SessionResp1, status),
282 &status__descriptor,
283 NULL,
284 0, /* flags */
285 0,NULL,NULL /* reserved1,reserved2, etc */
286 },
287 {
288 "device_verify_data",
289 3,
290 PROTOBUF_C_LABEL_NONE,
291 PROTOBUF_C_TYPE_BYTES,
292 0, /* quantifier_offset */
293 offsetof(SessionResp1, device_verify_data),
294 NULL,
295 NULL,
296 0, /* flags */
297 0,NULL,NULL /* reserved1,reserved2, etc */
298 },
299 };
300 static const unsigned session_resp1__field_indices_by_name[] = {
301 1, /* field[1] = device_verify_data */
302 0, /* field[0] = status */
303 };
304 static const ProtobufCIntRange session_resp1__number_ranges[2 + 1] =
305 {
306 { 1, 0 },
307 { 3, 1 },
308 { 0, 2 }
309 };
310 const ProtobufCMessageDescriptor session_resp1__descriptor =
311 {
312 PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
313 "SessionResp1",
314 "SessionResp1",
315 "SessionResp1",
316 "",
317 sizeof(SessionResp1),
318 2,
319 session_resp1__field_descriptors,
320 session_resp1__field_indices_by_name,
321 2, session_resp1__number_ranges,
322 (ProtobufCMessageInit) session_resp1__init,
323 NULL,NULL,NULL /* reserved[123] */
324 };
325 static const ProtobufCFieldDescriptor session_cmd0__field_descriptors[1] =
326 {
327 {
328 "client_pubkey",
329 1,
330 PROTOBUF_C_LABEL_NONE,
331 PROTOBUF_C_TYPE_BYTES,
332 0, /* quantifier_offset */
333 offsetof(SessionCmd0, client_pubkey),
334 NULL,
335 NULL,
336 0, /* flags */
337 0,NULL,NULL /* reserved1,reserved2, etc */
338 },
339 };
340 static const unsigned session_cmd0__field_indices_by_name[] = {
341 0, /* field[0] = client_pubkey */
342 };
343 static const ProtobufCIntRange session_cmd0__number_ranges[1 + 1] =
344 {
345 { 1, 0 },
346 { 0, 1 }
347 };
348 const ProtobufCMessageDescriptor session_cmd0__descriptor =
349 {
350 PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
351 "SessionCmd0",
352 "SessionCmd0",
353 "SessionCmd0",
354 "",
355 sizeof(SessionCmd0),
356 1,
357 session_cmd0__field_descriptors,
358 session_cmd0__field_indices_by_name,
359 1, session_cmd0__number_ranges,
360 (ProtobufCMessageInit) session_cmd0__init,
361 NULL,NULL,NULL /* reserved[123] */
362 };
363 static const ProtobufCFieldDescriptor session_resp0__field_descriptors[3] =
364 {
365 {
366 "status",
367 1,
368 PROTOBUF_C_LABEL_NONE,
369 PROTOBUF_C_TYPE_ENUM,
370 0, /* quantifier_offset */
371 offsetof(SessionResp0, status),
372 &status__descriptor,
373 NULL,
374 0, /* flags */
375 0,NULL,NULL /* reserved1,reserved2, etc */
376 },
377 {
378 "device_pubkey",
379 2,
380 PROTOBUF_C_LABEL_NONE,
381 PROTOBUF_C_TYPE_BYTES,
382 0, /* quantifier_offset */
383 offsetof(SessionResp0, device_pubkey),
384 NULL,
385 NULL,
386 0, /* flags */
387 0,NULL,NULL /* reserved1,reserved2, etc */
388 },
389 {
390 "device_random",
391 3,
392 PROTOBUF_C_LABEL_NONE,
393 PROTOBUF_C_TYPE_BYTES,
394 0, /* quantifier_offset */
395 offsetof(SessionResp0, device_random),
396 NULL,
397 NULL,
398 0, /* flags */
399 0,NULL,NULL /* reserved1,reserved2, etc */
400 },
401 };
402 static const unsigned session_resp0__field_indices_by_name[] = {
403 1, /* field[1] = device_pubkey */
404 2, /* field[2] = device_random */
405 0, /* field[0] = status */
406 };
407 static const ProtobufCIntRange session_resp0__number_ranges[1 + 1] =
408 {
409 { 1, 0 },
410 { 0, 3 }
411 };
412 const ProtobufCMessageDescriptor session_resp0__descriptor =
413 {
414 PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
415 "SessionResp0",
416 "SessionResp0",
417 "SessionResp0",
418 "",
419 sizeof(SessionResp0),
420 3,
421 session_resp0__field_descriptors,
422 session_resp0__field_indices_by_name,
423 1, session_resp0__number_ranges,
424 (ProtobufCMessageInit) session_resp0__init,
425 NULL,NULL,NULL /* reserved[123] */
426 };
427 static const ProtobufCFieldDescriptor sec1_payload__field_descriptors[5] =
428 {
429 {
430 "msg",
431 1,
432 PROTOBUF_C_LABEL_NONE,
433 PROTOBUF_C_TYPE_ENUM,
434 0, /* quantifier_offset */
435 offsetof(Sec1Payload, msg),
436 &sec1_msg_type__descriptor,
437 NULL,
438 0, /* flags */
439 0,NULL,NULL /* reserved1,reserved2, etc */
440 },
441 {
442 "sc0",
443 20,
444 PROTOBUF_C_LABEL_NONE,
445 PROTOBUF_C_TYPE_MESSAGE,
446 offsetof(Sec1Payload, payload_case),
447 offsetof(Sec1Payload, sc0),
448 &session_cmd0__descriptor,
449 NULL,
450 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
451 0,NULL,NULL /* reserved1,reserved2, etc */
452 },
453 {
454 "sr0",
455 21,
456 PROTOBUF_C_LABEL_NONE,
457 PROTOBUF_C_TYPE_MESSAGE,
458 offsetof(Sec1Payload, payload_case),
459 offsetof(Sec1Payload, sr0),
460 &session_resp0__descriptor,
461 NULL,
462 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
463 0,NULL,NULL /* reserved1,reserved2, etc */
464 },
465 {
466 "sc1",
467 22,
468 PROTOBUF_C_LABEL_NONE,
469 PROTOBUF_C_TYPE_MESSAGE,
470 offsetof(Sec1Payload, payload_case),
471 offsetof(Sec1Payload, sc1),
472 &session_cmd1__descriptor,
473 NULL,
474 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
475 0,NULL,NULL /* reserved1,reserved2, etc */
476 },
477 {
478 "sr1",
479 23,
480 PROTOBUF_C_LABEL_NONE,
481 PROTOBUF_C_TYPE_MESSAGE,
482 offsetof(Sec1Payload, payload_case),
483 offsetof(Sec1Payload, sr1),
484 &session_resp1__descriptor,
485 NULL,
486 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
487 0,NULL,NULL /* reserved1,reserved2, etc */
488 },
489 };
490 static const unsigned sec1_payload__field_indices_by_name[] = {
491 0, /* field[0] = msg */
492 1, /* field[1] = sc0 */
493 3, /* field[3] = sc1 */
494 2, /* field[2] = sr0 */
495 4, /* field[4] = sr1 */
496 };
497 static const ProtobufCIntRange sec1_payload__number_ranges[2 + 1] =
498 {
499 { 1, 0 },
500 { 20, 1 },
501 { 0, 5 }
502 };
503 const ProtobufCMessageDescriptor sec1_payload__descriptor =
504 {
505 PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
506 "Sec1Payload",
507 "Sec1Payload",
508 "Sec1Payload",
509 "",
510 sizeof(Sec1Payload),
511 5,
512 sec1_payload__field_descriptors,
513 sec1_payload__field_indices_by_name,
514 2, sec1_payload__number_ranges,
515 (ProtobufCMessageInit) sec1_payload__init,
516 NULL,NULL,NULL /* reserved[123] */
517 };
518 static const ProtobufCEnumValue sec1_msg_type__enum_values_by_number[4] =
519 {
520 { "Session_Command0", "SEC1_MSG_TYPE__Session_Command0", 0 },
521 { "Session_Response0", "SEC1_MSG_TYPE__Session_Response0", 1 },
522 { "Session_Command1", "SEC1_MSG_TYPE__Session_Command1", 2 },
523 { "Session_Response1", "SEC1_MSG_TYPE__Session_Response1", 3 },
524 };
525 static const ProtobufCIntRange sec1_msg_type__value_ranges[] = {
526 {0, 0},{0, 4}
527 };
528 static const ProtobufCEnumValueIndex sec1_msg_type__enum_values_by_name[4] =
529 {
530 { "Session_Command0", 0 },
531 { "Session_Command1", 2 },
532 { "Session_Response0", 1 },
533 { "Session_Response1", 3 },
534 };
535 const ProtobufCEnumDescriptor sec1_msg_type__descriptor =
536 {
537 PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
538 "Sec1MsgType",
539 "Sec1MsgType",
540 "Sec1MsgType",
541 "",
542 4,
543 sec1_msg_type__enum_values_by_number,
544 4,
545 sec1_msg_type__enum_values_by_name,
546 1,
547 sec1_msg_type__value_ranges,
548 NULL,NULL,NULL,NULL /* reserved[1234] */
549 };
550