Improvements to SSH RPC interface.

- Added Directory Listings.
 - Added File Streaming Node->Client
 - Updated generated protobuf files.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-rpc-b1@6282 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2013-03-25 19:05:31 +00:00
parent 4d205a8a4e
commit bef0b26744
13 changed files with 3486 additions and 509 deletions

View File

@ -216,12 +216,16 @@ protorpc {
rpc/proto/rpcprotochat.h \
rpc/proto/rpcprotosearch.h \
rpc/proto/rpcprotofiles.h \
rpc/proto/rpcprotostream.h \
rpc/proto/rpcprotoutils.h \
SOURCES += rpc/proto/rpcprotopeers.cc \
rpc/proto/rpcprotosystem.cc \
rpc/proto/rpcprotochat.cc \
rpc/proto/rpcprotosearch.cc \
rpc/proto/rpcprotofiles.cc \
rpc/proto/rpcprotostream.cc \
rpc/proto/rpcprotoutils.cc \
# Offical Generated Code (protobuf 2.4.1)
HEADERS += rpc/proto/gencc/core.pb.h \
@ -230,6 +234,7 @@ protorpc {
rpc/proto/gencc/chat.pb.h \
rpc/proto/gencc/search.pb.h \
rpc/proto/gencc/files.pb.h \
rpc/proto/gencc/stream.pb.h \
SOURCES += rpc/proto/gencc/core.pb.cc \
rpc/proto/gencc/peers.pb.cc \
@ -237,6 +242,7 @@ protorpc {
rpc/proto/gencc/chat.pb.cc \
rpc/proto/gencc/search.pb.cc \
rpc/proto/gencc/files.pb.cc \
rpc/proto/gencc/stream.pb.cc \
# Generated ProtoBuf Code the RPC System
# If you are developing, or have a different version of protobuf
@ -247,6 +253,7 @@ protorpc {
# ../../rsctrl/src/gencc/chat.pb.h \
# ../../rsctrl/src/gencc/search.pb.h \
# ../../rsctrl/src/gencc/files.pb.h \
# ../../rsctrl/src/gencc/stream.pb.h \
#SOURCES += ../../rsctrl/src/gencc/core.pb.cc \
# ../../rsctrl/src/gencc/peers.pb.cc \
@ -254,6 +261,7 @@ protorpc {
# ../../rsctrl/src/gencc/chat.pb.cc \
# ../../rsctrl/src/gencc/search.pb.cc \
# ../../rsctrl/src/gencc/files.pb.cc \
# ../../rsctrl/src/gencc/stream.pb.cc \
!win32 {
# unrecognized option

View File

@ -34,6 +34,13 @@ const ::google::protobuf::EnumDescriptor* RequestControlDownload_Action_descript
const ::google::protobuf::Descriptor* ResponseControlDownload_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
ResponseControlDownload_reflection_ = NULL;
const ::google::protobuf::Descriptor* RequestShareDirList_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RequestShareDirList_reflection_ = NULL;
const ::google::protobuf::Descriptor* ResponseShareDirList_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
ResponseShareDirList_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* ResponseShareDirList_ListType_descriptor_ = NULL;
const ::google::protobuf::EnumDescriptor* RequestMsgIds_descriptor_ = NULL;
const ::google::protobuf::EnumDescriptor* ResponseMsgIds_descriptor_ = NULL;
const ::google::protobuf::EnumDescriptor* Direction_descriptor_ = NULL;
@ -128,6 +135,42 @@ void protobuf_AssignDesc_files_2eproto() {
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(ResponseControlDownload));
RequestShareDirList_descriptor_ = file->message_type(5);
static const int RequestShareDirList_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestShareDirList, ssl_id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestShareDirList, path_),
};
RequestShareDirList_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
RequestShareDirList_descriptor_,
RequestShareDirList::default_instance_,
RequestShareDirList_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestShareDirList, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestShareDirList, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(RequestShareDirList));
ResponseShareDirList_descriptor_ = file->message_type(6);
static const int ResponseShareDirList_offsets_[5] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseShareDirList, status_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseShareDirList, ssl_id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseShareDirList, path_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseShareDirList, list_type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseShareDirList, files_),
};
ResponseShareDirList_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
ResponseShareDirList_descriptor_,
ResponseShareDirList::default_instance_,
ResponseShareDirList_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseShareDirList, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseShareDirList, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(ResponseShareDirList));
ResponseShareDirList_ListType_descriptor_ = ResponseShareDirList_descriptor_->enum_type(0);
RequestMsgIds_descriptor_ = file->enum_type(0);
ResponseMsgIds_descriptor_ = file->enum_type(1);
Direction_descriptor_ = file->enum_type(2);
@ -153,6 +196,10 @@ void protobuf_RegisterTypes(const ::std::string&) {
RequestControlDownload_descriptor_, &RequestControlDownload::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
ResponseControlDownload_descriptor_, &ResponseControlDownload::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RequestShareDirList_descriptor_, &RequestShareDirList::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
ResponseShareDirList_descriptor_, &ResponseShareDirList::default_instance());
}
} // namespace
@ -168,6 +215,10 @@ void protobuf_ShutdownFile_files_2eproto() {
delete RequestControlDownload_reflection_;
delete ResponseControlDownload::default_instance_;
delete ResponseControlDownload_reflection_;
delete RequestShareDirList::default_instance_;
delete RequestShareDirList_reflection_;
delete ResponseShareDirList::default_instance_;
delete ResponseShareDirList_reflection_;
}
void protobuf_AddDesc_files_2eproto() {
@ -194,13 +245,23 @@ void protobuf_AddDesc_files_2eproto() {
"TION_WAIT\020\003\022\020\n\014ACTION_PAUSE\020\004\022\022\n\016ACTION_"
"RESTART\020\005\022\020\n\014ACTION_CHECK\020\006\022\021\n\rACTION_CA"
"NCEL\020\007\">\n\027ResponseControlDownload\022#\n\006sta"
"tus\030\001 \002(\0132\023.rsctrl.core.Status*P\n\rReques"
"tMsgIds\022\035\n\031MsgId_RequestTransferList\020\001\022 "
"\n\034MsgId_RequestControlDownload\020\002*S\n\016Resp"
"onseMsgIds\022\036\n\032MsgId_ResponseTransferList"
"\020\001\022!\n\035MsgId_ResponseControlDownload\020\002*9\n"
"\tDirection\022\024\n\020DIRECTION_UPLOAD\020\001\022\026\n\022DIRE"
"CTION_DOWNLOAD\020\002", 896);
"tus\030\001 \002(\0132\023.rsctrl.core.Status\"3\n\023Reques"
"tShareDirList\022\016\n\006ssl_id\030\001 \002(\t\022\014\n\004path\030\002 "
"\002(\t\"\224\002\n\024ResponseShareDirList\022#\n\006status\030\001"
" \002(\0132\023.rsctrl.core.Status\022\016\n\006ssl_id\030\002 \002("
"\t\022\014\n\004path\030\003 \002(\t\022>\n\tlist_type\030\004 \002(\0162+.rsc"
"trl.files.ResponseShareDirList.ListType\022"
" \n\005files\030\005 \003(\0132\021.rsctrl.core.File\"W\n\010Lis"
"tType\022\021\n\rDIRQUERY_ROOT\020\001\022\023\n\017DIRQUERY_PER"
"SON\020\002\022\021\n\rDIRQUERY_FILE\020\003\022\020\n\014DIRQUERY_DIR"
"\020\004*o\n\rRequestMsgIds\022\035\n\031MsgId_RequestTran"
"sferList\020\001\022 \n\034MsgId_RequestControlDownlo"
"ad\020\002\022\035\n\031MsgId_RequestShareDirList\020\003*s\n\016R"
"esponseMsgIds\022\036\n\032MsgId_ResponseTransferL"
"ist\020\001\022!\n\035MsgId_ResponseControlDownload\020\002"
"\022\036\n\032MsgId_ResponseShareDirList\020\003*9\n\tDire"
"ction\022\024\n\020DIRECTION_UPLOAD\020\001\022\026\n\022DIRECTION"
"_DOWNLOAD\020\002", 1291);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"files.proto", &protobuf_RegisterTypes);
FileTransfer::default_instance_ = new FileTransfer();
@ -208,11 +269,15 @@ void protobuf_AddDesc_files_2eproto() {
ResponseTransferList::default_instance_ = new ResponseTransferList();
RequestControlDownload::default_instance_ = new RequestControlDownload();
ResponseControlDownload::default_instance_ = new ResponseControlDownload();
RequestShareDirList::default_instance_ = new RequestShareDirList();
ResponseShareDirList::default_instance_ = new ResponseShareDirList();
FileTransfer::default_instance_->InitAsDefaultInstance();
RequestTransferList::default_instance_->InitAsDefaultInstance();
ResponseTransferList::default_instance_->InitAsDefaultInstance();
RequestControlDownload::default_instance_->InitAsDefaultInstance();
ResponseControlDownload::default_instance_->InitAsDefaultInstance();
RequestShareDirList::default_instance_->InitAsDefaultInstance();
ResponseShareDirList::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_files_2eproto);
}
@ -231,6 +296,7 @@ bool RequestMsgIds_IsValid(int value) {
switch(value) {
case 1:
case 2:
case 3:
return true;
default:
return false;
@ -245,6 +311,7 @@ bool ResponseMsgIds_IsValid(int value) {
switch(value) {
case 1:
case 2:
case 3:
return true;
default:
return false;
@ -1586,6 +1653,732 @@ void ResponseControlDownload::Swap(ResponseControlDownload* other) {
}
// ===================================================================
#ifndef _MSC_VER
const int RequestShareDirList::kSslIdFieldNumber;
const int RequestShareDirList::kPathFieldNumber;
#endif // !_MSC_VER
RequestShareDirList::RequestShareDirList()
: ::google::protobuf::Message() {
SharedCtor();
}
void RequestShareDirList::InitAsDefaultInstance() {
}
RequestShareDirList::RequestShareDirList(const RequestShareDirList& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void RequestShareDirList::SharedCtor() {
_cached_size_ = 0;
ssl_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
path_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
RequestShareDirList::~RequestShareDirList() {
SharedDtor();
}
void RequestShareDirList::SharedDtor() {
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
delete ssl_id_;
}
if (path_ != &::google::protobuf::internal::kEmptyString) {
delete path_;
}
if (this != default_instance_) {
}
}
void RequestShareDirList::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RequestShareDirList::descriptor() {
protobuf_AssignDescriptorsOnce();
return RequestShareDirList_descriptor_;
}
const RequestShareDirList& RequestShareDirList::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_files_2eproto(); return *default_instance_;
}
RequestShareDirList* RequestShareDirList::default_instance_ = NULL;
RequestShareDirList* RequestShareDirList::New() const {
return new RequestShareDirList;
}
void RequestShareDirList::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_ssl_id()) {
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
ssl_id_->clear();
}
}
if (has_path()) {
if (path_ != &::google::protobuf::internal::kEmptyString) {
path_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool RequestShareDirList::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required string ssl_id = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_ssl_id()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_path;
break;
}
// required string path = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_path:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_path()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->path().data(), this->path().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void RequestShareDirList::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required string ssl_id = 1;
if (has_ssl_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
1, this->ssl_id(), output);
}
// required string path = 2;
if (has_path()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->path().data(), this->path().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->path(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* RequestShareDirList::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required string ssl_id = 1;
if (has_ssl_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->ssl_id(), target);
}
// required string path = 2;
if (has_path()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->path().data(), this->path().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->path(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int RequestShareDirList::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required string ssl_id = 1;
if (has_ssl_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->ssl_id());
}
// required string path = 2;
if (has_path()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->path());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void RequestShareDirList::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RequestShareDirList* source =
::google::protobuf::internal::dynamic_cast_if_available<const RequestShareDirList*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RequestShareDirList::MergeFrom(const RequestShareDirList& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_ssl_id()) {
set_ssl_id(from.ssl_id());
}
if (from.has_path()) {
set_path(from.path());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void RequestShareDirList::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RequestShareDirList::CopyFrom(const RequestShareDirList& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RequestShareDirList::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void RequestShareDirList::Swap(RequestShareDirList* other) {
if (other != this) {
std::swap(ssl_id_, other->ssl_id_);
std::swap(path_, other->path_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata RequestShareDirList::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RequestShareDirList_descriptor_;
metadata.reflection = RequestShareDirList_reflection_;
return metadata;
}
// ===================================================================
const ::google::protobuf::EnumDescriptor* ResponseShareDirList_ListType_descriptor() {
protobuf_AssignDescriptorsOnce();
return ResponseShareDirList_ListType_descriptor_;
}
bool ResponseShareDirList_ListType_IsValid(int value) {
switch(value) {
case 1:
case 2:
case 3:
case 4:
return true;
default:
return false;
}
}
#ifndef _MSC_VER
const ResponseShareDirList_ListType ResponseShareDirList::DIRQUERY_ROOT;
const ResponseShareDirList_ListType ResponseShareDirList::DIRQUERY_PERSON;
const ResponseShareDirList_ListType ResponseShareDirList::DIRQUERY_FILE;
const ResponseShareDirList_ListType ResponseShareDirList::DIRQUERY_DIR;
const ResponseShareDirList_ListType ResponseShareDirList::ListType_MIN;
const ResponseShareDirList_ListType ResponseShareDirList::ListType_MAX;
const int ResponseShareDirList::ListType_ARRAYSIZE;
#endif // _MSC_VER
#ifndef _MSC_VER
const int ResponseShareDirList::kStatusFieldNumber;
const int ResponseShareDirList::kSslIdFieldNumber;
const int ResponseShareDirList::kPathFieldNumber;
const int ResponseShareDirList::kListTypeFieldNumber;
const int ResponseShareDirList::kFilesFieldNumber;
#endif // !_MSC_VER
ResponseShareDirList::ResponseShareDirList()
: ::google::protobuf::Message() {
SharedCtor();
}
void ResponseShareDirList::InitAsDefaultInstance() {
status_ = const_cast< ::rsctrl::core::Status*>(&::rsctrl::core::Status::default_instance());
}
ResponseShareDirList::ResponseShareDirList(const ResponseShareDirList& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void ResponseShareDirList::SharedCtor() {
_cached_size_ = 0;
status_ = NULL;
ssl_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
path_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
list_type_ = 1;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
ResponseShareDirList::~ResponseShareDirList() {
SharedDtor();
}
void ResponseShareDirList::SharedDtor() {
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
delete ssl_id_;
}
if (path_ != &::google::protobuf::internal::kEmptyString) {
delete path_;
}
if (this != default_instance_) {
delete status_;
}
}
void ResponseShareDirList::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ResponseShareDirList::descriptor() {
protobuf_AssignDescriptorsOnce();
return ResponseShareDirList_descriptor_;
}
const ResponseShareDirList& ResponseShareDirList::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_files_2eproto(); return *default_instance_;
}
ResponseShareDirList* ResponseShareDirList::default_instance_ = NULL;
ResponseShareDirList* ResponseShareDirList::New() const {
return new ResponseShareDirList;
}
void ResponseShareDirList::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_status()) {
if (status_ != NULL) status_->::rsctrl::core::Status::Clear();
}
if (has_ssl_id()) {
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
ssl_id_->clear();
}
}
if (has_path()) {
if (path_ != &::google::protobuf::internal::kEmptyString) {
path_->clear();
}
}
list_type_ = 1;
}
files_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool ResponseShareDirList::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .rsctrl.core.Status status = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_status()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_ssl_id;
break;
}
// required string ssl_id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_ssl_id:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_ssl_id()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_path;
break;
}
// required string path = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_path:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_path()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->path().data(), this->path().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_list_type;
break;
}
// required .rsctrl.files.ResponseShareDirList.ListType list_type = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_list_type:
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::rsctrl::files::ResponseShareDirList_ListType_IsValid(value)) {
set_list_type(static_cast< ::rsctrl::files::ResponseShareDirList_ListType >(value));
} else {
mutable_unknown_fields()->AddVarint(4, value);
}
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(42)) goto parse_files;
break;
}
// repeated .rsctrl.core.File files = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_files:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_files()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(42)) goto parse_files;
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void ResponseShareDirList::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required .rsctrl.core.Status status = 1;
if (has_status()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, this->status(), output);
}
// required string ssl_id = 2;
if (has_ssl_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->ssl_id(), output);
}
// required string path = 3;
if (has_path()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->path().data(), this->path().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->path(), output);
}
// required .rsctrl.files.ResponseShareDirList.ListType list_type = 4;
if (has_list_type()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
4, this->list_type(), output);
}
// repeated .rsctrl.core.File files = 5;
for (int i = 0; i < this->files_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
5, this->files(i), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* ResponseShareDirList::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required .rsctrl.core.Status status = 1;
if (has_status()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
1, this->status(), target);
}
// required string ssl_id = 2;
if (has_ssl_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->ssl_id(), target);
}
// required string path = 3;
if (has_path()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->path().data(), this->path().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->path(), target);
}
// required .rsctrl.files.ResponseShareDirList.ListType list_type = 4;
if (has_list_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
4, this->list_type(), target);
}
// repeated .rsctrl.core.File files = 5;
for (int i = 0; i < this->files_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
5, this->files(i), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int ResponseShareDirList::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required .rsctrl.core.Status status = 1;
if (has_status()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->status());
}
// required string ssl_id = 2;
if (has_ssl_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->ssl_id());
}
// required string path = 3;
if (has_path()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->path());
}
// required .rsctrl.files.ResponseShareDirList.ListType list_type = 4;
if (has_list_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->list_type());
}
}
// repeated .rsctrl.core.File files = 5;
total_size += 1 * this->files_size();
for (int i = 0; i < this->files_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->files(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void ResponseShareDirList::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const ResponseShareDirList* source =
::google::protobuf::internal::dynamic_cast_if_available<const ResponseShareDirList*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void ResponseShareDirList::MergeFrom(const ResponseShareDirList& from) {
GOOGLE_CHECK_NE(&from, this);
files_.MergeFrom(from.files_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_status()) {
mutable_status()->::rsctrl::core::Status::MergeFrom(from.status());
}
if (from.has_ssl_id()) {
set_ssl_id(from.ssl_id());
}
if (from.has_path()) {
set_path(from.path());
}
if (from.has_list_type()) {
set_list_type(from.list_type());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void ResponseShareDirList::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ResponseShareDirList::CopyFrom(const ResponseShareDirList& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ResponseShareDirList::IsInitialized() const {
if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
if (has_status()) {
if (!this->status().IsInitialized()) return false;
}
for (int i = 0; i < files_size(); i++) {
if (!this->files(i).IsInitialized()) return false;
}
return true;
}
void ResponseShareDirList::Swap(ResponseShareDirList* other) {
if (other != this) {
std::swap(status_, other->status_);
std::swap(ssl_id_, other->ssl_id_);
std::swap(path_, other->path_);
std::swap(list_type_, other->list_type_);
files_.Swap(&other->files_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata ResponseShareDirList::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = ResponseShareDirList_descriptor_;
metadata.reflection = ResponseShareDirList_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace files

View File

@ -39,6 +39,8 @@ class RequestTransferList;
class ResponseTransferList;
class RequestControlDownload;
class ResponseControlDownload;
class RequestShareDirList;
class ResponseShareDirList;
enum RequestControlDownload_Action {
RequestControlDownload_Action_ACTION_START = 1,
@ -64,13 +66,35 @@ inline bool RequestControlDownload_Action_Parse(
return ::google::protobuf::internal::ParseNamedEnum<RequestControlDownload_Action>(
RequestControlDownload_Action_descriptor(), name, value);
}
enum ResponseShareDirList_ListType {
ResponseShareDirList_ListType_DIRQUERY_ROOT = 1,
ResponseShareDirList_ListType_DIRQUERY_PERSON = 2,
ResponseShareDirList_ListType_DIRQUERY_FILE = 3,
ResponseShareDirList_ListType_DIRQUERY_DIR = 4
};
bool ResponseShareDirList_ListType_IsValid(int value);
const ResponseShareDirList_ListType ResponseShareDirList_ListType_ListType_MIN = ResponseShareDirList_ListType_DIRQUERY_ROOT;
const ResponseShareDirList_ListType ResponseShareDirList_ListType_ListType_MAX = ResponseShareDirList_ListType_DIRQUERY_DIR;
const int ResponseShareDirList_ListType_ListType_ARRAYSIZE = ResponseShareDirList_ListType_ListType_MAX + 1;
const ::google::protobuf::EnumDescriptor* ResponseShareDirList_ListType_descriptor();
inline const ::std::string& ResponseShareDirList_ListType_Name(ResponseShareDirList_ListType value) {
return ::google::protobuf::internal::NameOfEnum(
ResponseShareDirList_ListType_descriptor(), value);
}
inline bool ResponseShareDirList_ListType_Parse(
const ::std::string& name, ResponseShareDirList_ListType* value) {
return ::google::protobuf::internal::ParseNamedEnum<ResponseShareDirList_ListType>(
ResponseShareDirList_ListType_descriptor(), name, value);
}
enum RequestMsgIds {
MsgId_RequestTransferList = 1,
MsgId_RequestControlDownload = 2
MsgId_RequestControlDownload = 2,
MsgId_RequestShareDirList = 3
};
bool RequestMsgIds_IsValid(int value);
const RequestMsgIds RequestMsgIds_MIN = MsgId_RequestTransferList;
const RequestMsgIds RequestMsgIds_MAX = MsgId_RequestControlDownload;
const RequestMsgIds RequestMsgIds_MAX = MsgId_RequestShareDirList;
const int RequestMsgIds_ARRAYSIZE = RequestMsgIds_MAX + 1;
const ::google::protobuf::EnumDescriptor* RequestMsgIds_descriptor();
@ -85,11 +109,12 @@ inline bool RequestMsgIds_Parse(
}
enum ResponseMsgIds {
MsgId_ResponseTransferList = 1,
MsgId_ResponseControlDownload = 2
MsgId_ResponseControlDownload = 2,
MsgId_ResponseShareDirList = 3
};
bool ResponseMsgIds_IsValid(int value);
const ResponseMsgIds ResponseMsgIds_MIN = MsgId_ResponseTransferList;
const ResponseMsgIds ResponseMsgIds_MAX = MsgId_ResponseControlDownload;
const ResponseMsgIds ResponseMsgIds_MAX = MsgId_ResponseShareDirList;
const int ResponseMsgIds_ARRAYSIZE = ResponseMsgIds_MAX + 1;
const ::google::protobuf::EnumDescriptor* ResponseMsgIds_descriptor();
@ -617,6 +642,266 @@ class ResponseControlDownload : public ::google::protobuf::Message {
void InitAsDefaultInstance();
static ResponseControlDownload* default_instance_;
};
// -------------------------------------------------------------------
class RequestShareDirList : public ::google::protobuf::Message {
public:
RequestShareDirList();
virtual ~RequestShareDirList();
RequestShareDirList(const RequestShareDirList& from);
inline RequestShareDirList& operator=(const RequestShareDirList& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const RequestShareDirList& default_instance();
void Swap(RequestShareDirList* other);
// implements Message ----------------------------------------------
RequestShareDirList* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const RequestShareDirList& from);
void MergeFrom(const RequestShareDirList& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required string ssl_id = 1;
inline bool has_ssl_id() const;
inline void clear_ssl_id();
static const int kSslIdFieldNumber = 1;
inline const ::std::string& ssl_id() const;
inline void set_ssl_id(const ::std::string& value);
inline void set_ssl_id(const char* value);
inline void set_ssl_id(const char* value, size_t size);
inline ::std::string* mutable_ssl_id();
inline ::std::string* release_ssl_id();
// required string path = 2;
inline bool has_path() const;
inline void clear_path();
static const int kPathFieldNumber = 2;
inline const ::std::string& path() const;
inline void set_path(const ::std::string& value);
inline void set_path(const char* value);
inline void set_path(const char* value, size_t size);
inline ::std::string* mutable_path();
inline ::std::string* release_path();
// @@protoc_insertion_point(class_scope:rsctrl.files.RequestShareDirList)
private:
inline void set_has_ssl_id();
inline void clear_has_ssl_id();
inline void set_has_path();
inline void clear_has_path();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::std::string* ssl_id_;
::std::string* path_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
friend void protobuf_AddDesc_files_2eproto();
friend void protobuf_AssignDesc_files_2eproto();
friend void protobuf_ShutdownFile_files_2eproto();
void InitAsDefaultInstance();
static RequestShareDirList* default_instance_;
};
// -------------------------------------------------------------------
class ResponseShareDirList : public ::google::protobuf::Message {
public:
ResponseShareDirList();
virtual ~ResponseShareDirList();
ResponseShareDirList(const ResponseShareDirList& from);
inline ResponseShareDirList& operator=(const ResponseShareDirList& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const ResponseShareDirList& default_instance();
void Swap(ResponseShareDirList* other);
// implements Message ----------------------------------------------
ResponseShareDirList* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const ResponseShareDirList& from);
void MergeFrom(const ResponseShareDirList& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef ResponseShareDirList_ListType ListType;
static const ListType DIRQUERY_ROOT = ResponseShareDirList_ListType_DIRQUERY_ROOT;
static const ListType DIRQUERY_PERSON = ResponseShareDirList_ListType_DIRQUERY_PERSON;
static const ListType DIRQUERY_FILE = ResponseShareDirList_ListType_DIRQUERY_FILE;
static const ListType DIRQUERY_DIR = ResponseShareDirList_ListType_DIRQUERY_DIR;
static inline bool ListType_IsValid(int value) {
return ResponseShareDirList_ListType_IsValid(value);
}
static const ListType ListType_MIN =
ResponseShareDirList_ListType_ListType_MIN;
static const ListType ListType_MAX =
ResponseShareDirList_ListType_ListType_MAX;
static const int ListType_ARRAYSIZE =
ResponseShareDirList_ListType_ListType_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
ListType_descriptor() {
return ResponseShareDirList_ListType_descriptor();
}
static inline const ::std::string& ListType_Name(ListType value) {
return ResponseShareDirList_ListType_Name(value);
}
static inline bool ListType_Parse(const ::std::string& name,
ListType* value) {
return ResponseShareDirList_ListType_Parse(name, value);
}
// accessors -------------------------------------------------------
// required .rsctrl.core.Status status = 1;
inline bool has_status() const;
inline void clear_status();
static const int kStatusFieldNumber = 1;
inline const ::rsctrl::core::Status& status() const;
inline ::rsctrl::core::Status* mutable_status();
inline ::rsctrl::core::Status* release_status();
// required string ssl_id = 2;
inline bool has_ssl_id() const;
inline void clear_ssl_id();
static const int kSslIdFieldNumber = 2;
inline const ::std::string& ssl_id() const;
inline void set_ssl_id(const ::std::string& value);
inline void set_ssl_id(const char* value);
inline void set_ssl_id(const char* value, size_t size);
inline ::std::string* mutable_ssl_id();
inline ::std::string* release_ssl_id();
// required string path = 3;
inline bool has_path() const;
inline void clear_path();
static const int kPathFieldNumber = 3;
inline const ::std::string& path() const;
inline void set_path(const ::std::string& value);
inline void set_path(const char* value);
inline void set_path(const char* value, size_t size);
inline ::std::string* mutable_path();
inline ::std::string* release_path();
// required .rsctrl.files.ResponseShareDirList.ListType list_type = 4;
inline bool has_list_type() const;
inline void clear_list_type();
static const int kListTypeFieldNumber = 4;
inline ::rsctrl::files::ResponseShareDirList_ListType list_type() const;
inline void set_list_type(::rsctrl::files::ResponseShareDirList_ListType value);
// repeated .rsctrl.core.File files = 5;
inline int files_size() const;
inline void clear_files();
static const int kFilesFieldNumber = 5;
inline const ::rsctrl::core::File& files(int index) const;
inline ::rsctrl::core::File* mutable_files(int index);
inline ::rsctrl::core::File* add_files();
inline const ::google::protobuf::RepeatedPtrField< ::rsctrl::core::File >&
files() const;
inline ::google::protobuf::RepeatedPtrField< ::rsctrl::core::File >*
mutable_files();
// @@protoc_insertion_point(class_scope:rsctrl.files.ResponseShareDirList)
private:
inline void set_has_status();
inline void clear_has_status();
inline void set_has_ssl_id();
inline void clear_has_ssl_id();
inline void set_has_path();
inline void clear_has_path();
inline void set_has_list_type();
inline void clear_has_list_type();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::rsctrl::core::Status* status_;
::std::string* ssl_id_;
::std::string* path_;
::google::protobuf::RepeatedPtrField< ::rsctrl::core::File > files_;
int list_type_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(5 + 31) / 32];
friend void protobuf_AddDesc_files_2eproto();
friend void protobuf_AssignDesc_files_2eproto();
friend void protobuf_ShutdownFile_files_2eproto();
void InitAsDefaultInstance();
static ResponseShareDirList* default_instance_;
};
// ===================================================================
@ -894,6 +1179,323 @@ inline ::rsctrl::core::Status* ResponseControlDownload::release_status() {
return temp;
}
// -------------------------------------------------------------------
// RequestShareDirList
// required string ssl_id = 1;
inline bool RequestShareDirList::has_ssl_id() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void RequestShareDirList::set_has_ssl_id() {
_has_bits_[0] |= 0x00000001u;
}
inline void RequestShareDirList::clear_has_ssl_id() {
_has_bits_[0] &= ~0x00000001u;
}
inline void RequestShareDirList::clear_ssl_id() {
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
ssl_id_->clear();
}
clear_has_ssl_id();
}
inline const ::std::string& RequestShareDirList::ssl_id() const {
return *ssl_id_;
}
inline void RequestShareDirList::set_ssl_id(const ::std::string& value) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(value);
}
inline void RequestShareDirList::set_ssl_id(const char* value) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(value);
}
inline void RequestShareDirList::set_ssl_id(const char* value, size_t size) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* RequestShareDirList::mutable_ssl_id() {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
return ssl_id_;
}
inline ::std::string* RequestShareDirList::release_ssl_id() {
clear_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = ssl_id_;
ssl_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
// required string path = 2;
inline bool RequestShareDirList::has_path() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void RequestShareDirList::set_has_path() {
_has_bits_[0] |= 0x00000002u;
}
inline void RequestShareDirList::clear_has_path() {
_has_bits_[0] &= ~0x00000002u;
}
inline void RequestShareDirList::clear_path() {
if (path_ != &::google::protobuf::internal::kEmptyString) {
path_->clear();
}
clear_has_path();
}
inline const ::std::string& RequestShareDirList::path() const {
return *path_;
}
inline void RequestShareDirList::set_path(const ::std::string& value) {
set_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
path_ = new ::std::string;
}
path_->assign(value);
}
inline void RequestShareDirList::set_path(const char* value) {
set_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
path_ = new ::std::string;
}
path_->assign(value);
}
inline void RequestShareDirList::set_path(const char* value, size_t size) {
set_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
path_ = new ::std::string;
}
path_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* RequestShareDirList::mutable_path() {
set_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
path_ = new ::std::string;
}
return path_;
}
inline ::std::string* RequestShareDirList::release_path() {
clear_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = path_;
path_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
// -------------------------------------------------------------------
// ResponseShareDirList
// required .rsctrl.core.Status status = 1;
inline bool ResponseShareDirList::has_status() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void ResponseShareDirList::set_has_status() {
_has_bits_[0] |= 0x00000001u;
}
inline void ResponseShareDirList::clear_has_status() {
_has_bits_[0] &= ~0x00000001u;
}
inline void ResponseShareDirList::clear_status() {
if (status_ != NULL) status_->::rsctrl::core::Status::Clear();
clear_has_status();
}
inline const ::rsctrl::core::Status& ResponseShareDirList::status() const {
return status_ != NULL ? *status_ : *default_instance_->status_;
}
inline ::rsctrl::core::Status* ResponseShareDirList::mutable_status() {
set_has_status();
if (status_ == NULL) status_ = new ::rsctrl::core::Status;
return status_;
}
inline ::rsctrl::core::Status* ResponseShareDirList::release_status() {
clear_has_status();
::rsctrl::core::Status* temp = status_;
status_ = NULL;
return temp;
}
// required string ssl_id = 2;
inline bool ResponseShareDirList::has_ssl_id() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void ResponseShareDirList::set_has_ssl_id() {
_has_bits_[0] |= 0x00000002u;
}
inline void ResponseShareDirList::clear_has_ssl_id() {
_has_bits_[0] &= ~0x00000002u;
}
inline void ResponseShareDirList::clear_ssl_id() {
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
ssl_id_->clear();
}
clear_has_ssl_id();
}
inline const ::std::string& ResponseShareDirList::ssl_id() const {
return *ssl_id_;
}
inline void ResponseShareDirList::set_ssl_id(const ::std::string& value) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(value);
}
inline void ResponseShareDirList::set_ssl_id(const char* value) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(value);
}
inline void ResponseShareDirList::set_ssl_id(const char* value, size_t size) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* ResponseShareDirList::mutable_ssl_id() {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
return ssl_id_;
}
inline ::std::string* ResponseShareDirList::release_ssl_id() {
clear_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = ssl_id_;
ssl_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
// required string path = 3;
inline bool ResponseShareDirList::has_path() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void ResponseShareDirList::set_has_path() {
_has_bits_[0] |= 0x00000004u;
}
inline void ResponseShareDirList::clear_has_path() {
_has_bits_[0] &= ~0x00000004u;
}
inline void ResponseShareDirList::clear_path() {
if (path_ != &::google::protobuf::internal::kEmptyString) {
path_->clear();
}
clear_has_path();
}
inline const ::std::string& ResponseShareDirList::path() const {
return *path_;
}
inline void ResponseShareDirList::set_path(const ::std::string& value) {
set_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
path_ = new ::std::string;
}
path_->assign(value);
}
inline void ResponseShareDirList::set_path(const char* value) {
set_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
path_ = new ::std::string;
}
path_->assign(value);
}
inline void ResponseShareDirList::set_path(const char* value, size_t size) {
set_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
path_ = new ::std::string;
}
path_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* ResponseShareDirList::mutable_path() {
set_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
path_ = new ::std::string;
}
return path_;
}
inline ::std::string* ResponseShareDirList::release_path() {
clear_has_path();
if (path_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = path_;
path_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
// required .rsctrl.files.ResponseShareDirList.ListType list_type = 4;
inline bool ResponseShareDirList::has_list_type() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void ResponseShareDirList::set_has_list_type() {
_has_bits_[0] |= 0x00000008u;
}
inline void ResponseShareDirList::clear_has_list_type() {
_has_bits_[0] &= ~0x00000008u;
}
inline void ResponseShareDirList::clear_list_type() {
list_type_ = 1;
clear_has_list_type();
}
inline ::rsctrl::files::ResponseShareDirList_ListType ResponseShareDirList::list_type() const {
return static_cast< ::rsctrl::files::ResponseShareDirList_ListType >(list_type_);
}
inline void ResponseShareDirList::set_list_type(::rsctrl::files::ResponseShareDirList_ListType value) {
GOOGLE_DCHECK(::rsctrl::files::ResponseShareDirList_ListType_IsValid(value));
set_has_list_type();
list_type_ = value;
}
// repeated .rsctrl.core.File files = 5;
inline int ResponseShareDirList::files_size() const {
return files_.size();
}
inline void ResponseShareDirList::clear_files() {
files_.Clear();
}
inline const ::rsctrl::core::File& ResponseShareDirList::files(int index) const {
return files_.Get(index);
}
inline ::rsctrl::core::File* ResponseShareDirList::mutable_files(int index) {
return files_.Mutable(index);
}
inline ::rsctrl::core::File* ResponseShareDirList::add_files() {
return files_.Add();
}
inline const ::google::protobuf::RepeatedPtrField< ::rsctrl::core::File >&
ResponseShareDirList::files() const {
return files_;
}
inline ::google::protobuf::RepeatedPtrField< ::rsctrl::core::File >*
ResponseShareDirList::mutable_files() {
return &files_;
}
// @@protoc_insertion_point(namespace_scope)
@ -909,6 +1511,10 @@ inline const EnumDescriptor* GetEnumDescriptor< ::rsctrl::files::RequestControlD
return ::rsctrl::files::RequestControlDownload_Action_descriptor();
}
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::rsctrl::files::ResponseShareDirList_ListType>() {
return ::rsctrl::files::ResponseShareDirList_ListType_descriptor();
}
template <>
inline const EnumDescriptor* GetEnumDescriptor< rsctrl::files::RequestMsgIds>() {
return rsctrl::files::RequestMsgIds_descriptor();
}

View File

@ -78,7 +78,7 @@ void protobuf_AssignDesc_stream_2eproto() {
sizeof(StreamFileDetail));
StreamVoipDetail_descriptor_ = file->message_type(1);
static const int StreamVoipDetail_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StreamVoipDetail, peerid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StreamVoipDetail, peer_id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StreamVoipDetail, duration_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StreamVoipDetail, offset_),
};
@ -137,8 +137,8 @@ void protobuf_AssignDesc_stream_2eproto() {
static const int RequestStartFileStream_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestStartFileStream, file_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestStartFileStream, rate_kbs_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestStartFileStream, startbyte_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestStartFileStream, endbyte_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestStartFileStream, start_byte_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestStartFileStream, end_byte_),
};
RequestStartFileStream_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
@ -286,46 +286,46 @@ void protobuf_AddDesc_stream_2eproto() {
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\014stream.proto\022\rrsctrl.stream\032\ncore.prot"
"o\"C\n\020StreamFileDetail\022\037\n\004file\030\001 \002(\0132\021.rs"
"ctrl.core.File\022\016\n\006offset\030\005 \002(\004\"D\n\020Stream"
"VoipDetail\022\016\n\006peerId\030\001 \002(\t\022\020\n\010duration\030\002"
" \002(\004\022\016\n\006offset\030\003 \002(\004\"\361\001\n\nStreamDesc\022\021\n\ts"
"tream_id\030\001 \002(\r\022.\n\013stream_type\030\002 \002(\0162\031.rs"
"ctrl.stream.StreamType\0220\n\014stream_state\030\003"
" \002(\0162\032.rsctrl.stream.StreamState\022\020\n\010rate"
"_kBs\030\004 \002(\002\022-\n\004file\030\005 \001(\0132\037.rsctrl.stream"
".StreamFileDetail\022-\n\004voip\030\006 \001(\0132\037.rsctrl"
".stream.StreamVoipDetail\"\257\001\n\nStreamData\022"
"\021\n\tstream_id\030\001 \002(\r\0220\n\014stream_state\030\002 \002(\016"
"2\032.rsctrl.stream.StreamState\022)\n\tsend_tim"
"e\030\003 \002(\0132\026.rsctrl.core.Timestamp\022\016\n\006offse"
"t\030\004 \002(\004\022\014\n\004size\030\005 \002(\r\022\023\n\013stream_data\030\006 \002"
"(\014\"o\n\026RequestStartFileStream\022\037\n\004file\030\001 \002"
"(\0132\021.rsctrl.core.File\022\020\n\010rate_kBs\030\002 \002(\002\022"
"\021\n\tstartByte\030\003 \001(\004\022\017\n\007endByte\030\004 \001(\004\"g\n\024R"
"esponseStreamDetail\022#\n\006status\030\001 \002(\0132\023.rs"
"ctrl.core.Status\022*\n\007streams\030\002 \003(\0132\031.rsct"
"rl.stream.StreamDesc\"\376\001\n\024RequestControlS"
"tream\022\021\n\tstream_id\030\001 \002(\r\022@\n\006action\030\002 \002(\016"
"20.rsctrl.stream.RequestControlStream.St"
"reamAction\022\020\n\010rate_kBs\030\003 \001(\002\022\021\n\tseek_byt"
"e\030\004 \001(\003\"l\n\014StreamAction\022\020\n\014STREAM_START\020"
"\001\022\017\n\013STREAM_STOP\020\002\022\020\n\014STREAM_PAUSE\020\003\022\026\n\022"
"STREAM_CHANGE_RATE\020\004\022\017\n\013STREAM_SEEK\020\005\"E\n"
"\022RequestListStreams\022/\n\014request_type\030\001 \002("
"\0162\031.rsctrl.stream.StreamType\"b\n\022Response"
"StreamData\022#\n\006status\030\001 \002(\0132\023.rsctrl.core"
".Status\022\'\n\004data\030\002 \002(\0132\031.rsctrl.stream.St"
"reamData*o\n\rRequestMsgIds\022 \n\034MsgId_Reque"
"stStartFileStream\020\001\022\036\n\032MsgId_RequestCont"
"rolStream\020\002\022\034\n\030MsgId_RequestListStreams\020"
"\003*F\n\016ResponseMsgIds\022\036\n\032MsgId_ResponseStr"
"eamDetail\020\001\022\024\n\020MsgId_StreamData\020\002*e\n\nStr"
"eamType\022\023\n\017STREAM_TYPE_ALL\020\001\022\025\n\021STREAM_T"
"YPE_FILES\020\002\022\024\n\020STREAM_TYPE_VOIP\020\003\022\025\n\021STR"
"EAM_TYPE_OTHER\020\004*n\n\013StreamState\022\026\n\022STREA"
"M_STATE_ERROR\020\000\022\024\n\020STREAM_STATE_RUN\020\001\022\027\n"
"\023STREAM_STATE_PAUSED\020\002\022\030\n\024STREAM_TYPE_FI"
"NISHED\020\003", 1648);
"ctrl.core.File\022\016\n\006offset\030\005 \002(\004\"E\n\020Stream"
"VoipDetail\022\017\n\007peer_id\030\001 \002(\t\022\020\n\010duration\030"
"\002 \002(\004\022\016\n\006offset\030\003 \002(\004\"\361\001\n\nStreamDesc\022\021\n\t"
"stream_id\030\001 \002(\r\022.\n\013stream_type\030\002 \002(\0162\031.r"
"sctrl.stream.StreamType\0220\n\014stream_state\030"
"\003 \002(\0162\032.rsctrl.stream.StreamState\022\020\n\010rat"
"e_kbs\030\004 \002(\002\022-\n\004file\030\005 \001(\0132\037.rsctrl.strea"
"m.StreamFileDetail\022-\n\004voip\030\006 \001(\0132\037.rsctr"
"l.stream.StreamVoipDetail\"\257\001\n\nStreamData"
"\022\021\n\tstream_id\030\001 \002(\r\0220\n\014stream_state\030\002 \002("
"\0162\032.rsctrl.stream.StreamState\022)\n\tsend_ti"
"me\030\003 \002(\0132\026.rsctrl.core.Timestamp\022\016\n\006offs"
"et\030\004 \002(\004\022\014\n\004size\030\005 \002(\r\022\023\n\013stream_data\030\006 "
"\002(\014\"q\n\026RequestStartFileStream\022\037\n\004file\030\001 "
"\002(\0132\021.rsctrl.core.File\022\020\n\010rate_kbs\030\002 \002(\002"
"\022\022\n\nstart_byte\030\003 \001(\004\022\020\n\010end_byte\030\004 \001(\004\"g"
"\n\024ResponseStreamDetail\022#\n\006status\030\001 \002(\0132\023"
".rsctrl.core.Status\022*\n\007streams\030\002 \003(\0132\031.r"
"sctrl.stream.StreamDesc\"\376\001\n\024RequestContr"
"olStream\022\021\n\tstream_id\030\001 \002(\r\022@\n\006action\030\002 "
"\002(\01620.rsctrl.stream.RequestControlStream"
".StreamAction\022\020\n\010rate_kbs\030\003 \001(\002\022\021\n\tseek_"
"byte\030\004 \001(\004\"l\n\014StreamAction\022\020\n\014STREAM_STA"
"RT\020\001\022\017\n\013STREAM_STOP\020\002\022\020\n\014STREAM_PAUSE\020\003\022"
"\026\n\022STREAM_CHANGE_RATE\020\004\022\017\n\013STREAM_SEEK\020\005"
"\"E\n\022RequestListStreams\022/\n\014request_type\030\001"
" \002(\0162\031.rsctrl.stream.StreamType\"b\n\022Respo"
"nseStreamData\022#\n\006status\030\001 \002(\0132\023.rsctrl.c"
"ore.Status\022\'\n\004data\030\002 \002(\0132\031.rsctrl.stream"
".StreamData*o\n\rRequestMsgIds\022 \n\034MsgId_Re"
"questStartFileStream\020\001\022\036\n\032MsgId_RequestC"
"ontrolStream\020\002\022\034\n\030MsgId_RequestListStrea"
"ms\020\003*N\n\016ResponseMsgIds\022\036\n\032MsgId_Response"
"StreamDetail\020\001\022\034\n\030MsgId_ResponseStreamDa"
"ta\020e*e\n\nStreamType\022\023\n\017STREAM_TYPE_ALL\020\001\022"
"\025\n\021STREAM_TYPE_FILES\020\002\022\024\n\020STREAM_TYPE_VO"
"IP\020\003\022\025\n\021STREAM_TYPE_OTHER\020\004*o\n\013StreamSta"
"te\022\026\n\022STREAM_STATE_ERROR\020\000\022\024\n\020STREAM_STA"
"TE_RUN\020\001\022\027\n\023STREAM_STATE_PAUSED\020\002\022\031\n\025STR"
"EAM_STATE_FINISHED\020\003", 1660);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"stream.proto", &protobuf_RegisterTypes);
StreamFileDetail::default_instance_ = new StreamFileDetail();
@ -378,7 +378,7 @@ const ::google::protobuf::EnumDescriptor* ResponseMsgIds_descriptor() {
bool ResponseMsgIds_IsValid(int value) {
switch(value) {
case 1:
case 2:
case 101:
return true;
default:
return false;
@ -698,7 +698,7 @@ StreamVoipDetail::StreamVoipDetail(const StreamVoipDetail& from)
void StreamVoipDetail::SharedCtor() {
_cached_size_ = 0;
peerid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
peer_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
duration_ = GOOGLE_ULONGLONG(0);
offset_ = GOOGLE_ULONGLONG(0);
::memset(_has_bits_, 0, sizeof(_has_bits_));
@ -709,8 +709,8 @@ StreamVoipDetail::~StreamVoipDetail() {
}
void StreamVoipDetail::SharedDtor() {
if (peerid_ != &::google::protobuf::internal::kEmptyString) {
delete peerid_;
if (peer_id_ != &::google::protobuf::internal::kEmptyString) {
delete peer_id_;
}
if (this != default_instance_) {
}
@ -738,9 +738,9 @@ StreamVoipDetail* StreamVoipDetail::New() const {
void StreamVoipDetail::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_peerid()) {
if (peerid_ != &::google::protobuf::internal::kEmptyString) {
peerid_->clear();
if (has_peer_id()) {
if (peer_id_ != &::google::protobuf::internal::kEmptyString) {
peer_id_->clear();
}
}
duration_ = GOOGLE_ULONGLONG(0);
@ -756,14 +756,14 @@ bool StreamVoipDetail::MergePartialFromCodedStream(
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required string peerId = 1;
// required string peer_id = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_peerid()));
input, this->mutable_peer_id()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->peerid().data(), this->peerid().length(),
this->peer_id().data(), this->peer_id().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
@ -822,13 +822,13 @@ bool StreamVoipDetail::MergePartialFromCodedStream(
void StreamVoipDetail::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required string peerId = 1;
if (has_peerid()) {
// required string peer_id = 1;
if (has_peer_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->peerid().data(), this->peerid().length(),
this->peer_id().data(), this->peer_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
1, this->peerid(), output);
1, this->peer_id(), output);
}
// required uint64 duration = 2;
@ -849,14 +849,14 @@ void StreamVoipDetail::SerializeWithCachedSizes(
::google::protobuf::uint8* StreamVoipDetail::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required string peerId = 1;
if (has_peerid()) {
// required string peer_id = 1;
if (has_peer_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->peerid().data(), this->peerid().length(),
this->peer_id().data(), this->peer_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->peerid(), target);
1, this->peer_id(), target);
}
// required uint64 duration = 2;
@ -880,11 +880,11 @@ int StreamVoipDetail::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required string peerId = 1;
if (has_peerid()) {
// required string peer_id = 1;
if (has_peer_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->peerid());
this->peer_id());
}
// required uint64 duration = 2;
@ -928,8 +928,8 @@ void StreamVoipDetail::MergeFrom(const ::google::protobuf::Message& from) {
void StreamVoipDetail::MergeFrom(const StreamVoipDetail& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_peerid()) {
set_peerid(from.peerid());
if (from.has_peer_id()) {
set_peer_id(from.peer_id());
}
if (from.has_duration()) {
set_duration(from.duration());
@ -961,7 +961,7 @@ bool StreamVoipDetail::IsInitialized() const {
void StreamVoipDetail::Swap(StreamVoipDetail* other) {
if (other != this) {
std::swap(peerid_, other->peerid_);
std::swap(peer_id_, other->peer_id_);
std::swap(duration_, other->duration_);
std::swap(offset_, other->offset_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
@ -985,7 +985,7 @@ void StreamVoipDetail::Swap(StreamVoipDetail* other) {
const int StreamDesc::kStreamIdFieldNumber;
const int StreamDesc::kStreamTypeFieldNumber;
const int StreamDesc::kStreamStateFieldNumber;
const int StreamDesc::kRateKBsFieldNumber;
const int StreamDesc::kRateKbsFieldNumber;
const int StreamDesc::kFileFieldNumber;
const int StreamDesc::kVoipFieldNumber;
#endif // !_MSC_VER
@ -1124,15 +1124,15 @@ bool StreamDesc::MergePartialFromCodedStream(
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(37)) goto parse_rate_kBs;
if (input->ExpectTag(37)) goto parse_rate_kbs;
break;
}
// required float rate_kBs = 4;
// required float rate_kbs = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_rate_kBs:
parse_rate_kbs:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &rate_kbs_)));
@ -1207,7 +1207,7 @@ void StreamDesc::SerializeWithCachedSizes(
3, this->stream_state(), output);
}
// required float rate_kBs = 4;
// required float rate_kbs = 4;
if (has_rate_kbs()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->rate_kbs(), output);
}
@ -1249,7 +1249,7 @@ void StreamDesc::SerializeWithCachedSizes(
3, this->stream_state(), target);
}
// required float rate_kBs = 4;
// required float rate_kbs = 4;
if (has_rate_kbs()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->rate_kbs(), target);
}
@ -1298,7 +1298,7 @@ int StreamDesc::ByteSize() const {
::google::protobuf::internal::WireFormatLite::EnumSize(this->stream_state());
}
// required float rate_kBs = 4;
// required float rate_kbs = 4;
if (has_rate_kbs()) {
total_size += 1 + 4;
}
@ -1847,7 +1847,7 @@ void StreamData::Swap(StreamData* other) {
#ifndef _MSC_VER
const int RequestStartFileStream::kFileFieldNumber;
const int RequestStartFileStream::kRateKBsFieldNumber;
const int RequestStartFileStream::kRateKbsFieldNumber;
const int RequestStartFileStream::kStartByteFieldNumber;
const int RequestStartFileStream::kEndByteFieldNumber;
#endif // !_MSC_VER
@ -1871,8 +1871,8 @@ void RequestStartFileStream::SharedCtor() {
_cached_size_ = 0;
file_ = NULL;
rate_kbs_ = 0;
startbyte_ = GOOGLE_ULONGLONG(0);
endbyte_ = GOOGLE_ULONGLONG(0);
start_byte_ = GOOGLE_ULONGLONG(0);
end_byte_ = GOOGLE_ULONGLONG(0);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
@ -1912,8 +1912,8 @@ void RequestStartFileStream::Clear() {
if (file_ != NULL) file_->::rsctrl::core::File::Clear();
}
rate_kbs_ = 0;
startbyte_ = GOOGLE_ULONGLONG(0);
endbyte_ = GOOGLE_ULONGLONG(0);
start_byte_ = GOOGLE_ULONGLONG(0);
end_byte_ = GOOGLE_ULONGLONG(0);
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
@ -1934,15 +1934,15 @@ bool RequestStartFileStream::MergePartialFromCodedStream(
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(21)) goto parse_rate_kBs;
if (input->ExpectTag(21)) goto parse_rate_kbs;
break;
}
// required float rate_kBs = 2;
// required float rate_kbs = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_rate_kBs:
parse_rate_kbs:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &rate_kbs_)));
@ -1950,35 +1950,35 @@ bool RequestStartFileStream::MergePartialFromCodedStream(
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_startByte;
if (input->ExpectTag(24)) goto parse_start_byte;
break;
}
// optional uint64 startByte = 3;
// optional uint64 start_byte = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_startByte:
parse_start_byte:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &startbyte_)));
set_has_startbyte();
input, &start_byte_)));
set_has_start_byte();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_endByte;
if (input->ExpectTag(32)) goto parse_end_byte;
break;
}
// optional uint64 endByte = 4;
// optional uint64 end_byte = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_endByte:
parse_end_byte:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &endbyte_)));
set_has_endbyte();
input, &end_byte_)));
set_has_end_byte();
} else {
goto handle_uninterpreted;
}
@ -2010,19 +2010,19 @@ void RequestStartFileStream::SerializeWithCachedSizes(
1, this->file(), output);
}
// required float rate_kBs = 2;
// required float rate_kbs = 2;
if (has_rate_kbs()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->rate_kbs(), output);
}
// optional uint64 startByte = 3;
if (has_startbyte()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->startbyte(), output);
// optional uint64 start_byte = 3;
if (has_start_byte()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->start_byte(), output);
}
// optional uint64 endByte = 4;
if (has_endbyte()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->endbyte(), output);
// optional uint64 end_byte = 4;
if (has_end_byte()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->end_byte(), output);
}
if (!unknown_fields().empty()) {
@ -2040,19 +2040,19 @@ void RequestStartFileStream::SerializeWithCachedSizes(
1, this->file(), target);
}
// required float rate_kBs = 2;
// required float rate_kbs = 2;
if (has_rate_kbs()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->rate_kbs(), target);
}
// optional uint64 startByte = 3;
if (has_startbyte()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->startbyte(), target);
// optional uint64 start_byte = 3;
if (has_start_byte()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->start_byte(), target);
}
// optional uint64 endByte = 4;
if (has_endbyte()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->endbyte(), target);
// optional uint64 end_byte = 4;
if (has_end_byte()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->end_byte(), target);
}
if (!unknown_fields().empty()) {
@ -2073,23 +2073,23 @@ int RequestStartFileStream::ByteSize() const {
this->file());
}
// required float rate_kBs = 2;
// required float rate_kbs = 2;
if (has_rate_kbs()) {
total_size += 1 + 4;
}
// optional uint64 startByte = 3;
if (has_startbyte()) {
// optional uint64 start_byte = 3;
if (has_start_byte()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->startbyte());
this->start_byte());
}
// optional uint64 endByte = 4;
if (has_endbyte()) {
// optional uint64 end_byte = 4;
if (has_end_byte()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->endbyte());
this->end_byte());
}
}
@ -2125,11 +2125,11 @@ void RequestStartFileStream::MergeFrom(const RequestStartFileStream& from) {
if (from.has_rate_kbs()) {
set_rate_kbs(from.rate_kbs());
}
if (from.has_startbyte()) {
set_startbyte(from.startbyte());
if (from.has_start_byte()) {
set_start_byte(from.start_byte());
}
if (from.has_endbyte()) {
set_endbyte(from.endbyte());
if (from.has_end_byte()) {
set_end_byte(from.end_byte());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
@ -2160,8 +2160,8 @@ void RequestStartFileStream::Swap(RequestStartFileStream* other) {
if (other != this) {
std::swap(file_, other->file_);
std::swap(rate_kbs_, other->rate_kbs_);
std::swap(startbyte_, other->startbyte_);
std::swap(endbyte_, other->endbyte_);
std::swap(start_byte_, other->start_byte_);
std::swap(end_byte_, other->end_byte_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
@ -2468,7 +2468,7 @@ const int RequestControlStream::StreamAction_ARRAYSIZE;
#ifndef _MSC_VER
const int RequestControlStream::kStreamIdFieldNumber;
const int RequestControlStream::kActionFieldNumber;
const int RequestControlStream::kRateKBsFieldNumber;
const int RequestControlStream::kRateKbsFieldNumber;
const int RequestControlStream::kSeekByteFieldNumber;
#endif // !_MSC_VER
@ -2491,7 +2491,7 @@ void RequestControlStream::SharedCtor() {
stream_id_ = 0u;
action_ = 1;
rate_kbs_ = 0;
seek_byte_ = GOOGLE_LONGLONG(0);
seek_byte_ = GOOGLE_ULONGLONG(0);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
@ -2529,7 +2529,7 @@ void RequestControlStream::Clear() {
stream_id_ = 0u;
action_ = 1;
rate_kbs_ = 0;
seek_byte_ = GOOGLE_LONGLONG(0);
seek_byte_ = GOOGLE_ULONGLONG(0);
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
@ -2573,15 +2573,15 @@ bool RequestControlStream::MergePartialFromCodedStream(
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(29)) goto parse_rate_kBs;
if (input->ExpectTag(29)) goto parse_rate_kbs;
break;
}
// optional float rate_kBs = 3;
// optional float rate_kbs = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_rate_kBs:
parse_rate_kbs:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &rate_kbs_)));
@ -2593,13 +2593,13 @@ bool RequestControlStream::MergePartialFromCodedStream(
break;
}
// optional int64 seek_byte = 4;
// optional uint64 seek_byte = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_seek_byte:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &seek_byte_)));
set_has_seek_byte();
} else {
@ -2638,14 +2638,14 @@ void RequestControlStream::SerializeWithCachedSizes(
2, this->action(), output);
}
// optional float rate_kBs = 3;
// optional float rate_kbs = 3;
if (has_rate_kbs()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->rate_kbs(), output);
}
// optional int64 seek_byte = 4;
// optional uint64 seek_byte = 4;
if (has_seek_byte()) {
::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->seek_byte(), output);
::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->seek_byte(), output);
}
if (!unknown_fields().empty()) {
@ -2667,14 +2667,14 @@ void RequestControlStream::SerializeWithCachedSizes(
2, this->action(), target);
}
// optional float rate_kBs = 3;
// optional float rate_kbs = 3;
if (has_rate_kbs()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->rate_kbs(), target);
}
// optional int64 seek_byte = 4;
// optional uint64 seek_byte = 4;
if (has_seek_byte()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->seek_byte(), target);
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->seek_byte(), target);
}
if (!unknown_fields().empty()) {
@ -2701,15 +2701,15 @@ int RequestControlStream::ByteSize() const {
::google::protobuf::internal::WireFormatLite::EnumSize(this->action());
}
// optional float rate_kBs = 3;
// optional float rate_kbs = 3;
if (has_rate_kbs()) {
total_size += 1 + 4;
}
// optional int64 seek_byte = 4;
// optional uint64 seek_byte = 4;
if (has_seek_byte()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int64Size(
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->seek_byte());
}

View File

@ -88,11 +88,11 @@ inline bool RequestMsgIds_Parse(
}
enum ResponseMsgIds {
MsgId_ResponseStreamDetail = 1,
MsgId_StreamData = 2
MsgId_ResponseStreamData = 101
};
bool ResponseMsgIds_IsValid(int value);
const ResponseMsgIds ResponseMsgIds_MIN = MsgId_ResponseStreamDetail;
const ResponseMsgIds ResponseMsgIds_MAX = MsgId_StreamData;
const ResponseMsgIds ResponseMsgIds_MAX = MsgId_ResponseStreamData;
const int ResponseMsgIds_ARRAYSIZE = ResponseMsgIds_MAX + 1;
const ::google::protobuf::EnumDescriptor* ResponseMsgIds_descriptor();
@ -130,11 +130,11 @@ enum StreamState {
STREAM_STATE_ERROR = 0,
STREAM_STATE_RUN = 1,
STREAM_STATE_PAUSED = 2,
STREAM_TYPE_FINISHED = 3
STREAM_STATE_FINISHED = 3
};
bool StreamState_IsValid(int value);
const StreamState StreamState_MIN = STREAM_STATE_ERROR;
const StreamState StreamState_MAX = STREAM_TYPE_FINISHED;
const StreamState StreamState_MAX = STREAM_STATE_FINISHED;
const int StreamState_ARRAYSIZE = StreamState_MAX + 1;
const ::google::protobuf::EnumDescriptor* StreamState_descriptor();
@ -296,16 +296,16 @@ class StreamVoipDetail : public ::google::protobuf::Message {
// accessors -------------------------------------------------------
// required string peerId = 1;
inline bool has_peerid() const;
inline void clear_peerid();
// required string peer_id = 1;
inline bool has_peer_id() const;
inline void clear_peer_id();
static const int kPeerIdFieldNumber = 1;
inline const ::std::string& peerid() const;
inline void set_peerid(const ::std::string& value);
inline void set_peerid(const char* value);
inline void set_peerid(const char* value, size_t size);
inline ::std::string* mutable_peerid();
inline ::std::string* release_peerid();
inline const ::std::string& peer_id() const;
inline void set_peer_id(const ::std::string& value);
inline void set_peer_id(const char* value);
inline void set_peer_id(const char* value, size_t size);
inline ::std::string* mutable_peer_id();
inline ::std::string* release_peer_id();
// required uint64 duration = 2;
inline bool has_duration() const;
@ -323,8 +323,8 @@ class StreamVoipDetail : public ::google::protobuf::Message {
// @@protoc_insertion_point(class_scope:rsctrl.stream.StreamVoipDetail)
private:
inline void set_has_peerid();
inline void clear_has_peerid();
inline void set_has_peer_id();
inline void clear_has_peer_id();
inline void set_has_duration();
inline void clear_has_duration();
inline void set_has_offset();
@ -332,7 +332,7 @@ class StreamVoipDetail : public ::google::protobuf::Message {
::google::protobuf::UnknownFieldSet _unknown_fields_;
::std::string* peerid_;
::std::string* peer_id_;
::google::protobuf::uint64 duration_;
::google::protobuf::uint64 offset_;
@ -423,10 +423,10 @@ class StreamDesc : public ::google::protobuf::Message {
inline rsctrl::stream::StreamState stream_state() const;
inline void set_stream_state(rsctrl::stream::StreamState value);
// required float rate_kBs = 4;
// required float rate_kbs = 4;
inline bool has_rate_kbs() const;
inline void clear_rate_kbs();
static const int kRateKBsFieldNumber = 4;
static const int kRateKbsFieldNumber = 4;
inline float rate_kbs() const;
inline void set_rate_kbs(float value);
@ -681,26 +681,26 @@ class RequestStartFileStream : public ::google::protobuf::Message {
inline ::rsctrl::core::File* mutable_file();
inline ::rsctrl::core::File* release_file();
// required float rate_kBs = 2;
// required float rate_kbs = 2;
inline bool has_rate_kbs() const;
inline void clear_rate_kbs();
static const int kRateKBsFieldNumber = 2;
static const int kRateKbsFieldNumber = 2;
inline float rate_kbs() const;
inline void set_rate_kbs(float value);
// optional uint64 startByte = 3;
inline bool has_startbyte() const;
inline void clear_startbyte();
// optional uint64 start_byte = 3;
inline bool has_start_byte() const;
inline void clear_start_byte();
static const int kStartByteFieldNumber = 3;
inline ::google::protobuf::uint64 startbyte() const;
inline void set_startbyte(::google::protobuf::uint64 value);
inline ::google::protobuf::uint64 start_byte() const;
inline void set_start_byte(::google::protobuf::uint64 value);
// optional uint64 endByte = 4;
inline bool has_endbyte() const;
inline void clear_endbyte();
// optional uint64 end_byte = 4;
inline bool has_end_byte() const;
inline void clear_end_byte();
static const int kEndByteFieldNumber = 4;
inline ::google::protobuf::uint64 endbyte() const;
inline void set_endbyte(::google::protobuf::uint64 value);
inline ::google::protobuf::uint64 end_byte() const;
inline void set_end_byte(::google::protobuf::uint64 value);
// @@protoc_insertion_point(class_scope:rsctrl.stream.RequestStartFileStream)
private:
@ -708,16 +708,16 @@ class RequestStartFileStream : public ::google::protobuf::Message {
inline void clear_has_file();
inline void set_has_rate_kbs();
inline void clear_has_rate_kbs();
inline void set_has_startbyte();
inline void clear_has_startbyte();
inline void set_has_endbyte();
inline void clear_has_endbyte();
inline void set_has_start_byte();
inline void clear_has_start_byte();
inline void set_has_end_byte();
inline void clear_has_end_byte();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::rsctrl::core::File* file_;
::google::protobuf::uint64 startbyte_;
::google::protobuf::uint64 endbyte_;
::google::protobuf::uint64 start_byte_;
::google::protobuf::uint64 end_byte_;
float rate_kbs_;
mutable int _cached_size_;
@ -923,19 +923,19 @@ class RequestControlStream : public ::google::protobuf::Message {
inline ::rsctrl::stream::RequestControlStream_StreamAction action() const;
inline void set_action(::rsctrl::stream::RequestControlStream_StreamAction value);
// optional float rate_kBs = 3;
// optional float rate_kbs = 3;
inline bool has_rate_kbs() const;
inline void clear_rate_kbs();
static const int kRateKBsFieldNumber = 3;
static const int kRateKbsFieldNumber = 3;
inline float rate_kbs() const;
inline void set_rate_kbs(float value);
// optional int64 seek_byte = 4;
// optional uint64 seek_byte = 4;
inline bool has_seek_byte() const;
inline void clear_seek_byte();
static const int kSeekByteFieldNumber = 4;
inline ::google::protobuf::int64 seek_byte() const;
inline void set_seek_byte(::google::protobuf::int64 value);
inline ::google::protobuf::uint64 seek_byte() const;
inline void set_seek_byte(::google::protobuf::uint64 value);
// @@protoc_insertion_point(class_scope:rsctrl.stream.RequestControlStream)
private:
@ -952,7 +952,7 @@ class RequestControlStream : public ::google::protobuf::Message {
::google::protobuf::uint32 stream_id_;
int action_;
::google::protobuf::int64 seek_byte_;
::google::protobuf::uint64 seek_byte_;
float rate_kbs_;
mutable int _cached_size_;
@ -1203,60 +1203,60 @@ inline void StreamFileDetail::set_offset(::google::protobuf::uint64 value) {
// StreamVoipDetail
// required string peerId = 1;
inline bool StreamVoipDetail::has_peerid() const {
// required string peer_id = 1;
inline bool StreamVoipDetail::has_peer_id() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void StreamVoipDetail::set_has_peerid() {
inline void StreamVoipDetail::set_has_peer_id() {
_has_bits_[0] |= 0x00000001u;
}
inline void StreamVoipDetail::clear_has_peerid() {
inline void StreamVoipDetail::clear_has_peer_id() {
_has_bits_[0] &= ~0x00000001u;
}
inline void StreamVoipDetail::clear_peerid() {
if (peerid_ != &::google::protobuf::internal::kEmptyString) {
peerid_->clear();
inline void StreamVoipDetail::clear_peer_id() {
if (peer_id_ != &::google::protobuf::internal::kEmptyString) {
peer_id_->clear();
}
clear_has_peerid();
clear_has_peer_id();
}
inline const ::std::string& StreamVoipDetail::peerid() const {
return *peerid_;
inline const ::std::string& StreamVoipDetail::peer_id() const {
return *peer_id_;
}
inline void StreamVoipDetail::set_peerid(const ::std::string& value) {
set_has_peerid();
if (peerid_ == &::google::protobuf::internal::kEmptyString) {
peerid_ = new ::std::string;
inline void StreamVoipDetail::set_peer_id(const ::std::string& value) {
set_has_peer_id();
if (peer_id_ == &::google::protobuf::internal::kEmptyString) {
peer_id_ = new ::std::string;
}
peerid_->assign(value);
peer_id_->assign(value);
}
inline void StreamVoipDetail::set_peerid(const char* value) {
set_has_peerid();
if (peerid_ == &::google::protobuf::internal::kEmptyString) {
peerid_ = new ::std::string;
inline void StreamVoipDetail::set_peer_id(const char* value) {
set_has_peer_id();
if (peer_id_ == &::google::protobuf::internal::kEmptyString) {
peer_id_ = new ::std::string;
}
peerid_->assign(value);
peer_id_->assign(value);
}
inline void StreamVoipDetail::set_peerid(const char* value, size_t size) {
set_has_peerid();
if (peerid_ == &::google::protobuf::internal::kEmptyString) {
peerid_ = new ::std::string;
inline void StreamVoipDetail::set_peer_id(const char* value, size_t size) {
set_has_peer_id();
if (peer_id_ == &::google::protobuf::internal::kEmptyString) {
peer_id_ = new ::std::string;
}
peerid_->assign(reinterpret_cast<const char*>(value), size);
peer_id_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* StreamVoipDetail::mutable_peerid() {
set_has_peerid();
if (peerid_ == &::google::protobuf::internal::kEmptyString) {
peerid_ = new ::std::string;
inline ::std::string* StreamVoipDetail::mutable_peer_id() {
set_has_peer_id();
if (peer_id_ == &::google::protobuf::internal::kEmptyString) {
peer_id_ = new ::std::string;
}
return peerid_;
return peer_id_;
}
inline ::std::string* StreamVoipDetail::release_peerid() {
clear_has_peerid();
if (peerid_ == &::google::protobuf::internal::kEmptyString) {
inline ::std::string* StreamVoipDetail::release_peer_id() {
clear_has_peer_id();
if (peer_id_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = peerid_;
peerid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::std::string* temp = peer_id_;
peer_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
@ -1377,7 +1377,7 @@ inline void StreamDesc::set_stream_state(rsctrl::stream::StreamState value) {
stream_state_ = value;
}
// required float rate_kBs = 4;
// required float rate_kbs = 4;
inline bool StreamDesc::has_rate_kbs() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
@ -1670,7 +1670,7 @@ inline ::rsctrl::core::File* RequestStartFileStream::release_file() {
return temp;
}
// required float rate_kBs = 2;
// required float rate_kbs = 2;
inline bool RequestStartFileStream::has_rate_kbs() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
@ -1692,48 +1692,48 @@ inline void RequestStartFileStream::set_rate_kbs(float value) {
rate_kbs_ = value;
}
// optional uint64 startByte = 3;
inline bool RequestStartFileStream::has_startbyte() const {
// optional uint64 start_byte = 3;
inline bool RequestStartFileStream::has_start_byte() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void RequestStartFileStream::set_has_startbyte() {
inline void RequestStartFileStream::set_has_start_byte() {
_has_bits_[0] |= 0x00000004u;
}
inline void RequestStartFileStream::clear_has_startbyte() {
inline void RequestStartFileStream::clear_has_start_byte() {
_has_bits_[0] &= ~0x00000004u;
}
inline void RequestStartFileStream::clear_startbyte() {
startbyte_ = GOOGLE_ULONGLONG(0);
clear_has_startbyte();
inline void RequestStartFileStream::clear_start_byte() {
start_byte_ = GOOGLE_ULONGLONG(0);
clear_has_start_byte();
}
inline ::google::protobuf::uint64 RequestStartFileStream::startbyte() const {
return startbyte_;
inline ::google::protobuf::uint64 RequestStartFileStream::start_byte() const {
return start_byte_;
}
inline void RequestStartFileStream::set_startbyte(::google::protobuf::uint64 value) {
set_has_startbyte();
startbyte_ = value;
inline void RequestStartFileStream::set_start_byte(::google::protobuf::uint64 value) {
set_has_start_byte();
start_byte_ = value;
}
// optional uint64 endByte = 4;
inline bool RequestStartFileStream::has_endbyte() const {
// optional uint64 end_byte = 4;
inline bool RequestStartFileStream::has_end_byte() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void RequestStartFileStream::set_has_endbyte() {
inline void RequestStartFileStream::set_has_end_byte() {
_has_bits_[0] |= 0x00000008u;
}
inline void RequestStartFileStream::clear_has_endbyte() {
inline void RequestStartFileStream::clear_has_end_byte() {
_has_bits_[0] &= ~0x00000008u;
}
inline void RequestStartFileStream::clear_endbyte() {
endbyte_ = GOOGLE_ULONGLONG(0);
clear_has_endbyte();
inline void RequestStartFileStream::clear_end_byte() {
end_byte_ = GOOGLE_ULONGLONG(0);
clear_has_end_byte();
}
inline ::google::protobuf::uint64 RequestStartFileStream::endbyte() const {
return endbyte_;
inline ::google::protobuf::uint64 RequestStartFileStream::end_byte() const {
return end_byte_;
}
inline void RequestStartFileStream::set_endbyte(::google::protobuf::uint64 value) {
set_has_endbyte();
endbyte_ = value;
inline void RequestStartFileStream::set_end_byte(::google::protobuf::uint64 value) {
set_has_end_byte();
end_byte_ = value;
}
// -------------------------------------------------------------------
@ -1843,7 +1843,7 @@ inline void RequestControlStream::set_action(::rsctrl::stream::RequestControlStr
action_ = value;
}
// optional float rate_kBs = 3;
// optional float rate_kbs = 3;
inline bool RequestControlStream::has_rate_kbs() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
@ -1865,7 +1865,7 @@ inline void RequestControlStream::set_rate_kbs(float value) {
rate_kbs_ = value;
}
// optional int64 seek_byte = 4;
// optional uint64 seek_byte = 4;
inline bool RequestControlStream::has_seek_byte() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
@ -1876,13 +1876,13 @@ inline void RequestControlStream::clear_has_seek_byte() {
_has_bits_[0] &= ~0x00000008u;
}
inline void RequestControlStream::clear_seek_byte() {
seek_byte_ = GOOGLE_LONGLONG(0);
seek_byte_ = GOOGLE_ULONGLONG(0);
clear_has_seek_byte();
}
inline ::google::protobuf::int64 RequestControlStream::seek_byte() const {
inline ::google::protobuf::uint64 RequestControlStream::seek_byte() const {
return seek_byte_;
}
inline void RequestControlStream::set_seek_byte(::google::protobuf::int64 value) {
inline void RequestControlStream::set_seek_byte(::google::protobuf::uint64 value) {
set_has_seek_byte();
seek_byte_ = value;
}

View File

@ -38,6 +38,12 @@ const ::google::protobuf::internal::GeneratedMessageReflection*
const ::google::protobuf::Descriptor* ResponseSystemExternalAccess_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
ResponseSystemExternalAccess_reflection_ = NULL;
const ::google::protobuf::Descriptor* RequestSystemAccount_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RequestSystemAccount_reflection_ = NULL;
const ::google::protobuf::Descriptor* ResponseSystemAccount_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
ResponseSystemAccount_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* RequestMsgIds_descriptor_ = NULL;
const ::google::protobuf::EnumDescriptor* ResponseMsgIds_descriptor_ = NULL;
@ -146,6 +152,39 @@ void protobuf_AssignDesc_system_2eproto() {
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(ResponseSystemExternalAccess));
RequestSystemAccount_descriptor_ = file->message_type(6);
static const int RequestSystemAccount_offsets_[1] = {
};
RequestSystemAccount_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
RequestSystemAccount_descriptor_,
RequestSystemAccount::default_instance_,
RequestSystemAccount_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestSystemAccount, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestSystemAccount, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(RequestSystemAccount));
ResponseSystemAccount_descriptor_ = file->message_type(7);
static const int ResponseSystemAccount_offsets_[5] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseSystemAccount, status_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseSystemAccount, pgp_name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseSystemAccount, location_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseSystemAccount, pgp_id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseSystemAccount, ssl_id_),
};
ResponseSystemAccount_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
ResponseSystemAccount_descriptor_,
ResponseSystemAccount::default_instance_,
ResponseSystemAccount_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseSystemAccount, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseSystemAccount, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(ResponseSystemAccount));
RequestMsgIds_descriptor_ = file->enum_type(0);
ResponseMsgIds_descriptor_ = file->enum_type(1);
}
@ -172,6 +211,10 @@ void protobuf_RegisterTypes(const ::std::string&) {
RequestSystemExternalAccess_descriptor_, &RequestSystemExternalAccess::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
ResponseSystemExternalAccess_descriptor_, &ResponseSystemExternalAccess::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RequestSystemAccount_descriptor_, &RequestSystemAccount::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
ResponseSystemAccount_descriptor_, &ResponseSystemAccount::default_instance());
}
} // namespace
@ -189,6 +232,10 @@ void protobuf_ShutdownFile_system_2eproto() {
delete RequestSystemExternalAccess_reflection_;
delete ResponseSystemExternalAccess::default_instance_;
delete ResponseSystemExternalAccess_reflection_;
delete RequestSystemAccount::default_instance_;
delete RequestSystemAccount_reflection_;
delete ResponseSystemAccount::default_instance_;
delete ResponseSystemAccount_reflection_;
}
void protobuf_AddDesc_system_2eproto() {
@ -218,13 +265,18 @@ void protobuf_AddDesc_system_2eproto() {
"estSystemExternalAccess\"f\n\034ResponseSyste"
"mExternalAccess\022#\n\006status\030\001 \002(\0132\023.rsctrl"
".core.Status\022\020\n\010ext_port\030\002 \002(\r\022\017\n\007dht_ke"
"y\030\003 \002(\t*r\n\rRequestMsgIds\022\035\n\031MsgId_Reques"
"tSystemStatus\020\001\022\033\n\027MsgId_RequestSystemQu"
"it\020\002\022%\n!MsgId_RequestSystemExternalAcces"
"s\020\003*v\n\016ResponseMsgIds\022\036\n\032MsgId_ResponseS"
"ystemStatus\020\001\022\034\n\030MsgId_ResponseSystemQui"
"t\020\002\022&\n\"MsgId_ResponseSystemExternalAcces"
"s\020\003", 1003);
"y\030\003 \002(\t\"\026\n\024RequestSystemAccount\"\200\001\n\025Resp"
"onseSystemAccount\022#\n\006status\030\001 \002(\0132\023.rsct"
"rl.core.Status\022\020\n\010pgp_name\030\002 \002(\t\022\020\n\010loca"
"tion\030\003 \002(\t\022\016\n\006pgp_id\030\004 \002(\t\022\016\n\006ssl_id\030\005 \002"
"(\t*\222\001\n\rRequestMsgIds\022\035\n\031MsgId_RequestSys"
"temStatus\020\001\022\033\n\027MsgId_RequestSystemQuit\020\002"
"\022%\n!MsgId_RequestSystemExternalAccess\020\003\022"
"\036\n\032MsgId_RequestSystemAccount\020\004*\227\001\n\016Resp"
"onseMsgIds\022\036\n\032MsgId_ResponseSystemStatus"
"\020\001\022\034\n\030MsgId_ResponseSystemQuit\020\002\022&\n\"MsgI"
"d_ResponseSystemExternalAccess\020\003\022\037\n\033MsgI"
"d_ResponseSystemAccount\020\004", 1225);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"system.proto", &protobuf_RegisterTypes);
RequestSystemStatus::default_instance_ = new RequestSystemStatus();
@ -233,12 +285,16 @@ void protobuf_AddDesc_system_2eproto() {
ResponseSystemQuit::default_instance_ = new ResponseSystemQuit();
RequestSystemExternalAccess::default_instance_ = new RequestSystemExternalAccess();
ResponseSystemExternalAccess::default_instance_ = new ResponseSystemExternalAccess();
RequestSystemAccount::default_instance_ = new RequestSystemAccount();
ResponseSystemAccount::default_instance_ = new ResponseSystemAccount();
RequestSystemStatus::default_instance_->InitAsDefaultInstance();
ResponseSystemStatus::default_instance_->InitAsDefaultInstance();
RequestSystemQuit::default_instance_->InitAsDefaultInstance();
ResponseSystemQuit::default_instance_->InitAsDefaultInstance();
RequestSystemExternalAccess::default_instance_->InitAsDefaultInstance();
ResponseSystemExternalAccess::default_instance_->InitAsDefaultInstance();
RequestSystemAccount::default_instance_->InitAsDefaultInstance();
ResponseSystemAccount::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_system_2eproto);
}
@ -258,6 +314,7 @@ bool RequestMsgIds_IsValid(int value) {
case 1:
case 2:
case 3:
case 4:
return true;
default:
return false;
@ -273,6 +330,7 @@ bool ResponseMsgIds_IsValid(int value) {
case 1:
case 2:
case 3:
case 4:
return true;
default:
return false;
@ -1779,6 +1837,605 @@ void ResponseSystemExternalAccess::Swap(ResponseSystemExternalAccess* other) {
}
// ===================================================================
#ifndef _MSC_VER
#endif // !_MSC_VER
RequestSystemAccount::RequestSystemAccount()
: ::google::protobuf::Message() {
SharedCtor();
}
void RequestSystemAccount::InitAsDefaultInstance() {
}
RequestSystemAccount::RequestSystemAccount(const RequestSystemAccount& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void RequestSystemAccount::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
RequestSystemAccount::~RequestSystemAccount() {
SharedDtor();
}
void RequestSystemAccount::SharedDtor() {
if (this != default_instance_) {
}
}
void RequestSystemAccount::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RequestSystemAccount::descriptor() {
protobuf_AssignDescriptorsOnce();
return RequestSystemAccount_descriptor_;
}
const RequestSystemAccount& RequestSystemAccount::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_system_2eproto(); return *default_instance_;
}
RequestSystemAccount* RequestSystemAccount::default_instance_ = NULL;
RequestSystemAccount* RequestSystemAccount::New() const {
return new RequestSystemAccount;
}
void RequestSystemAccount::Clear() {
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool RequestSystemAccount::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
}
return true;
#undef DO_
}
void RequestSystemAccount::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* RequestSystemAccount::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int RequestSystemAccount::ByteSize() const {
int total_size = 0;
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void RequestSystemAccount::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RequestSystemAccount* source =
::google::protobuf::internal::dynamic_cast_if_available<const RequestSystemAccount*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RequestSystemAccount::MergeFrom(const RequestSystemAccount& from) {
GOOGLE_CHECK_NE(&from, this);
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void RequestSystemAccount::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RequestSystemAccount::CopyFrom(const RequestSystemAccount& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RequestSystemAccount::IsInitialized() const {
return true;
}
void RequestSystemAccount::Swap(RequestSystemAccount* other) {
if (other != this) {
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata RequestSystemAccount::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RequestSystemAccount_descriptor_;
metadata.reflection = RequestSystemAccount_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int ResponseSystemAccount::kStatusFieldNumber;
const int ResponseSystemAccount::kPgpNameFieldNumber;
const int ResponseSystemAccount::kLocationFieldNumber;
const int ResponseSystemAccount::kPgpIdFieldNumber;
const int ResponseSystemAccount::kSslIdFieldNumber;
#endif // !_MSC_VER
ResponseSystemAccount::ResponseSystemAccount()
: ::google::protobuf::Message() {
SharedCtor();
}
void ResponseSystemAccount::InitAsDefaultInstance() {
status_ = const_cast< ::rsctrl::core::Status*>(&::rsctrl::core::Status::default_instance());
}
ResponseSystemAccount::ResponseSystemAccount(const ResponseSystemAccount& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void ResponseSystemAccount::SharedCtor() {
_cached_size_ = 0;
status_ = NULL;
pgp_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
location_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
pgp_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
ssl_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
ResponseSystemAccount::~ResponseSystemAccount() {
SharedDtor();
}
void ResponseSystemAccount::SharedDtor() {
if (pgp_name_ != &::google::protobuf::internal::kEmptyString) {
delete pgp_name_;
}
if (location_ != &::google::protobuf::internal::kEmptyString) {
delete location_;
}
if (pgp_id_ != &::google::protobuf::internal::kEmptyString) {
delete pgp_id_;
}
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
delete ssl_id_;
}
if (this != default_instance_) {
delete status_;
}
}
void ResponseSystemAccount::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ResponseSystemAccount::descriptor() {
protobuf_AssignDescriptorsOnce();
return ResponseSystemAccount_descriptor_;
}
const ResponseSystemAccount& ResponseSystemAccount::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_system_2eproto(); return *default_instance_;
}
ResponseSystemAccount* ResponseSystemAccount::default_instance_ = NULL;
ResponseSystemAccount* ResponseSystemAccount::New() const {
return new ResponseSystemAccount;
}
void ResponseSystemAccount::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_status()) {
if (status_ != NULL) status_->::rsctrl::core::Status::Clear();
}
if (has_pgp_name()) {
if (pgp_name_ != &::google::protobuf::internal::kEmptyString) {
pgp_name_->clear();
}
}
if (has_location()) {
if (location_ != &::google::protobuf::internal::kEmptyString) {
location_->clear();
}
}
if (has_pgp_id()) {
if (pgp_id_ != &::google::protobuf::internal::kEmptyString) {
pgp_id_->clear();
}
}
if (has_ssl_id()) {
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
ssl_id_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool ResponseSystemAccount::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .rsctrl.core.Status status = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_status()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_pgp_name;
break;
}
// required string pgp_name = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_pgp_name:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_pgp_name()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->pgp_name().data(), this->pgp_name().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_location;
break;
}
// required string location = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_location:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_location()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->location().data(), this->location().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_pgp_id;
break;
}
// required string pgp_id = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_pgp_id:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_pgp_id()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->pgp_id().data(), this->pgp_id().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(42)) goto parse_ssl_id;
break;
}
// required string ssl_id = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_ssl_id:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_ssl_id()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void ResponseSystemAccount::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required .rsctrl.core.Status status = 1;
if (has_status()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, this->status(), output);
}
// required string pgp_name = 2;
if (has_pgp_name()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->pgp_name().data(), this->pgp_name().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->pgp_name(), output);
}
// required string location = 3;
if (has_location()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->location().data(), this->location().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->location(), output);
}
// required string pgp_id = 4;
if (has_pgp_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->pgp_id().data(), this->pgp_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
4, this->pgp_id(), output);
}
// required string ssl_id = 5;
if (has_ssl_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
5, this->ssl_id(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* ResponseSystemAccount::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required .rsctrl.core.Status status = 1;
if (has_status()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
1, this->status(), target);
}
// required string pgp_name = 2;
if (has_pgp_name()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->pgp_name().data(), this->pgp_name().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->pgp_name(), target);
}
// required string location = 3;
if (has_location()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->location().data(), this->location().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->location(), target);
}
// required string pgp_id = 4;
if (has_pgp_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->pgp_id().data(), this->pgp_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
4, this->pgp_id(), target);
}
// required string ssl_id = 5;
if (has_ssl_id()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->ssl_id().data(), this->ssl_id().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
5, this->ssl_id(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int ResponseSystemAccount::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required .rsctrl.core.Status status = 1;
if (has_status()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->status());
}
// required string pgp_name = 2;
if (has_pgp_name()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->pgp_name());
}
// required string location = 3;
if (has_location()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->location());
}
// required string pgp_id = 4;
if (has_pgp_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->pgp_id());
}
// required string ssl_id = 5;
if (has_ssl_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->ssl_id());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void ResponseSystemAccount::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const ResponseSystemAccount* source =
::google::protobuf::internal::dynamic_cast_if_available<const ResponseSystemAccount*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void ResponseSystemAccount::MergeFrom(const ResponseSystemAccount& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_status()) {
mutable_status()->::rsctrl::core::Status::MergeFrom(from.status());
}
if (from.has_pgp_name()) {
set_pgp_name(from.pgp_name());
}
if (from.has_location()) {
set_location(from.location());
}
if (from.has_pgp_id()) {
set_pgp_id(from.pgp_id());
}
if (from.has_ssl_id()) {
set_ssl_id(from.ssl_id());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void ResponseSystemAccount::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ResponseSystemAccount::CopyFrom(const ResponseSystemAccount& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ResponseSystemAccount::IsInitialized() const {
if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false;
if (has_status()) {
if (!this->status().IsInitialized()) return false;
}
return true;
}
void ResponseSystemAccount::Swap(ResponseSystemAccount* other) {
if (other != this) {
std::swap(status_, other->status_);
std::swap(pgp_name_, other->pgp_name_);
std::swap(location_, other->location_);
std::swap(pgp_id_, other->pgp_id_);
std::swap(ssl_id_, other->ssl_id_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata ResponseSystemAccount::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = ResponseSystemAccount_descriptor_;
metadata.reflection = ResponseSystemAccount_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace system

View File

@ -40,6 +40,8 @@ class RequestSystemQuit;
class ResponseSystemQuit;
class RequestSystemExternalAccess;
class ResponseSystemExternalAccess;
class RequestSystemAccount;
class ResponseSystemAccount;
enum ResponseSystemStatus_NetCode {
ResponseSystemStatus_NetCode_BAD_UNKNOWN = 0,
@ -89,11 +91,12 @@ inline bool RequestSystemQuit_QuitCode_Parse(
enum RequestMsgIds {
MsgId_RequestSystemStatus = 1,
MsgId_RequestSystemQuit = 2,
MsgId_RequestSystemExternalAccess = 3
MsgId_RequestSystemExternalAccess = 3,
MsgId_RequestSystemAccount = 4
};
bool RequestMsgIds_IsValid(int value);
const RequestMsgIds RequestMsgIds_MIN = MsgId_RequestSystemStatus;
const RequestMsgIds RequestMsgIds_MAX = MsgId_RequestSystemExternalAccess;
const RequestMsgIds RequestMsgIds_MAX = MsgId_RequestSystemAccount;
const int RequestMsgIds_ARRAYSIZE = RequestMsgIds_MAX + 1;
const ::google::protobuf::EnumDescriptor* RequestMsgIds_descriptor();
@ -109,11 +112,12 @@ inline bool RequestMsgIds_Parse(
enum ResponseMsgIds {
MsgId_ResponseSystemStatus = 1,
MsgId_ResponseSystemQuit = 2,
MsgId_ResponseSystemExternalAccess = 3
MsgId_ResponseSystemExternalAccess = 3,
MsgId_ResponseSystemAccount = 4
};
bool ResponseMsgIds_IsValid(int value);
const ResponseMsgIds ResponseMsgIds_MIN = MsgId_ResponseSystemStatus;
const ResponseMsgIds ResponseMsgIds_MAX = MsgId_ResponseSystemExternalAccess;
const ResponseMsgIds ResponseMsgIds_MAX = MsgId_ResponseSystemAccount;
const int ResponseMsgIds_ARRAYSIZE = ResponseMsgIds_MAX + 1;
const ::google::protobuf::EnumDescriptor* ResponseMsgIds_descriptor();
@ -721,6 +725,217 @@ class ResponseSystemExternalAccess : public ::google::protobuf::Message {
void InitAsDefaultInstance();
static ResponseSystemExternalAccess* default_instance_;
};
// -------------------------------------------------------------------
class RequestSystemAccount : public ::google::protobuf::Message {
public:
RequestSystemAccount();
virtual ~RequestSystemAccount();
RequestSystemAccount(const RequestSystemAccount& from);
inline RequestSystemAccount& operator=(const RequestSystemAccount& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const RequestSystemAccount& default_instance();
void Swap(RequestSystemAccount* other);
// implements Message ----------------------------------------------
RequestSystemAccount* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const RequestSystemAccount& from);
void MergeFrom(const RequestSystemAccount& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:rsctrl.system.RequestSystemAccount)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[1];
friend void protobuf_AddDesc_system_2eproto();
friend void protobuf_AssignDesc_system_2eproto();
friend void protobuf_ShutdownFile_system_2eproto();
void InitAsDefaultInstance();
static RequestSystemAccount* default_instance_;
};
// -------------------------------------------------------------------
class ResponseSystemAccount : public ::google::protobuf::Message {
public:
ResponseSystemAccount();
virtual ~ResponseSystemAccount();
ResponseSystemAccount(const ResponseSystemAccount& from);
inline ResponseSystemAccount& operator=(const ResponseSystemAccount& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const ResponseSystemAccount& default_instance();
void Swap(ResponseSystemAccount* other);
// implements Message ----------------------------------------------
ResponseSystemAccount* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const ResponseSystemAccount& from);
void MergeFrom(const ResponseSystemAccount& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required .rsctrl.core.Status status = 1;
inline bool has_status() const;
inline void clear_status();
static const int kStatusFieldNumber = 1;
inline const ::rsctrl::core::Status& status() const;
inline ::rsctrl::core::Status* mutable_status();
inline ::rsctrl::core::Status* release_status();
// required string pgp_name = 2;
inline bool has_pgp_name() const;
inline void clear_pgp_name();
static const int kPgpNameFieldNumber = 2;
inline const ::std::string& pgp_name() const;
inline void set_pgp_name(const ::std::string& value);
inline void set_pgp_name(const char* value);
inline void set_pgp_name(const char* value, size_t size);
inline ::std::string* mutable_pgp_name();
inline ::std::string* release_pgp_name();
// required string location = 3;
inline bool has_location() const;
inline void clear_location();
static const int kLocationFieldNumber = 3;
inline const ::std::string& location() const;
inline void set_location(const ::std::string& value);
inline void set_location(const char* value);
inline void set_location(const char* value, size_t size);
inline ::std::string* mutable_location();
inline ::std::string* release_location();
// required string pgp_id = 4;
inline bool has_pgp_id() const;
inline void clear_pgp_id();
static const int kPgpIdFieldNumber = 4;
inline const ::std::string& pgp_id() const;
inline void set_pgp_id(const ::std::string& value);
inline void set_pgp_id(const char* value);
inline void set_pgp_id(const char* value, size_t size);
inline ::std::string* mutable_pgp_id();
inline ::std::string* release_pgp_id();
// required string ssl_id = 5;
inline bool has_ssl_id() const;
inline void clear_ssl_id();
static const int kSslIdFieldNumber = 5;
inline const ::std::string& ssl_id() const;
inline void set_ssl_id(const ::std::string& value);
inline void set_ssl_id(const char* value);
inline void set_ssl_id(const char* value, size_t size);
inline ::std::string* mutable_ssl_id();
inline ::std::string* release_ssl_id();
// @@protoc_insertion_point(class_scope:rsctrl.system.ResponseSystemAccount)
private:
inline void set_has_status();
inline void clear_has_status();
inline void set_has_pgp_name();
inline void clear_has_pgp_name();
inline void set_has_location();
inline void clear_has_location();
inline void set_has_pgp_id();
inline void clear_has_pgp_id();
inline void set_has_ssl_id();
inline void clear_has_ssl_id();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::rsctrl::core::Status* status_;
::std::string* pgp_name_;
::std::string* location_;
::std::string* pgp_id_;
::std::string* ssl_id_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(5 + 31) / 32];
friend void protobuf_AddDesc_system_2eproto();
friend void protobuf_AssignDesc_system_2eproto();
friend void protobuf_ShutdownFile_system_2eproto();
void InitAsDefaultInstance();
static ResponseSystemAccount* default_instance_;
};
// ===================================================================
@ -1034,6 +1249,275 @@ inline ::std::string* ResponseSystemExternalAccess::release_dht_key() {
}
}
// -------------------------------------------------------------------
// RequestSystemAccount
// -------------------------------------------------------------------
// ResponseSystemAccount
// required .rsctrl.core.Status status = 1;
inline bool ResponseSystemAccount::has_status() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void ResponseSystemAccount::set_has_status() {
_has_bits_[0] |= 0x00000001u;
}
inline void ResponseSystemAccount::clear_has_status() {
_has_bits_[0] &= ~0x00000001u;
}
inline void ResponseSystemAccount::clear_status() {
if (status_ != NULL) status_->::rsctrl::core::Status::Clear();
clear_has_status();
}
inline const ::rsctrl::core::Status& ResponseSystemAccount::status() const {
return status_ != NULL ? *status_ : *default_instance_->status_;
}
inline ::rsctrl::core::Status* ResponseSystemAccount::mutable_status() {
set_has_status();
if (status_ == NULL) status_ = new ::rsctrl::core::Status;
return status_;
}
inline ::rsctrl::core::Status* ResponseSystemAccount::release_status() {
clear_has_status();
::rsctrl::core::Status* temp = status_;
status_ = NULL;
return temp;
}
// required string pgp_name = 2;
inline bool ResponseSystemAccount::has_pgp_name() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void ResponseSystemAccount::set_has_pgp_name() {
_has_bits_[0] |= 0x00000002u;
}
inline void ResponseSystemAccount::clear_has_pgp_name() {
_has_bits_[0] &= ~0x00000002u;
}
inline void ResponseSystemAccount::clear_pgp_name() {
if (pgp_name_ != &::google::protobuf::internal::kEmptyString) {
pgp_name_->clear();
}
clear_has_pgp_name();
}
inline const ::std::string& ResponseSystemAccount::pgp_name() const {
return *pgp_name_;
}
inline void ResponseSystemAccount::set_pgp_name(const ::std::string& value) {
set_has_pgp_name();
if (pgp_name_ == &::google::protobuf::internal::kEmptyString) {
pgp_name_ = new ::std::string;
}
pgp_name_->assign(value);
}
inline void ResponseSystemAccount::set_pgp_name(const char* value) {
set_has_pgp_name();
if (pgp_name_ == &::google::protobuf::internal::kEmptyString) {
pgp_name_ = new ::std::string;
}
pgp_name_->assign(value);
}
inline void ResponseSystemAccount::set_pgp_name(const char* value, size_t size) {
set_has_pgp_name();
if (pgp_name_ == &::google::protobuf::internal::kEmptyString) {
pgp_name_ = new ::std::string;
}
pgp_name_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* ResponseSystemAccount::mutable_pgp_name() {
set_has_pgp_name();
if (pgp_name_ == &::google::protobuf::internal::kEmptyString) {
pgp_name_ = new ::std::string;
}
return pgp_name_;
}
inline ::std::string* ResponseSystemAccount::release_pgp_name() {
clear_has_pgp_name();
if (pgp_name_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = pgp_name_;
pgp_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
// required string location = 3;
inline bool ResponseSystemAccount::has_location() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void ResponseSystemAccount::set_has_location() {
_has_bits_[0] |= 0x00000004u;
}
inline void ResponseSystemAccount::clear_has_location() {
_has_bits_[0] &= ~0x00000004u;
}
inline void ResponseSystemAccount::clear_location() {
if (location_ != &::google::protobuf::internal::kEmptyString) {
location_->clear();
}
clear_has_location();
}
inline const ::std::string& ResponseSystemAccount::location() const {
return *location_;
}
inline void ResponseSystemAccount::set_location(const ::std::string& value) {
set_has_location();
if (location_ == &::google::protobuf::internal::kEmptyString) {
location_ = new ::std::string;
}
location_->assign(value);
}
inline void ResponseSystemAccount::set_location(const char* value) {
set_has_location();
if (location_ == &::google::protobuf::internal::kEmptyString) {
location_ = new ::std::string;
}
location_->assign(value);
}
inline void ResponseSystemAccount::set_location(const char* value, size_t size) {
set_has_location();
if (location_ == &::google::protobuf::internal::kEmptyString) {
location_ = new ::std::string;
}
location_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* ResponseSystemAccount::mutable_location() {
set_has_location();
if (location_ == &::google::protobuf::internal::kEmptyString) {
location_ = new ::std::string;
}
return location_;
}
inline ::std::string* ResponseSystemAccount::release_location() {
clear_has_location();
if (location_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = location_;
location_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
// required string pgp_id = 4;
inline bool ResponseSystemAccount::has_pgp_id() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void ResponseSystemAccount::set_has_pgp_id() {
_has_bits_[0] |= 0x00000008u;
}
inline void ResponseSystemAccount::clear_has_pgp_id() {
_has_bits_[0] &= ~0x00000008u;
}
inline void ResponseSystemAccount::clear_pgp_id() {
if (pgp_id_ != &::google::protobuf::internal::kEmptyString) {
pgp_id_->clear();
}
clear_has_pgp_id();
}
inline const ::std::string& ResponseSystemAccount::pgp_id() const {
return *pgp_id_;
}
inline void ResponseSystemAccount::set_pgp_id(const ::std::string& value) {
set_has_pgp_id();
if (pgp_id_ == &::google::protobuf::internal::kEmptyString) {
pgp_id_ = new ::std::string;
}
pgp_id_->assign(value);
}
inline void ResponseSystemAccount::set_pgp_id(const char* value) {
set_has_pgp_id();
if (pgp_id_ == &::google::protobuf::internal::kEmptyString) {
pgp_id_ = new ::std::string;
}
pgp_id_->assign(value);
}
inline void ResponseSystemAccount::set_pgp_id(const char* value, size_t size) {
set_has_pgp_id();
if (pgp_id_ == &::google::protobuf::internal::kEmptyString) {
pgp_id_ = new ::std::string;
}
pgp_id_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* ResponseSystemAccount::mutable_pgp_id() {
set_has_pgp_id();
if (pgp_id_ == &::google::protobuf::internal::kEmptyString) {
pgp_id_ = new ::std::string;
}
return pgp_id_;
}
inline ::std::string* ResponseSystemAccount::release_pgp_id() {
clear_has_pgp_id();
if (pgp_id_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = pgp_id_;
pgp_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
// required string ssl_id = 5;
inline bool ResponseSystemAccount::has_ssl_id() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void ResponseSystemAccount::set_has_ssl_id() {
_has_bits_[0] |= 0x00000010u;
}
inline void ResponseSystemAccount::clear_has_ssl_id() {
_has_bits_[0] &= ~0x00000010u;
}
inline void ResponseSystemAccount::clear_ssl_id() {
if (ssl_id_ != &::google::protobuf::internal::kEmptyString) {
ssl_id_->clear();
}
clear_has_ssl_id();
}
inline const ::std::string& ResponseSystemAccount::ssl_id() const {
return *ssl_id_;
}
inline void ResponseSystemAccount::set_ssl_id(const ::std::string& value) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(value);
}
inline void ResponseSystemAccount::set_ssl_id(const char* value) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(value);
}
inline void ResponseSystemAccount::set_ssl_id(const char* value, size_t size) {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
ssl_id_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* ResponseSystemAccount::mutable_ssl_id() {
set_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
ssl_id_ = new ::std::string;
}
return ssl_id_;
}
inline ::std::string* ResponseSystemAccount::release_ssl_id() {
clear_has_ssl_id();
if (ssl_id_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = ssl_id_;
ssl_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
// @@protoc_insertion_point(namespace_scope)

View File

@ -25,8 +25,10 @@
#include "rpc/proto/gencc/files.pb.h"
#include <retroshare/rsfiles.h>
#include <retroshare/rspeers.h>
#include "util/rsstring.h"
#include "util/rsdir.h"
#include <stdio.h>
@ -36,6 +38,9 @@
#include <set>
bool fill_file_from_details(rsctrl::core::File *file, DirDetails &details);
bool fill_file_as_dir(rsctrl::core::File *file, const std::string &dir_name);
RpcProtoFiles::RpcProtoFiles(uint32_t serviceId)
:RpcQueueService(serviceId)
{
@ -93,6 +98,10 @@ int RpcProtoFiles::processMsg(uint32_t chan_id, uint32_t msg_id, uint32_t req_id
processReqControlDownload(chan_id, msg_id, req_id, msg);
break;
case rsctrl::files::MsgId_RequestShareDirList:
processReqShareDirList(chan_id, msg_id, req_id, msg);
break;
default:
std::cerr << "RpcProtoFiles::processMsg() ERROR should never get here";
std::cerr << std::endl;
@ -340,5 +349,253 @@ int RpcProtoFiles::processReqControlDownload(uint32_t chan_id, uint32_t /* msg_i
}
int RpcProtoFiles::processReqShareDirList(uint32_t chan_id, uint32_t /* msg_id */, uint32_t req_id, const std::string &msg)
{
std::cerr << "RpcProtoFiles::processReqShareDirList()";
std::cerr << std::endl;
// parse msg.
rsctrl::files::RequestShareDirList req;
if (!req.ParseFromString(msg))
{
std::cerr << "RpcProtoFiles::processReqShareDirList() ERROR ParseFromString()";
std::cerr << std::endl;
return 0;
}
// response.
rsctrl::files::ResponseShareDirList resp;
bool success = true;
std::string errorMsg;
std::string uid = req.ssl_id();
std::string path = req.path();
DirDetails details;
if (uid.empty())
{
uid = rsPeers->getOwnId();
}
std::cerr << "RpcProtoFiles::processReqShareDirList() For uid: " << uid << " & path: " << path;
std::cerr << std::endl;
if (path.empty())
{
/* we have to do a nasty hack to get anything useful.
* we do a ref=NULL to get the pointers to People,
* then use the correct one to get root directories
*/
std::cerr << "RpcProtoFiles::processReqShareDirList() Hack to get root Dirs!";
std::cerr << std::endl;
FileSearchFlags flags;
if (uid == rsPeers->getOwnId())
{
flags |= RS_FILE_HINTS_LOCAL;
}
DirDetails root_details;
if (!rsFiles->RequestDirDetails(NULL, root_details, flags))
{
std::cerr << "RpcProtoFiles::processReqShareDirList() ref=NULL Hack failed";
std::cerr << std::endl;
success = false;
errorMsg = "Root Directory Request Failed.";
}
else
{
void *person_ref = NULL;
std::list<DirStub>::iterator sit;
for(sit = root_details.children.begin(); sit != root_details.children.end(); sit++)
{
//std::cerr << "RpcProtoFiles::processReqShareDirList() Root.child->name : " << sit->name;
if (sit->name == uid)
{
person_ref = sit->ref;
break;
}
}
if (!person_ref)
{
std::cerr << "RpcProtoFiles::processReqShareDirList() Person match failed";
std::cerr << std::endl;
success = false;
errorMsg = "Missing Person Root Directory.";
}
else
{
// Doing the REAL request!
if (!rsFiles->RequestDirDetails(person_ref, details, flags))
{
std::cerr << "RpcProtoFiles::processReqShareDirList() Personal Shared Dir Hack failed";
std::cerr << std::endl;
success = false;
errorMsg = "Missing Person Shared Directories";
}
}
}
}
else
{
// Path must begin with / for proper matching.
if (path[0] != '/')
{
path = '/' + path;
}
if (!rsFiles->RequestDirDetails(uid, path, details))
{
std::cerr << "RpcProtoFiles::processReqShareDirList() ERROR Unknown Dir";
std::cerr << std::endl;
success = false;
errorMsg = "Directory Request Failed.";
}
}
if (success)
{
// setup basics of response.
resp.set_ssl_id(uid);
resp.set_path(path);
switch(details.type)
{
case DIR_TYPE_ROOT:
{
std::cerr << "RpcProtoFiles::processReqShareDirList() Details.type == ROOT ??";
std::cerr << std::endl;
resp.set_list_type(rsctrl::files::ResponseShareDirList::DIRQUERY_ROOT);
rsctrl::core::File *file = resp.add_files();
fill_file_as_dir(file, details.name);
}
break;
case DIR_TYPE_FILE:
{
std::cerr << "RpcProtoFiles::processReqShareDirList() Details.type == FILE";
std::cerr << std::endl;
resp.set_list_type(rsctrl::files::ResponseShareDirList::DIRQUERY_FILE);
rsctrl::core::File *file = resp.add_files();
fill_file_from_details(file, details);
}
break;
default:
std::cerr << "RpcProtoFiles::processReqShareDirList() Details.type == UNKNOWN => default to DIR";
std::cerr << std::endl;
case DIR_TYPE_PERSON:
case DIR_TYPE_DIR:
{
std::cerr << "RpcProtoFiles::processReqShareDirList() Details.type == DIR or PERSON";
std::cerr << std::endl;
resp.set_list_type(rsctrl::files::ResponseShareDirList::DIRQUERY_DIR);
//std::string dir_path = RsDirUtil::makePath(details.path, details.name);
std::string dir_path = details.path;
std::cerr << "RpcProtoFiles::processReqShareDirList() details.path: " << details.path;
std::cerr << " details.name: " << details.name;
std::cerr << std::endl;
std::list<DirStub>::iterator sit;
for(sit = details.children.begin(); sit != details.children.end(); sit++)
{
std::cerr << "RpcProtoFiles::processReqShareDirList() checking child: " << sit->name;
std::cerr << std::endl;
if (sit->type == DIR_TYPE_FILE)
{
std::cerr << "RpcProtoFiles::processReqShareDirList() is FILE, fetching details.";
std::cerr << std::endl;
DirDetails child_details;
std::string child_path = RsDirUtil::makePath(dir_path, sit->name);
if (rsFiles->RequestDirDetails(uid, child_path, child_details))
{
rsctrl::core::File *file = resp.add_files();
fill_file_from_details(file, child_details);
}
else
{
std::cerr << "RpcProtoFiles::processReqShareDirList() RequestDirDetails(" << child_path << ") Failed!!!";
std::cerr << std::endl;
}
}
else
{
std::cerr << "RpcProtoFiles::processReqShareDirList() is DIR";
std::cerr << std::endl;
rsctrl::core::File *file = resp.add_files();
fill_file_as_dir(file, sit->name);
}
}
}
break;
}
}
/* DONE - Generate Reply */
if (success)
{
rsctrl::core::Status *status = resp.mutable_status();
status->set_code(rsctrl::core::Status::SUCCESS);
}
else
{
rsctrl::core::Status *status = resp.mutable_status();
status->set_code(rsctrl::core::Status::FAILED);
status->set_msg(errorMsg);
}
std::string outmsg;
if (!resp.SerializeToString(&outmsg))
{
std::cerr << "RpcProtoFiles::processReqTransferList() ERROR SerialiseToString()";
std::cerr << std::endl;
return 0;
}
// Correctly Name Message.
uint32_t out_msg_id = constructMsgId(rsctrl::core::CORE, rsctrl::core::FILES,
rsctrl::files::MsgId_ResponseShareDirList, true);
// queue it.
queueResponse(chan_id, out_msg_id, req_id, outmsg);
return 1;
}
/***** HELPER FUNCTIONS *****/
bool fill_file_from_details(rsctrl::core::File *file, DirDetails &details)
{
file->set_hash(details.hash);
file->set_name(details.name);
file->set_size(details.count);
return true;
}
bool fill_file_as_dir(rsctrl::core::File *file, const std::string &dir_name)
{
file->set_hash("");
file->set_name(dir_name);
file->set_size(0);
return true;
}

View File

@ -38,6 +38,7 @@ protected:
int processReqTransferList(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
int processReqControlDownload(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
int processReqShareDirList(uint32_t chan_id, uint32_t /* msg_id */, uint32_t req_id, const std::string &msg);
};

View File

@ -94,9 +94,9 @@ int RpcProtoPeers::processMsg(uint32_t chan_id, uint32_t msg_id, uint32_t req_id
case rsctrl::peers::MsgId_RequestExaminePeer:
processExaminePeer(chan_id, msg_id, req_id, msg);
break;
case rsctrl::peers::MsgId_RequestModifyPeer:
processModifyPeer(chan_id, msg_id, req_id, msg);
break;
//case rsctrl::peers::MsgId_RequestModifyPeer:
// processModifyPeer(chan_id, msg_id, req_id, msg);
// break;
default:
std::cerr << "RpcProtoPeers::processMsg() ERROR should never get here";
std::cerr << std::endl;

View File

@ -21,12 +21,21 @@
*
*/
#include "rpc/proto/rpcprotochat.h"
#include "rpc/proto/gencc/chat.pb.h"
#include "rpc/proto/rpcprotostream.h"
#include "rpc/proto/rpcprotoutils.h"
#include <retroshare/rsmsgs.h>
#include <retroshare/rspeers.h>
#include <retroshare/rshistory.h>
#include "rpc/proto/gencc/stream.pb.h"
#include "rpc/proto/gencc/core.pb.h"
#include <retroshare/rsexpr.h>
#include <retroshare/rsfiles.h>
// from libretroshare
#include "util/rsdir.h"
//#include <retroshare/rsmsgs.h>
//#include <retroshare/rspeers.h>
//#include <retroshare/rshistory.h>
#include "util/rsstring.h"
@ -37,35 +46,68 @@
#include <set>
#define MAX_DESIRED_RATE 1000.0 // 1Mb/s
#define MIN_STREAM_CHUNK_SIZE 10
#define MAX_STREAM_CHUNK_SIZE 100000
#define STREAM_STANDARD_MIN_DT 0.1
#define STREAM_BACKGROUND_MIN_DT 0.5
bool fill_stream_details(rsctrl::stream::ResponseStreamDetail &resp,
const std::list<RpcStream> &streams);
bool fill_stream_detail(rsctrl::stream::StreamDetail &detail,
bool fill_stream_desc(rsctrl::stream::StreamDesc &desc,
const RpcStream &stream);
// Helper Functions -> maybe move to libretroshare/utils ??
bool convertUTF8toWString(const std::string &msg_utf8, std::wstring &msg_wstr);
bool convertWStringToUTF8(const std::wstring &msg_wstr, std::string &msg_utf8);
bool fill_stream_data(rsctrl::stream::StreamData &data, const RpcStream &stream);
bool convertStringToLobbyId(const std::string &chat_id, ChatLobbyId &lobby_id);
bool convertLobbyIdToString(const ChatLobbyId &lobby_id, std::string &chat_id);
bool fillLobbyInfoFromChatLobbyInfo(const ChatLobbyInfo &cfi, rsctrl::stream::ChatLobbyInfo *lobby);
bool fillLobbyInfoFromVisibleChatLobbyRecord(const VisibleChatLobbyRecord &pclr, rsctrl::stream::ChatLobbyInfo *lobby);
bool fillLobbyInfoFromChatLobbyInvite(const ChatLobbyInvite &cli, rsctrl::stream::ChatLobbyInfo *lobby);
bool fillChatMessageFromHistoryMsg(const HistoryMsg &histmsg, rsctrl::stream::ChatMessage *rpcmsg);
bool createQueuedEventSendMsg(const ChatInfo &chatinfo, rsctrl::stream::ChatType ctype,
std::string chat_id, const RpcEventRegister &ereg, RpcQueuedMsg &qmsg);
bool createQueuedStreamMsg(const RpcStream &stream, rsctrl::stream::ResponseStreamData &resp, RpcQueuedMsg &qmsg);
RpcProtoStream::RpcProtoStream(uint32_t serviceId)
:RpcQueueService(serviceId)
{
mNextStreamId = 1;
return;
}
void RpcProtoStream::reset(uint32_t chan_id)
{
// We should be using a mutex for all stream operations!!!!
// TODO
//RsStackMutex stack(mQueueMtx); /********** LOCKED MUTEX ***************/
std::list<uint32_t> toRemove;
std::map<uint32_t, RpcStream>::iterator it;
for(it = mStreams.begin(); it != mStreams.end(); it++)
{
if (it->second.chan_id == chan_id)
{
toRemove.push_back(it->first);
}
}
std::list<uint32_t>::iterator rit;
for(rit = toRemove.begin(); rit != toRemove.end(); rit++)
{
it = mStreams.find(*rit);
if (it != mStreams.end())
{
mStreams.erase(it);
}
}
// Call the rest of reset.
RpcQueueService::reset(chan_id);
}
//RpcProtoStream::msgsAccepted(std::list<uint32_t> &msgIds); /* not used at the moment */
int RpcProtoStream::processMsg(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg)
@ -116,17 +158,17 @@ int RpcProtoStream::processMsg(uint32_t chan_id, uint32_t msg_id, uint32_t req_i
processReqStartFileStream(chan_id, msg_id, req_id, msg);
break;
case rsctrl::stream::MsgId_RequestCreateLobby:
case rsctrl::stream::MsgId_RequestControlStream:
processReqControlStream(chan_id, msg_id, req_id, msg);
break;
case rsctrl::stream::MsgId_RequestJoinOrLeaveLobby:
case rsctrl::stream::MsgId_RequestListStreams:
processReqListStreams(chan_id, msg_id, req_id, msg);
break;
case rsctrl::stream::MsgId_RequestRegisterStreams:
processReqRegisterStreams(chan_id, msg_id, req_id, msg);
break;
// case rsctrl::stream::MsgId_RequestRegisterStreams:
// processReqRegisterStreams(chan_id, msg_id, req_id, msg);
// break;
default:
std::cerr << "RpcProtoStream::processMsg() ERROR should never get here";
@ -163,10 +205,15 @@ int RpcProtoStream::processReqStartFileStream(uint32_t chan_id, uint32_t /*msg_i
// SETUP STREAM.
// FIND the FILE.
Expression * exp;
std::list<std::string> hashes;
hashes.push_back(req.file().hash());
//HashExpression exp(StringOperator::EqualsString, hashes);
HashExpression exp(EqualsString, hashes);
std::list<DirDetails> results;
FileSearchFlags flags;
int ans = rsFiles->SearchBoolExp(exp, results, flags);
FileSearchFlags flags = RS_FILE_HINTS_LOCAL;
int ans = rsFiles->SearchBoolExp(&exp, results, flags);
// CREATE A STREAM OBJECT.
if (results.size() < 1)
@ -176,23 +223,39 @@ int RpcProtoStream::processReqStartFileStream(uint32_t chan_id, uint32_t /*msg_i
}
else
{
DirDetails &dirdetail = results.front();
RpcStream stream;
stream.chan_id = chan_id;
stream.req_id = req_id;
stream.stream_id = getNextStreamId();
stream.state = RUNNING;
stream.state = RpcStream::RUNNING;
// Convert to Full local path.
std::string virtual_path = RsDirUtil::makePath(dirdetail.path, dirdetail.name);
if (!rsFiles->ConvertSharedFilePath(virtual_path, stream.path))
{
success = false;
errorMsg = "Cannot Match to Shared Directory";
}
stream.length = dirdetail.count;
stream.hash = dirdetail.hash;
stream.name = dirdetail.name;
stream.path = ... // from results.
stream.offset = 0;
stream.length = file.size;
stream.start_byte = 0;
stream.end_byte = stream.length;
stream.desired_rate = req.rate_kbs();
stream.desired_rate = req.rate_kBs;
if (stream.desired_rate > MAX_DESIRED_RATE)
{
stream.desired_rate = MAX_DESIRED_RATE;
}
// make response
rsctrl::stream::StreamDetail &detail = resp.streams_add();
if (!fill_stream_detail(detail, stream))
rsctrl::stream::StreamDesc *desc = resp.add_streams();
if (!fill_stream_desc(*desc, stream))
{
success = false;
errorMsg = "Failed to Invalid Action";
@ -201,8 +264,16 @@ int RpcProtoStream::processReqStartFileStream(uint32_t chan_id, uint32_t /*msg_i
{
// insert.
mStreams[stream.stream_id] = stream;
// register the stream too.
std::cerr << "RpcProtoStream::processReqStartFileStream() Registering the stream event.";
std::cerr << std::endl;
registerForEvents(chan_id, req_id, REGISTRATION_STREAMS);
}
std::cerr << "RpcProtoStream::processReqStartFileStream() List of Registered Streams:";
std::cerr << std::endl;
printEventRegister(std::cerr);
}
/* DONE - Generate Reply */
@ -258,53 +329,79 @@ int RpcProtoStream::processReqControlStream(uint32_t chan_id, uint32_t /*msg_id*
// FIND MATCHING STREAM.
std::map<uint32_t, RpcStream>::iterator it;
it = mStreams.find(resp.stream_id);
it = mStreams.find(req.stream_id());
if (it != mStreams.end())
{
// TWEAK
// FILL IN REPLY.
// DONE.
switch(resp.action)
if (it->second.state == RpcStream::STREAMERR)
{
case STREAM_START:
if (it->state == PAUSED)
{
it->state = RUNNING;
}
break;
case STREAM_STOP:
it->state = FINISHED;
break;
case STREAM_PAUSE:
if (it->state == RUNNING)
{
it->state = PAUSED;
}
break;
case STREAM_CHANGE_RATE:
it->desired_rate = req.rate_kBs;
break;
case STREAM_SEEK:
if (req.seek_byte < it-> endByte)
{
it->offset = req.seek_byte;
}
break;
default:
if (req.action() == rsctrl::stream::RequestControlStream::STREAM_STOP)
{
it->second.state = RpcStream::FINISHED;
}
else
{
success = false;
errorMsg = "Invalid Action";
errorMsg = "Stream Error";
}
}
else
{
switch(req.action())
{
case rsctrl::stream::RequestControlStream::STREAM_START:
if (it->second.state == RpcStream::PAUSED)
{
it->second.state = RpcStream::RUNNING;
}
break;
case rsctrl::stream::RequestControlStream::STREAM_STOP:
it->second.state = RpcStream::FINISHED;
break;
case rsctrl::stream::RequestControlStream::STREAM_PAUSE:
if (it->second.state == RpcStream::RUNNING)
{
it->second.state = RpcStream::PAUSED;
it->second.transfer_time = 0; // reset timings.
}
break;
case rsctrl::stream::RequestControlStream::STREAM_CHANGE_RATE:
it->second.desired_rate = req.rate_kbs();
break;
case rsctrl::stream::RequestControlStream::STREAM_SEEK:
if (req.seek_byte() < it->second.end_byte)
{
it->second.offset = req.seek_byte();
}
break;
default:
success = false;
errorMsg = "Invalid Action";
}
}
// FILL IN REPLY.
if (success)
{
rsctrl::stream::StreamDetail &detail = resp.streams_add();
if (!fill_stream_detail(detail, it->second))
rsctrl::stream::StreamDesc *desc = resp.add_streams();
if (!fill_stream_desc(*desc, it->second))
{
success = false;
errorMsg = "Invalid Action";
}
}
// Cleanup - TODO, this is explicit at the moment. - should be automatic after finish.
if (it->second.state == RpcStream::FINISHED)
{
deregisterForEvents(it->second.chan_id, it->second.req_id, REGISTRATION_STREAMS);
mStreams.erase(it);
}
}
else
{
@ -366,16 +463,20 @@ int RpcProtoStream::processReqListStreams(uint32_t chan_id, uint32_t /*msg_id*/,
std::map<uint32_t, RpcStream>::iterator it;
for(it = mStreams.begin(); it != mStreams.end(); it++)
{
bool match = true;
// TODO fill in match!
/* check that it matches */
if (! match)
{
continue;
}
rsctrl::stream::StreamDetail &detail = resp.streams_add();
if (!fill_stream_detail(detail, it->second))
rsctrl::stream::StreamDesc *desc = resp.add_streams();
if (!fill_stream_desc(*desc, it->second))
{
success = false;
errorMsg = "Some Details Failed to Fill";
@ -413,106 +514,9 @@ int RpcProtoStream::processReqListStreams(uint32_t chan_id, uint32_t /*msg_id*/,
}
int RpcProtoStream::processReqRegisterStreams(uint32_t chan_id, uint32_t /*msg_id*/, uint32_t req_id, const std::string &msg)
{
std::cerr << "RpcProtoStream::processReqRegisterStreams()";
std::cerr << std::endl;
// parse msg.
rsctrl::stream::RequestRegisterStreams req;
if (!req.ParseFromString(msg))
{
std::cerr << "RpcProtoStream::processReqRegisterStreams() ERROR ParseFromString()";
std::cerr << std::endl;
return 0;
}
// response.
rsctrl::stream::ResponseRegisterStreams resp;
bool success = true;
bool doregister = false;
std::string errorMsg;
switch(req.action())
{
case rsctrl::stream::RequestRegisterStreams::REGISTER:
doregister = true;
break;
case rsctrl::stream::RequestRegisterStreams::DEREGISTER:
doregister = false;
break;
default:
std::cerr << "ERROR action is invalid";
std::cerr << std::endl;
success = false;
errorMsg = "RegisterStreams.Action is invalid";
break;
}
if (success)
{
if (doregister)
{
std::cerr << "Registering for Streams";
std::cerr << std::endl;
registerForEvents(chan_id, req_id, REGISTRATION_STREAMS);
}
else
{
std::cerr << "Deregistering for Streams";
std::cerr << std::endl;
deregisterForEvents(chan_id, req_id, REGISTRATION_STREAMS);
}
printEventRegister(std::cerr);
}
/* DONE - Generate Reply */
if (success)
{
rsctrl::core::Status *status = resp.mutable_status();
status->set_code(rsctrl::core::Status::SUCCESS);
}
else
{
rsctrl::core::Status *status = resp.mutable_status();
status->set_code(rsctrl::core::Status::FAILED);
status->set_msg(errorMsg);
}
std::string outmsg;
if (!resp.SerializeToString(&outmsg))
{
std::cerr << "RpcProtoStream::processReqCreateLobbies() ERROR SerialiseToString()";
std::cerr << std::endl;
return 0;
}
// Correctly Name Message.
uint32_t out_msg_id = constructMsgId(rsctrl::core::CORE, rsctrl::core::STREAM,
rsctrl::stream::MsgId_ResponseRegisterStreams, true);
// queue it.
queueResponse(chan_id, out_msg_id, req_id, outmsg);
return 1;
}
// EVENTS. (STREAMS)
int RpcProtoStream::locked_checkForEvents(uint32_t event, const std::list<RpcEventRegister> &registered, std::list<RpcQueuedMsg> &stream_msgs)
int RpcProtoStream::locked_checkForEvents(uint32_t event, const std::list<RpcEventRegister> & /* registered */, std::list<RpcQueuedMsg> &stream_msgs)
{
/* Wow - here already! */
std::cerr << "locked_checkForEvents()";
std::cerr << std::endl;
/* only one event type for now */
if (event != REGISTRATION_STREAMS)
{
@ -528,128 +532,204 @@ int RpcProtoStream::locked_checkForEvents(uint32_t event, const std::list<RpcEve
* NOTE we'll have to something more complex for VoIP!
*/
float ts = getTimeStamp();
float dt = ts - mStreamRates.last_ts;
double ts = getTimeStamp();
double dt = ts - mStreamRates.last_ts;
uint32_t data_sent = 0;
#define FILTER_K (0.75)
if (mStreamRates.last_ts != 0)
if (dt < 5.0) //mStreamRates.last_ts != 0)
{
mStreamRates.avg_dt = FILTER_K * mStreamRates.avg_dt
+ (1.0 - FILTER_K) * dt;
}
else
{
mStreamRates.avg_dt = dt;
std::cerr << "RpcProtoStream::locked_checkForEvents() Large dT - resetting avg";
std::cerr << std::endl;
mStreamRates.avg_dt = 0.0;
}
mStreamRates.last_ts = ts;
std::list<uint32_t> to_remove;
std::map<uint32_t, RpcStream>::iterator it;
for(it = mStreams.begin(); it != mStreams.end(); it++)
{
RpcStream &stream = it->second;
if (stream.state == PAUSED)
if (!(stream.state == RpcStream::RUNNING))
{
continue;
}
/* we ignore the Events Register... just use stream info, */
int channel_id = stream.chan_id;
uint32_t size = stream.desired_rate * mStreamRates.avg_dt;
double stream_dt = ts - stream.transfer_time;
switch(stream.transfer_type)
{
case RpcStream::REALTIME:
// let it go through always.
break;
case RpcStream::STANDARD:
if (stream_dt < STREAM_STANDARD_MIN_DT)
{
continue;
}
break;
case RpcStream::BACKGROUND:
if (stream_dt < STREAM_BACKGROUND_MIN_DT)
{
continue;
}
break;
}
if (!stream.transfer_time)
{
std::cerr << "RpcProtoStream::locked_checkForEvents() Null stream.transfer_time .. resetting";
std::cerr << std::endl;
stream.transfer_avg_dt = STREAM_STANDARD_MIN_DT;
}
else
{
std::cerr << "RpcProtoStream::locked_checkForEvents() stream.transfer_avg_dt: " << stream.transfer_avg_dt;
std::cerr << " stream_dt: " << stream_dt;
std::cerr << std::endl;
stream.transfer_avg_dt = FILTER_K * stream.transfer_avg_dt
+ (1.0 - FILTER_K) * stream_dt;
std::cerr << "RpcProtoStream::locked_checkForEvents() ==> stream.transfer_avg_dt: " << stream.transfer_avg_dt;
std::cerr << std::endl;
}
uint32_t size = stream.desired_rate * 1000.0 * stream.transfer_avg_dt;
stream.transfer_time = ts;
if (size < MIN_STREAM_CHUNK_SIZE)
{
size = MIN_STREAM_CHUNK_SIZE;
}
if (size > MAX_STREAM_CHUNK_SIZE)
{
size = MAX_STREAM_CHUNK_SIZE;
}
/* get data */
uint64_t remaining = stream.end_byte - stream.offset;
if (remaining < size)
{
size = remaining;
stream.state = FINISHED;
to_remove.push_back(it->first);
stream.state = RpcStream::FINISHED;
std::cerr << "RpcProtoStream::locked_checkForEvents() Sending Remaining: " << size;
std::cerr << std::endl;
}
std::cerr << "RpcProtoStream::locked_checkForEvents() Handling Stream: " << stream.stream_id << " state: " << stream.state;
std::cerr << std::endl;
std::cerr << "path: " << stream.path;
std::cerr << std::endl;
std::cerr << "offset: " << stream.offset;
std::cerr << " avg_dt: " << stream.transfer_avg_dt;
std::cerr << " x desired_rate: " << stream.desired_rate;
std::cerr << " => chunk_size: " << size;
std::cerr << std::endl;
/* fill in the answer */
StreamData data;
data.stream_id = stream.stream_id;
data.stream_state = stream.state;
data.send_time = getTimeStamp();
data.offset = stream.offset;
data.size = size;
rsctrl::stream::ResponseStreamData resp;
rsctrl::core::Status *status = resp.mutable_status();
status->set_code(rsctrl::core::Status::SUCCESS);
fill_stream_data(stream, data);
rsctrl::stream::StreamData *data = resp.mutable_data();
data->set_stream_id(stream.stream_id);
RpcQueuedMsg qmsg;
rsctrl::stream::ChatType ctype = rsctrl::stream::TYPE_GROUP;
std::string chat_id = ""; // No ID for group.
if (createQueuedEventSendMsg(*it, ctype, chat_id, *rit, qmsg))
// convert state.
switch(stream.state)
{
std::cerr << "Created MsgEvent";
std::cerr << std::endl;
case RpcStream::RUNNING:
data->set_stream_state(rsctrl::stream::STREAM_STATE_RUN);
break;
// This case cannot happen.
case RpcStream::PAUSED:
data->set_stream_state(rsctrl::stream::STREAM_STATE_PAUSED);
break;
// This can only happen at last chunk.
default:
case RpcStream::FINISHED:
data->set_stream_state(rsctrl::stream::STREAM_STATE_FINISHED);
break;
}
events.push_back(qmsg);
rsctrl::core::Timestamp *ts = data->mutable_send_time();
setTimeStamp(ts);
data->set_offset(stream.offset);
data->set_size(size);
if (fill_stream_data(*data, stream))
{
/* increment seek_location - for next request */
stream.offset += size;
RpcQueuedMsg qmsg;
if (createQueuedStreamMsg(stream, resp, qmsg))
{
std::cerr << "Created Stream Msg.";
std::cerr << std::endl;
stream_msgs.push_back(qmsg);
}
else
{
std::cerr << "ERROR Creating Stream Msg";
std::cerr << std::endl;
}
}
else
{
std::cerr << "ERROR Creating MsgEvent";
stream.state = RpcStream::STREAMERR;
std::cerr << "ERROR Filling Stream Data";
std::cerr << std::endl;
}
}
return 1;
}
// TODO
int RpcProtoStream::cleanup_checkForEvents(uint32_t /* event */, const std::list<RpcEventRegister> & /* registered */)
{
std::list<uint32_t> to_remove;
std::list<uint32_t>::iterator rit;
for(rit = to_remove.begin(); rit != to_remove.end(); rit++)
{
/* kill the stream! */
std::map<uint32_t, RpcStream>::iterator it;
it = mStreams.find(*rit);
if (it != mStreams.end())
{
mStreams.erase(it);
}
}
return 1;
}
/***** HELPER FUNCTIONS *****/
bool createQueuedEventSendMsg(const ChatInfo &chatinfo, rsctrl::stream::ChatType ctype,
std::string chat_id, const RpcEventRegister &ereg, RpcQueuedMsg &qmsg)
bool createQueuedStreamMsg(const RpcStream &stream, rsctrl::stream::ResponseStreamData &resp, RpcQueuedMsg &qmsg)
{
rsctrl::stream::EventChatMessage event;
rsctrl::stream::ChatMessage *msg = event.mutable_msg();
rsctrl::stream::ChatId *id = msg->mutable_id();
id->set_chat_type(ctype);
id->set_chat_id(chat_id);
msg->set_peer_nickname(chatinfo.peer_nickname);
msg->set_chat_flags(chatinfo.chatflags);
msg->set_send_time(chatinfo.sendTime);
msg->set_recv_time(chatinfo.recvTime);
std::string msg_utf8;
if (!convertWStringToUTF8(chatinfo.msg, msg_utf8))
{
std::cerr << "RpcProtoStream::createQueuedEventSendMsg() ERROR Converting Msg";
std::cerr << std::endl;
return false;
}
msg->set_msg(msg_utf8);
/* DONE - Generate Reply */
std::string outmsg;
if (!event.SerializeToString(&outmsg))
if (!resp.SerializeToString(&outmsg))
{
std::cerr << "RpcProtoStream::createQueuedEventSendMsg() ERROR SerialiseToString()";
std::cerr << std::endl;
@ -657,37 +737,88 @@ bool createQueuedEventSendMsg(const ChatInfo &chatinfo, rsctrl::stream::ChatType
}
// Correctly Name Message.
qmsg.mMsgId = constructMsgId(rsctrl::core::CORE, rsctrl::core::CHAT,
rsctrl::stream::MsgId_EventChatMessage, true);
qmsg.mMsgId = constructMsgId(rsctrl::core::CORE, rsctrl::core::STREAM,
rsctrl::stream::MsgId_ResponseStreamData, true);
qmsg.mChanId = ereg.mChanId;
qmsg.mReqId = ereg.mReqId;
qmsg.mChanId = stream.chan_id;
qmsg.mReqId = stream.req_id;
qmsg.mMsg = outmsg;
return true;
}
/****************** NEW HELPER FNS ******************/
bool fill_stream_details(rsctrl::stream::ResponseStreamDetail &resp,
const std::list<RpcStream> &streams)
{
std::cerr << "fill_stream_details()";
std::cerr << std::endl;
bool val = true;
std::list<RpcStream>::const_iterator it;
for (it = streams.begin(); it != streams.end(); it++)
{
rsctrl::stream::StreamDetail &detail = resp.streams_add();
fill_stream_detail(detail, *it);
rsctrl::stream::StreamDesc *desc = resp.add_streams();
val &= fill_stream_desc(*desc, *it);
}
return val;
}
bool fill_stream_detail(rsctrl::stream::StreamDetail &detail,
const RpcStream &stream)
bool fill_stream_desc(rsctrl::stream::StreamDesc &desc, const RpcStream &stream)
{
std::cerr << "fill_stream_desc()";
std::cerr << std::endl;
return true;
}
bool fill_stream_data(rsctrl::stream::StreamData &data, const RpcStream &stream)
{
/* fill the StreamData from stream */
/* open file */
FILE *fd = RsDirUtil::rs_fopen(stream.path.c_str(), "rb");
if (!fd)
{
std::cerr << "fill_stream_data() Failed to open file: " << stream.path;
std::cerr << std::endl;
return false;
}
uint32_t data_size = data.size();
uint64_t base_loc = data.offset();
void *buffer = malloc(data_size);
/* seek to correct spot */
fseeko64(fd, base_loc, SEEK_SET);
/* copy data into bytes */
if (1 != fread(buffer, data_size, 1, fd))
{
std::cerr << "fill_stream_data() Failed to get data. data_size=" << data_size << ", base_loc=" << base_loc << " !";
std::cerr << std::endl;
return false;
}
data.set_stream_data(buffer, data_size);
free(buffer);
fclose(fd);
return true;
}
uint32_t RpcProtoStream::getNextStreamId()
{
return mNextStreamId++;
}

View File

@ -33,10 +33,25 @@
class RpcStream
{
public:
RpcStream(): chan_id(0), req_id(0), stream_id(0), state(0),
offset(0), length(0), start_byte(0), end_byte(0), desired_rate(0),
transfer_type(0), transfer_time(0), transfer_avg_dt(0)
{ return; }
static const uint32_t STREAMERR = 0x00000;
static const uint32_t RUNNING = 0x00001;
static const uint32_t PAUSED = 0x00002;
static const uint32_t FINISHED = 0x00003;
uint32_t chan_id;
uint32_t req_id;
uint32_t stream_id;
uint32_t state;
std::string name;
std::string hash;
std::string path;
uint64_t offset; // where we currently are.
uint64_t length; // filesize.
@ -44,18 +59,31 @@ class RpcStream
uint64_t end_byte;
float desired_rate; // Kb/s
// Transfer Type
static const uint32_t STANDARD = 0x00000;
static const uint32_t REALTIME = 0x00001;
static const uint32_t BACKGROUND = 0x00002;
uint32_t transfer_type;
double transfer_time;
double transfer_avg_dt;
};
class RpcStreamRates
{
public:
RpcStreamRates(): avg_data_rate(0), avg_dt(1), last_data_rate(0), last_ts(0) { return; }
float avg_data_rate;
float avg_dt;
double avg_data_rate;
double avg_dt;
float last_data_rate;
float last_ts;
double last_data_rate;
double last_ts;
};
@ -66,15 +94,20 @@ class RpcProtoStream: public RpcQueueService
public:
RpcProtoStream(uint32_t serviceId);
virtual int processMsg(uint32_t chan_id, uint32_t msgId, uint32_t req_id, const std::string &msg);
virtual void reset(uint32_t chan_id);
uint32_t getNextStreamId();
protected:
int processReqStartFileStream(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
int processReqControlStream(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
int processReqListStreams(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
int processReqRegisterStreams(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
uint32_t mNextStreamId;
RpcStreamRates mStreamRates;
std::map<uint32_t, RpcStream> mStreams;
@ -82,6 +115,9 @@ protected:
// EVENTS.
virtual int locked_checkForEvents(uint32_t event, const std::list<RpcEventRegister> &registered, std::list<RpcQueuedMsg> &events);
// Not actually used yet.
int cleanup_checkForEvents(uint32_t event, const std::list<RpcEventRegister> &registered);
};

View File

@ -29,6 +29,7 @@
#include "rpc/proto/rpcprotochat.h"
#include "rpc/proto/rpcprotosearch.h"
#include "rpc/proto/rpcprotofiles.h"
#include "rpc/proto/rpcprotostream.h"
#include "rpc/rpcecho.h"
@ -53,6 +54,9 @@ RpcMediator *CreateRpcSystem(RpcComms *comms, NotifyTxt *notify)
RpcProtoFiles *files = new RpcProtoFiles(1);
server->addService(files);
RpcProtoStream *streamer = new RpcProtoStream(1);
server->addService(streamer);
/* Finally an Echo Service - which will echo back any unprocesses commands. */
RpcEcho *echo = new RpcEcho(1);
server->addService(echo);