diff --git a/native/cpp/CommonCpp/grpc/ClientGetReadReactor.cpp b/native/cpp/CommonCpp/grpc/ClientGetReadReactor.cpp --- a/native/cpp/CommonCpp/grpc/ClientGetReadReactor.cpp +++ b/native/cpp/CommonCpp/grpc/ClientGetReadReactor.cpp @@ -16,7 +16,7 @@ } std::lock_guard guard{this->onReadDoneCallbackMutex}; if (this->onReadDoneCallback) { - this->onReadDoneCallback(this->response.payload()); + this->onReadDoneCallback(this->response.messageresponse().payload()); } StartRead(&(this->response)); } diff --git a/services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.cpp b/services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.cpp --- a/services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.cpp +++ b/services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.cpp @@ -197,8 +197,8 @@ tunnelbroker::GetResponse response; auto respondToWriter = [&writer, &response](std::string fromDeviceID, std::string payload) { - response.set_fromdeviceid(fromDeviceID); - response.set_payload(payload); + response.mutable_messageresponse()->set_fromdeviceid(fromDeviceID); + response.mutable_messageresponse()->set_payload(payload); if (!writer->Write(response)) { throw std::runtime_error( "gRPC: 'Get' writer error on sending data to the client"); diff --git a/shared/protos/_generated/tunnelbroker.pb.h b/shared/protos/_generated/tunnelbroker.pb.h --- a/shared/protos/_generated/tunnelbroker.pb.h +++ b/shared/protos/_generated/tunnelbroker.pb.h @@ -48,7 +48,7 @@ PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[19] + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[20] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; @@ -69,6 +69,9 @@ class GetResponse; struct GetResponseDefaultTypeInternal; extern GetResponseDefaultTypeInternal _GetResponse_default_instance_; +class GetResponseMessage; +struct GetResponseMessageDefaultTypeInternal; +extern GetResponseMessageDefaultTypeInternal _GetResponseMessage_default_instance_; class MessageToClient; struct MessageToClientDefaultTypeInternal; extern MessageToClientDefaultTypeInternal _MessageToClient_default_instance_; @@ -120,6 +123,7 @@ template<> ::tunnelbroker::CheckResponse* Arena::CreateMaybeMessage<::tunnelbroker::CheckResponse>(Arena*); template<> ::tunnelbroker::GetRequest* Arena::CreateMaybeMessage<::tunnelbroker::GetRequest>(Arena*); template<> ::tunnelbroker::GetResponse* Arena::CreateMaybeMessage<::tunnelbroker::GetResponse>(Arena*); +template<> ::tunnelbroker::GetResponseMessage* Arena::CreateMaybeMessage<::tunnelbroker::GetResponseMessage>(Arena*); template<> ::tunnelbroker::MessageToClient* Arena::CreateMaybeMessage<::tunnelbroker::MessageToClient>(Arena*); template<> ::tunnelbroker::MessageToClientStruct* Arena::CreateMaybeMessage<::tunnelbroker::MessageToClientStruct>(Arena*); template<> ::tunnelbroker::MessageToTunnelbroker* Arena::CreateMaybeMessage<::tunnelbroker::MessageToTunnelbroker>(Arena*); @@ -1257,24 +1261,24 @@ }; // ------------------------------------------------------------------- -class GetResponse PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:tunnelbroker.GetResponse) */ { +class GetResponseMessage PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:tunnelbroker.GetResponseMessage) */ { public: - inline GetResponse() : GetResponse(nullptr) {} - virtual ~GetResponse(); - explicit constexpr GetResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GetResponseMessage() : GetResponseMessage(nullptr) {} + virtual ~GetResponseMessage(); + explicit constexpr GetResponseMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - GetResponse(const GetResponse& from); - GetResponse(GetResponse&& from) noexcept - : GetResponse() { + GetResponseMessage(const GetResponseMessage& from); + GetResponseMessage(GetResponseMessage&& from) noexcept + : GetResponseMessage() { *this = ::std::move(from); } - inline GetResponse& operator=(const GetResponse& from) { + inline GetResponseMessage& operator=(const GetResponseMessage& from) { CopyFrom(from); return *this; } - inline GetResponse& operator=(GetResponse&& from) noexcept { + inline GetResponseMessage& operator=(GetResponseMessage&& from) noexcept { if (GetArena() == from.GetArena()) { if (this != &from) InternalSwap(&from); } else { @@ -1292,20 +1296,20 @@ static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return GetMetadataStatic().reflection; } - static const GetResponse& default_instance() { + static const GetResponseMessage& default_instance() { return *internal_default_instance(); } - static inline const GetResponse* internal_default_instance() { - return reinterpret_cast( - &_GetResponse_default_instance_); + static inline const GetResponseMessage* internal_default_instance() { + return reinterpret_cast( + &_GetResponseMessage_default_instance_); } static constexpr int kIndexInFileMessages = 6; - friend void swap(GetResponse& a, GetResponse& b) { + friend void swap(GetResponseMessage& a, GetResponseMessage& b) { a.Swap(&b); } - inline void Swap(GetResponse* other) { + inline void Swap(GetResponseMessage* other) { if (other == this) return; if (GetArena() == other->GetArena()) { InternalSwap(other); @@ -1313,7 +1317,7 @@ ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(GetResponse* other) { + void UnsafeArenaSwap(GetResponseMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -1321,17 +1325,17 @@ // implements Message ---------------------------------------------- - inline GetResponse* New() const final { - return CreateMaybeMessage(nullptr); + inline GetResponseMessage* New() const final { + return CreateMaybeMessage(nullptr); } - GetResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); + GetResponseMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); } void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const GetResponse& from); - void MergeFrom(const GetResponse& from); + void CopyFrom(const GetResponseMessage& from); + void MergeFrom(const GetResponseMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1345,13 +1349,13 @@ inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(GetResponse* other); + void InternalSwap(GetResponseMessage* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "tunnelbroker.GetResponse"; + return "tunnelbroker.GetResponseMessage"; } protected: - explicit GetResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + explicit GetResponseMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); @@ -1430,7 +1434,7 @@ std::string* _internal_mutable_payload(); public: - // @@protoc_insertion_point(class_scope:tunnelbroker.GetResponse) + // @@protoc_insertion_point(class_scope:tunnelbroker.GetResponseMessage) private: class _Internal; @@ -1445,6 +1449,186 @@ }; // ------------------------------------------------------------------- +class GetResponse PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:tunnelbroker.GetResponse) */ { + public: + inline GetResponse() : GetResponse(nullptr) {} + virtual ~GetResponse(); + explicit constexpr GetResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GetResponse(const GetResponse& from); + GetResponse(GetResponse&& from) noexcept + : GetResponse() { + *this = ::std::move(from); + } + + inline GetResponse& operator=(const GetResponse& from) { + CopyFrom(from); + return *this; + } + inline GetResponse& operator=(GetResponse&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const GetResponse& default_instance() { + return *internal_default_instance(); + } + enum DateCase { + kMessageResponse = 1, + kPing = 2, + DATE_NOT_SET = 0, + }; + + static inline const GetResponse* internal_default_instance() { + return reinterpret_cast( + &_GetResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(GetResponse& a, GetResponse& b) { + a.Swap(&b); + } + inline void Swap(GetResponse* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GetResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline GetResponse* New() const final { + return CreateMaybeMessage(nullptr); + } + + GetResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const GetResponse& from); + void MergeFrom(const GetResponse& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "tunnelbroker.GetResponse"; + } + protected: + explicit GetResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + return ::descriptor_table_tunnelbroker_2eproto_metadata_getter(kIndexInFileMessages); + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kMessageResponseFieldNumber = 1, + kPingFieldNumber = 2, + }; + // .tunnelbroker.GetResponseMessage messageResponse = 1; + bool has_messageresponse() const; + private: + bool _internal_has_messageresponse() const; + public: + void clear_messageresponse(); + const ::tunnelbroker::GetResponseMessage& messageresponse() const; + ::tunnelbroker::GetResponseMessage* release_messageresponse(); + ::tunnelbroker::GetResponseMessage* mutable_messageresponse(); + void set_allocated_messageresponse(::tunnelbroker::GetResponseMessage* messageresponse); + private: + const ::tunnelbroker::GetResponseMessage& _internal_messageresponse() const; + ::tunnelbroker::GetResponseMessage* _internal_mutable_messageresponse(); + public: + void unsafe_arena_set_allocated_messageresponse( + ::tunnelbroker::GetResponseMessage* messageresponse); + ::tunnelbroker::GetResponseMessage* unsafe_arena_release_messageresponse(); + + // bool ping = 2; + bool has_ping() const; + private: + bool _internal_has_ping() const; + public: + void clear_ping(); + bool ping() const; + void set_ping(bool value); + private: + bool _internal_ping() const; + void _internal_set_ping(bool value); + public: + + void clear_date(); + DateCase date_case() const; + // @@protoc_insertion_point(class_scope:tunnelbroker.GetResponse) + private: + class _Internal; + void set_has_messageresponse(); + void set_has_ping(); + + inline bool has_date() const; + inline void clear_has_date(); + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union DateUnion { + constexpr DateUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + ::tunnelbroker::GetResponseMessage* messageresponse_; + bool ping_; + } date_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + + friend struct ::TableStruct_tunnelbroker_2eproto; +}; +// ------------------------------------------------------------------- + class ProcessedMessages PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:tunnelbroker.ProcessedMessages) */ { public: @@ -1488,7 +1672,7 @@ &_ProcessedMessages_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 8; friend void swap(ProcessedMessages& a, ProcessedMessages& b) { a.Swap(&b); @@ -1640,7 +1824,7 @@ &_MessageToTunnelbrokerStruct_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 9; friend void swap(MessageToTunnelbrokerStruct& a, MessageToTunnelbrokerStruct& b) { a.Swap(&b); @@ -1846,7 +2030,7 @@ &_MessagesToSend_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 10; friend void swap(MessagesToSend& a, MessagesToSend& b) { a.Swap(&b); @@ -1998,7 +2182,7 @@ &_MessageToTunnelbroker_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 11; friend void swap(MessageToTunnelbroker& a, MessageToTunnelbroker& b) { a.Swap(&b); @@ -2195,7 +2379,7 @@ &_MessageToClientStruct_default_instance_); } static constexpr int kIndexInFileMessages = - 11; + 12; friend void swap(MessageToClientStruct& a, MessageToClientStruct& b) { a.Swap(&b); @@ -2401,7 +2585,7 @@ &_MessagesToDeliver_default_instance_); } static constexpr int kIndexInFileMessages = - 12; + 13; friend void swap(MessagesToDeliver& a, MessagesToDeliver& b) { a.Swap(&b); @@ -2553,7 +2737,7 @@ &_MessageToClient_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 14; friend void swap(MessageToClient& a, MessageToClient& b) { a.Swap(&b); @@ -2732,7 +2916,7 @@ &_CheckRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 14; + 15; friend void swap(CheckRequest& a, CheckRequest& b) { a.Swap(&b); @@ -2894,7 +3078,7 @@ &_CheckResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 16; friend void swap(CheckResponse& a, CheckResponse& b) { a.Swap(&b); @@ -3031,7 +3215,7 @@ &_NewPrimaryRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 17; friend void swap(NewPrimaryRequest& a, NewPrimaryRequest& b) { a.Swap(&b); @@ -3193,7 +3377,7 @@ &_NewPrimaryResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 17; + 18; friend void swap(NewPrimaryResponse& a, NewPrimaryResponse& b) { a.Swap(&b); @@ -3330,7 +3514,7 @@ &_PongRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 18; + 19; friend void swap(PongRequest& a, PongRequest& b) { a.Swap(&b); @@ -4379,59 +4563,59 @@ // ------------------------------------------------------------------- -// GetResponse +// GetResponseMessage // string fromDeviceID = 1; -inline void GetResponse::clear_fromdeviceid() { +inline void GetResponseMessage::clear_fromdeviceid() { fromdeviceid_.ClearToEmpty(); } -inline const std::string& GetResponse::fromdeviceid() const { - // @@protoc_insertion_point(field_get:tunnelbroker.GetResponse.fromDeviceID) +inline const std::string& GetResponseMessage::fromdeviceid() const { + // @@protoc_insertion_point(field_get:tunnelbroker.GetResponseMessage.fromDeviceID) return _internal_fromdeviceid(); } -inline void GetResponse::set_fromdeviceid(const std::string& value) { +inline void GetResponseMessage::set_fromdeviceid(const std::string& value) { _internal_set_fromdeviceid(value); - // @@protoc_insertion_point(field_set:tunnelbroker.GetResponse.fromDeviceID) + // @@protoc_insertion_point(field_set:tunnelbroker.GetResponseMessage.fromDeviceID) } -inline std::string* GetResponse::mutable_fromdeviceid() { - // @@protoc_insertion_point(field_mutable:tunnelbroker.GetResponse.fromDeviceID) +inline std::string* GetResponseMessage::mutable_fromdeviceid() { + // @@protoc_insertion_point(field_mutable:tunnelbroker.GetResponseMessage.fromDeviceID) return _internal_mutable_fromdeviceid(); } -inline const std::string& GetResponse::_internal_fromdeviceid() const { +inline const std::string& GetResponseMessage::_internal_fromdeviceid() const { return fromdeviceid_.Get(); } -inline void GetResponse::_internal_set_fromdeviceid(const std::string& value) { +inline void GetResponseMessage::_internal_set_fromdeviceid(const std::string& value) { fromdeviceid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); } -inline void GetResponse::set_fromdeviceid(std::string&& value) { +inline void GetResponseMessage::set_fromdeviceid(std::string&& value) { fromdeviceid_.Set( ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:tunnelbroker.GetResponse.fromDeviceID) + // @@protoc_insertion_point(field_set_rvalue:tunnelbroker.GetResponseMessage.fromDeviceID) } -inline void GetResponse::set_fromdeviceid(const char* value) { +inline void GetResponseMessage::set_fromdeviceid(const char* value) { GOOGLE_DCHECK(value != nullptr); fromdeviceid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena()); - // @@protoc_insertion_point(field_set_char:tunnelbroker.GetResponse.fromDeviceID) + // @@protoc_insertion_point(field_set_char:tunnelbroker.GetResponseMessage.fromDeviceID) } -inline void GetResponse::set_fromdeviceid(const char* value, +inline void GetResponseMessage::set_fromdeviceid(const char* value, size_t size) { fromdeviceid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:tunnelbroker.GetResponse.fromDeviceID) + // @@protoc_insertion_point(field_set_pointer:tunnelbroker.GetResponseMessage.fromDeviceID) } -inline std::string* GetResponse::_internal_mutable_fromdeviceid() { +inline std::string* GetResponseMessage::_internal_mutable_fromdeviceid() { return fromdeviceid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); } -inline std::string* GetResponse::release_fromdeviceid() { - // @@protoc_insertion_point(field_release:tunnelbroker.GetResponse.fromDeviceID) +inline std::string* GetResponseMessage::release_fromdeviceid() { + // @@protoc_insertion_point(field_release:tunnelbroker.GetResponseMessage.fromDeviceID) return fromdeviceid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } -inline void GetResponse::set_allocated_fromdeviceid(std::string* fromdeviceid) { +inline void GetResponseMessage::set_allocated_fromdeviceid(std::string* fromdeviceid) { if (fromdeviceid != nullptr) { } else { @@ -4439,60 +4623,60 @@ } fromdeviceid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), fromdeviceid, GetArena()); - // @@protoc_insertion_point(field_set_allocated:tunnelbroker.GetResponse.fromDeviceID) + // @@protoc_insertion_point(field_set_allocated:tunnelbroker.GetResponseMessage.fromDeviceID) } // bytes payload = 2; -inline void GetResponse::clear_payload() { +inline void GetResponseMessage::clear_payload() { payload_.ClearToEmpty(); } -inline const std::string& GetResponse::payload() const { - // @@protoc_insertion_point(field_get:tunnelbroker.GetResponse.payload) +inline const std::string& GetResponseMessage::payload() const { + // @@protoc_insertion_point(field_get:tunnelbroker.GetResponseMessage.payload) return _internal_payload(); } -inline void GetResponse::set_payload(const std::string& value) { +inline void GetResponseMessage::set_payload(const std::string& value) { _internal_set_payload(value); - // @@protoc_insertion_point(field_set:tunnelbroker.GetResponse.payload) + // @@protoc_insertion_point(field_set:tunnelbroker.GetResponseMessage.payload) } -inline std::string* GetResponse::mutable_payload() { - // @@protoc_insertion_point(field_mutable:tunnelbroker.GetResponse.payload) +inline std::string* GetResponseMessage::mutable_payload() { + // @@protoc_insertion_point(field_mutable:tunnelbroker.GetResponseMessage.payload) return _internal_mutable_payload(); } -inline const std::string& GetResponse::_internal_payload() const { +inline const std::string& GetResponseMessage::_internal_payload() const { return payload_.Get(); } -inline void GetResponse::_internal_set_payload(const std::string& value) { +inline void GetResponseMessage::_internal_set_payload(const std::string& value) { payload_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); } -inline void GetResponse::set_payload(std::string&& value) { +inline void GetResponseMessage::set_payload(std::string&& value) { payload_.Set( ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:tunnelbroker.GetResponse.payload) + // @@protoc_insertion_point(field_set_rvalue:tunnelbroker.GetResponseMessage.payload) } -inline void GetResponse::set_payload(const char* value) { +inline void GetResponseMessage::set_payload(const char* value) { GOOGLE_DCHECK(value != nullptr); payload_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena()); - // @@protoc_insertion_point(field_set_char:tunnelbroker.GetResponse.payload) + // @@protoc_insertion_point(field_set_char:tunnelbroker.GetResponseMessage.payload) } -inline void GetResponse::set_payload(const void* value, +inline void GetResponseMessage::set_payload(const void* value, size_t size) { payload_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:tunnelbroker.GetResponse.payload) + // @@protoc_insertion_point(field_set_pointer:tunnelbroker.GetResponseMessage.payload) } -inline std::string* GetResponse::_internal_mutable_payload() { +inline std::string* GetResponseMessage::_internal_mutable_payload() { return payload_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); } -inline std::string* GetResponse::release_payload() { - // @@protoc_insertion_point(field_release:tunnelbroker.GetResponse.payload) +inline std::string* GetResponseMessage::release_payload() { + // @@protoc_insertion_point(field_release:tunnelbroker.GetResponseMessage.payload) return payload_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } -inline void GetResponse::set_allocated_payload(std::string* payload) { +inline void GetResponseMessage::set_allocated_payload(std::string* payload) { if (payload != nullptr) { } else { @@ -4500,85 +4684,209 @@ } payload_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), payload, GetArena()); - // @@protoc_insertion_point(field_set_allocated:tunnelbroker.GetResponse.payload) + // @@protoc_insertion_point(field_set_allocated:tunnelbroker.GetResponseMessage.payload) } // repeated string blobHashes = 3; -inline int GetResponse::_internal_blobhashes_size() const { +inline int GetResponseMessage::_internal_blobhashes_size() const { return blobhashes_.size(); } -inline int GetResponse::blobhashes_size() const { +inline int GetResponseMessage::blobhashes_size() const { return _internal_blobhashes_size(); } -inline void GetResponse::clear_blobhashes() { +inline void GetResponseMessage::clear_blobhashes() { blobhashes_.Clear(); } -inline std::string* GetResponse::add_blobhashes() { - // @@protoc_insertion_point(field_add_mutable:tunnelbroker.GetResponse.blobHashes) +inline std::string* GetResponseMessage::add_blobhashes() { + // @@protoc_insertion_point(field_add_mutable:tunnelbroker.GetResponseMessage.blobHashes) return _internal_add_blobhashes(); } -inline const std::string& GetResponse::_internal_blobhashes(int index) const { +inline const std::string& GetResponseMessage::_internal_blobhashes(int index) const { return blobhashes_.Get(index); } -inline const std::string& GetResponse::blobhashes(int index) const { - // @@protoc_insertion_point(field_get:tunnelbroker.GetResponse.blobHashes) +inline const std::string& GetResponseMessage::blobhashes(int index) const { + // @@protoc_insertion_point(field_get:tunnelbroker.GetResponseMessage.blobHashes) return _internal_blobhashes(index); } -inline std::string* GetResponse::mutable_blobhashes(int index) { - // @@protoc_insertion_point(field_mutable:tunnelbroker.GetResponse.blobHashes) +inline std::string* GetResponseMessage::mutable_blobhashes(int index) { + // @@protoc_insertion_point(field_mutable:tunnelbroker.GetResponseMessage.blobHashes) return blobhashes_.Mutable(index); } -inline void GetResponse::set_blobhashes(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:tunnelbroker.GetResponse.blobHashes) +inline void GetResponseMessage::set_blobhashes(int index, const std::string& value) { + // @@protoc_insertion_point(field_set:tunnelbroker.GetResponseMessage.blobHashes) blobhashes_.Mutable(index)->assign(value); } -inline void GetResponse::set_blobhashes(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:tunnelbroker.GetResponse.blobHashes) +inline void GetResponseMessage::set_blobhashes(int index, std::string&& value) { + // @@protoc_insertion_point(field_set:tunnelbroker.GetResponseMessage.blobHashes) blobhashes_.Mutable(index)->assign(std::move(value)); } -inline void GetResponse::set_blobhashes(int index, const char* value) { +inline void GetResponseMessage::set_blobhashes(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); blobhashes_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:tunnelbroker.GetResponse.blobHashes) + // @@protoc_insertion_point(field_set_char:tunnelbroker.GetResponseMessage.blobHashes) } -inline void GetResponse::set_blobhashes(int index, const char* value, size_t size) { +inline void GetResponseMessage::set_blobhashes(int index, const char* value, size_t size) { blobhashes_.Mutable(index)->assign( reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:tunnelbroker.GetResponse.blobHashes) + // @@protoc_insertion_point(field_set_pointer:tunnelbroker.GetResponseMessage.blobHashes) } -inline std::string* GetResponse::_internal_add_blobhashes() { +inline std::string* GetResponseMessage::_internal_add_blobhashes() { return blobhashes_.Add(); } -inline void GetResponse::add_blobhashes(const std::string& value) { +inline void GetResponseMessage::add_blobhashes(const std::string& value) { blobhashes_.Add()->assign(value); - // @@protoc_insertion_point(field_add:tunnelbroker.GetResponse.blobHashes) + // @@protoc_insertion_point(field_add:tunnelbroker.GetResponseMessage.blobHashes) } -inline void GetResponse::add_blobhashes(std::string&& value) { +inline void GetResponseMessage::add_blobhashes(std::string&& value) { blobhashes_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:tunnelbroker.GetResponse.blobHashes) + // @@protoc_insertion_point(field_add:tunnelbroker.GetResponseMessage.blobHashes) } -inline void GetResponse::add_blobhashes(const char* value) { +inline void GetResponseMessage::add_blobhashes(const char* value) { GOOGLE_DCHECK(value != nullptr); blobhashes_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:tunnelbroker.GetResponse.blobHashes) + // @@protoc_insertion_point(field_add_char:tunnelbroker.GetResponseMessage.blobHashes) } -inline void GetResponse::add_blobhashes(const char* value, size_t size) { +inline void GetResponseMessage::add_blobhashes(const char* value, size_t size) { blobhashes_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:tunnelbroker.GetResponse.blobHashes) + // @@protoc_insertion_point(field_add_pointer:tunnelbroker.GetResponseMessage.blobHashes) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -GetResponse::blobhashes() const { - // @@protoc_insertion_point(field_list:tunnelbroker.GetResponse.blobHashes) +GetResponseMessage::blobhashes() const { + // @@protoc_insertion_point(field_list:tunnelbroker.GetResponseMessage.blobHashes) return blobhashes_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -GetResponse::mutable_blobhashes() { - // @@protoc_insertion_point(field_mutable_list:tunnelbroker.GetResponse.blobHashes) +GetResponseMessage::mutable_blobhashes() { + // @@protoc_insertion_point(field_mutable_list:tunnelbroker.GetResponseMessage.blobHashes) return &blobhashes_; } // ------------------------------------------------------------------- +// GetResponse + +// .tunnelbroker.GetResponseMessage messageResponse = 1; +inline bool GetResponse::_internal_has_messageresponse() const { + return date_case() == kMessageResponse; +} +inline bool GetResponse::has_messageresponse() const { + return _internal_has_messageresponse(); +} +inline void GetResponse::set_has_messageresponse() { + _oneof_case_[0] = kMessageResponse; +} +inline void GetResponse::clear_messageresponse() { + if (_internal_has_messageresponse()) { + if (GetArena() == nullptr) { + delete date_.messageresponse_; + } + clear_has_date(); + } +} +inline ::tunnelbroker::GetResponseMessage* GetResponse::release_messageresponse() { + // @@protoc_insertion_point(field_release:tunnelbroker.GetResponse.messageResponse) + if (_internal_has_messageresponse()) { + clear_has_date(); + ::tunnelbroker::GetResponseMessage* temp = date_.messageresponse_; + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + date_.messageresponse_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::tunnelbroker::GetResponseMessage& GetResponse::_internal_messageresponse() const { + return _internal_has_messageresponse() + ? *date_.messageresponse_ + : reinterpret_cast< ::tunnelbroker::GetResponseMessage&>(::tunnelbroker::_GetResponseMessage_default_instance_); +} +inline const ::tunnelbroker::GetResponseMessage& GetResponse::messageresponse() const { + // @@protoc_insertion_point(field_get:tunnelbroker.GetResponse.messageResponse) + return _internal_messageresponse(); +} +inline ::tunnelbroker::GetResponseMessage* GetResponse::unsafe_arena_release_messageresponse() { + // @@protoc_insertion_point(field_unsafe_arena_release:tunnelbroker.GetResponse.messageResponse) + if (_internal_has_messageresponse()) { + clear_has_date(); + ::tunnelbroker::GetResponseMessage* temp = date_.messageresponse_; + date_.messageresponse_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void GetResponse::unsafe_arena_set_allocated_messageresponse(::tunnelbroker::GetResponseMessage* messageresponse) { + clear_date(); + if (messageresponse) { + set_has_messageresponse(); + date_.messageresponse_ = messageresponse; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tunnelbroker.GetResponse.messageResponse) +} +inline ::tunnelbroker::GetResponseMessage* GetResponse::_internal_mutable_messageresponse() { + if (!_internal_has_messageresponse()) { + clear_date(); + set_has_messageresponse(); + date_.messageresponse_ = CreateMaybeMessage< ::tunnelbroker::GetResponseMessage >(GetArena()); + } + return date_.messageresponse_; +} +inline ::tunnelbroker::GetResponseMessage* GetResponse::mutable_messageresponse() { + // @@protoc_insertion_point(field_mutable:tunnelbroker.GetResponse.messageResponse) + return _internal_mutable_messageresponse(); +} + +// bool ping = 2; +inline bool GetResponse::_internal_has_ping() const { + return date_case() == kPing; +} +inline bool GetResponse::has_ping() const { + return _internal_has_ping(); +} +inline void GetResponse::set_has_ping() { + _oneof_case_[0] = kPing; +} +inline void GetResponse::clear_ping() { + if (_internal_has_ping()) { + date_.ping_ = false; + clear_has_date(); + } +} +inline bool GetResponse::_internal_ping() const { + if (_internal_has_ping()) { + return date_.ping_; + } + return false; +} +inline void GetResponse::_internal_set_ping(bool value) { + if (!_internal_has_ping()) { + clear_date(); + set_has_ping(); + } + date_.ping_ = value; +} +inline bool GetResponse::ping() const { + // @@protoc_insertion_point(field_get:tunnelbroker.GetResponse.ping) + return _internal_ping(); +} +inline void GetResponse::set_ping(bool value) { + _internal_set_ping(value); + // @@protoc_insertion_point(field_set:tunnelbroker.GetResponse.ping) +} + +inline bool GetResponse::has_date() const { + return date_case() != DATE_NOT_SET; +} +inline void GetResponse::clear_has_date() { + _oneof_case_[0] = DATE_NOT_SET; +} +inline GetResponse::DateCase GetResponse::date_case() const { + return GetResponse::DateCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + // ProcessedMessages // repeated string messageID = 1; @@ -6107,6 +6415,8 @@ // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/shared/protos/_generated/tunnelbroker.pb.cc b/shared/protos/_generated/tunnelbroker.pb.cc --- a/shared/protos/_generated/tunnelbroker.pb.cc +++ b/shared/protos/_generated/tunnelbroker.pb.cc @@ -99,11 +99,23 @@ }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetRequestDefaultTypeInternal _GetRequest_default_instance_; -constexpr GetResponse::GetResponse( +constexpr GetResponseMessage::GetResponseMessage( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : blobhashes_() , fromdeviceid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , payload_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} +struct GetResponseMessageDefaultTypeInternal { + constexpr GetResponseMessageDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~GetResponseMessageDefaultTypeInternal() {} + union { + GetResponseMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetResponseMessageDefaultTypeInternal _GetResponseMessage_default_instance_; +constexpr GetResponse::GetResponse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : _oneof_case_{}{} struct GetResponseDefaultTypeInternal { constexpr GetResponseDefaultTypeInternal() : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} @@ -269,7 +281,7 @@ }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PongRequestDefaultTypeInternal _PongRequest_default_instance_; } // namespace tunnelbroker -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tunnelbroker_2eproto[19]; +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tunnelbroker_2eproto[20]; static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_tunnelbroker_2eproto[2]; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tunnelbroker_2eproto = nullptr; @@ -327,13 +339,21 @@ ~0u, // no _weak_field_map_ PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetRequest, sessionid_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponse, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponseMessage, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponse, fromdeviceid_), - PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponse, payload_), - PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponse, blobhashes_), + PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponseMessage, fromdeviceid_), + PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponseMessage, payload_), + PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponseMessage, blobhashes_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponse, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponse, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::tunnelbroker::GetResponse, date_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::tunnelbroker::ProcessedMessages, _internal_metadata_), ~0u, // no _extensions_ @@ -428,19 +448,20 @@ { 31, -1, sizeof(::tunnelbroker::NewSessionResponse)}, { 37, -1, sizeof(::tunnelbroker::SendRequest)}, { 46, -1, sizeof(::tunnelbroker::GetRequest)}, - { 52, -1, sizeof(::tunnelbroker::GetResponse)}, - { 60, -1, sizeof(::tunnelbroker::ProcessedMessages)}, - { 66, -1, sizeof(::tunnelbroker::MessageToTunnelbrokerStruct)}, - { 75, -1, sizeof(::tunnelbroker::MessagesToSend)}, - { 81, -1, sizeof(::tunnelbroker::MessageToTunnelbroker)}, - { 90, -1, sizeof(::tunnelbroker::MessageToClientStruct)}, - { 99, -1, sizeof(::tunnelbroker::MessagesToDeliver)}, - { 105, -1, sizeof(::tunnelbroker::MessageToClient)}, - { 113, -1, sizeof(::tunnelbroker::CheckRequest)}, - { 120, -1, sizeof(::tunnelbroker::CheckResponse)}, - { 126, -1, sizeof(::tunnelbroker::NewPrimaryRequest)}, - { 133, -1, sizeof(::tunnelbroker::NewPrimaryResponse)}, - { 139, -1, sizeof(::tunnelbroker::PongRequest)}, + { 52, -1, sizeof(::tunnelbroker::GetResponseMessage)}, + { 60, -1, sizeof(::tunnelbroker::GetResponse)}, + { 68, -1, sizeof(::tunnelbroker::ProcessedMessages)}, + { 74, -1, sizeof(::tunnelbroker::MessageToTunnelbrokerStruct)}, + { 83, -1, sizeof(::tunnelbroker::MessagesToSend)}, + { 89, -1, sizeof(::tunnelbroker::MessageToTunnelbroker)}, + { 98, -1, sizeof(::tunnelbroker::MessageToClientStruct)}, + { 107, -1, sizeof(::tunnelbroker::MessagesToDeliver)}, + { 113, -1, sizeof(::tunnelbroker::MessageToClient)}, + { 121, -1, sizeof(::tunnelbroker::CheckRequest)}, + { 128, -1, sizeof(::tunnelbroker::CheckResponse)}, + { 134, -1, sizeof(::tunnelbroker::NewPrimaryRequest)}, + { 141, -1, sizeof(::tunnelbroker::NewPrimaryResponse)}, + { 147, -1, sizeof(::tunnelbroker::PongRequest)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -450,6 +471,7 @@ reinterpret_cast(&::tunnelbroker::_NewSessionResponse_default_instance_), reinterpret_cast(&::tunnelbroker::_SendRequest_default_instance_), reinterpret_cast(&::tunnelbroker::_GetRequest_default_instance_), + reinterpret_cast(&::tunnelbroker::_GetResponseMessage_default_instance_), reinterpret_cast(&::tunnelbroker::_GetResponse_default_instance_), reinterpret_cast(&::tunnelbroker::_ProcessedMessages_default_instance_), reinterpret_cast(&::tunnelbroker::_MessageToTunnelbrokerStruct_default_instance_), @@ -480,62 +502,65 @@ "essionResponse\022\021\n\tsessionID\030\001 \001(\t\"Y\n\013Sen" "dRequest\022\021\n\tsessionID\030\001 \001(\t\022\022\n\ntoDeviceI" "D\030\002 \001(\t\022\017\n\007payload\030\003 \001(\014\022\022\n\nblobHashes\030\004" - " \003(\t\"\037\n\nGetRequest\022\021\n\tsessionID\030\001 \001(\t\"H\n" - "\013GetResponse\022\024\n\014fromDeviceID\030\001 \001(\t\022\017\n\007pa" - "yload\030\002 \001(\014\022\022\n\nblobHashes\030\003 \003(\t\"&\n\021Proce" - "ssedMessages\022\021\n\tmessageID\030\001 \003(\t\"i\n\033Messa" - "geToTunnelbrokerStruct\022\021\n\tmessageID\030\001 \001(" - "\t\022\022\n\ntoDeviceID\030\002 \001(\t\022\017\n\007payload\030\003 \001(\t\022\022" - "\n\nblobHashes\030\004 \003(\t\"M\n\016MessagesToSend\022;\n\010" - "messages\030\001 \003(\0132).tunnelbroker.MessageToT" - "unnelbrokerStruct\"\250\001\n\025MessageToTunnelbro" - "ker\022\021\n\tsessionID\030\001 \001(\t\0226\n\016messagesToSend" - "\030\002 \001(\0132\034.tunnelbroker.MessagesToSendH\000\022<" - "\n\021processedMessages\030\003 \001(\0132\037.tunnelbroker" - ".ProcessedMessagesH\000B\006\n\004data\"e\n\025MessageT" - "oClientStruct\022\021\n\tmessageID\030\001 \001(\t\022\024\n\014from" - "DeviceID\030\002 \001(\t\022\017\n\007payload\030\003 \001(\t\022\022\n\nblobH" - "ashes\030\004 \003(\t\"J\n\021MessagesToDeliver\0225\n\010mess" - "ages\030\001 \003(\0132#.tunnelbroker.MessageToClien" - "tStruct\"\225\001\n\017MessageToClient\022<\n\021messagesT" - "oDeliver\030\001 \001(\0132\037.tunnelbroker.MessagesTo" - "DeliverH\000\022<\n\021processedMessages\030\002 \001(\0132\037.t" - "unnelbroker.ProcessedMessagesH\000B\006\n\004data\"" - "3\n\014CheckRequest\022\016\n\006userId\030\001 \001(\t\022\023\n\013devic" - "eToken\030\002 \001(\t\"K\n\rCheckResponse\022:\n\021checkRe" - "sponseType\030\001 \001(\0162\037.tunnelbroker.CheckRes" - "ponseType\"8\n\021NewPrimaryRequest\022\016\n\006userId" - "\030\001 \001(\t\022\023\n\013deviceToken\030\002 \001(\t\"%\n\022NewPrimar" - "yResponse\022\017\n\007success\030\001 \001(\010\"2\n\013PongReques" - "t\022\016\n\006userId\030\001 \001(\t\022\023\n\013deviceToken\030\002 \001(\t*n" - "\n\021CheckResponseType\022\030\n\024PRIMARY_DOESNT_EX" - "IST\020\000\022\022\n\016PRIMARY_ONLINE\020\001\022\023\n\017PRIMARY_OFF" - "LINE\020\002\022\026\n\022CURRENT_IS_PRIMARY\020\0032\237\005\n\023Tunne" - "lbrokerService\022W\n\032CheckIfPrimaryDeviceOn" - "line\022\032.tunnelbroker.CheckRequest\032\033.tunne" - "lbroker.CheckResponse\"\000\022]\n\026BecomeNewPrim" - "aryDevice\022\037.tunnelbroker.NewPrimaryReque" - "st\032 .tunnelbroker.NewPrimaryResponse\"\000\022\?" - "\n\010SendPong\022\031.tunnelbroker.PongRequest\032\026." - "google.protobuf.Empty\"\000\022c\n\020SessionSignat" - "ure\022%.tunnelbroker.SessionSignatureReque" - "st\032&.tunnelbroker.SessionSignatureRespon" - "se\"\000\022Q\n\nNewSession\022\037.tunnelbroker.NewSes" - "sionRequest\032 .tunnelbroker.NewSessionRes" - "ponse\"\000\022;\n\004Send\022\031.tunnelbroker.SendReque" - "st\032\026.google.protobuf.Empty\"\000\022>\n\003Get\022\030.tu" - "nnelbroker.GetRequest\032\031.tunnelbroker.Get" - "Response\"\0000\001\022Z\n\016MessagesStream\022#.tunnelb" - "roker.MessageToTunnelbroker\032\035.tunnelbrok" - "er.MessageToClient\"\000(\0010\001b\006proto3" + " \003(\t\"\037\n\nGetRequest\022\021\n\tsessionID\030\001 \001(\t\"O\n" + "\022GetResponseMessage\022\024\n\014fromDeviceID\030\001 \001(" + "\t\022\017\n\007payload\030\002 \001(\014\022\022\n\nblobHashes\030\003 \003(\t\"b" + "\n\013GetResponse\022;\n\017messageResponse\030\001 \001(\0132 " + ".tunnelbroker.GetResponseMessageH\000\022\016\n\004pi" + "ng\030\002 \001(\010H\000B\006\n\004date\"&\n\021ProcessedMessages\022" + "\021\n\tmessageID\030\001 \003(\t\"i\n\033MessageToTunnelbro" + "kerStruct\022\021\n\tmessageID\030\001 \001(\t\022\022\n\ntoDevice" + "ID\030\002 \001(\t\022\017\n\007payload\030\003 \001(\t\022\022\n\nblobHashes\030" + "\004 \003(\t\"M\n\016MessagesToSend\022;\n\010messages\030\001 \003(" + "\0132).tunnelbroker.MessageToTunnelbrokerSt" + "ruct\"\250\001\n\025MessageToTunnelbroker\022\021\n\tsessio" + "nID\030\001 \001(\t\0226\n\016messagesToSend\030\002 \001(\0132\034.tunn" + "elbroker.MessagesToSendH\000\022<\n\021processedMe" + "ssages\030\003 \001(\0132\037.tunnelbroker.ProcessedMes" + "sagesH\000B\006\n\004data\"e\n\025MessageToClientStruct" + "\022\021\n\tmessageID\030\001 \001(\t\022\024\n\014fromDeviceID\030\002 \001(" + "\t\022\017\n\007payload\030\003 \001(\t\022\022\n\nblobHashes\030\004 \003(\t\"J" + "\n\021MessagesToDeliver\0225\n\010messages\030\001 \003(\0132#." + "tunnelbroker.MessageToClientStruct\"\225\001\n\017M" + "essageToClient\022<\n\021messagesToDeliver\030\001 \001(" + "\0132\037.tunnelbroker.MessagesToDeliverH\000\022<\n\021" + "processedMessages\030\002 \001(\0132\037.tunnelbroker.P" + "rocessedMessagesH\000B\006\n\004data\"3\n\014CheckReque" + "st\022\016\n\006userId\030\001 \001(\t\022\023\n\013deviceToken\030\002 \001(\t\"" + "K\n\rCheckResponse\022:\n\021checkResponseType\030\001 " + "\001(\0162\037.tunnelbroker.CheckResponseType\"8\n\021" + "NewPrimaryRequest\022\016\n\006userId\030\001 \001(\t\022\023\n\013dev" + "iceToken\030\002 \001(\t\"%\n\022NewPrimaryResponse\022\017\n\007" + "success\030\001 \001(\010\"2\n\013PongRequest\022\016\n\006userId\030\001" + " \001(\t\022\023\n\013deviceToken\030\002 \001(\t*n\n\021CheckRespon" + "seType\022\030\n\024PRIMARY_DOESNT_EXIST\020\000\022\022\n\016PRIM" + "ARY_ONLINE\020\001\022\023\n\017PRIMARY_OFFLINE\020\002\022\026\n\022CUR" + "RENT_IS_PRIMARY\020\0032\237\005\n\023TunnelbrokerServic" + "e\022W\n\032CheckIfPrimaryDeviceOnline\022\032.tunnel" + "broker.CheckRequest\032\033.tunnelbroker.Check" + "Response\"\000\022]\n\026BecomeNewPrimaryDevice\022\037.t" + "unnelbroker.NewPrimaryRequest\032 .tunnelbr" + "oker.NewPrimaryResponse\"\000\022\?\n\010SendPong\022\031." + "tunnelbroker.PongRequest\032\026.google.protob" + "uf.Empty\"\000\022c\n\020SessionSignature\022%.tunnelb" + "roker.SessionSignatureRequest\032&.tunnelbr" + "oker.SessionSignatureResponse\"\000\022Q\n\nNewSe" + "ssion\022\037.tunnelbroker.NewSessionRequest\032 " + ".tunnelbroker.NewSessionResponse\"\000\022;\n\004Se" + "nd\022\031.tunnelbroker.SendRequest\032\026.google.p" + "rotobuf.Empty\"\000\022>\n\003Get\022\030.tunnelbroker.Ge" + "tRequest\032\031.tunnelbroker.GetResponse\"\0000\001\022" + "Z\n\016MessagesStream\022#.tunnelbroker.Message" + "ToTunnelbroker\032\035.tunnelbroker.MessageToC" + "lient\"\000(\0010\001b\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tunnelbroker_2eproto_deps[1] = { &::descriptor_table_google_2fprotobuf_2fempty_2eproto, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tunnelbroker_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tunnelbroker_2eproto = { - false, false, 2472, descriptor_table_protodef_tunnelbroker_2eproto, "tunnelbroker.proto", - &descriptor_table_tunnelbroker_2eproto_once, descriptor_table_tunnelbroker_2eproto_deps, 1, 19, + false, false, 2579, descriptor_table_protodef_tunnelbroker_2eproto, "tunnelbroker.proto", + &descriptor_table_tunnelbroker_2eproto_once, descriptor_table_tunnelbroker_2eproto_deps, 1, 20, schemas, file_default_instances, TableStruct_tunnelbroker_2eproto::offsets, file_level_metadata_tunnelbroker_2eproto, file_level_enum_descriptors_tunnelbroker_2eproto, file_level_service_descriptors_tunnelbroker_2eproto, }; @@ -2129,18 +2154,18 @@ // =================================================================== -class GetResponse::_Internal { +class GetResponseMessage::_Internal { public: }; -GetResponse::GetResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) +GetResponseMessage::GetResponseMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena) : ::PROTOBUF_NAMESPACE_ID::Message(arena), blobhashes_(arena) { SharedCtor(); RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:tunnelbroker.GetResponse) + // @@protoc_insertion_point(arena_constructor:tunnelbroker.GetResponseMessage) } -GetResponse::GetResponse(const GetResponse& from) +GetResponseMessage::GetResponseMessage(const GetResponseMessage& from) : ::PROTOBUF_NAMESPACE_ID::Message(), blobhashes_(from.blobhashes_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -2154,38 +2179,38 @@ payload_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_payload(), GetArena()); } - // @@protoc_insertion_point(copy_constructor:tunnelbroker.GetResponse) + // @@protoc_insertion_point(copy_constructor:tunnelbroker.GetResponseMessage) } -void GetResponse::SharedCtor() { +void GetResponseMessage::SharedCtor() { fromdeviceid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); payload_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } -GetResponse::~GetResponse() { - // @@protoc_insertion_point(destructor:tunnelbroker.GetResponse) +GetResponseMessage::~GetResponseMessage() { + // @@protoc_insertion_point(destructor:tunnelbroker.GetResponseMessage) SharedDtor(); _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -void GetResponse::SharedDtor() { +void GetResponseMessage::SharedDtor() { GOOGLE_DCHECK(GetArena() == nullptr); fromdeviceid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); payload_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } -void GetResponse::ArenaDtor(void* object) { - GetResponse* _this = reinterpret_cast< GetResponse* >(object); +void GetResponseMessage::ArenaDtor(void* object) { + GetResponseMessage* _this = reinterpret_cast< GetResponseMessage* >(object); (void)_this; } -void GetResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +void GetResponseMessage::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { } -void GetResponse::SetCachedSize(int size) const { +void GetResponseMessage::SetCachedSize(int size) const { _cached_size_.Set(size); } -void GetResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:tunnelbroker.GetResponse) +void GetResponseMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:tunnelbroker.GetResponseMessage) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2196,7 +2221,7 @@ _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* GetResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* GetResponseMessage::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { ::PROTOBUF_NAMESPACE_ID::uint32 tag; @@ -2208,7 +2233,7 @@ if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { auto str = _internal_mutable_fromdeviceid(); ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "tunnelbroker.GetResponse.fromDeviceID")); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "tunnelbroker.GetResponseMessage.fromDeviceID")); CHK_(ptr); } else goto handle_unusual; continue; @@ -2228,7 +2253,7 @@ ptr += 1; auto str = _internal_add_blobhashes(); ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "tunnelbroker.GetResponse.blobHashes")); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "tunnelbroker.GetResponseMessage.blobHashes")); CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); @@ -2256,9 +2281,9 @@ #undef CHK_ } -::PROTOBUF_NAMESPACE_ID::uint8* GetResponse::_InternalSerialize( +::PROTOBUF_NAMESPACE_ID::uint8* GetResponseMessage::_InternalSerialize( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:tunnelbroker.GetResponse) + // @@protoc_insertion_point(serialize_to_array_start:tunnelbroker.GetResponseMessage) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -2267,7 +2292,7 @@ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_fromdeviceid().data(), static_cast(this->_internal_fromdeviceid().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "tunnelbroker.GetResponse.fromDeviceID"); + "tunnelbroker.GetResponseMessage.fromDeviceID"); target = stream->WriteStringMaybeAliased( 1, this->_internal_fromdeviceid(), target); } @@ -2284,7 +2309,7 @@ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( s.data(), static_cast(s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "tunnelbroker.GetResponse.blobHashes"); + "tunnelbroker.GetResponseMessage.blobHashes"); target = stream->WriteString(3, s, target); } @@ -2292,12 +2317,12 @@ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:tunnelbroker.GetResponse) + // @@protoc_insertion_point(serialize_to_array_end:tunnelbroker.GetResponseMessage) return target; } -size_t GetResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:tunnelbroker.GetResponse) +size_t GetResponseMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tunnelbroker.GetResponseMessage) size_t total_size = 0; ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; @@ -2335,6 +2360,283 @@ return total_size; } +void GetResponseMessage::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tunnelbroker.GetResponseMessage) + GOOGLE_DCHECK_NE(&from, this); + const GetResponseMessage* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tunnelbroker.GetResponseMessage) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tunnelbroker.GetResponseMessage) + MergeFrom(*source); + } +} + +void GetResponseMessage::MergeFrom(const GetResponseMessage& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tunnelbroker.GetResponseMessage) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + blobhashes_.MergeFrom(from.blobhashes_); + if (from.fromdeviceid().size() > 0) { + _internal_set_fromdeviceid(from._internal_fromdeviceid()); + } + if (from.payload().size() > 0) { + _internal_set_payload(from._internal_payload()); + } +} + +void GetResponseMessage::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tunnelbroker.GetResponseMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetResponseMessage::CopyFrom(const GetResponseMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tunnelbroker.GetResponseMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetResponseMessage::IsInitialized() const { + return true; +} + +void GetResponseMessage::InternalSwap(GetResponseMessage* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + blobhashes_.InternalSwap(&other->blobhashes_); + fromdeviceid_.Swap(&other->fromdeviceid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + payload_.Swap(&other->payload_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata GetResponseMessage::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +class GetResponse::_Internal { + public: + static const ::tunnelbroker::GetResponseMessage& messageresponse(const GetResponse* msg); +}; + +const ::tunnelbroker::GetResponseMessage& +GetResponse::_Internal::messageresponse(const GetResponse* msg) { + return *msg->date_.messageresponse_; +} +void GetResponse::set_allocated_messageresponse(::tunnelbroker::GetResponseMessage* messageresponse) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + clear_date(); + if (messageresponse) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(messageresponse); + if (message_arena != submessage_arena) { + messageresponse = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, messageresponse, submessage_arena); + } + set_has_messageresponse(); + date_.messageresponse_ = messageresponse; + } + // @@protoc_insertion_point(field_set_allocated:tunnelbroker.GetResponse.messageResponse) +} +GetResponse::GetResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tunnelbroker.GetResponse) +} +GetResponse::GetResponse(const GetResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + clear_has_date(); + switch (from.date_case()) { + case kMessageResponse: { + _internal_mutable_messageresponse()->::tunnelbroker::GetResponseMessage::MergeFrom(from._internal_messageresponse()); + break; + } + case kPing: { + _internal_set_ping(from._internal_ping()); + break; + } + case DATE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:tunnelbroker.GetResponse) +} + +void GetResponse::SharedCtor() { +clear_has_date(); +} + +GetResponse::~GetResponse() { + // @@protoc_insertion_point(destructor:tunnelbroker.GetResponse) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void GetResponse::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (has_date()) { + clear_date(); + } +} + +void GetResponse::ArenaDtor(void* object) { + GetResponse* _this = reinterpret_cast< GetResponse* >(object); + (void)_this; +} +void GetResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void GetResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void GetResponse::clear_date() { +// @@protoc_insertion_point(one_of_clear_start:tunnelbroker.GetResponse) + switch (date_case()) { + case kMessageResponse: { + if (GetArena() == nullptr) { + delete date_.messageresponse_; + } + break; + } + case kPing: { + // No need to clear + break; + } + case DATE_NOT_SET: { + break; + } + } + _oneof_case_[0] = DATE_NOT_SET; +} + + +void GetResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:tunnelbroker.GetResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_date(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GetResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .tunnelbroker.GetResponseMessage messageResponse = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_messageresponse(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bool ping = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + _internal_set_ping(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* GetResponse::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:tunnelbroker.GetResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .tunnelbroker.GetResponseMessage messageResponse = 1; + if (_internal_has_messageresponse()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 1, _Internal::messageresponse(this), target, stream); + } + + // bool ping = 2; + if (_internal_has_ping()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_ping(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:tunnelbroker.GetResponse) + return target; +} + +size_t GetResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tunnelbroker.GetResponse) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + switch (date_case()) { + // .tunnelbroker.GetResponseMessage messageResponse = 1; + case kMessageResponse: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *date_.messageresponse_); + break; + } + // bool ping = 2; + case kPing: { + total_size += 1 + 1; + break; + } + case DATE_NOT_SET: { + break; + } + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + void GetResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:tunnelbroker.GetResponse) GOOGLE_DCHECK_NE(&from, this); @@ -2357,12 +2659,18 @@ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - blobhashes_.MergeFrom(from.blobhashes_); - if (from.fromdeviceid().size() > 0) { - _internal_set_fromdeviceid(from._internal_fromdeviceid()); - } - if (from.payload().size() > 0) { - _internal_set_payload(from._internal_payload()); + switch (from.date_case()) { + case kMessageResponse: { + _internal_mutable_messageresponse()->::tunnelbroker::GetResponseMessage::MergeFrom(from._internal_messageresponse()); + break; + } + case kPing: { + _internal_set_ping(from._internal_ping()); + break; + } + case DATE_NOT_SET: { + break; + } } } @@ -2387,9 +2695,8 @@ void GetResponse::InternalSwap(GetResponse* other) { using std::swap; _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - blobhashes_.InternalSwap(&other->blobhashes_); - fromdeviceid_.Swap(&other->fromdeviceid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - payload_.Swap(&other->payload_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + swap(date_, other->date_); + swap(_oneof_case_[0], other->_oneof_case_[0]); } ::PROTOBUF_NAMESPACE_ID::Metadata GetResponse::GetMetadata() const { @@ -5376,6 +5683,9 @@ template<> PROTOBUF_NOINLINE ::tunnelbroker::GetRequest* Arena::CreateMaybeMessage< ::tunnelbroker::GetRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::tunnelbroker::GetRequest >(arena); } +template<> PROTOBUF_NOINLINE ::tunnelbroker::GetResponseMessage* Arena::CreateMaybeMessage< ::tunnelbroker::GetResponseMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::tunnelbroker::GetResponseMessage >(arena); +} template<> PROTOBUF_NOINLINE ::tunnelbroker::GetResponse* Arena::CreateMaybeMessage< ::tunnelbroker::GetResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::tunnelbroker::GetResponse >(arena); } diff --git a/shared/protos/tunnelbroker.proto b/shared/protos/tunnelbroker.proto --- a/shared/protos/tunnelbroker.proto +++ b/shared/protos/tunnelbroker.proto @@ -70,12 +70,19 @@ string sessionID = 1; } -message GetResponse { +message GetResponseMessage { string fromDeviceID = 1; bytes payload = 2; repeated string blobHashes = 3; } +message GetResponse { + oneof date { + GetResponseMessage messageResponse = 1; + bool ping = 2; + } +} + // Common messages structures for the MessagesStream message ProcessedMessages {