1 /* Generated by the protocol buffer compiler. DO NOT EDIT! */ 2 /* Generated from: session.proto */ 3 4 #ifndef PROTOBUF_C_session_2eproto__INCLUDED 5 #define PROTOBUF_C_session_2eproto__INCLUDED 6 7 #include <protobuf-c/protobuf-c.h> 8 9 PROTOBUF_C__BEGIN_DECLS 10 11 #if PROTOBUF_C_VERSION_NUMBER < 1003000 12 # error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. 13 #elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION 14 # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. 15 #endif 16 17 #include "sec0.pb-c.h" 18 #include "sec1.pb-c.h" 19 20 typedef struct _SessionData SessionData; 21 22 23 /* --- enums --- */ 24 25 /* 26 * Allowed values for the type of security 27 * being used in a protocomm session 28 */ 29 typedef enum _SecSchemeVersion { 30 /* 31 *!< Unsecured - plaintext communication 32 */ 33 SEC_SCHEME_VERSION__SecScheme0 = 0, 34 /* 35 *!< Security scheme 1 - Curve25519 + AES-256-CTR 36 */ 37 SEC_SCHEME_VERSION__SecScheme1 = 1 38 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SEC_SCHEME_VERSION) 39 } SecSchemeVersion; 40 41 /* --- messages --- */ 42 43 typedef enum { 44 SESSION_DATA__PROTO__NOT_SET = 0, 45 SESSION_DATA__PROTO_SEC0 = 10, 46 SESSION_DATA__PROTO_SEC1 = 11 47 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SESSION_DATA__PROTO) 48 } SessionData__ProtoCase; 49 50 /* 51 * Data structure exchanged when establishing 52 * secure session between Host and Client 53 */ 54 struct _SessionData 55 { 56 ProtobufCMessage base; 57 /* 58 *!< Type of security 59 */ 60 SecSchemeVersion sec_ver; 61 SessionData__ProtoCase proto_case; 62 union { 63 /* 64 *!< Payload data in case of security 0 65 */ 66 Sec0Payload *sec0; 67 /* 68 *!< Payload data in case of security 1 69 */ 70 Sec1Payload *sec1; 71 }; 72 }; 73 #define SESSION_DATA__INIT \ 74 { PROTOBUF_C_MESSAGE_INIT (&session_data__descriptor) \ 75 , SEC_SCHEME_VERSION__SecScheme0, SESSION_DATA__PROTO__NOT_SET, {0} } 76 77 78 /* SessionData methods */ 79 void session_data__init 80 (SessionData *message); 81 size_t session_data__get_packed_size 82 (const SessionData *message); 83 size_t session_data__pack 84 (const SessionData *message, 85 uint8_t *out); 86 size_t session_data__pack_to_buffer 87 (const SessionData *message, 88 ProtobufCBuffer *buffer); 89 SessionData * 90 session_data__unpack 91 (ProtobufCAllocator *allocator, 92 size_t len, 93 const uint8_t *data); 94 void session_data__free_unpacked 95 (SessionData *message, 96 ProtobufCAllocator *allocator); 97 /* --- per-message closures --- */ 98 99 typedef void (*SessionData_Closure) 100 (const SessionData *message, 101 void *closure_data); 102 103 /* --- services --- */ 104 105 106 /* --- descriptors --- */ 107 108 extern const ProtobufCEnumDescriptor sec_scheme_version__descriptor; 109 extern const ProtobufCMessageDescriptor session_data__descriptor; 110 111 PROTOBUF_C__END_DECLS 112 113 114 #endif /* PROTOBUF_C_session_2eproto__INCLUDED */ 115