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

#ifndef PROTOBUF_C_protocol_2eproto__INCLUDED
#define PROTOBUF_C_protocol_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 "github.com/gogo/protobuf/gogoproto/gogo.pb-c.h"

typedef struct _Pb__PubMsg Pb__PubMsg;
typedef struct _Pb__PubAck Pb__PubAck;
typedef struct _Pb__MsgProto Pb__MsgProto;
typedef struct _Pb__Ack Pb__Ack;
typedef struct _Pb__ConnectRequest Pb__ConnectRequest;
typedef struct _Pb__ConnectResponse Pb__ConnectResponse;
typedef struct _Pb__Ping Pb__Ping;
typedef struct _Pb__PingResponse Pb__PingResponse;
typedef struct _Pb__SubscriptionRequest Pb__SubscriptionRequest;
typedef struct _Pb__SubscriptionResponse Pb__SubscriptionResponse;
typedef struct _Pb__UnsubscribeRequest Pb__UnsubscribeRequest;
typedef struct _Pb__CloseRequest Pb__CloseRequest;
typedef struct _Pb__CloseResponse Pb__CloseResponse;


/* --- enums --- */

/*
 * Enum for start position type.
 */
typedef enum _Pb__StartPosition {
  PB__START_POSITION__NewOnly = 0,
  PB__START_POSITION__LastReceived = 1,
  PB__START_POSITION__TimeDeltaStart = 2,
  PB__START_POSITION__SequenceStart = 3,
  PB__START_POSITION__First = 4
    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(PB__START_POSITION)
} Pb__StartPosition;

/* --- messages --- */

/*
 * How messages are delivered to the STAN cluster
 */
struct  _Pb__PubMsg
{
  ProtobufCMessage base;
  /*
   * ClientID
   */
  char *clientid;
  /*
   * guid
   */
  char *guid;
  /*
   * subject
   */
  char *subject;
  /*
   * optional reply
   */
  char *reply;
  /*
   * payload
   */
  ProtobufCBinaryData data;
  /*
   * Connection ID. For servers that know about this field, clientID can be omitted
   */
  ProtobufCBinaryData connid;
  /*
   * optional sha256 of data
   */
  ProtobufCBinaryData sha256;
};
#define PB__PUB_MSG__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__pub_msg__descriptor) \
    , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, {0,NULL}, {0,NULL}, {0,NULL} }


/*
 * Used to ACK to publishers
 */
struct  _Pb__PubAck
{
  ProtobufCMessage base;
  /*
   * guid
   */
  char *guid;
  /*
   * err string, empty/omitted if no error
   */
  char *error;
};
#define PB__PUB_ACK__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__pub_ack__descriptor) \
    , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }


/*
 * Msg struct. Sequence is assigned for global ordering by
 * the cluster after the publisher has been acknowledged.
 */
struct  _Pb__MsgProto
{
  ProtobufCMessage base;
  /*
   * globally ordered sequence number for the subject's channel
   */
  uint64_t sequence;
  /*
   * subject
   */
  char *subject;
  /*
   * optional reply
   */
  char *reply;
  /*
   * payload
   */
  ProtobufCBinaryData data;
  /*
   * received timestamp
   */
  int64_t timestamp;
  /*
   * Flag specifying if the message is being redelivered
   */
  protobuf_c_boolean redelivered;
  /*
   * optional IEEE CRC32
   */
  uint32_t crc32;
};
#define PB__MSG_PROTO__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__msg_proto__descriptor) \
    , 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, {0,NULL}, 0, 0, 0 }


/*
 * Ack will deliver an ack for a delivered msg.
 */
struct  _Pb__Ack
{
  ProtobufCMessage base;
  /*
   * Subject
   */
  char *subject;
  /*
   * Sequence to acknowledge
   */
  uint64_t sequence;
};
#define PB__ACK__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__ack__descriptor) \
    , (char *)protobuf_c_empty_string, 0 }


/*
 * Connection Request
 */
struct  _Pb__ConnectRequest
{
  ProtobufCMessage base;
  /*
   * Client name/identifier.
   */
  char *clientid;
  /*
   * Inbox for server initiated heartbeats.
   */
  char *heartbeatinbox;
  /*
   * Protocol the client is at.
   */
  int32_t protocol;
  /*
   * Connection ID, a way to uniquely identify a connection (no connection should ever have the same)
   */
  ProtobufCBinaryData connid;
  /*
   * Interval at which client wishes to send PINGs (expressed in seconds).
   */
  int32_t pinginterval;
  /*
   * Maximum number of PINGs without a response after which the connection can be considered lost.
   */
  int32_t pingmaxout;
};
#define PB__CONNECT_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__connect_request__descriptor) \
    , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, {0,NULL}, 0, 0 }


/*
 * Response to a client connect
 */
struct  _Pb__ConnectResponse
{
  ProtobufCMessage base;
  /*
   * Prefix to use when publishing to this STAN cluster
   */
  char *pubprefix;
  /*
   * Subject to use for subscription requests
   */
  char *subrequests;
  /*
   * Subject to use for unsubscribe requests
   */
  char *unsubrequests;
  /*
   * Subject for closing the stan connection
   */
  char *closerequests;
  /*
   * err string, empty/omitted if no error
   */
  char *error;
  /*
   * Subject to use for subscription close requests
   */
  char *subcloserequests;
  /*
   * Subject to use for PING requests
   */
  char *pingrequests;
  /*
   * Interval at which client should send PINGs (expressed in seconds).
   */
  int32_t pinginterval;
  /*
   * Maximum number of PINGs without a response after which the connection can be considered lost
   */
  int32_t pingmaxout;
  /*
   * Protocol version the server is at
   */
  int32_t protocol;
  /*
   * Possibly used to sign acks, etc.
   */
  char *publickey;
};
#define PB__CONNECT_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__connect_response__descriptor) \
    , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, 0, 0, (char *)protobuf_c_empty_string }


/*
 * PING from client to server
 */
struct  _Pb__Ping
{
  ProtobufCMessage base;
  /*
   * Connection ID
   */
  ProtobufCBinaryData connid;
};
#define PB__PING__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__ping__descriptor) \
    , {0,NULL} }


/*
 * PING response from the server
 */
struct  _Pb__PingResponse
{
  ProtobufCMessage base;
  /*
   * Error string, empty/omitted if no error
   */
  char *error;
};
#define PB__PING_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__ping_response__descriptor) \
    , (char *)protobuf_c_empty_string }


/*
 * Protocol for a client to subscribe
 */
struct  _Pb__SubscriptionRequest
{
  ProtobufCMessage base;
  /*
   * ClientID
   */
  char *clientid;
  /*
   * Formal subject to subscribe to, e.g. foo.bar
   */
  char *subject;
  /*
   * Optional queue group
   */
  char *qgroup;
  /*
   * Inbox subject to deliver messages on
   */
  char *inbox;
  /*
   * Maximum inflight messages without an ack allowed
   */
  int32_t maxinflight;
  /*
   * Timeout for receiving an ack from the client
   */
  int32_t ackwaitinsecs;
  /*
   * Optional durable name which survives client restarts
   */
  char *durablename;
  /*
   * Start position
   */
  Pb__StartPosition startposition;
  /*
   * Optional start sequence number
   */
  uint64_t startsequence;
  /*
   * Optional start time
   */
  int64_t starttimedelta;
};
#define PB__SUBSCRIPTION_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__subscription_request__descriptor) \
    , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, 0, (char *)protobuf_c_empty_string, PB__START_POSITION__NewOnly, 0, 0 }


/*
 * Response for SubscriptionRequest and UnsubscribeRequests
 */
struct  _Pb__SubscriptionResponse
{
  ProtobufCMessage base;
  /*
   * ackInbox for sending acks
   */
  char *ackinbox;
  /*
   * err string, empty/omitted if no error
   */
  char *error;
};
#define PB__SUBSCRIPTION_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__subscription_response__descriptor) \
    , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }


/*
 * Protocol for a clients to unsubscribe. Will return a SubscriptionResponse
 */
struct  _Pb__UnsubscribeRequest
{
  ProtobufCMessage base;
  /*
   * ClientID
   */
  char *clientid;
  /*
   * subject for the subscription
   */
  char *subject;
  /*
   * Inbox subject to identify subscription
   */
  char *inbox;
  /*
   * Optional durable name which survives client restarts
   */
  char *durablename;
};
#define PB__UNSUBSCRIBE_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__unsubscribe_request__descriptor) \
    , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }


/*
 * Protocol for a client to close a connection
 */
struct  _Pb__CloseRequest
{
  ProtobufCMessage base;
  /*
   * Client name provided to Connect() requests
   */
  char *clientid;
};
#define PB__CLOSE_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__close_request__descriptor) \
    , (char *)protobuf_c_empty_string }


/*
 * Response for CloseRequest
 */
struct  _Pb__CloseResponse
{
  ProtobufCMessage base;
  /*
   * err string, empty/omitted if no error
   */
  char *error;
};
#define PB__CLOSE_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&pb__close_response__descriptor) \
    , (char *)protobuf_c_empty_string }


/* Pb__PubMsg methods */
void   pb__pub_msg__init
                     (Pb__PubMsg         *message);
size_t pb__pub_msg__get_packed_size
                     (const Pb__PubMsg   *message);
size_t pb__pub_msg__pack
                     (const Pb__PubMsg   *message,
                      uint8_t             *out);
size_t pb__pub_msg__pack_to_buffer
                     (const Pb__PubMsg   *message,
                      ProtobufCBuffer     *buffer);
Pb__PubMsg *
       pb__pub_msg__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__pub_msg__free_unpacked
                     (Pb__PubMsg *message,
                      ProtobufCAllocator *allocator);
/* Pb__PubAck methods */
void   pb__pub_ack__init
                     (Pb__PubAck         *message);
size_t pb__pub_ack__get_packed_size
                     (const Pb__PubAck   *message);
size_t pb__pub_ack__pack
                     (const Pb__PubAck   *message,
                      uint8_t             *out);
size_t pb__pub_ack__pack_to_buffer
                     (const Pb__PubAck   *message,
                      ProtobufCBuffer     *buffer);
Pb__PubAck *
       pb__pub_ack__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__pub_ack__free_unpacked
                     (Pb__PubAck *message,
                      ProtobufCAllocator *allocator);
/* Pb__MsgProto methods */
void   pb__msg_proto__init
                     (Pb__MsgProto         *message);
size_t pb__msg_proto__get_packed_size
                     (const Pb__MsgProto   *message);
size_t pb__msg_proto__pack
                     (const Pb__MsgProto   *message,
                      uint8_t             *out);
size_t pb__msg_proto__pack_to_buffer
                     (const Pb__MsgProto   *message,
                      ProtobufCBuffer     *buffer);
Pb__MsgProto *
       pb__msg_proto__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__msg_proto__free_unpacked
                     (Pb__MsgProto *message,
                      ProtobufCAllocator *allocator);
/* Pb__Ack methods */
void   pb__ack__init
                     (Pb__Ack         *message);
size_t pb__ack__get_packed_size
                     (const Pb__Ack   *message);
size_t pb__ack__pack
                     (const Pb__Ack   *message,
                      uint8_t             *out);
size_t pb__ack__pack_to_buffer
                     (const Pb__Ack   *message,
                      ProtobufCBuffer     *buffer);
Pb__Ack *
       pb__ack__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__ack__free_unpacked
                     (Pb__Ack *message,
                      ProtobufCAllocator *allocator);
/* Pb__ConnectRequest methods */
void   pb__connect_request__init
                     (Pb__ConnectRequest         *message);
size_t pb__connect_request__get_packed_size
                     (const Pb__ConnectRequest   *message);
size_t pb__connect_request__pack
                     (const Pb__ConnectRequest   *message,
                      uint8_t             *out);
size_t pb__connect_request__pack_to_buffer
                     (const Pb__ConnectRequest   *message,
                      ProtobufCBuffer     *buffer);
Pb__ConnectRequest *
       pb__connect_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__connect_request__free_unpacked
                     (Pb__ConnectRequest *message,
                      ProtobufCAllocator *allocator);
/* Pb__ConnectResponse methods */
void   pb__connect_response__init
                     (Pb__ConnectResponse         *message);
size_t pb__connect_response__get_packed_size
                     (const Pb__ConnectResponse   *message);
size_t pb__connect_response__pack
                     (const Pb__ConnectResponse   *message,
                      uint8_t             *out);
size_t pb__connect_response__pack_to_buffer
                     (const Pb__ConnectResponse   *message,
                      ProtobufCBuffer     *buffer);
Pb__ConnectResponse *
       pb__connect_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__connect_response__free_unpacked
                     (Pb__ConnectResponse *message,
                      ProtobufCAllocator *allocator);
/* Pb__Ping methods */
void   pb__ping__init
                     (Pb__Ping         *message);
size_t pb__ping__get_packed_size
                     (const Pb__Ping   *message);
size_t pb__ping__pack
                     (const Pb__Ping   *message,
                      uint8_t             *out);
size_t pb__ping__pack_to_buffer
                     (const Pb__Ping   *message,
                      ProtobufCBuffer     *buffer);
Pb__Ping *
       pb__ping__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__ping__free_unpacked
                     (Pb__Ping *message,
                      ProtobufCAllocator *allocator);
/* Pb__PingResponse methods */
void   pb__ping_response__init
                     (Pb__PingResponse         *message);
size_t pb__ping_response__get_packed_size
                     (const Pb__PingResponse   *message);
size_t pb__ping_response__pack
                     (const Pb__PingResponse   *message,
                      uint8_t             *out);
size_t pb__ping_response__pack_to_buffer
                     (const Pb__PingResponse   *message,
                      ProtobufCBuffer     *buffer);
Pb__PingResponse *
       pb__ping_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__ping_response__free_unpacked
                     (Pb__PingResponse *message,
                      ProtobufCAllocator *allocator);
/* Pb__SubscriptionRequest methods */
void   pb__subscription_request__init
                     (Pb__SubscriptionRequest         *message);
size_t pb__subscription_request__get_packed_size
                     (const Pb__SubscriptionRequest   *message);
size_t pb__subscription_request__pack
                     (const Pb__SubscriptionRequest   *message,
                      uint8_t             *out);
size_t pb__subscription_request__pack_to_buffer
                     (const Pb__SubscriptionRequest   *message,
                      ProtobufCBuffer     *buffer);
Pb__SubscriptionRequest *
       pb__subscription_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__subscription_request__free_unpacked
                     (Pb__SubscriptionRequest *message,
                      ProtobufCAllocator *allocator);
/* Pb__SubscriptionResponse methods */
void   pb__subscription_response__init
                     (Pb__SubscriptionResponse         *message);
size_t pb__subscription_response__get_packed_size
                     (const Pb__SubscriptionResponse   *message);
size_t pb__subscription_response__pack
                     (const Pb__SubscriptionResponse   *message,
                      uint8_t             *out);
size_t pb__subscription_response__pack_to_buffer
                     (const Pb__SubscriptionResponse   *message,
                      ProtobufCBuffer     *buffer);
Pb__SubscriptionResponse *
       pb__subscription_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__subscription_response__free_unpacked
                     (Pb__SubscriptionResponse *message,
                      ProtobufCAllocator *allocator);
/* Pb__UnsubscribeRequest methods */
void   pb__unsubscribe_request__init
                     (Pb__UnsubscribeRequest         *message);
size_t pb__unsubscribe_request__get_packed_size
                     (const Pb__UnsubscribeRequest   *message);
size_t pb__unsubscribe_request__pack
                     (const Pb__UnsubscribeRequest   *message,
                      uint8_t             *out);
size_t pb__unsubscribe_request__pack_to_buffer
                     (const Pb__UnsubscribeRequest   *message,
                      ProtobufCBuffer     *buffer);
Pb__UnsubscribeRequest *
       pb__unsubscribe_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__unsubscribe_request__free_unpacked
                     (Pb__UnsubscribeRequest *message,
                      ProtobufCAllocator *allocator);
/* Pb__CloseRequest methods */
void   pb__close_request__init
                     (Pb__CloseRequest         *message);
size_t pb__close_request__get_packed_size
                     (const Pb__CloseRequest   *message);
size_t pb__close_request__pack
                     (const Pb__CloseRequest   *message,
                      uint8_t             *out);
size_t pb__close_request__pack_to_buffer
                     (const Pb__CloseRequest   *message,
                      ProtobufCBuffer     *buffer);
Pb__CloseRequest *
       pb__close_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__close_request__free_unpacked
                     (Pb__CloseRequest *message,
                      ProtobufCAllocator *allocator);
/* Pb__CloseResponse methods */
void   pb__close_response__init
                     (Pb__CloseResponse         *message);
size_t pb__close_response__get_packed_size
                     (const Pb__CloseResponse   *message);
size_t pb__close_response__pack
                     (const Pb__CloseResponse   *message,
                      uint8_t             *out);
size_t pb__close_response__pack_to_buffer
                     (const Pb__CloseResponse   *message,
                      ProtobufCBuffer     *buffer);
Pb__CloseResponse *
       pb__close_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   pb__close_response__free_unpacked
                     (Pb__CloseResponse *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Pb__PubMsg_Closure)
                 (const Pb__PubMsg *message,
                  void *closure_data);
typedef void (*Pb__PubAck_Closure)
                 (const Pb__PubAck *message,
                  void *closure_data);
typedef void (*Pb__MsgProto_Closure)
                 (const Pb__MsgProto *message,
                  void *closure_data);
typedef void (*Pb__Ack_Closure)
                 (const Pb__Ack *message,
                  void *closure_data);
typedef void (*Pb__ConnectRequest_Closure)
                 (const Pb__ConnectRequest *message,
                  void *closure_data);
typedef void (*Pb__ConnectResponse_Closure)
                 (const Pb__ConnectResponse *message,
                  void *closure_data);
typedef void (*Pb__Ping_Closure)
                 (const Pb__Ping *message,
                  void *closure_data);
typedef void (*Pb__PingResponse_Closure)
                 (const Pb__PingResponse *message,
                  void *closure_data);
typedef void (*Pb__SubscriptionRequest_Closure)
                 (const Pb__SubscriptionRequest *message,
                  void *closure_data);
typedef void (*Pb__SubscriptionResponse_Closure)
                 (const Pb__SubscriptionResponse *message,
                  void *closure_data);
typedef void (*Pb__UnsubscribeRequest_Closure)
                 (const Pb__UnsubscribeRequest *message,
                  void *closure_data);
typedef void (*Pb__CloseRequest_Closure)
                 (const Pb__CloseRequest *message,
                  void *closure_data);
typedef void (*Pb__CloseResponse_Closure)
                 (const Pb__CloseResponse *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCEnumDescriptor    pb__start_position__descriptor;
extern const ProtobufCMessageDescriptor pb__pub_msg__descriptor;
extern const ProtobufCMessageDescriptor pb__pub_ack__descriptor;
extern const ProtobufCMessageDescriptor pb__msg_proto__descriptor;
extern const ProtobufCMessageDescriptor pb__ack__descriptor;
extern const ProtobufCMessageDescriptor pb__connect_request__descriptor;
extern const ProtobufCMessageDescriptor pb__connect_response__descriptor;
extern const ProtobufCMessageDescriptor pb__ping__descriptor;
extern const ProtobufCMessageDescriptor pb__ping_response__descriptor;
extern const ProtobufCMessageDescriptor pb__subscription_request__descriptor;
extern const ProtobufCMessageDescriptor pb__subscription_response__descriptor;
extern const ProtobufCMessageDescriptor pb__unsubscribe_request__descriptor;
extern const ProtobufCMessageDescriptor pb__close_request__descriptor;
extern const ProtobufCMessageDescriptor pb__close_response__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_protocol_2eproto__INCLUDED */
