feature/protocomm: Added the protocomm component from idf.

This commit is contained in:
Supreet Deshpande
2019-02-21 11:56:05 +05:30
parent ae40917d65
commit 66142e0196
39 changed files with 6890 additions and 0 deletions

View File

@ -0,0 +1,49 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: constants.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "constants.pb-c.h"
static const ProtobufCEnumValue status__enum_values_by_number[8] =
{
{ "Success", "STATUS__Success", 0 },
{ "InvalidSecScheme", "STATUS__InvalidSecScheme", 1 },
{ "InvalidProto", "STATUS__InvalidProto", 2 },
{ "TooManySessions", "STATUS__TooManySessions", 3 },
{ "InvalidArgument", "STATUS__InvalidArgument", 4 },
{ "InternalError", "STATUS__InternalError", 5 },
{ "CryptoError", "STATUS__CryptoError", 6 },
{ "InvalidSession", "STATUS__InvalidSession", 7 },
};
static const ProtobufCIntRange status__value_ranges[] = {
{0, 0},{0, 8}
};
static const ProtobufCEnumValueIndex status__enum_values_by_name[8] =
{
{ "CryptoError", 6 },
{ "InternalError", 5 },
{ "InvalidArgument", 4 },
{ "InvalidProto", 2 },
{ "InvalidSecScheme", 1 },
{ "InvalidSession", 7 },
{ "Success", 0 },
{ "TooManySessions", 3 },
};
const ProtobufCEnumDescriptor status__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"Status",
"Status",
"Status",
"",
8,
status__enum_values_by_number,
8,
status__enum_values_by_name,
1,
status__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};

View File

@ -0,0 +1,53 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: constants.proto */
#ifndef PROTOBUF_C_constants_2eproto__INCLUDED
#define PROTOBUF_C_constants_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
# 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.
#endif
/* --- enums --- */
/*
* Allowed values for the status
* of a protocomm instance
*/
typedef enum _Status {
STATUS__Success = 0,
STATUS__InvalidSecScheme = 1,
STATUS__InvalidProto = 2,
STATUS__TooManySessions = 3,
STATUS__InvalidArgument = 4,
STATUS__InternalError = 5,
STATUS__CryptoError = 6,
STATUS__InvalidSession = 7
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(STATUS)
} Status;
/* --- messages --- */
/* --- per-message closures --- */
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCEnumDescriptor status__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_constants_2eproto__INCLUDED */

View File

