mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-18 19:08:35 -04:00
Added Dsdv Data transport packet.
Shifted Dsdv address to separate TLV data type. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-dhtmods@4679 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7f30b19f2a
commit
1cfcac7377
6 changed files with 376 additions and 53 deletions
|
@ -224,9 +224,9 @@ int p3Dsdv::generateRoutingTable(const std::string &peerId, bool incremental)
|
|||
|
||||
RsTlvDsdvEntry entry;
|
||||
|
||||
entry.idType = v.mDest.mIdType;
|
||||
entry.anonChunk = v.mDest.mAnonChunk;
|
||||
entry.serviceId = v.mDest.mHash;
|
||||
entry.endPoint.idType = v.mDest.mIdType;
|
||||
entry.endPoint.anonChunk = v.mDest.mAnonChunk;
|
||||
entry.endPoint.serviceId = v.mDest.mHash;
|
||||
entry.sequence = v.mStableRoute.mSequence;
|
||||
entry.distance = v.mStableRoute.mDistance;
|
||||
|
||||
|
@ -286,14 +286,14 @@ int p3Dsdv::handleDSDV(RsDsdvRouteItem *dsdv)
|
|||
|
||||
/* find the entry */
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator tit;
|
||||
tit = mTable.find(entry.serviceId);
|
||||
tit = mTable.find(entry.endPoint.serviceId);
|
||||
if (tit == mTable.end())
|
||||
{
|
||||
/* new entry! */
|
||||
RsDsdvTableEntry v;
|
||||
v.mDest.mIdType = entry.idType;
|
||||
v.mDest.mAnonChunk = entry.anonChunk;
|
||||
v.mDest.mHash = entry.serviceId;
|
||||
v.mDest.mIdType = entry.endPoint.idType;
|
||||
v.mDest.mAnonChunk = entry.endPoint.anonChunk;
|
||||
v.mDest.mHash = entry.endPoint.serviceId;
|
||||
|
||||
v.mBestRoute.mNextHop = dsdv->PeerId();
|
||||
v.mBestRoute.mReceived = now;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue