2012-01-11 18:01:29 -05:00
|
|
|
#ifndef RSGNP_H
|
|
|
|
#define RSGNP_H
|
|
|
|
|
2012-01-18 18:20:53 -05:00
|
|
|
/*
|
|
|
|
* libretroshare/src/gxs: rsgnp.h
|
|
|
|
*
|
|
|
|
* General Exchange Protocol interface for RetroShare.
|
|
|
|
*
|
|
|
|
* Copyright 2011-2011 by Robert Fernie, Christopher Evi-Prker
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License Version 2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
|
|
|
*
|
|
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-01-15 08:07:31 -05:00
|
|
|
#include <set>
|
2012-01-18 18:20:53 -05:00
|
|
|
#include <string>
|
2012-01-16 16:52:22 -05:00
|
|
|
#include <time.h>
|
|
|
|
#include <stdlib.h>
|
2012-01-18 18:20:53 -05:00
|
|
|
#include <list>
|
|
|
|
#include <map>
|
2012-01-15 08:07:31 -05:00
|
|
|
|
2012-01-18 18:20:53 -05:00
|
|
|
#include "gxs/rsgxs.h"
|
2012-02-12 10:18:05 -05:00
|
|
|
#include "services/p3service.h"
|
2012-01-19 18:32:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* This is universal format for messages that is transported throughout
|
|
|
|
* the general exchange service chain. From concrete service to
|
|
|
|
*/
|
|
|
|
class RsGxsSignedMessage : RsItem {
|
|
|
|
|
|
|
|
uint32_t timestamp;
|
|
|
|
void* signature;
|
|
|
|
void* data;
|
|
|
|
uint32_t msg_flags; /* encrypted */
|
|
|
|
std::string msgId; /* hash of all message data */
|
|
|
|
std::string grpId;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Item for dealing
|
|
|
|
* with grp list
|
|
|
|
*/
|
|
|
|
class RsGxsMessageList : public RsGxsSignedMessage {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Item for dealing with group
|
|
|
|
* description and msg list
|
|
|
|
*/
|
|
|
|
class RsGxsGroup : public RsGxsSignedMessage {
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-01-18 18:20:53 -05:00
|
|
|
typedef std::map<std::string, std::set<std::string> > PeerGrp;
|
2012-01-11 18:01:29 -05:00
|
|
|
|
|
|
|
/*!
|
2012-01-18 18:20:53 -05:00
|
|
|
* Retroshare General Network Exchange Service: \n
|
2012-01-19 18:32:27 -05:00
|
|
|
* Interface:
|
2012-02-12 10:18:05 -05:00
|
|
|
* - This provides a module to service peer's requests for GXS messages \n
|
2012-01-19 18:32:27 -05:00
|
|
|
* and also request GXS messages from other peers. \n
|
2012-02-12 10:18:05 -05:00
|
|
|
* - The general mode of operation is to sychronise all messages/grps between
|
|
|
|
* peers
|
|
|
|
*
|
|
|
|
* The interface is sparse as this service is mostly making the requests to other GXS components
|
|
|
|
*
|
|
|
|
* Groups:
|
|
|
|
* - As this is where exchanges occur between peers, this is also where groups relationships
|
|
|
|
* should get resolved as far as
|
|
|
|
* - Per implemented GXS there are a set of rules which will determine whether data is transferred
|
|
|
|
* between any set of groups
|
|
|
|
*
|
|
|
|
* 1 allow transfers to any group
|
|
|
|
* 2 transfers only between group
|
|
|
|
* - the also group matrix settings which is by default everyone can transfer to each other
|
2012-01-11 18:01:29 -05:00
|
|
|
*/
|
2012-02-12 10:18:05 -05:00
|
|
|
class RsNetworktExchangeService : public p3Service
|
2012-01-11 18:01:29 -05:00
|
|
|
{
|
|
|
|
public:
|
2012-01-15 08:07:31 -05:00
|
|
|
|
2012-02-12 10:18:05 -05:00
|
|
|
RsNetworkExchangeService(uint16_t subtype);
|
2012-01-15 08:07:31 -05:00
|
|
|
|
|
|
|
|
2012-01-18 18:20:53 -05:00
|
|
|
/*!
|
2012-02-12 10:18:05 -05:00
|
|
|
* Use this to set how far back synchronisation of messages should take place
|
|
|
|
* @param range how far back from current time to synchronise with other peers
|
2012-01-18 18:20:53 -05:00
|
|
|
*/
|
2012-02-12 10:18:05 -05:00
|
|
|
virtual void setTimeRange(uint64_t range) = 0;
|
2012-01-15 08:07:31 -05:00
|
|
|
|
2012-01-11 18:01:29 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RSGNP_H
|