/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.6-dev */
#ifndef PB_CASTMESSAGE_PB_H_INCLUDED
#define PB_CASTMESSAGE_PB_H_INCLUDED
#include <pb.h>
#if PB_PROTO_HEADER_VERSION != 40
#error Regenerate this file with the current version of nanopb generator.
#endif
/* Enum definitions */
typedef enum _CastMessage_ProtocolVersion {
CastMessage_ProtocolVersion_CASTV2_1_0 = 0
} CastMessage_ProtocolVersion;
typedef enum _CastMessage_PayloadType {
CastMessage_PayloadType_STRING = 0,
CastMessage_PayloadType_BINARY = 1
} CastMessage_PayloadType;
typedef enum _AuthError_ErrorType {
AuthError_ErrorType_INTERNAL_ERROR = 0,
AuthError_ErrorType_NO_TLS = 1
} AuthError_ErrorType;
/* Struct definitions */
/* Messages for authentication protocol between a sender and a receiver. */
typedef struct _AuthChallenge {
char dummy_field;
} AuthChallenge;
typedef struct _AuthResponse {
pb_callback_t signature;
pb_callback_t client_auth_certificate;
pb_callback_t client_ca;
} AuthResponse;
typedef struct _AuthError {
AuthError_ErrorType error_type;
} AuthError;
typedef struct _CastMessage {
CastMessage_ProtocolVersion protocol_version;
/* source and destination ids identify the origin and destination of the
message. They are used to route messages between endpoints that share a
device-to-device channel.
For messages between applications:
- The sender application id is a unique identifier generated on behalf of
the sender application.
- The receiver id is always the the session id for the application.
For messages to or from the sender or receiver platform, the special ids
'sender-0' and 'receiver-0' can be used.
For messages intended for all endpoints using a given channel, the
wildcard destination_id '*' can be used. */
char source_id[128];
char destination_id[128];
/* This is the core multiplexing key. All messages are sent on a namespace
and endpoints sharing a channel listen on one or more namespaces. The
namespace defines the protocol and semantics of the message. */
char namespace[128];
CastMessage_PayloadType payload_type;
/* Depending on payload_type, exactly one of the following optional fields
will always be set. */
bool has_payload_utf8;
char payload_utf8[2048];
pb_callback_t payload_binary;
} CastMessage;
typedef struct _DeviceAuthMessage {
/* Request fields */
bool has_challenge;
AuthChallenge challenge;
/* Response fields */
bool has_response;
AuthResponse response;
bool has_error;
AuthError error;
} DeviceAuthMessage;
/* Helper constants for enums */
#define _CastMessage_ProtocolVersion_MIN CastMessage_ProtocolVersion_CASTV2_1_0
#define _CastMessage_ProtocolVersion_MAX CastMessage_ProtocolVersion_CASTV2_1_0
#define _CastMessage_ProtocolVersion_ARRAYSIZE ((CastMessage_ProtocolVersion)(CastMessage_ProtocolVersion_CASTV2_1_0+1))
#define _CastMessage_PayloadType_MIN CastMessage_PayloadType_STRING
#define _CastMessage_PayloadType_MAX CastMessage_PayloadType_BINARY
#define _CastMessage_PayloadType_ARRAYSIZE ((CastMessage_PayloadType)(CastMessage_PayloadType_BINARY+1))
#define _AuthError_ErrorType_MIN AuthError_ErrorType_INTERNAL_ERROR
#define _AuthError_ErrorType_MAX AuthError_ErrorType_NO_TLS
#define _AuthError_ErrorType_ARRAYSIZE ((AuthError_ErrorType)(AuthError_ErrorType_NO_TLS+1))
#ifdef __cplusplus
extern "C" {
#endif
/* Initializer values for message structs */
#define CastMessage_init_default {CastMessage_ProtocolVersion_CASTV2_1_0, "sender-0", "receiver-0", "", CastMessage_PayloadType_STRING, false, "", {{NULL}, NULL}}
#define AuthChallenge_init_default {0}
#define AuthResponse_init_default {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
#define AuthError_init_default {_AuthError_ErrorType_MIN}
#define DeviceAuthMessage_init_default {false, AuthChallenge_init_default, false, AuthResponse_init_default, false, AuthError_init_default}
#define CastMessage_init_zero {_CastMessage_ProtocolVersion_MIN, "", "", "", _CastMessage_PayloadType_MIN, false, "", {{NULL}, NULL}}
#define AuthChallenge_init_zero {0}
#define AuthResponse_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
#define AuthError_init_zero {_AuthError_ErrorType_MIN}
#define DeviceAuthMessage_init_zero {false, AuthChallenge_init_zero, false, AuthResponse_init_zero, false, AuthError_init_zero}
/* Field tags (for use in manual encoding/decoding) */
#define AuthResponse_signature_tag 1
#define AuthResponse_client_auth_certificate_tag 2
#define AuthResponse_client_ca_tag 3
#define AuthError_error_type_tag 1
#define CastMessage_protocol_version_tag 1
#define CastMessage_source_id_tag 2
#define CastMessage_destination_id_tag 3
#define CastMessage_namespace_tag 4
#define CastMessage_payload_type_tag 5
#define CastMessage_payload_utf8_tag 6
#define CastMessage_payload_binary_tag 7
#define DeviceAuthMessage_challenge_tag 1
#define DeviceAuthMessage_response_tag 2
#define DeviceAuthMessage_error_tag 3
/* Struct field encoding specification for nanopb */
#define CastMessage_FIELDLIST(X, a) \
X(a, STATIC, REQUIRED, UENUM, protocol_version, 1) \
X(a, STATIC, REQUIRED, STRING, source_id, 2) \
X(a, STATIC, REQUIRED, STRING, destination_id, 3) \
X(a, STATIC, REQUIRED, STRING, namespace, 4) \
X(a, STATIC, REQUIRED, UENUM, payload_type, 5) \
X(a, STATIC, OPTIONAL, STRING, payload_utf8, 6) \
X(a, CALLBACK, OPTIONAL, BYTES, payload_binary, 7)
#define CastMessage_CALLBACK pb_default_field_callback
#define CastMessage_DEFAULT (const pb_byte_t*)"\x12\x08\x73\x65\x6e\x64\x65\x72\x2d\x30\x1a\x0a\x72\x65\x63\x65\x69\x76\x65\x72\x2d\x30\x00"
#define AuthChallenge_FIELDLIST(X, a) \
#define AuthChallenge_CALLBACK NULL
#define AuthChallenge_DEFAULT NULL
#define AuthResponse_FIELDLIST(X, a) \
X(a, CALLBACK, REQUIRED, BYTES, signature, 1) \
X(a, CALLBACK, REQUIRED, BYTES, client_auth_certificate, 2) \
X(a, CALLBACK, REPEATED, BYTES, client_ca, 3)
#define AuthResponse_CALLBACK pb_default_field_callback
#define AuthResponse_DEFAULT NULL
#define AuthError_FIELDLIST(X, a) \
X(a, STATIC, REQUIRED, UENUM, error_type, 1)
#define AuthError_CALLBACK NULL
#define AuthError_DEFAULT NULL
#define DeviceAuthMessage_FIELDLIST(X, a) \
X(a, STATIC, OPTIONAL, MESSAGE, challenge, 1) \
X(a, STATIC, OPTIONAL, MESSAGE, response, 2) \
X(a, STATIC, OPTIONAL, MESSAGE, error, 3)
#define DeviceAuthMessage_CALLBACK NULL
#define DeviceAuthMessage_DEFAULT NULL
#define DeviceAuthMessage_challenge_MSGTYPE AuthChallenge
#define DeviceAuthMessage_response_MSGTYPE AuthResponse
#define DeviceAuthMessage_error_MSGTYPE AuthError
extern const pb_msgdesc_t CastMessage_msg;
extern const pb_msgdesc_t AuthChallenge_msg;
extern const pb_msgdesc_t AuthResponse_msg;
extern const pb_msgdesc_t AuthError_msg;
extern const pb_msgdesc_t DeviceAuthMessage_msg;
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define CastMessage_fields &CastMessage_msg
#define AuthChallenge_fields &AuthChallenge_msg
#define AuthResponse_fields &AuthResponse_msg
#define AuthError_fields &AuthError_msg
#define DeviceAuthMessage_fields &DeviceAuthMessage_msg
/* Maximum encoded size of messages (where known) */
/* CastMessage_size depends on runtime parameters */
/* AuthResponse_size depends on runtime parameters */
/* DeviceAuthMessage_size depends on runtime parameters */
#define AuthChallenge_size 0
#define AuthError_size 2
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif