2012-01-11 23:01:29 +00:00
|
|
|
#ifndef RSGNP_H
|
|
|
|
#define RSGNP_H
|
|
|
|
|
2012-01-15 13:07:31 +00:00
|
|
|
#include <set>
|
|
|
|
|
|
|
|
#include "services/p3service.h"
|
|
|
|
#include "gxs/rsgdp.h"
|
2012-01-11 23:01:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Retroshare general network protocol
|
|
|
|
*
|
2012-01-15 13:07:31 +00:00
|
|
|
* This simply deals with the receiving and sending
|
2012-01-11 23:01:29 +00:00
|
|
|
* RsGxs data
|
|
|
|
*
|
|
|
|
*/
|
2012-01-15 13:07:31 +00:00
|
|
|
class RsGnp : p3ThreadedService
|
2012-01-11 23:01:29 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
RsGnp();
|
2012-01-15 13:07:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*** gdp::iterface *****/
|
|
|
|
int requestMsgs(std::set<std::string> msgId, double &delay);
|
|
|
|
void addGdp(RsGdp* gdp);
|
|
|
|
void removeGdp(RsGdp* gdp);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
/*** IMPLEMENTATION DETAILS ****/
|
|
|
|
|
|
|
|
/* Get/Send Messages */
|
|
|
|
void getAvailableMsgs(std::string peerId, time_t from, time_t to); /* request over the network */
|
|
|
|
void sendAvailableMsgs(std::string peerId, gdp::id grpId, time_t from, time_t to); /* send to peers */
|
|
|
|
|
|
|
|
requestMessages(std::string peerId, gdp::id grpId, std::list<gdp::id> msgIds);
|
|
|
|
sendMessages(std::string peerId, gdp::id grpId, std::list<gdp::id> msgIds); /* send to peer, obviously permissions have been checked first */
|
|
|
|
|
|
|
|
/* Search the network */
|
2012-01-11 23:01:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RSGNP_H
|