--- Merging r4718 through r4752 from branches/v0.5-dhtmods

Added ZeroConf for OSX.
Changes for Relay Support.

Summary of Changes:
libbitdht
----------
 * added Relay Flags to bdNode::setNodeDhtMode()
 * added dropRelayServers() / pingRelayServers() functions for mode switches
 * added utility function:  bdFriendList::findPeersWithFlags()
 * added utility function:  bdSpace::clean_node_flags(uint32_t flags)
 * added RelayMode to ConnectManager.
 * added failedConnection callback when in Server Mode.
 * added incomplete udpproxylayer code. (not compiled)

libretroshare
-------------
 * added Configuration to p3BitDht for storing Relay Settings. (bit Hackish!)
 * added RelayHandler & getRelayReceiver() - to outsource some Relay functions.
 * + RelayHandler_InstallRelayConnection() & RelayHandler_LogFailedProxyAttempt()
 * added RelayServer, Mode and RelayAllowance to external DHT interface.
 * added p3PeerMgr::getGpgId() for ZeroConf usage.
 * updated parts of pqiassist virtual interfaces.
 * added Bandwidth storage to udprelay.
 * modified the way Relay Slots are allocated to match GUI interface.
 * ZeroConf now working on OSX.
 * added ZeroConf to OSX compilation.
 * extended rsDht interface to expose Relay configuration.

retroshare-gui
--------------
 * added Relay configuration panel.




git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4753 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2012-01-06 15:33:51 +00:00
commit ac6f0fcfe4
35 changed files with 3620 additions and 113 deletions

View file

@ -86,11 +86,16 @@ const uint32_t CONFIG_TYPE_HISTORY = 0x0015;
/// turtle router
const uint32_t CONFIG_TYPE_TURTLE = 0x0020;
/// dht (relay stuff mainly)
const uint32_t CONFIG_TYPE_BITDHT = 0x0030;
/* standard services */
const uint32_t CONFIG_TYPE_QBLOG = 0x0101;
const uint32_t CONFIG_TYPE_FORUMS = 0x0102;
const uint32_t CONFIG_TYPE_CHANNELS = 0x0103;
/* CACHE ID Must be at the END so that other configurations
* are loaded First (Cache Config --> Cache Loading)
*/

View file

@ -255,6 +255,22 @@ bool p3PeerMgrIMPL::getPeerName(const std::string &ssl_id, std::string &name)
return true;
}
bool p3PeerMgrIMPL::getGpgId(const std::string &ssl_id, std::string &gpgId)
{
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
/* check for existing */
std::map<std::string, peerState>::iterator it;
it = mFriendList.find(ssl_id);
if (it == mFriendList.end())
{
return false;
}
gpgId = it->second.gpg_id;
return true;
}
bool p3PeerMgrIMPL::getFriendNetStatus(const std::string &id, peerState &state)

View file

@ -182,6 +182,7 @@ virtual bool getFriendNetStatus(const std::string &id, peerState &state) = 0;
virtual bool getOthersNetStatus(const std::string &id, peerState &state) = 0;
virtual bool getPeerName(const std::string &ssl_id, std::string &name) = 0;
virtual bool getGpgId(const std::string &sslId, std::string &gpgId) = 0;
/************* DEPRECIATED FUNCTIONS (TO REMOVE) ********/
@ -266,6 +267,7 @@ virtual bool getFriendNetStatus(const std::string &id, peerState &state);
virtual bool getOthersNetStatus(const std::string &id, peerState &state);
virtual bool getPeerName(const std::string &ssl_id, std::string &name);
virtual bool getGpgId(const std::string &sslId, std::string &gpgId);
/************* DEPRECIATED FUNCTIONS (TO REMOVE) ********/

View file

@ -146,26 +146,17 @@ virtual bool dropPeer(std::string id) = 0;
virtual int addBadPeer(const struct sockaddr_in &addr, uint32_t reason, uint32_t flags, uint32_t age) = 0;
virtual int addKnownPeer(const std::string &pid, const struct sockaddr_in &addr, uint32_t flags) = 0;
//virtual int addFriend(const std::string pid) = 0;
//virtual int addFriendOfFriend(const std::string pid) = 0;
//virtual int addOther(const std::string pid) = 0;
virtual void ConnectionFeedback(std::string pid, int mode) = 0;
/* extract current peer status */
virtual bool getPeerStatus(std::string id,
struct sockaddr_in &laddr, struct sockaddr_in &raddr,
uint32_t &type, uint32_t &mode) = 0;
uint32_t &type, uint32_t &mode) = 0; // DEPRECIATE.
virtual bool setAttachMode(bool on) = 0;
//virtual bool getExternalInterface(struct sockaddr_in &raddr,
// uint32_t &mode) = 0;
virtual bool setAttachMode(bool on) = 0; // FIXUP.
/***** Stats for Network / DHT *****/
virtual bool getNetworkStats(uint32_t &netsize, uint32_t &localnetsize) = 0;
virtual bool getNetworkStats(uint32_t &netsize, uint32_t &localnetsize) = 0; // DEPRECIATE.
protected:
std::string mPeerId;