mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Added external interface to control Relay Parameters.
* Modified UdpRelay handles the counting... now each Relay Class has a bandwidth limit, and you can drop down to a lower class - if your one is full. This ensures that the desired bandwidth is kept, and allows more friends to use the relays. * Added Interface in p3bitdht. TODO: Test this stuff! git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-dhtmods@4728 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4d2175636e
commit
203fd6bffc
5 changed files with 159 additions and 53 deletions
|
@ -71,6 +71,13 @@ extern RsDht *rsDht;
|
|||
#define RSDHT_TOU_MODE_RELAY 3
|
||||
|
||||
|
||||
#define RSDHT_RELAY_NUM_CLASS 4
|
||||
|
||||
#define RSDHT_RELAY_CLASS_ALL 0
|
||||
#define RSDHT_RELAY_CLASS_GENERAL 1
|
||||
#define RSDHT_RELAY_CLASS_FOF 2
|
||||
#define RSDHT_RELAY_CLASS_FRIENDS 3
|
||||
|
||||
|
||||
class RsDhtPeer
|
||||
{
|
||||
|
@ -96,26 +103,18 @@ class RsDhtNetPeer
|
|||
std::string mRsId;
|
||||
|
||||
uint32_t mPeerType;
|
||||
|
||||
uint32_t mDhtState;
|
||||
|
||||
//connectLogic.
|
||||
std::string mConnectState;
|
||||
|
||||
// connect Status
|
||||
uint32_t mPeerConnectState;
|
||||
// connect mode
|
||||
uint32_t mPeerConnectMode;
|
||||
std::string mConnectState; // connectLogic.
|
||||
|
||||
uint32_t mPeerConnectState; // connect Status
|
||||
uint32_t mPeerConnectMode; // connect mode
|
||||
bool mExclusiveProxyLock;
|
||||
|
||||
std::string mPeerConnectProxyId;
|
||||
|
||||
// Req Status.
|
||||
uint32_t mPeerReqState;
|
||||
|
||||
// Peer Cb Mgs.
|
||||
std::string mCbPeerMsg;
|
||||
uint32_t mPeerReqState; // Req Status.
|
||||
std::string mCbPeerMsg; // Peer Cb Mgs.
|
||||
|
||||
};
|
||||
|
||||
|
@ -168,6 +167,15 @@ virtual int getRelayProxies(std::list<RsDhtRelayProxy> &relayProxies) = 0;
|
|||
|
||||
virtual std::string getUdpAddressString() = 0;
|
||||
|
||||
|
||||
// Interface for controlling Relays & DHT Relay Mode
|
||||
virtual uint32_t getRelayMode() = 0;
|
||||
virtual int setRelayMode(uint32_t mode) = 0;
|
||||
|
||||
virtual int getRelayAllowance(int classIdx, uint32_t &count, uint32_t &bandwidth) = 0;
|
||||
virtual int setRelayAllowance(int classIdx, uint32_t count, uint32_t bandwidth) = 0;
|
||||
|
||||
|
||||
#if 0
|
||||
virtual std::string getPeerStatusString();
|
||||
virtual std::string getDhtStatusString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue