mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
Changes to support Relays.
* added p3BitDht::addKnownNode() so that DhtIds can be used instead of SslIds. * switched from bdStdDht() functions to use bdModDht(). * made DhtFunctions a class variable. * added function to modify NodePerBucket() parameter. * Bugfix for LinkType. peerConnectAddress.flags was not initialised. * Extra debugging of LinkType data (use LINKMGR_DEBUG_LINKTYPE). * cleaned up udprelay output. * Added Compile Rules to libretroshare.pro for building LocalNet Testing Version. (testnetwork) git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-dhtmods@4795 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
fe955c9a4f
commit
96c9071920
7 changed files with 131 additions and 20 deletions
|
@ -275,6 +275,49 @@ int p3BitDht::addKnownPeer(const std::string &pid, const struct sockaddr_in &add
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Total duplicate of above function - can't be helped, should merge somehow */
|
||||
int p3BitDht::addKnownNode(const bdId *id, uint32_t flags)
|
||||
{
|
||||
int bdflags = 0;
|
||||
|
||||
switch(flags & NETASSIST_KNOWN_PEER_TYPE_MASK)
|
||||
{
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
case NETASSIST_KNOWN_PEER_WHITELIST:
|
||||
bdflags = BITDHT_PEER_STATUS_DHT_WHITELIST;
|
||||
|
||||
break;
|
||||
case NETASSIST_KNOWN_PEER_FOF:
|
||||
bdflags = BITDHT_PEER_STATUS_DHT_FOF;
|
||||
|
||||
break;
|
||||
case NETASSIST_KNOWN_PEER_FRIEND:
|
||||
bdflags = BITDHT_PEER_STATUS_DHT_FRIEND;
|
||||
|
||||
break;
|
||||
case NETASSIST_KNOWN_PEER_RELAY:
|
||||
bdflags = BITDHT_PEER_STATUS_DHT_RELAY_SERVER;
|
||||
|
||||
break;
|
||||
case NETASSIST_KNOWN_PEER_SELF:
|
||||
bdflags = BITDHT_PEER_STATUS_DHT_SELF;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (flags & NETASSIST_KNOWN_PEER_ONLINE)
|
||||
{
|
||||
bdflags |= BD_FRIEND_ENTRY_ONLINE;
|
||||
}
|
||||
|
||||
mUdpBitDht->updateKnownPeer(id, 0, bdflags);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue