mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 03:49:29 -04:00
implemented most of rsdataservice,
updated rsnxsitems with discrete msgs and grp item rather than collection of msgs/grps added flags header file added first declaration of implemented genexchange service (client API interface) git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@5180 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f05ed342ed
commit
add4715da0
16 changed files with 1179 additions and 554 deletions
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
* RetroShare Serialiser.
|
||||
*
|
||||
* Copyright 2012 Christopher Evi-Parker, Robert Fernie.
|
||||
* Copyright 2012 Christopher Evi-Parker, Robert Fernie.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
@ -39,72 +39,42 @@
|
|||
|
||||
/*!
|
||||
* Base class used by client API
|
||||
* for their messages.
|
||||
* Main purpose is to transfer
|
||||
* between GDS and client side GXS
|
||||
* for messages.
|
||||
* Main purpose is for msg flows
|
||||
* between GDS and GXS API clients
|
||||
*/
|
||||
class RsGxsMsg : public RsItem
|
||||
{
|
||||
public:
|
||||
|
||||
RsGxsMsg() : RsItem() {}
|
||||
RsGxsMsg() : RsItem(0) {}
|
||||
virtual ~RsGxsMsg(){ return; }
|
||||
|
||||
|
||||
std::string grpId; /// grp id
|
||||
std::string msgId; /// message id
|
||||
uint32_t timestamp; /// when created
|
||||
std::string identity;
|
||||
uint32_t flag;
|
||||
};
|
||||
|
||||
/*!
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
class RsGxsSignedMsg : public RsItem
|
||||
{
|
||||
|
||||
RsGxsSignedMsg(uint16_t servtype, uint8_t subtype)
|
||||
: RsItem(RS_PKT_VERSION_SERVICE, servtype, subtype) { return; }
|
||||
|
||||
virtual ~RsGxsSignedMsg() { return; }
|
||||
|
||||
virtual void clear();
|
||||
virtual std::ostream& print(std::ostream &out, uint16_t indent = 0);
|
||||
/***** Don not serialise or set these members *****/
|
||||
|
||||
std::string grpId; /// group id
|
||||
std::string msgId; /// message id
|
||||
uint32_t timestamp;
|
||||
std::string identity;
|
||||
uint32_t flag;
|
||||
RsTlvBinaryData* msg;
|
||||
RsTlvBinaryData signature; // needs to be a set of signatures with bitfield flag ids
|
||||
// set should cover idenitity and publication key
|
||||
uint32_t timeStamp; /// UTC time when created
|
||||
std::string identity; /// identity associated with (no id means no signed)
|
||||
|
||||
/*!
|
||||
* The purpose of the flag is to note
|
||||
* If this message is an edit (note that edits only applies to
|
||||
* signed msgs)
|
||||
*/
|
||||
uint32_t msgFlag;
|
||||
|
||||
/***** Don not serialise or set these members *****/
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
class RsGxsSignedGroup
|
||||
{
|
||||
|
||||
|
||||
std::string grpId;
|
||||
std::string identity;
|
||||
RsTlvKeySignature sign;
|
||||
uint32_t timestamp; // UTC time
|
||||
RsTlvBinaryData* grp;
|
||||
uint32_t flag;
|
||||
};
|
||||
|
||||
/*!
|
||||
* This is the base group used by API client to exchange
|
||||
* data
|
||||
*
|
||||
* Base class used by client API
|
||||
* for groups.
|
||||
* Main purpose is for msg flows
|
||||
* between GDS and GXS API clients
|
||||
*/
|
||||
class RsGxsGroup : public RsItem
|
||||
{
|
||||
|
@ -112,47 +82,67 @@ class RsGxsGroup : public RsItem
|
|||
|
||||
public:
|
||||
|
||||
// publication type
|
||||
static const uint32_t FLAG_GRP_TYPE_KEY_SHARED;
|
||||
static const uint32_t FLAG_GRP_TYPE_PRIVATE_ENC;
|
||||
static const uint32_t FLAG_GRP_TYPE_PUBLIC;
|
||||
static const uint32_t FLAG_GRP_TYPE_MASK;
|
||||
|
||||
// type of msgs
|
||||
static const uint32_t FLAG_MSGS_TYPE_SIGNED;
|
||||
static const uint32_t FLAG_MSGS_TYPE_ANON;
|
||||
static const uint32_t FLAG_MSGS_TYPE_MASK;
|
||||
|
||||
/*** type of msgs ***/
|
||||
|
||||
RsGxsGroup(uint16_t servtype, uint8_t subtype)
|
||||
: RsItem(servtype) { return; }
|
||||
|
||||
virtual ~RsGxsGroup() { return; }
|
||||
|
||||
std::string grpId;
|
||||
|
||||
std::string grpId; /// group id
|
||||
std::string identity; /// identity associated with group
|
||||
uint32_t timeStamp; // UTC time
|
||||
uint32_t flag;
|
||||
uint32_t timeStamp; /// UTC time
|
||||
bool subscribed;
|
||||
bool read;
|
||||
|
||||
/*!
|
||||
* Three thing flag represents:
|
||||
* Is it signed by identity?
|
||||
* Group type (private, public, restricted)
|
||||
* msgs allowed (signed and anon)
|
||||
*/
|
||||
uint32_t grpFlag;
|
||||
|
||||
/***** *****/
|
||||
|
||||
|
||||
};
|
||||
|
||||
class RsGxsKey : public RsItem {
|
||||
|
||||
|
||||
|
||||
class RsGxsSearch : public RsItem {
|
||||
|
||||
RsGxsSearch(uint32_t servtype) : RsItem(servtype) { return ; }
|
||||
virtual ~RsGxsSearch() { return;}
|
||||
|
||||
};
|
||||
|
||||
class RsGxsSrchResMsgCtx : public RsItem {
|
||||
|
||||
RsGxsSrchResMsgCtx(uint32_t servtype) : RsItem(servtype) { return; }
|
||||
virtual ~RsGxsSrchResMsgCtx() {return; }
|
||||
std::string msgId;
|
||||
RsTlvKeySignature sign;
|
||||
|
||||
};
|
||||
|
||||
class RsGxsSrchResGrpCtx : public RsItem {
|
||||
|
||||
RsGxsSrchResGrpCtx(uint32_t servtype) : RsItem(servtype) { return; }
|
||||
virtual ~RsGxsSrchResGrpCtx() {return; }
|
||||
std::string msgId;
|
||||
RsTlvKeySignature sign;
|
||||
|
||||
};
|
||||
|
||||
class RsGxsSerialiser : public RsSerialType
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
|
||||
RsGxsSerialiser(uint32_t servtype) : RsSerialType(servtype) { return; }
|
||||
virtual ~RsGxsSerialiser() { return; }
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue