2018-11-04 15:17:22 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* unittests/libretroshare/services/gxs/GxsPeerNode.h *
|
|
|
|
* *
|
2018-11-11 14:42:48 -05:00
|
|
|
* Copyright 2014 by Robert Fernie <retroshare.project@gmail.com> *
|
2018-11-04 15:17:22 -05:00
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program 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 Lesser General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
******************************************************************************/
|
2014-04-13 08:21:51 -04:00
|
|
|
#pragma once
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
// from retroshare
|
|
|
|
#include "retroshare/rsids.h"
|
|
|
|
#include "retroshare/rstypes.h"
|
|
|
|
#include "retroshare/rsgxscircles.h"
|
|
|
|
#include "retroshare/rsidentity.h"
|
|
|
|
|
2014-04-13 08:21:51 -04:00
|
|
|
// from librssimulator
|
|
|
|
#include "peer/PeerNode.h"
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
#include "gxstestservice.h"
|
|
|
|
|
2014-04-13 08:21:51 -04:00
|
|
|
class RsGxsIdExchange;
|
|
|
|
class RsGxsCircleExchange;
|
|
|
|
class GxsTestService;
|
|
|
|
class RsGeneralDataService;
|
|
|
|
class RsGxsNetService;
|
2014-04-27 09:26:14 -04:00
|
|
|
class p3IdService;
|
|
|
|
class p3GxsCircles;
|
|
|
|
class FakePgpAuxUtils;
|
2014-04-13 08:21:51 -04:00
|
|
|
|
|
|
|
class GxsPeerNode: public PeerNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
GxsPeerNode(const RsPeerId &ownId, const std::list<RsPeerId> &peers, int testMode, bool useIdentityService);
|
2014-04-13 08:21:51 -04:00
|
|
|
~GxsPeerNode();
|
|
|
|
|
2014-05-04 08:50:19 -04:00
|
|
|
bool checkTestServiceAllowedGroups(const RsPeerId &peerId);
|
|
|
|
bool checkCircleServiceAllowedGroups(const RsPeerId &peerId);
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
bool createIdentity(const std::string &name,
|
|
|
|
bool pgpLinked,
|
|
|
|
uint32_t circleType,
|
|
|
|
const RsGxsCircleId &circleId,
|
|
|
|
RsGxsId &gxsId);
|
|
|
|
|
|
|
|
bool createCircle(const std::string &name,
|
|
|
|
uint32_t circleType,
|
|
|
|
const RsGxsCircleId &circleId,
|
|
|
|
const RsGxsId &authorId,
|
2015-12-13 11:22:31 -05:00
|
|
|
std::set<RsPgpId> localMembers,
|
|
|
|
std::set<RsGxsId> externalMembers,
|
2014-04-27 09:26:14 -04:00
|
|
|
RsGxsGroupId &groupId);
|
|
|
|
|
|
|
|
bool createGroup(const std::string &name,
|
|
|
|
uint32_t circleType,
|
|
|
|
const RsGxsCircleId &circleId,
|
|
|
|
const RsGxsId &authorId,
|
|
|
|
RsGxsGroupId &groupId);
|
|
|
|
|
|
|
|
bool createMsg(const std::string &msgstr,
|
|
|
|
const RsGxsGroupId &groupId,
|
|
|
|
const RsGxsId &authorId,
|
|
|
|
RsGxsMessageId &msgId);
|
|
|
|
|
|
|
|
bool subscribeToGroup(const RsGxsGroupId &groupId, bool subscribe);
|
|
|
|
|
|
|
|
bool getGroups(std::vector<RsTestGroup> &groups);
|
|
|
|
bool getGroupList(std::list<RsGxsGroupId> &groups);
|
|
|
|
bool getMsgList(const RsGxsGroupId &id, std::list<RsGxsMessageId> &msgIds);
|
|
|
|
|
|
|
|
bool getIdentities(std::vector<RsGxsIdGroup> &groups);
|
|
|
|
bool getIdentitiesList(std::list<RsGxsGroupId> &groups);
|
|
|
|
|
|
|
|
bool getCircles(std::vector<RsGxsCircleGroup> &groups);
|
|
|
|
bool getCirclesList(std::list<RsGxsGroupId> &groups);
|
|
|
|
|
|
|
|
uint32_t mUseIdentityService;
|
2014-04-13 08:21:51 -04:00
|
|
|
uint32_t mTestMode;
|
|
|
|
std::string mGxsDir;
|
|
|
|
|
2014-04-27 09:26:14 -04:00
|
|
|
FakePgpAuxUtils *mPgpAuxUtils;
|
|
|
|
|
|
|
|
p3IdService *mGxsIdService;
|
|
|
|
p3GxsCircles *mGxsCircles;
|
|
|
|
|
|
|
|
RsGeneralDataService* mGxsIdDs;
|
|
|
|
RsGxsNetService* mGxsIdNs;
|
|
|
|
|
|
|
|
RsGeneralDataService* mGxsCirclesDs;
|
|
|
|
RsGxsNetService* mGxsCirclesNs;
|
2014-04-13 08:21:51 -04:00
|
|
|
|
|
|
|
GxsTestService *mTestService;
|
|
|
|
RsGeneralDataService* mTestDs;
|
|
|
|
RsGxsNetService* mTestNs;
|
|
|
|
};
|
|
|
|
|
|
|
|
|