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

/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif

#include "peer/peer.pb-c.h"
void   protos__peer_id__init
                     (Protos__PeerID         *message)
{
  static Protos__PeerID init_value = PROTOS__PEER_ID__INIT;
  *message = init_value;
}
size_t protos__peer_id__get_packed_size
                     (const Protos__PeerID *message)
{
  assert(message->base.descriptor == &protos__peer_id__descriptor);
  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t protos__peer_id__pack
                     (const Protos__PeerID *message,
                      uint8_t       *out)
{
  assert(message->base.descriptor == &protos__peer_id__descriptor);
  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t protos__peer_id__pack_to_buffer
                     (const Protos__PeerID *message,
                      ProtobufCBuffer *buffer)
{
  assert(message->base.descriptor == &protos__peer_id__descriptor);
  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Protos__PeerID *
       protos__peer_id__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data)
{
  return (Protos__PeerID *)
     protobuf_c_message_unpack (&protos__peer_id__descriptor,
                                allocator, len, data);
}
void   protos__peer_id__free_unpacked
                     (Protos__PeerID *message,
                      ProtobufCAllocator *allocator)
{
  assert(message->base.descriptor == &protos__peer_id__descriptor);
  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void   protos__peer_endpoint__init
                     (Protos__PeerEndpoint         *message)
{
  static Protos__PeerEndpoint init_value = PROTOS__PEER_ENDPOINT__INIT;
  *message = init_value;
}
size_t protos__peer_endpoint__get_packed_size
                     (const Protos__PeerEndpoint *message)
{
  assert(message->base.descriptor == &protos__peer_endpoint__descriptor);
  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t protos__peer_endpoint__pack
                     (const Protos__PeerEndpoint *message,
                      uint8_t       *out)
{
  assert(message->base.descriptor == &protos__peer_endpoint__descriptor);
  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t protos__peer_endpoint__pack_to_buffer
                     (const Protos__PeerEndpoint *message,
                      ProtobufCBuffer *buffer)
{
  assert(message->base.descriptor == &protos__peer_endpoint__descriptor);
  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Protos__PeerEndpoint *
       protos__peer_endpoint__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data)
{
  return (Protos__PeerEndpoint *)
     protobuf_c_message_unpack (&protos__peer_endpoint__descriptor,
                                allocator, len, data);
}
void   protos__peer_endpoint__free_unpacked
                     (Protos__PeerEndpoint *message,
                      ProtobufCAllocator *allocator)
{
  assert(message->base.descriptor == &protos__peer_endpoint__descriptor);
  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor protos__peer_id__field_descriptors[1] =
{
  {
    "name",
    1,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_STRING,
    0,   /* quantifier_offset */
    offsetof(Protos__PeerID, name),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
};
static const unsigned protos__peer_id__field_indices_by_name[] = {
  0,   /* field[0] = name */
};
static const ProtobufCIntRange protos__peer_id__number_ranges[1 + 1] =
{
  { 1, 0 },
  { 0, 1 }
};
const ProtobufCMessageDescriptor protos__peer_id__descriptor =
{
  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
  "protos.PeerID",
  "PeerID",
  "Protos__PeerID",
  "protos",
  sizeof(Protos__PeerID),
  1,
  protos__peer_id__field_descriptors,
  protos__peer_id__field_indices_by_name,
  1,  protos__peer_id__number_ranges,
  (ProtobufCMessageInit) protos__peer_id__init,
  NULL,NULL,NULL    /* reserved[123] */
};
static const ProtobufCFieldDescriptor protos__peer_endpoint__field_descriptors[2] =
{
  {
    "id",
    1,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_MESSAGE,
    0,   /* quantifier_offset */
    offsetof(Protos__PeerEndpoint, id),
    &protos__peer_id__descriptor,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "address",
    2,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_STRING,
    0,   /* quantifier_offset */
    offsetof(Protos__PeerEndpoint, address),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
};
static const unsigned protos__peer_endpoint__field_indices_by_name[] = {
  1,   /* field[1] = address */
  0,   /* field[0] = id */
};
static const ProtobufCIntRange protos__peer_endpoint__number_ranges[1 + 1] =
{
  { 1, 0 },
  { 0, 2 }
};
const ProtobufCMessageDescriptor protos__peer_endpoint__descriptor =
{
  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
  "protos.PeerEndpoint",
  "PeerEndpoint",
  "Protos__PeerEndpoint",
  "protos",
  sizeof(Protos__PeerEndpoint),
  2,
  protos__peer_endpoint__field_descriptors,
  protos__peer_endpoint__field_indices_by_name,
  1,  protos__peer_endpoint__number_ranges,
  (ProtobufCMessageInit) protos__peer_endpoint__init,
  NULL,NULL,NULL    /* reserved[123] */
};
static const ProtobufCMethodDescriptor protos__endorser__method_descriptors[1] =
{
  { "ProcessProposal", &protos__signed_proposal__descriptor, &protos__proposal_response__descriptor },
};
const unsigned protos__endorser__method_indices_by_name[] = {
  0         /* ProcessProposal */
};
const ProtobufCServiceDescriptor protos__endorser__descriptor =
{
  PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC,
  "protos.Endorser",
  "Endorser",
  "Protos__Endorser",
  "protos",
  1,
  protos__endorser__method_descriptors,
  protos__endorser__method_indices_by_name
};
void protos__endorser__process_proposal(ProtobufCService *service,
                                        const Protos__SignedProposal *input,
                                        Protos__ProposalResponse_Closure closure,
                                        void *closure_data)
{
  assert(service->descriptor == &protos__endorser__descriptor);
  service->invoke(service, 0, (const ProtobufCMessage *) input, (ProtobufCClosure) closure, closure_data);
}
void protos__endorser__init (Protos__Endorser_Service *service,
                             Protos__Endorser_ServiceDestroy destroy)
{
  protobuf_c_service_generated_init (&service->base,
                                     &protos__endorser__descriptor,
                                     (ProtobufCServiceDestroy) destroy);
}
