Changeset 5743 for source/ariba/overlay/modules/chord
- Timestamp:
- Aug 6, 2009, 2:32:48 PM (15 years ago)
- Location:
- source/ariba/overlay/modules/chord
- Files:
-
- 3 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 -
source/ariba/overlay/modules/chord/Chord.h
r5668 r5743 81 81 82 82 // helper: sets up a link using the "base overlay" 83 LinkID setup( const EndpointDescriptor& endp, const NodeID& node = NodeID::UNSPECIFIED ); 83 LinkID setup( const EndpointDescriptor& endp, 84 const NodeID& node = NodeID::UNSPECIFIED, 85 const NodeID& remoteRelay = NodeID::UNSPECIFIED ); 84 86 85 87 // helper: sends a message using the "base overlay" -
source/ariba/overlay/modules/chord/messages/Discovery.h
r5681 r5743 70 70 this->follow_type = msg.follow_type; 71 71 this->ttl = msg.ttl; 72 this->source_relay = msg.source_relay; 72 73 this->source_endpoint = msg.source_endpoint; 73 74 } … … 99 100 } 100 101 102 inline void setSourceRelay( const NodeID& relay ) { 103 source_relay = relay; 104 } 105 106 inline const NodeID& getSourceRelay() const { 107 return source_relay; 108 } 101 109 private: 102 110 uint8_t follow_type; 103 111 uint8_t ttl; 104 112 EndpointDescriptor source_endpoint; 113 NodeID source_relay; 105 114 }; 106 115 … … 112 121 113 122 // serialize end-point 114 X && source_ endpoint;123 X && source_relay && source_endpoint; 115 124 } sznEnd(); 116 125
Note:
See TracChangeset
for help on using the changeset viewer.