mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-04 20:34:26 -04:00
Merge branch 'master' into gxs_mail_experiments
This commit is contained in:
commit
5159e326c7
335 changed files with 12307 additions and 24670 deletions
|
@ -1,107 +0,0 @@
|
|||
#ifndef RETROSHARE_DSDV_INTERFACE_H
|
||||
#define RETROSHARE_DSDV_INTERFACE_H
|
||||
|
||||
/*
|
||||
* libretroshare/src/rsiface: rsdsdv.h
|
||||
*
|
||||
* RetroShare C++ Interface.
|
||||
*
|
||||
* Copyright 2011-2011 by Robert Fernie.
|
||||
*
|
||||
* 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".
|
||||
*
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
/* The Main Interface Class - for information about your Peers */
|
||||
class RsDsdv;
|
||||
extern RsDsdv *rsDsdv;
|
||||
|
||||
|
||||
#define RSDSDV_IDTYPE_PEER 0x0001
|
||||
#define RSDSDV_IDTYPE_SERVICE 0x0002
|
||||
#define RSDSDV_IDTYPE_TEST 0x0100
|
||||
|
||||
#define RSDSDV_FLAGS_SIGNIFICANT_CHANGE 0x0001
|
||||
#define RSDSDV_FLAGS_STABLE_ROUTE 0x0002
|
||||
#define RSDSDV_FLAGS_NEW_ROUTE 0x0004
|
||||
#define RSDSDV_FLAGS_OWN_SERVICE 0x0008
|
||||
|
||||
|
||||
class RsDsdvId
|
||||
{
|
||||
public:
|
||||
|
||||
uint32_t mIdType;
|
||||
std::string mAnonChunk;
|
||||
std::string mHash;
|
||||
};
|
||||
|
||||
class RsDsdvRoute
|
||||
{
|
||||
public:
|
||||
|
||||
RsPeerId mNextHop;
|
||||
uint32_t mSequence;
|
||||
uint32_t mDistance;
|
||||
time_t mReceived;
|
||||
time_t mValidSince;
|
||||
|
||||
};
|
||||
|
||||
class RsDsdvTableEntry
|
||||
{
|
||||
public:
|
||||
|
||||
RsDsdvId mDest;
|
||||
bool mIsStable;
|
||||
RsDsdvRoute mStableRoute;
|
||||
//RsDsdvRoute mFreshestRoute;
|
||||
|
||||
std::map<RsPeerId, RsDsdvRoute> mAllRoutes;
|
||||
|
||||
uint32_t mFlags;
|
||||
|
||||
/* if we've matched it to someone */
|
||||
std::string mMatchedHash;
|
||||
bool mMatched;
|
||||
bool mOwnSource;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const RsDsdvId &id);
|
||||
std::ostream &operator<<(std::ostream &out, const RsDsdvRoute &route);
|
||||
std::ostream &operator<<(std::ostream &out, const RsDsdvTableEntry &entry);
|
||||
|
||||
|
||||
class RsDsdv
|
||||
{
|
||||
public:
|
||||
|
||||
RsDsdv() { return; }
|
||||
virtual ~RsDsdv() { return; }
|
||||
|
||||
virtual uint32_t getLocalServices(std::list<std::string> &hashes) = 0;
|
||||
virtual uint32_t getAllServices(std::list<std::string> &hashes) = 0;
|
||||
virtual int getDsdvEntry(const std::string &hash, RsDsdvTableEntry &entry) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -59,11 +59,12 @@ template<int n> class t_RsFlags32
|
|||
uint32_t _bits ;
|
||||
};
|
||||
|
||||
#define FLAGS_TAG_TRANSFER_REQS 0x4228af
|
||||
#define FLAGS_TAG_TRANSFER_REQS 0x4228af
|
||||
#define FLAGS_TAG_FILE_STORAGE 0x184738
|
||||
#define FLAGS_TAG_FILE_SEARCH 0xf29ba5
|
||||
#define FLAGS_TAG_FILE_SEARCH 0xf29ba5
|
||||
#define FLAGS_TAG_SERVICE_PERM 0x380912
|
||||
#define FLAGS_TAG_SERVICE_CHAT 0x839042
|
||||
#define FLAGS_TAG_SERIALIZER 0xa0338d
|
||||
|
||||
// Flags for requesting transfers, ask for turtle, cache, speed, etc.
|
||||
//
|
||||
|
@ -85,3 +86,7 @@ typedef t_RsFlags32<FLAGS_TAG_SERVICE_PERM > ServicePermissionFlags ;
|
|||
//
|
||||
typedef t_RsFlags32<FLAGS_TAG_SERVICE_CHAT > ChatLobbyFlags ;
|
||||
|
||||
// Flags for serializer
|
||||
//
|
||||
typedef t_RsFlags32<FLAGS_TAG_SERIALIZER > SerializationFlags ;
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <inttypes.h>
|
||||
|
||||
#include <retroshare/rstypes.h>
|
||||
#include <retroshare/rsids.h>
|
||||
|
||||
typedef GXSGroupId RsGxsGroupId;
|
||||
typedef Sha1CheckSum RsGxsMessageId;
|
||||
|
@ -25,7 +26,7 @@ typedef std::pair<RsGxsGroupId, RsGxsMessageId> RsGxsGrpMsgIdPair;
|
|||
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsGxsMessageId> > MsgRelatedIdResult;
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq;
|
||||
|
||||
class RsMsgMetaData;
|
||||
struct RsMsgMetaData;
|
||||
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > MsgMetaResult;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "retroshare/rsgxsifacetypes.h"
|
||||
#include "retroshare/rstokenservice.h"
|
||||
|
||||
class RsMsgMetaData ;
|
||||
struct RsMsgMetaData ;
|
||||
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > GxsMsgMetaMap;
|
||||
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsMsgMetaData> > GxsMsgRelatedMetaMap;
|
||||
|
|
|
@ -305,6 +305,9 @@ public:
|
|||
virtual bool setAsRegularContact(const RsGxsId& id,bool is_a_contact) = 0 ;
|
||||
virtual bool isARegularContact(const RsGxsId& id) = 0 ;
|
||||
|
||||
virtual bool serialiseIdentityToMemory(const RsGxsId& id,std::string& radix_string)=0;
|
||||
virtual bool deserialiseIdentityFromMemory(const std::string& radix_string)=0;
|
||||
|
||||
/*!
|
||||
* \brief overallReputationLevel
|
||||
* Returns the overall reputation level of the supplied identity. See rsreputations.h
|
||||
|
@ -319,6 +322,7 @@ public:
|
|||
*/
|
||||
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsIdGroup> &groups) = 0;
|
||||
virtual bool getGroupSerializedData(const uint32_t &token, std::map<RsGxsId,std::string>& serialized_groups)=0;
|
||||
//virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsIdOpinion> &opinions) = 0;
|
||||
|
||||
};
|
||||
|
|
|
@ -136,7 +136,7 @@ template<uint32_t ID_SIZE_IN_BYTES,bool UPPER_CASE,uint32_t UNIQUE_IDENTIFIER> c
|
|||
offset += SIZE_IN_BYTES ;
|
||||
return true ;
|
||||
}
|
||||
bool deserialise(void *data,uint32_t pktsize,uint32_t& offset)
|
||||
bool deserialise(const void *data,uint32_t pktsize,uint32_t& offset)
|
||||
{
|
||||
if(offset + SIZE_IN_BYTES > pktsize)
|
||||
return false ;
|
||||
|
|
|
@ -78,15 +78,16 @@ const uint32_t RS_FEED_TYPE_SECURITY = 0x0800;
|
|||
const uint32_t RS_FEED_TYPE_POSTED = 0x1000;
|
||||
const uint32_t RS_FEED_TYPE_SECURITY_IP = 0x2000;
|
||||
|
||||
const uint32_t RS_FEED_ITEM_PEER_CONNECT = RS_FEED_TYPE_PEER | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_PEER_DISCONNECT = RS_FEED_TYPE_PEER | 0x0002;
|
||||
const uint32_t RS_FEED_ITEM_PEER_HELLO = RS_FEED_TYPE_PEER | 0x0003;
|
||||
const uint32_t RS_FEED_ITEM_PEER_NEW = RS_FEED_TYPE_PEER | 0x0004;
|
||||
const uint32_t RS_FEED_ITEM_PEER_CONNECT = RS_FEED_TYPE_PEER | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_PEER_DISCONNECT = RS_FEED_TYPE_PEER | 0x0002;
|
||||
const uint32_t RS_FEED_ITEM_PEER_HELLO = RS_FEED_TYPE_PEER | 0x0003;
|
||||
const uint32_t RS_FEED_ITEM_PEER_NEW = RS_FEED_TYPE_PEER | 0x0004;
|
||||
const uint32_t RS_FEED_ITEM_PEER_OFFSET = RS_FEED_TYPE_PEER | 0x0005;
|
||||
|
||||
const uint32_t RS_FEED_ITEM_SEC_CONNECT_ATTEMPT = RS_FEED_TYPE_SECURITY | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_SEC_AUTH_DENIED = RS_FEED_TYPE_SECURITY | 0x0002;
|
||||
const uint32_t RS_FEED_ITEM_SEC_UNKNOWN_IN = RS_FEED_TYPE_SECURITY | 0x0003;
|
||||
const uint32_t RS_FEED_ITEM_SEC_UNKNOWN_OUT = RS_FEED_TYPE_SECURITY | 0x0004;
|
||||
const uint32_t RS_FEED_ITEM_SEC_CONNECT_ATTEMPT = RS_FEED_TYPE_SECURITY | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_SEC_AUTH_DENIED = RS_FEED_TYPE_SECURITY | 0x0002;
|
||||
const uint32_t RS_FEED_ITEM_SEC_UNKNOWN_IN = RS_FEED_TYPE_SECURITY | 0x0003;
|
||||
const uint32_t RS_FEED_ITEM_SEC_UNKNOWN_OUT = RS_FEED_TYPE_SECURITY | 0x0004;
|
||||
const uint32_t RS_FEED_ITEM_SEC_WRONG_SIGNATURE = RS_FEED_TYPE_SECURITY | 0x0005;
|
||||
const uint32_t RS_FEED_ITEM_SEC_BAD_CERTIFICATE = RS_FEED_TYPE_SECURITY | 0x0006;
|
||||
const uint32_t RS_FEED_ITEM_SEC_INTERNAL_ERROR = RS_FEED_TYPE_SECURITY | 0x0007;
|
||||
|
|
|
@ -52,7 +52,7 @@ class RsPhotoThumbnail
|
|||
|
||||
// Holds Thumbnail image.
|
||||
uint8_t *data;
|
||||
int size;
|
||||
uint32_t size;
|
||||
std::string type;
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define RETROSHARE_RTT_INTERFACE_H
|
||||
|
||||
/*
|
||||
* libretroshare/src/retroshare: rsrtt.h
|
||||
* libretroshare/src/retroshare: rsrtt.h
|
||||
*
|
||||
* RetroShare C++ Interface.
|
||||
*
|
||||
|
@ -58,6 +58,7 @@ class RsRtt
|
|||
virtual ~RsRtt() { return; }
|
||||
|
||||
virtual uint32_t getPongResults(const RsPeerId& id, int n, std::list<RsRttPongResult> &results) = 0;
|
||||
virtual double getMeanOffset(const RsPeerId& id) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ virtual ~RsServiceControl() { return; }
|
|||
|
||||
virtual bool getOwnServices(RsPeerServiceInfo &info) = 0;
|
||||
virtual std::string getServiceName(uint32_t service_id) = 0;
|
||||
virtual bool getServiceItemNames(uint32_t service_id,std::map<uint8_t,std::string>& names) = 0;
|
||||
|
||||
virtual bool getServicesAllowed(const RsPeerId &peerId, RsPeerServiceInfo &info) = 0;
|
||||
virtual bool getServicesProvided(const RsPeerId &peerId, RsPeerServiceInfo &info) = 0;
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
#define GXS_REQUEST_TYPE_GROUP_STATS 0x01600000
|
||||
#define GXS_REQUEST_TYPE_SERVICE_STATS 0x03200000
|
||||
#define GXS_REQUEST_TYPE_GROUP_SERIALIZED_DATA 0x04000000
|
||||
|
||||
|
||||
// TODO CLEANUP: RS_TOKREQOPT_MSG_* should be an inner enum of RsTokReqOptions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue