Changeset 5743 for source/ariba/overlay/modules/chord/Chord.cpp
- Timestamp:
- Aug 6, 2009, 2:32:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/modules/chord/Chord.cpp
r5736 r5743 57 57 58 58 // create routing table 59 this->table = new chord_routing_table(_nodeid, 2);59 this->table = new chord_routing_table(_nodeid, 4); 60 60 orphan_removal_counter = 0; 61 61 discovery_count = 0; … … 71 71 72 72 /// helper: sets up a link using the base overlay 73 LinkID Chord::setup(const EndpointDescriptor& endp, const NodeID& node ) {73 LinkID Chord::setup(const EndpointDescriptor& endp, const NodeID& node, const NodeID& remoteRelay ) { 74 74 logging_debug("Request to setup link to " << endp.toString() ); 75 75 76 // check if we already have a connection 76 77 for (int i=0; i<table->size(); i++) 77 78 if ((*table)[i]->id == node && !((*table)[i]->info.isUnspecified())) … … 89 90 90 91 // establish link via base overlay 91 return baseoverlay.establishLink(endp, node, OverlayInterface::OVERLAY_SERVICE_ID );92 return baseoverlay.establishLink(endp, node, OverlayInterface::OVERLAY_SERVICE_ID, remoteRelay ); 92 93 } 93 94 … … 105 106 Discovery dmsg; 106 107 dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor()); 108 dmsg.setSourceRelay(baseoverlay.getRelayNode(destination)); 107 109 dmsg.setFollowType(Discovery::normal); 108 110 dmsg.setTTL((uint8_t) ttl); … … 120 122 Discovery dmsg; 121 123 dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor()); 124 dmsg.setSourceRelay(baseoverlay.getRelayNode(nodeid)); 122 125 dmsg.setFollowType(Discovery::successor); 123 126 dmsg.setTTL((uint8_t)3); … … 130 133 Discovery dmsg; 131 134 dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor()); 135 dmsg.setSourceRelay(baseoverlay.getRelayNode(nodeid)); 132 136 dmsg.setFollowType(Discovery::predecessor); 133 137 dmsg.setTTL((uint8_t)3); … … 332 336 // check if source node can be added to routing table and setup link 333 337 if (m->getSource() != nodeid && table->is_insertable(m->getSource())) 334 setup(*dmsg->getSourceEndpoint(), m->getSource() );338 setup(*dmsg->getSourceEndpoint(), m->getSource(), dmsg->getSourceRelay() ); 335 339 336 340 // delegate discovery message
Note:
See TracChangeset
for help on using the changeset viewer.