@ -0,0 +1,293 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: sec0.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "sec0.pb-c.h"
void s0_session_cmd__init
(S0SessionCmd *message)
{
static const S0SessionCmd init_value = S0_SESSION_CMD__INIT;
*message = init_value;
}
size_t s0_session_cmd__get_packed_size
(const S0SessionCmd *message)
{
assert(message->base.descriptor == &s0_session_cmd__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t s0_session_cmd__pack
(const S0SessionCmd *message,
uint8_t *out)
{
assert(message->base.descriptor == &s0_session_cmd__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t s0_session_cmd__pack_to_buffer
(const S0SessionCmd *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &s0_session_cmd__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
S0SessionCmd *
s0_session_cmd__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (S0SessionCmd *)
protobuf_c_message_unpack (&s0_session_cmd__descriptor,
allocator, len, data);
}
void s0_session_cmd__free_unpacked
(S0SessionCmd *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &s0_session_cmd__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void s0_session_resp__init
(S0SessionResp *message)
{
static const S0SessionResp init_value = S0_SESSION_RESP__INIT;
*message = init_value;
}
size_t s0_session_resp__get_packed_size
(const S0SessionResp *message)
{
assert(message->base.descriptor == &s0_session_resp__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t s0_session_resp__pack
(const S0SessionResp *message,
uint8_t *out)
{
assert(message->base.descriptor == &s0_session_resp__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t s0_session_resp__pack_to_buffer
(const S0SessionResp *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &s0_session_resp__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
S0SessionResp *
s0_session_resp__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (S0SessionResp *)
protobuf_c_message_unpack (&s0_session_resp__descriptor,
allocator, len, data);
}
void s0_session_resp__free_unpacked
(S0SessionResp *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &s0_session_resp__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void sec0_payload__init
(Sec0Payload *message)
{
static const Sec0Payload init_value = SEC0_PAYLOAD__INIT;
*message = init_value;
}
size_t sec0_payload__get_packed_size
(const Sec0Payload *message)
{
assert(message->base.descriptor == &sec0_payload__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t sec0_payload__pack
(const Sec0Payload *message,
uint8_t *out)
{
assert(message->base.descriptor == &sec0_payload__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t sec0_payload__pack_to_buffer
(const Sec0Payload *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &sec0_payload__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Sec0Payload *
sec0_payload__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Sec0Payload *)
protobuf_c_message_unpack (&sec0_payload__descriptor,
allocator, len, data);
}
void sec0_payload__free_unpacked
(Sec0Payload *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &sec0_payload__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
#define s0_session_cmd__field_descriptors NULL
#define s0_session_cmd__field_indices_by_name NULL
#define s0_session_cmd__number_ranges NULL
const ProtobufCMessageDescriptor s0_session_cmd__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"S0SessionCmd",
"S0SessionCmd",
"S0SessionCmd",
"",
sizeof(S0SessionCmd),
0,
s0_session_cmd__field_descriptors,
s0_session_cmd__field_indices_by_name,
0, s0_session_cmd__number_ranges,
(ProtobufCMessageInit) s0_session_cmd__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor s0_session_resp__field_descriptors[1] =
{
{
"status",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(S0SessionResp, status),
&status__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned s0_session_resp__field_indices_by_name[] = {
0, /* field[0] = status */
};
static const ProtobufCIntRange s0_session_resp__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor s0_session_resp__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"S0SessionResp",
"S0SessionResp",
"S0SessionResp",
"",
sizeof(S0SessionResp),
1,
s0_session_resp__field_descriptors,
s0_session_resp__field_indices_by_name,
1, s0_session_resp__number_ranges,
(ProtobufCMessageInit) s0_session_resp__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor sec0_payload__field_descriptors[3] =
{
{
"msg",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(Sec0Payload, msg),
&sec0_msg_type__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sc",
20,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Sec0Payload, payload_case),
offsetof(Sec0Payload, sc),
&s0_session_cmd__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sr",
21,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Sec0Payload, payload_case),
offsetof(Sec0Payload, sr),
&s0_session_resp__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned sec0_payload__field_indices_by_name[] = {
0, /* field[0] = msg */
1, /* field[1] = sc */
2, /* field[2] = sr */
};
static const ProtobufCIntRange sec0_payload__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 20, 1 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor sec0_payload__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"Sec0Payload",
"Sec0Payload",
"Sec0Payload",
"",
sizeof(Sec0Payload),
3,
sec0_payload__field_descriptors,
sec0_payload__field_indices_by_name,
2, sec0_payload__number_ranges,
(ProtobufCMessageInit) sec0_payload__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCEnumValue sec0_msg_type__enum_values_by_number[2] =
{
{ "S0_Session_Command", "SEC0_MSG_TYPE__S0_Session_Command", 0 },
{ "S0_Session_Response", "SEC0_MSG_TYPE__S0_Session_Response", 1 },
};
static const ProtobufCIntRange sec0_msg_type__value_ranges[] = {
{0, 0},{0, 2}
};
static const ProtobufCEnumValueIndex sec0_msg_type__enum_values_by_name[2] =
{
{ "S0_Session_Command", 0 },
{ "S0_Session_Response", 1 },
};
const ProtobufCEnumDescriptor sec0_msg_type__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"Sec0MsgType",
"Sec0MsgType",
"Sec0MsgType",
"",
2,
sec0_msg_type__enum_values_by_number,
2,
sec0_msg_type__enum_values_by_name,
1,
sec0_msg_type__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};

View File

@ -0,0 +1,178 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: sec0.proto */
#ifndef PROTOBUF_C_sec0_2eproto__INCLUDED
#define PROTOBUF_C_sec0_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
# 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.
#endif
#include "constants.pb-c.h"
typedef struct _S0SessionCmd S0SessionCmd;
typedef struct _S0SessionResp S0SessionResp;
typedef struct _Sec0Payload Sec0Payload;
/* --- enums --- */
/*
* A message must be of type Cmd or Resp
*/
typedef enum _Sec0MsgType {
SEC0_MSG_TYPE__S0_Session_Command = 0,
SEC0_MSG_TYPE__S0_Session_Response = 1
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SEC0_MSG_TYPE)
} Sec0MsgType;
/* --- messages --- */
/*
* Data structure of Session command/request packet
*/
struct _S0SessionCmd
{
ProtobufCMessage base;
};
#define S0_SESSION_CMD__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&s0_session_cmd__descriptor) \
}
/*
* Data structure of Session response packet
*/
struct _S0SessionResp
{
ProtobufCMessage base;
Status status;
};
#define S0_SESSION_RESP__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&s0_session_resp__descriptor) \
, STATUS__Success }
typedef enum {
SEC0_PAYLOAD__PAYLOAD__NOT_SET = 0,
SEC0_PAYLOAD__PAYLOAD_SC = 20,
SEC0_PAYLOAD__PAYLOAD_SR = 21
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SEC0_PAYLOAD__PAYLOAD)
} Sec0Payload__PayloadCase;
/*
* Payload structure of session data
*/
struct _Sec0Payload
{
ProtobufCMessage base;
/*
*!< Type of message
*/
Sec0MsgType msg;
Sec0Payload__PayloadCase payload_case;
union {
/*
*!< Payload data interpreted as Cmd
*/
S0SessionCmd *sc;
/*
*!< Payload data interpreted as Resp
*/
S0SessionResp *sr;
};
};
#define SEC0_PAYLOAD__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&sec0_payload__descriptor) \
, SEC0_MSG_TYPE__S0_Session_Command, SEC0_PAYLOAD__PAYLOAD__NOT_SET, {0} }
/* S0SessionCmd methods */
void s0_session_cmd__init
(S0SessionCmd *message);
size_t s0_session_cmd__get_packed_size
(const S0SessionCmd *message);
size_t s0_session_cmd__pack
(const S0SessionCmd *message,
uint8_t *out);
size_t s0_session_cmd__pack_to_buffer
(const S0SessionCmd *message,
ProtobufCBuffer *buffer);
S0SessionCmd *
s0_session_cmd__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void s0_session_cmd__free_unpacked
(S0SessionCmd *message,
ProtobufCAllocator *allocator);
/* S0SessionResp methods */
void s0_session_resp__init
(S0SessionResp *message);
size_t s0_session_resp__get_packed_size
(const S0SessionResp *message);
size_t s0_session_resp__pack
(const S0SessionResp *message,
uint8_t *out);
size_t s0_session_resp__pack_to_buffer
(const S0SessionResp *message,
ProtobufCBuffer *buffer);
S0SessionResp *
s0_session_resp__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void s0_session_resp__free_unpacked
(S0SessionResp *message,
ProtobufCAllocator *allocator);
/* Sec0Payload methods */
void sec0_payload__init
(Sec0Payload *message);
size_t sec0_payload__get_packed_size
(const Sec0Payload *message);
size_t sec0_payload__pack
(const Sec0Payload *message,
uint8_t *out);
size_t sec0_payload__pack_to_buffer
(const Sec0Payload *message,
ProtobufCBuffer *buffer);
Sec0Payload *
sec0_payload__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void sec0_payload__free_unpacked
(Sec0Payload *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*S0SessionCmd_Closure)
(const S0SessionCmd *message,
void *closure_data);
typedef void (*S0SessionResp_Closure)
(const S0SessionResp *message,
void *closure_data);
typedef void (*Sec0Payload_Closure)
(const Sec0Payload *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCEnumDescriptor sec0_msg_type__descriptor;
extern const ProtobufCMessageDescriptor s0_session_cmd__descriptor;
extern const ProtobufCMessageDescriptor s0_session_resp__descriptor;
extern const ProtobufCMessageDescriptor sec0_payload__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_sec0_2eproto__INCLUDED */

View File

@ -0,0 +1,549 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: sec1.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "sec1.pb-c.h"
void session_cmd1__init
(SessionCmd1 *message)
{
static const SessionCmd1 init_value = SESSION_CMD1__INIT;
*message = init_value;
}
size_t session_cmd1__get_packed_size
(const SessionCmd1 *message)
{
assert(message->base.descriptor == &session_cmd1__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t session_cmd1__pack
(const SessionCmd1 *message,
uint8_t *out)
{
assert(message->base.descriptor == &session_cmd1__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t session_cmd1__pack_to_buffer
(const SessionCmd1 *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &session_cmd1__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
SessionCmd1 *
session_cmd1__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (SessionCmd1 *)
protobuf_c_message_unpack (&session_cmd1__descriptor,
allocator, len, data);
}
void session_cmd1__free_unpacked
(SessionCmd1 *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &session_cmd1__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void session_resp1__init
(SessionResp1 *message)
{
static const SessionResp1 init_value = SESSION_RESP1__INIT;
*message = init_value;
}
size_t session_resp1__get_packed_size
(const SessionResp1 *message)
{
assert(message->base.descriptor == &session_resp1__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t session_resp1__pack
(const SessionResp1 *message,
uint8_t *out)
{
assert(message->base.descriptor == &session_resp1__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t session_resp1__pack_to_buffer
(const SessionResp1 *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &session_resp1__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
SessionResp1 *
session_resp1__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (SessionResp1 *)
protobuf_c_message_unpack (&session_resp1__descriptor,
allocator, len, data);
}
void session_resp1__free_unpacked
(SessionResp1 *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &session_resp1__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void session_cmd0__init
(SessionCmd0 *message)
{
static const SessionCmd0 init_value = SESSION_CMD0__INIT;
*message = init_value;
}
size_t session_cmd0__get_packed_size
(const SessionCmd0 *message)
{
assert(message->base.descriptor == &session_cmd0__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t session_cmd0__pack
(const SessionCmd0 *message,
uint8_t *out)
{
assert(message->base.descriptor == &session_cmd0__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t session_cmd0__pack_to_buffer
(const SessionCmd0 *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &session_cmd0__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
SessionCmd0 *
session_cmd0__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (SessionCmd0 *)
protobuf_c_message_unpack (&session_cmd0__descriptor,
allocator, len, data);
}
void session_cmd0__free_unpacked
(SessionCmd0 *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &session_cmd0__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void session_resp0__init
(SessionResp0 *message)
{
static const SessionResp0 init_value = SESSION_RESP0__INIT;
*message = init_value;
}
size_t session_resp0__get_packed_size
(const SessionResp0 *message)
{
assert(message->base.descriptor == &session_resp0__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t session_resp0__pack
(const SessionResp0 *message,
uint8_t *out)
{
assert(message->base.descriptor == &session_resp0__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t session_resp0__pack_to_buffer
(const SessionResp0 *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &session_resp0__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
SessionResp0 *
session_resp0__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (SessionResp0 *)
protobuf_c_message_unpack (&session_resp0__descriptor,
allocator, len, data);
}
void session_resp0__free_unpacked
(SessionResp0 *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &session_resp0__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void sec1_payload__init
(Sec1Payload *message)
{
static const Sec1Payload init_value = SEC1_PAYLOAD__INIT;
*message = init_value;
}
size_t sec1_payload__get_packed_size
(const Sec1Payload *message)
{
assert(message->base.descriptor == &sec1_payload__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t sec1_payload__pack
(const Sec1Payload *message,
uint8_t *out)
{
assert(message->base.descriptor == &sec1_payload__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t sec1_payload__pack_to_buffer
(const Sec1Payload *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &sec1_payload__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Sec1Payload *
sec1_payload__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Sec1Payload *)
protobuf_c_message_unpack (&sec1_payload__descriptor,
allocator, len, data);
}
void sec1_payload__free_unpacked
(Sec1Payload *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &sec1_payload__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor session_cmd1__field_descriptors[1] =
{
{
"client_verify_data",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(SessionCmd1, client_verify_data),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned session_cmd1__field_indices_by_name[] = {
0, /* field[0] = client_verify_data */
};
static const ProtobufCIntRange session_cmd1__number_ranges[1 + 1] =
{
{ 2, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor session_cmd1__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"SessionCmd1",
"SessionCmd1",
"SessionCmd1",
"",
sizeof(SessionCmd1),
1,
session_cmd1__field_descriptors,
session_cmd1__field_indices_by_name,
1, session_cmd1__number_ranges,
(ProtobufCMessageInit) session_cmd1__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor session_resp1__field_descriptors[2] =
{
{
"status",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(SessionResp1, status),
&status__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"device_verify_data",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(SessionResp1, device_verify_data),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned session_resp1__field_indices_by_name[] = {
1, /* field[1] = device_verify_data */
0, /* field[0] = status */
};
static const ProtobufCIntRange session_resp1__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 3, 1 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor session_resp1__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"SessionResp1",
"SessionResp1",
"SessionResp1",
"",
sizeof(SessionResp1),
2,
session_resp1__field_descriptors,
session_resp1__field_indices_by_name,
2, session_resp1__number_ranges,
(ProtobufCMessageInit) session_resp1__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor session_cmd0__field_descriptors[1] =
{
{
"client_pubkey",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(SessionCmd0, client_pubkey),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned session_cmd0__field_indices_by_name[] = {
0, /* field[0] = client_pubkey */
};
static const ProtobufCIntRange session_cmd0__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor session_cmd0__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"SessionCmd0",
"SessionCmd0",
"SessionCmd0",
"",
sizeof(SessionCmd0),
1,
session_cmd0__field_descriptors,
session_cmd0__field_indices_by_name,
1, session_cmd0__number_ranges,
(ProtobufCMessageInit) session_cmd0__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor session_resp0__field_descriptors[3] =
{
{
"status",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(SessionResp0, status),
&status__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"device_pubkey",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(SessionResp0, device_pubkey),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"device_random",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(SessionResp0, device_random),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned session_resp0__field_indices_by_name[] = {
1, /* field[1] = device_pubkey */
2, /* field[2] = device_random */
0, /* field[0] = status */
};
static const ProtobufCIntRange session_resp0__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor session_resp0__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"SessionResp0",
"SessionResp0",
"SessionResp0",
"",
sizeof(SessionResp0),
3,
session_resp0__field_descriptors,
session_resp0__field_indices_by_name,
1, session_resp0__number_ranges,
(ProtobufCMessageInit) session_resp0__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor sec1_payload__field_descriptors[5] =
{
{
"msg",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(Sec1Payload, msg),
&sec1_msg_type__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sc0",
20,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Sec1Payload, payload_case),
offsetof(Sec1Payload, sc0),
&session_cmd0__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sr0",
21,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Sec1Payload, payload_case),
offsetof(Sec1Payload, sr0),
&session_resp0__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sc1",
22,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Sec1Payload, payload_case),
offsetof(Sec1Payload, sc1),
&session_cmd1__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sr1",
23,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Sec1Payload, payload_case),
offsetof(Sec1Payload, sr1),
&session_resp1__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned sec1_payload__field_indices_by_name[] = {
0, /* field[0] = msg */
1, /* field[1] = sc0 */
3, /* field[3] = sc1 */
2, /* field[2] = sr0 */
4, /* field[4] = sr1 */
};
static const ProtobufCIntRange sec1_payload__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 20, 1 },
{ 0, 5 }
};
const ProtobufCMessageDescriptor sec1_payload__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"Sec1Payload",
"Sec1Payload",
"Sec1Payload",
"",
sizeof(Sec1Payload),
5,
sec1_payload__field_descriptors,
sec1_payload__field_indices_by_name,
2, sec1_payload__number_ranges,
(ProtobufCMessageInit) sec1_payload__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCEnumValue sec1_msg_type__enum_values_by_number[4] =
{
{ "Session_Command0", "SEC1_MSG_TYPE__Session_Command0", 0 },
{ "Session_Response0", "SEC1_MSG_TYPE__Session_Response0", 1 },
{ "Session_Command1", "SEC1_MSG_TYPE__Session_Command1", 2 },
{ "Session_Response1", "SEC1_MSG_TYPE__Session_Response1", 3 },
};
static const ProtobufCIntRange sec1_msg_type__value_ranges[] = {
{0, 0},{0, 4}
};
static const ProtobufCEnumValueIndex sec1_msg_type__enum_values_by_name[4] =
{
{ "Session_Command0", 0 },
{ "Session_Command1", 2 },
{ "Session_Response0", 1 },
{ "Session_Response1", 3 },
};
const ProtobufCEnumDescriptor sec1_msg_type__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"Sec1MsgType",
"Sec1MsgType",
"Sec1MsgType",
"",
4,
sec1_msg_type__enum_values_by_number,
4,
sec1_msg_type__enum_values_by_name,
1,
sec1_msg_type__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};

View File

@ -0,0 +1,268 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: sec1.proto */
#ifndef PROTOBUF_C_sec1_2eproto__INCLUDED
#define PROTOBUF_C_sec1_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
# 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.
#endif
#include "constants.pb-c.h"
typedef struct _SessionCmd1 SessionCmd1;
typedef struct _SessionResp1 SessionResp1;
typedef struct _SessionCmd0 SessionCmd0;
typedef struct _SessionResp0 SessionResp0;
typedef struct _Sec1Payload Sec1Payload;
/* --- enums --- */
/*
* A message must be of type Cmd0 / Cmd1 / Resp0 / Resp1
*/
typedef enum _Sec1MsgType {
SEC1_MSG_TYPE__Session_Command0 = 0,
SEC1_MSG_TYPE__Session_Response0 = 1,
SEC1_MSG_TYPE__Session_Command1 = 2,
SEC1_MSG_TYPE__Session_Response1 = 3
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SEC1_MSG_TYPE)
} Sec1MsgType;
/* --- messages --- */
/*
* Data structure of Session command1 packet
*/
struct _SessionCmd1
{
ProtobufCMessage base;
ProtobufCBinaryData client_verify_data;
};
#define SESSION_CMD1__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&session_cmd1__descriptor) \
, {0,NULL} }
/*
* Data structure of Session response1 packet
*/
struct _SessionResp1
{
ProtobufCMessage base;
Status status;
ProtobufCBinaryData device_verify_data;
};
#define SESSION_RESP1__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&session_resp1__descriptor) \
, STATUS__Success, {0,NULL} }
/*
* Data structure of Session command0 packet
*/
struct _SessionCmd0
{
ProtobufCMessage base;
ProtobufCBinaryData client_pubkey;
};
#define SESSION_CMD0__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&session_cmd0__descriptor) \
, {0,NULL} }
/*
* Data structure of Session response0 packet
*/
struct _SessionResp0
{
ProtobufCMessage base;
Status status;
ProtobufCBinaryData device_pubkey;
ProtobufCBinaryData device_random;
};
#define SESSION_RESP0__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&session_resp0__descriptor) \
, STATUS__Success, {0,NULL}, {0,NULL} }
typedef enum {
SEC1_PAYLOAD__PAYLOAD__NOT_SET = 0,
SEC1_PAYLOAD__PAYLOAD_SC0 = 20,
SEC1_PAYLOAD__PAYLOAD_SR0 = 21,
SEC1_PAYLOAD__PAYLOAD_SC1 = 22,
SEC1_PAYLOAD__PAYLOAD_SR1 = 23
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SEC1_PAYLOAD__PAYLOAD)
} Sec1Payload__PayloadCase;
/*
* Payload structure of session data
*/
struct _Sec1Payload
{
ProtobufCMessage base;
/*
*!< Type of message
*/
Sec1MsgType msg;
Sec1Payload__PayloadCase payload_case;
union {
/*
*!< Payload data interpreted as Cmd0
*/
SessionCmd0 *sc0;
/*
*!< Payload data interpreted as Resp0
*/
SessionResp0 *sr0;
/*
*!< Payload data interpreted as Cmd1
*/
SessionCmd1 *sc1;
/*
*!< Payload data interpreted as Resp1
*/
SessionResp1 *sr1;
};
};
#define SEC1_PAYLOAD__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&sec1_payload__descriptor) \
, SEC1_MSG_TYPE__Session_Command0, SEC1_PAYLOAD__PAYLOAD__NOT_SET, {0} }
/* SessionCmd1 methods */
void session_cmd1__init
(SessionCmd1 *message);
size_t session_cmd1__get_packed_size
(const SessionCmd1 *message);
size_t session_cmd1__pack
(const SessionCmd1 *message,
uint8_t *out);
size_t session_cmd1__pack_to_buffer
(const SessionCmd1 *message,
ProtobufCBuffer *buffer);
SessionCmd1 *
session_cmd1__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void session_cmd1__free_unpacked
(SessionCmd1 *message,
ProtobufCAllocator *allocator);
/* SessionResp1 methods */
void session_resp1__init
(SessionResp1 *message);
size_t session_resp1__get_packed_size
(const SessionResp1 *message);
size_t session_resp1__pack
(const SessionResp1 *message,
uint8_t *out);
size_t session_resp1__pack_to_buffer
(const SessionResp1 *message,
ProtobufCBuffer *buffer);
SessionResp1 *
session_resp1__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void session_resp1__free_unpacked
(SessionResp1 *message,
ProtobufCAllocator *allocator);
/* SessionCmd0 methods */
void session_cmd0__init
(SessionCmd0 *message);
size_t session_cmd0__get_packed_size
(const SessionCmd0 *message);
size_t session_cmd0__pack
(const SessionCmd0 *message,
uint8_t *out);
size_t session_cmd0__pack_to_buffer
(const SessionCmd0 *message,
ProtobufCBuffer *buffer);
SessionCmd0 *
session_cmd0__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void session_cmd0__free_unpacked
(SessionCmd0 *message,
ProtobufCAllocator *allocator);
/* SessionResp0 methods */
void session_resp0__init
(SessionResp0 *message);
size_t session_resp0__get_packed_size
(const SessionResp0 *message);
size_t session_resp0__pack
(const SessionResp0 *message,
uint8_t *out);
size_t session_resp0__pack_to_buffer
(const SessionResp0 *message,
ProtobufCBuffer *buffer);
SessionResp0 *
session_resp0__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void session_resp0__free_unpacked
(SessionResp0 *message,
ProtobufCAllocator *allocator);
/* Sec1Payload methods */
void sec1_payload__init
(Sec1Payload *message);
size_t sec1_payload__get_packed_size
(const Sec1Payload *message);
size_t sec1_payload__pack
(const Sec1Payload *message,
uint8_t *out);
size_t sec1_payload__pack_to_buffer
(const Sec1Payload *message,
ProtobufCBuffer *buffer);
Sec1Payload *
sec1_payload__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void sec1_payload__free_unpacked
(Sec1Payload *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*SessionCmd1_Closure)
(const SessionCmd1 *message,
void *closure_data);
typedef void (*SessionResp1_Closure)
(const SessionResp1 *message,
void *closure_data);
typedef void (*SessionCmd0_Closure)
(const SessionCmd0 *message,
void *closure_data);
typedef void (*SessionResp0_Closure)
(const SessionResp0 *message,
void *closure_data);
typedef void (*Sec1Payload_Closure)
(const Sec1Payload *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCEnumDescriptor sec1_msg_type__descriptor;
extern const ProtobufCMessageDescriptor session_cmd1__descriptor;
extern const ProtobufCMessageDescriptor session_resp1__descriptor;
extern const ProtobufCMessageDescriptor session_cmd0__descriptor;
extern const ProtobufCMessageDescriptor session_resp0__descriptor;
extern const ProtobufCMessageDescriptor sec1_payload__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_sec1_2eproto__INCLUDED */

View File

@ -0,0 +1,147 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: session.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "session.pb-c.h"
void session_data__init
(SessionData *message)
{
static const SessionData init_value = SESSION_DATA__INIT;
*message = init_value;
}
size_t session_data__get_packed_size
(const SessionData *message)
{
assert(message->base.descriptor == &session_data__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t session_data__pack
(const SessionData *message,
uint8_t *out)
{
assert(message->base.descriptor == &session_data__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t session_data__pack_to_buffer
(const SessionData *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &session_data__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
SessionData *
session_data__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (SessionData *)
protobuf_c_message_unpack (&session_data__descriptor,
allocator, len, data);
}
void session_data__free_unpacked
(SessionData *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &session_data__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor session_data__field_descriptors[3] =
{
{
"sec_ver",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(SessionData, sec_ver),
&sec_scheme_version__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sec0",
10,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(SessionData, proto_case),
offsetof(SessionData, sec0),
&sec0_payload__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sec1",
11,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(SessionData, proto_case),
offsetof(SessionData, sec1),
&sec1_payload__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned session_data__field_indices_by_name[] = {
1, /* field[1] = sec0 */
2, /* field[2] = sec1 */
0, /* field[0] = sec_ver */
};
static const ProtobufCIntRange session_data__number_ranges[2 + 1] =
{
{ 2, 0 },
{ 10, 1 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor session_data__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"SessionData",
"SessionData",
"SessionData",
"",
sizeof(SessionData),
3,
session_data__field_descriptors,
session_data__field_indices_by_name,
2, session_data__number_ranges,
(ProtobufCMessageInit) session_data__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCEnumValue sec_scheme_version__enum_values_by_number[2] =
{
{ "SecScheme0", "SEC_SCHEME_VERSION__SecScheme0", 0 },
{ "SecScheme1", "SEC_SCHEME_VERSION__SecScheme1", 1 },
};
static const ProtobufCIntRange sec_scheme_version__value_ranges[] = {
{0, 0},{0, 2}
};
static const ProtobufCEnumValueIndex sec_scheme_version__enum_values_by_name[2] =
{
{ "SecScheme0", 0 },
{ "SecScheme1", 1 },
};
const ProtobufCEnumDescriptor sec_scheme_version__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"SecSchemeVersion",
"SecSchemeVersion",
"SecSchemeVersion",
"",
2,
sec_scheme_version__enum_values_by_number,
2,
sec_scheme_version__enum_values_by_name,
1,
sec_scheme_version__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};

View File

@ -0,0 +1,114 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: session.proto */
#ifndef PROTOBUF_C_session_2eproto__INCLUDED
#define PROTOBUF_C_session_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
# 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.
#endif
#include "sec0.pb-c.h"
#include "sec1.pb-c.h"
typedef struct _SessionData SessionData;
/* --- enums --- */
/*
* Allowed values for the type of security
* being used in a protocomm session
*/
typedef enum _SecSchemeVersion {
/*
*!< Unsecured - plaintext communication
*/
SEC_SCHEME_VERSION__SecScheme0 = 0,
/*
*!< Security scheme 1 - Curve25519 + AES-256-CTR
*/
SEC_SCHEME_VERSION__SecScheme1 = 1
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SEC_SCHEME_VERSION)
} SecSchemeVersion;
/* --- messages --- */
typedef enum {
SESSION_DATA__PROTO__NOT_SET = 0,
SESSION_DATA__PROTO_SEC0 = 10,
SESSION_DATA__PROTO_SEC1 = 11
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SESSION_DATA__PROTO)
} SessionData__ProtoCase;
/*
* Data structure exchanged when establishing
* secure session between Host and Client
*/
struct _SessionData
{
ProtobufCMessage base;
/*
*!< Type of security
*/
SecSchemeVersion sec_ver;
SessionData__ProtoCase proto_case;
union {
/*
*!< Payload data in case of security 0
*/
Sec0Payload *sec0;
/*
*!< Payload data in case of security 1
*/
Sec1Payload *sec1;
};
};
#define SESSION_DATA__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&session_data__descriptor) \
, SEC_SCHEME_VERSION__SecScheme0, SESSION_DATA__PROTO__NOT_SET, {0} }
/* SessionData methods */
void session_data__init
(SessionData *message);
size_t session_data__get_packed_size
(const SessionData *message);
size_t session_data__pack
(const SessionData *message,
uint8_t *out);
size_t session_data__pack_to_buffer
(const SessionData *message,
ProtobufCBuffer *buffer);
SessionData *
session_data__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void session_data__free_unpacked
(SessionData *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*SessionData_Closure)
(const SessionData *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCEnumDescriptor sec_scheme_version__descriptor;
extern const ProtobufCMessageDescriptor session_data__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_session_2eproto__INCLUDED */