mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 11:54:30 -04:00
Merge branch 'master' into tunnel-names
This commit is contained in:
commit
c47e6f620d
1552 changed files with 110144 additions and 105662 deletions
|
@ -289,6 +289,7 @@ public:
|
|||
/* Operating Mode */
|
||||
virtual uint32_t getOperatingMode() = 0;
|
||||
virtual bool setOperatingMode(uint32_t opMode) = 0;
|
||||
virtual bool setOperatingMode(const std::string &opModeStr) = 0;
|
||||
|
||||
/* Data Rate Control - to be moved here */
|
||||
virtual int SetMaxDataRates( int downKb, int upKb ) = 0;
|
||||
|
|
|
@ -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
|
||||
|
|
@ -41,11 +41,15 @@ namespace RsRegularExpression { class Expression; }
|
|||
/* These are used mainly by ftController at the moment */
|
||||
const uint32_t RS_FILE_CTRL_PAUSE = 0x00000100;
|
||||
const uint32_t RS_FILE_CTRL_START = 0x00000200;
|
||||
const uint32_t RS_FILE_CTRL_FORCE_CHECK = 0x00000400;
|
||||
const uint32_t RS_FILE_CTRL_FORCE_CHECK = 0x00000400;
|
||||
|
||||
const uint32_t RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT = 0x00000001 ;
|
||||
const uint32_t RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE = 0x00000002 ;
|
||||
|
||||
const uint32_t RS_FILE_PERM_DIRECT_DL_YES = 0x00000001 ;
|
||||
const uint32_t RS_FILE_PERM_DIRECT_DL_NO = 0x00000002 ;
|
||||
const uint32_t RS_FILE_PERM_DIRECT_DL_PER_USER = 0x00000003 ;
|
||||
|
||||
const uint32_t RS_FILE_RATE_TRICKLE = 0x00000001;
|
||||
const uint32_t RS_FILE_RATE_SLOW = 0x00000002;
|
||||
const uint32_t RS_FILE_RATE_STANDARD = 0x00000003;
|
||||
|
@ -56,6 +60,9 @@ const uint32_t RS_FILE_RATE_STREAM_VIDEO = 0x00000006;
|
|||
const uint32_t RS_FILE_PEER_ONLINE = 0x00001000;
|
||||
const uint32_t RS_FILE_PEER_OFFLINE = 0x00002000;
|
||||
|
||||
const uint32_t RS_FILE_SHARE_FLAGS_IGNORE_PREFIXES = 0x0001 ;
|
||||
const uint32_t RS_FILE_SHARE_FLAGS_IGNORE_SUFFIXES = 0x0002 ;
|
||||
|
||||
/************************************
|
||||
* Used To indicate where to search.
|
||||
*
|
||||
|
@ -165,8 +172,12 @@ class RsFiles
|
|||
virtual void setFreeDiskSpaceLimit(uint32_t size_in_mb) =0;
|
||||
virtual bool FileControl(const RsFileHash& hash, uint32_t flags) = 0;
|
||||
virtual bool FileClearCompleted() = 0;
|
||||
virtual void setDefaultEncryptionPolicy(uint32_t policy)=0 ; // RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT/PERMISSIVE
|
||||
virtual uint32_t defaultEncryptionPolicy()=0 ;
|
||||
virtual void setDefaultEncryptionPolicy(uint32_t policy)=0; // RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT/PERMISSIVE
|
||||
virtual uint32_t defaultEncryptionPolicy()=0;
|
||||
virtual void setMaxUploadSlotsPerFriend(uint32_t n)=0;
|
||||
virtual uint32_t getMaxUploadSlotsPerFriend()=0;
|
||||
virtual void setFilePermDirectDL(uint32_t perm)=0;
|
||||
virtual uint32_t filePermDirectDL()=0;
|
||||
|
||||
/***
|
||||
* Control of Downloads Priority.
|
||||
|
@ -243,12 +254,17 @@ class RsFiles
|
|||
virtual bool updateShareFlags(const SharedDirInfo& dir) = 0; // updates the flags. The directory should already exist !
|
||||
virtual bool removeSharedDirectory(std::string dir) = 0;
|
||||
|
||||
virtual bool getIgnoreLists(std::list<std::string>& ignored_prefixes, std::list<std::string>& ignored_suffixes,uint32_t& flags) =0;
|
||||
virtual void setIgnoreLists(const std::list<std::string>& ignored_prefixes, const std::list<std::string>& ignored_suffixes,uint32_t flags) =0;
|
||||
|
||||
virtual void setWatchPeriod(int minutes) =0;
|
||||
virtual void setWatchEnabled(bool b) =0;
|
||||
virtual int watchPeriod() const =0;
|
||||
virtual int watchPeriod() const =0;
|
||||
virtual bool watchEnabled() =0;
|
||||
virtual bool followSymLinks() const=0;
|
||||
virtual void setFollowSymLinks(bool b)=0 ;
|
||||
virtual void togglePauseHashingProcess() =0; // pauses/resumes the hashing process.
|
||||
virtual bool hashingProcessPaused() =0;
|
||||
|
||||
virtual bool getShareDownloadDirectory() = 0;
|
||||
virtual bool shareDownloadDirectory(bool share) = 0;
|
||||
|
|
|
@ -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 ;
|
||||
|
||||
|
|
|
@ -60,6 +60,8 @@ public:
|
|||
|
||||
public:
|
||||
RsMsgMetaData mMeta;
|
||||
|
||||
std::set<RsGxsMessageId> mOlderVersions ;
|
||||
std::string mMsg; // UTF8 encoded.
|
||||
|
||||
std::list<RsGxsFile> mFiles;
|
||||
|
|
|
@ -142,6 +142,7 @@ public:
|
|||
|
||||
/* standard load */
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsCircleGroup> &groups) = 0;
|
||||
virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsCircleMsg> &msgs) = 0;
|
||||
|
||||
/* make new group */
|
||||
virtual void createGroup(uint32_t& token, RsGxsCircleGroup &group) = 0;
|
||||
|
|
|
@ -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;
|
||||
|
|
104
libretroshare/src/retroshare/rsgxstrans.h
Normal file
104
libretroshare/src/retroshare/rsgxstrans.h
Normal file
|
@ -0,0 +1,104 @@
|
|||
#pragma once
|
||||
|
||||
#include "retroshare/rstokenservice.h"
|
||||
#include "retroshare/rsgxsifacehelper.h"
|
||||
#include "retroshare/rsgxscommon.h"
|
||||
|
||||
/// Subservices identifiers (like port for TCP)
|
||||
enum class GxsTransSubServices : uint16_t
|
||||
{
|
||||
UNKNOWN = 0x00,
|
||||
TEST_SERVICE = 0x01,
|
||||
P3_MSG_SERVICE = 0x02,
|
||||
P3_CHAT_SERVICE = 0x03
|
||||
};
|
||||
|
||||
/// Values must fit into uint8_t
|
||||
enum class GxsTransItemsSubtypes : uint8_t
|
||||
{
|
||||
GXS_TRANS_SUBTYPE_MAIL = 0x01,
|
||||
GXS_TRANS_SUBTYPE_RECEIPT = 0x02,
|
||||
GXS_TRANS_SUBTYPE_GROUP = 0x03,
|
||||
OUTGOING_RECORD_ITEM_deprecated = 0x04,
|
||||
OUTGOING_RECORD_ITEM = 0x05
|
||||
};
|
||||
|
||||
enum class GxsTransSendStatus : uint8_t
|
||||
{
|
||||
UNKNOWN = 0x00,
|
||||
PENDING_PROCESSING = 0x01,
|
||||
PENDING_PREFERRED_GROUP = 0x02,
|
||||
PENDING_RECEIPT_CREATE = 0x03,
|
||||
PENDING_RECEIPT_SIGNATURE = 0x04,
|
||||
PENDING_SERIALIZATION = 0x05,
|
||||
PENDING_PAYLOAD_CREATE = 0x06,
|
||||
PENDING_PAYLOAD_ENCRYPT = 0x07,
|
||||
PENDING_PUBLISH = 0x08,
|
||||
/** This will be useful so the user can know if the mail reached at least
|
||||
* some friend node, in case of internet connection interruption */
|
||||
//PENDING_TRANSFER,
|
||||
PENDING_RECEIPT_RECEIVE = 0x09,
|
||||
/// Records with status >= RECEIPT_RECEIVED get deleted
|
||||
RECEIPT_RECEIVED = 0x0a,
|
||||
FAILED_RECEIPT_SIGNATURE = 0xf0,
|
||||
FAILED_ENCRYPTION = 0xf1
|
||||
};
|
||||
|
||||
typedef uint64_t RsGxsTransId;
|
||||
|
||||
class RsGxsTransGroup
|
||||
{
|
||||
public:
|
||||
RsGroupMetaData mMeta;
|
||||
};
|
||||
|
||||
class RsGxsTransMsg
|
||||
{
|
||||
public:
|
||||
RsGxsTransMsg() : size(0),data(NULL) {}
|
||||
virtual ~RsGxsTransMsg() { free(data) ; }
|
||||
|
||||
public:
|
||||
RsMsgMetaData mMeta;
|
||||
|
||||
uint32_t size ;
|
||||
uint8_t *data ;
|
||||
};
|
||||
|
||||
struct RsGxsTransOutgoingRecord
|
||||
{
|
||||
GxsTransSendStatus status;
|
||||
RsGxsId recipient;
|
||||
RsGxsTransId trans_id;
|
||||
|
||||
GxsTransSubServices client_service;
|
||||
|
||||
uint32_t data_size ;
|
||||
Sha1CheckSum data_hash ;
|
||||
uint32_t send_TS ;
|
||||
RsGxsGroupId group_id ;
|
||||
};
|
||||
|
||||
class RsGxsTrans: public RsGxsIfaceHelper
|
||||
{
|
||||
public:
|
||||
class GxsTransStatistics
|
||||
{
|
||||
public:
|
||||
GxsTransStatistics() {}
|
||||
|
||||
RsGxsGroupId prefered_group_id ;
|
||||
std::vector<RsGxsTransOutgoingRecord> outgoing_records;
|
||||
};
|
||||
|
||||
RsGxsTrans(RsGxsIface *gxs) : RsGxsIfaceHelper(gxs) {}
|
||||
|
||||
virtual ~RsGxsTrans() {}
|
||||
|
||||
virtual bool getStatistics(GxsTransStatistics& stats)=0;
|
||||
|
||||
// virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsTransGroup> &groups) = 0;
|
||||
// virtual bool getPostData(const uint32_t &token, std::vector<RsGxsTransMsg> &posts) = 0;
|
||||
};
|
||||
|
||||
extern RsGxsTrans *rsGxsTrans ;
|
|
@ -91,11 +91,11 @@ class GxsReputation
|
|||
};
|
||||
|
||||
|
||||
class RsGxsIdGroup
|
||||
struct RsGxsIdGroup
|
||||
{
|
||||
public:
|
||||
RsGxsIdGroup(): mLastUsageTS(0), mPgpKnown(false),mIsAContact(false) { return; }
|
||||
~RsGxsIdGroup() { return; }
|
||||
RsGxsIdGroup() :
|
||||
mLastUsageTS(0), mPgpKnown(false), mIsAContact(false) {}
|
||||
~RsGxsIdGroup() {}
|
||||
|
||||
|
||||
RsGroupMetaData mMeta;
|
||||
|
@ -305,6 +305,11 @@ 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,
|
||||
RsGxsId* id = nullptr ) = 0;
|
||||
|
||||
/*!
|
||||
* \brief overallReputationLevel
|
||||
* Returns the overall reputation level of the supplied identity. See rsreputations.h
|
||||
|
@ -319,6 +324,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;
|
||||
|
||||
};
|
||||
|
|
|
@ -94,6 +94,22 @@ template<uint32_t ID_SIZE_IN_BYTES,bool UPPER_CASE,uint32_t UNIQUE_IDENTIFIER> c
|
|||
inline bool operator==(const t_RsGenericIdType<ID_SIZE_IN_BYTES,UPPER_CASE,UNIQUE_IDENTIFIER>& fp) const { return !memcmp(bytes,fp.bytes,ID_SIZE_IN_BYTES) ; }
|
||||
inline bool operator!=(const t_RsGenericIdType<ID_SIZE_IN_BYTES,UPPER_CASE,UNIQUE_IDENTIFIER>& fp) const { return !!memcmp(bytes,fp.bytes,ID_SIZE_IN_BYTES); }
|
||||
inline bool operator< (const t_RsGenericIdType<ID_SIZE_IN_BYTES,UPPER_CASE,UNIQUE_IDENTIFIER>& fp) const { return (memcmp(bytes,fp.bytes,ID_SIZE_IN_BYTES) < 0) ; }
|
||||
inline t_RsGenericIdType<ID_SIZE_IN_BYTES,UPPER_CASE,UNIQUE_IDENTIFIER>
|
||||
operator~ () const
|
||||
{
|
||||
t_RsGenericIdType<ID_SIZE_IN_BYTES,UPPER_CASE,UNIQUE_IDENTIFIER> ret;
|
||||
for(uint32_t i=0; i < ID_SIZE_IN_BYTES; ++i)
|
||||
ret.bytes[i] = ~bytes[i];
|
||||
return ret;
|
||||
}
|
||||
inline t_RsGenericIdType<ID_SIZE_IN_BYTES,UPPER_CASE,UNIQUE_IDENTIFIER>
|
||||
operator| (const t_RsGenericIdType<ID_SIZE_IN_BYTES,UPPER_CASE,UNIQUE_IDENTIFIER>& fp) const
|
||||
{
|
||||
t_RsGenericIdType<ID_SIZE_IN_BYTES,UPPER_CASE,UNIQUE_IDENTIFIER> ret;
|
||||
for(uint32_t i=0; i < ID_SIZE_IN_BYTES; ++i)
|
||||
ret.bytes[i] = bytes[i] | fp.bytes[i];
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline bool isNull() const
|
||||
{
|
||||
|
@ -120,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 ;
|
||||
|
|
|
@ -53,9 +53,10 @@ int InitRetroShare(int argc, char **argv, RsInit *config);
|
|||
|
||||
class RsControl /* The Main Interface Class - for controlling the server */
|
||||
{
|
||||
public:
|
||||
static RsControl *instance() ;
|
||||
static void earlyInitNotificationSystem() { instance() ; }
|
||||
public:
|
||||
/// TODO: This should return a reference instead of a pointer!
|
||||
static RsControl *instance();
|
||||
static void earlyInitNotificationSystem() { instance(); }
|
||||
|
||||
/* Real Startup Fn */
|
||||
virtual int StartupRetroShare() = 0;
|
||||
|
|
|
@ -78,7 +78,7 @@ class RsInit
|
|||
/*!
|
||||
* Setup Hidden Location;
|
||||
*/
|
||||
static bool SetHiddenLocation(const std::string& hiddenaddress, uint16_t port);
|
||||
static void SetHiddenLocation(const std::string& hiddenaddress, uint16_t port, bool useBob);
|
||||
|
||||
static bool LoadPassword(const std::string& passwd) ;
|
||||
|
||||
|
|
|
@ -392,10 +392,10 @@ extern RsMsgs *rsMsgs;
|
|||
|
||||
class RsMsgs
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
RsMsgs() { return; }
|
||||
virtual ~RsMsgs() { return; }
|
||||
RsMsgs() {}
|
||||
virtual ~RsMsgs() {}
|
||||
|
||||
/****************************************/
|
||||
/* Message Items */
|
||||
|
@ -490,7 +490,10 @@ virtual ChatLobbyId createChatLobby(const std::string& lobby_name,const RsGxsId&
|
|||
virtual uint32_t getDistantChatPermissionFlags()=0 ;
|
||||
virtual bool setDistantChatPermissionFlags(uint32_t flags)=0 ;
|
||||
|
||||
virtual bool initiateDistantChatConnexion(const RsGxsId& to_pid,const RsGxsId& from_pid,DistantChatPeerId& pid,uint32_t& error_code) = 0;
|
||||
virtual bool initiateDistantChatConnexion(
|
||||
const RsGxsId& to_pid, const RsGxsId& from_pid,
|
||||
DistantChatPeerId& pid, uint32_t& error_code,
|
||||
bool notify = true ) = 0;
|
||||
virtual bool getDistantChatStatus(const DistantChatPeerId& pid,DistantChatPeerInfo& info)=0;
|
||||
virtual bool closeDistantChatConnexion(const DistantChatPeerId& pid)=0;
|
||||
|
||||
|
|
|
@ -77,16 +77,18 @@ const uint32_t RS_FEED_TYPE_FILES = 0x0400;
|
|||
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_TYPE_CIRCLE = 0x4000;
|
||||
|
||||
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;
|
||||
|
@ -113,9 +115,12 @@ const uint32_t RS_FEED_ITEM_POSTED_NEW = RS_FEED_TYPE_POSTED | 0x0001;
|
|||
//const uint32_t RS_FEED_ITEM_POSTED_UPDATE = RS_FEED_TYPE_POSTED | 0x0002;
|
||||
const uint32_t RS_FEED_ITEM_POSTED_MSG = RS_FEED_TYPE_POSTED | 0x0003;
|
||||
|
||||
const uint32_t RS_FEED_ITEM_CHAT_NEW = RS_FEED_TYPE_CHAT | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_MESSAGE = RS_FEED_TYPE_MSG | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_FILES_NEW = RS_FEED_TYPE_FILES | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_CHAT_NEW = RS_FEED_TYPE_CHAT | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_MESSAGE = RS_FEED_TYPE_MSG | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_FILES_NEW = RS_FEED_TYPE_FILES | 0x0001;
|
||||
|
||||
const uint32_t RS_FEED_ITEM_CIRCLE_MEMB_REQ = RS_FEED_TYPE_CIRCLE | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_CIRCLE_INVIT_REC = RS_FEED_TYPE_CIRCLE | 0x0002;
|
||||
|
||||
const uint32_t RS_MESSAGE_CONNECT_ATTEMPT = 0x0001;
|
||||
|
||||
|
@ -200,8 +205,10 @@ class RsNotify
|
|||
|
||||
virtual bool GetFeedItem(RsFeedItem &item) = 0;
|
||||
|
||||
virtual bool cachePgpPassphrase (const std::string& /* pgp_passphrase */) { return false ; }
|
||||
virtual bool clearPgpPassphrase () { return false ; }
|
||||
virtual bool cachePgpPassphrase (const std::string& /* pgp_passphrase */) { return false ; }
|
||||
virtual bool clearPgpPassphrase () { return false ; }
|
||||
|
||||
virtual bool setDisableAskPassword (const bool /*bValue*/) { return false ; }
|
||||
};
|
||||
|
||||
class NotifyClient
|
||||
|
@ -227,6 +234,7 @@ class NotifyClient
|
|||
virtual void notifyDiskFull (uint32_t /* location */, uint32_t /* size limit in MB */) {}
|
||||
virtual void notifyPeerStatusChanged (const std::string& /* peer_id */, uint32_t /* status */) {}
|
||||
virtual void notifyGxsChange (const RsGxsChanges& /* changes */) {}
|
||||
virtual void notifyConnectionWithoutCert () {}
|
||||
|
||||
/* one or more peers has changed the states */
|
||||
virtual void notifyPeerStatusChangedSummary () {}
|
||||
|
@ -238,7 +246,7 @@ class NotifyClient
|
|||
virtual void notifyHistoryChanged (uint32_t /* msgId */, int /* type */) {}
|
||||
|
||||
virtual bool askForPassword (const std::string& /* title */, const std::string& /* key_details */, bool /* prev_is_bad */, std::string& /* password */,bool& /* cancelled */ ) { return false ;}
|
||||
virtual bool askForPluginConfirmation (const std::string& /* plugin_filename */, const std::string& /* plugin_file_hash */) { return false ;}
|
||||
virtual bool askForPluginConfirmation (const std::string& /* plugin_filename */, const std::string& /* plugin_file_hash */,bool /* first_time */) { return false ;}
|
||||
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
@ -137,7 +138,7 @@ public:
|
|||
|
||||
/*!
|
||||
* Use this to request group related information
|
||||
* @param token The token returned for the request, store this value to pool for request completion
|
||||
* @param token The token returned for the request, store this value to poll for request completion
|
||||
* @param ansType The type of result (e.g. group data, meta, ids)
|
||||
* @param opts Additional option that affect outcome of request. Please see specific services, for valid values
|
||||
* @param groupIds group id to request info for
|
||||
|
@ -147,7 +148,7 @@ public:
|
|||
|
||||
/*!
|
||||
* Use this to request all group related info
|
||||
* @param token The token returned for the request, store this value to pool for request completion
|
||||
* @param token The token returned for the request, store this value to poll for request completion
|
||||
* @param ansType The type of result (e.g. group data, meta, ids)
|
||||
* @param opts Additional option that affect outcome of request. Please see specific services, for valid values
|
||||
* @return
|
||||
|
@ -155,7 +156,7 @@ public:
|
|||
virtual bool requestGroupInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts) = 0;
|
||||
|
||||
/*!
|
||||
* Use this to get msg related information, store this value to pole for request completion
|
||||
* Use this to get msg related information, store this value to poll for request completion
|
||||
* @param token The token returned for the request
|
||||
* @param ansType The type of result wanted
|
||||
* @param opts Additional option that affect outcome of request. Please see specific services, for valid values
|
||||
|
@ -165,7 +166,7 @@ public:
|
|||
virtual bool requestMsgInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const GxsMsgReq& msgIds) = 0;
|
||||
|
||||
/*!
|
||||
* Use this to get msg related information, store this value to pole for request completion
|
||||
* Use this to get msg related information, store this value to poll for request completion
|
||||
* @param token The token returned for the request
|
||||
* @param ansType The type of result wanted
|
||||
* @param opts Additional option that affect outcome of request. Please see specific services, for valid values
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RS_MAJOR_VERSION 0
|
||||
#define RS_MINOR_VERSION 6
|
||||
#define RS_BUILD_NUMBER 2
|
||||
#define RS_BUILD_NUMBER_ADD "x" // <-- do we need this?
|
||||
#define RS_BUILD_NUMBER 3
|
||||
#define RS_BUILD_NUMBER_ADD "" // <-- do we need this?
|
||||
// The revision number should be the 4 first bytes of the git revision hash, which is obtained using:
|
||||
// git log --pretty="%H" | head -1 | cut -c1-8
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RS_MAJOR_VERSION 0
|
||||
#define RS_MINOR_VERSION 6
|
||||
#define RS_BUILD_NUMBER 2
|
||||
#define RS_BUILD_NUMBER 3
|
||||
#define RS_BUILD_NUMBER_ADD ""
|
||||
|
||||
// The revision number should be the 4 first bytes of the git revision hash, which is obtained using:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue