session.pb-c.h 3.1 KB

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