/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: common/message.proto */

#ifndef PROTOBUF_C_common_2fmessage_2eproto__INCLUDED
#define PROTOBUF_C_common_2fmessage_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 1004000 < 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


typedef struct Common__RawMessage Common__RawMessage;
typedef struct Common__RawMessage__Signature Common__RawMessage__Signature;
typedef struct Common__Response Common__Response;


/* --- enums --- */

typedef enum _Common__RawMessage__Type {
  /*
   * server handle message directly, proxy_info is empty
   */
  COMMON__RAW_MESSAGE__TYPE__DIRECT = 0,
  /*
   * server forward message to target server as proxy
   */
  COMMON__RAW_MESSAGE__TYPE__PROXY = 1
    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(COMMON__RAW_MESSAGE__TYPE)
} Common__RawMessage__Type;
typedef enum _Common__Status_hwbcs {
  COMMON__STATUS__HWBCS__UNKNOWN = 0,
  COMMON__STATUS__HWBCS__SUCCESS = 200,
  COMMON__STATUS__HWBCS__HASH = 201,
  COMMON__STATUS__HWBCS__BAD_REQUEST = 400,
  COMMON__STATUS__HWBCS__FORBIDDEN = 403,
  COMMON__STATUS__HWBCS__NOT_FOUND = 404,
  COMMON__STATUS__HWBCS__CONTRACT_NOT_READY = 405,
  COMMON__STATUS__HWBCS__CONTRACT_LAUNCHING = 406,
  COMMON__STATUS__HWBCS__CONTRACT_LAUNCH_ERR = 407,
  COMMON__STATUS__HWBCS__CONTRACT_RUNTIME_ERR = 408,
  COMMON__STATUS__HWBCS__REQUEST_ENTITY_TOO_LARGE = 413,
  COMMON__STATUS__HWBCS__INTERNAL_SERVER_ERROR = 500,
  COMMON__STATUS__HWBCS__NOT_IMPLEMENTED = 501,
  COMMON__STATUS__HWBCS__SERVICE_UNAVAILABLE = 503
     PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(COMMON__STATUS_HWBCS)
} Common__Status_hwbcs;

/* --- messages --- */

struct  Common__RawMessage__Signature
{
  ProtobufCMessage base;
  /*
   * Certificate in crypto.proto
   */
  ProtobufCBinaryData cert;
  ProtobufCBinaryData sign;
};
#define COMMON__RAW_MESSAGE__SIGNATURE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__raw_message__signature__descriptor) \
    , {0,NULL}, {0,NULL} }


struct  Common__RawMessage
{
  ProtobufCMessage base;
  Common__RawMessage__Signature *signature;
  ProtobufCBinaryData payload;
  Common__RawMessage__Type type;
  /*
   * proxy message attachment information,
   * common.EndorseTarget when invoking contract,
   * common.ProposeTarget when sending transcation
   */
  ProtobufCBinaryData proxy_info;
};
#define COMMON__RAW_MESSAGE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__raw_message__descriptor) \
    , NULL, {0,NULL}, COMMON__RAW_MESSAGE__TYPE__DIRECT, {0,NULL} }


struct  Common__Response
{
  ProtobufCMessage base;
  Common__Status_hwbcs status;
  char *status_info;
  ProtobufCBinaryData payload;
};
#define COMMON__RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__response__descriptor) \
    , COMMON__STATUS__HWBCS__UNKNOWN, (char *)protobuf_c_empty_string, {0,NULL} }


/* Common__RawMessage__Signature methods */
void   common__raw_message__signature__init
                     (Common__RawMessage__Signature         *message);
/* Common__RawMessage methods */
void   common__raw_message__init
                     (Common__RawMessage         *message);
size_t common__raw_message__get_packed_size
                     (const Common__RawMessage   *message);
size_t common__raw_message__pack
                     (const Common__RawMessage   *message,
                      uint8_t             *out);
size_t common__raw_message__pack_to_buffer
                     (const Common__RawMessage   *message,
                      ProtobufCBuffer     *buffer);
Common__RawMessage *
       common__raw_message__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__raw_message__free_unpacked
                     (Common__RawMessage *message,
                      ProtobufCAllocator *allocator);
/* Common__Response methods */
void   common__response__init
                     (Common__Response         *message);
size_t common__response__get_packed_size
                     (const Common__Response   *message);
size_t common__response__pack
                     (const Common__Response   *message,
                      uint8_t             *out);
size_t common__response__pack_to_buffer
                     (const Common__Response   *message,
                      ProtobufCBuffer     *buffer);
Common__Response *
       common__response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__response__free_unpacked
                     (Common__Response *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Common__RawMessage__Signature_Closure)
                 (const Common__RawMessage__Signature *message,
                  void *closure_data);
typedef void (*Common__RawMessage_Closure)
                 (const Common__RawMessage *message,
                  void *closure_data);
typedef void (*Common__Response_Closure)
                 (const Common__Response *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCEnumDescriptor    common__status__hwbcs__descriptor;
extern const ProtobufCMessageDescriptor common__raw_message__descriptor;
extern const ProtobufCMessageDescriptor common__raw_message__signature__descriptor;
extern const ProtobufCEnumDescriptor    common__raw_message__type__descriptor;
extern const ProtobufCMessageDescriptor common__response__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_common_2fmessage_2eproto__INCLUDED */
