This commit is contained in:
2020-08-27 19:40:11 +03:00
parent e1f2c90790
commit 234d4e73be
9 changed files with 101 additions and 20 deletions

View File

@@ -19,10 +19,24 @@
#include "picloudtcp.h"
#include "picrypt.h"
#include "pichunkstream.h"
const char hash_def_key[] = "_picrypt_";
PIByteArray & operator <<(PIByteArray & s, const PICloud::Header & v) {
s << v.version << v.type << v.sname;
return s;
}
PIByteArray & operator >>(PIByteArray & s, PICloud::Header & v) {
s >> v.version >> v.type >> v.sname;
return s;
}
PICloudTCP::PICloudTCP() {
}

View File

@@ -26,6 +26,30 @@
#include "pip_cloud_export.h"
#include "pistring.h"
namespace PICloud {
enum Version {
Version_1 = 1,
};
enum HeaderType {
Server = 1,
Client = 2,
};
struct PIP_CLOUD_EXPORT Header {
Header() {
version = Version_1;
}
uchar version; // PICloud::Version
uchar type; // PICloud::HeaderType
PIString sname; // server name
};
}
PIP_CLOUD_EXPORT PIByteArray & operator <<(PIByteArray & s, const PICloud::Header & v);
PIP_CLOUD_EXPORT PIByteArray & operator >>(PIByteArray & s, PICloud::Header & v);
class PIP_CLOUD_EXPORT PICloudTCP {
public: