- Timestamp:
- Aug 12, 2009, 12:04:09 AM (15 years ago)
- Location:
- source/ariba
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r5871 r5876 211 211 } 212 212 213 /// shows the current link state 213 214 void BaseOverlay::showLinks() { 214 215 int i=0; … … 220 221 logging_info("----------------------------------------------"); 221 222 } 223 224 /// compares two arbitrary links to the same node 225 int BaseOverlay::compare( const LinkID& lhs, const LinkID& rhs ) { 226 LinkDescriptor* lhsld = getDescriptor(lhs); 227 LinkDescriptor* rhsld = getDescriptor(rhs); 228 if (lhsld==NULL || rhsld==NULL 229 || !lhsld->up || !rhsld->up 230 || lhsld->remoteNode != rhsld->remoteNode) return -1; 231 232 if ((lhsld->remoteLink^lhsld->overlayId)<(rhsld->remoteLink^lhsld->overlayId) ) 233 return -1; 234 235 return 1; 236 } 237 222 238 223 239 // internal message delivery --------------------------------------------------- -
source/ariba/overlay/BaseOverlay.h
r5870 r5876 434 434 void showLinks(); 435 435 436 /// compares two arbitrary links to the same node 437 int compare( const LinkID& lhs, const LinkID& rhs ); 438 436 439 // relay route management -------------------------------------------------- 437 440 -
source/ariba/overlay/modules/chord/Chord.cpp
r5871 r5876 232 232 break; 233 233 } 234 /* 235 // check if we already have a connection, yes-> do not handle duplicate! 236 for (int i=0; i<table->size(); i++) 237 if ((*table)[i]->id == remote && !((*table)[i]->info.isUnspecified()) && (*table)[i]->info != lnk) { 238 239 return; 240 } 241 */ 234 242 235 if (remote==nodeid) { 243 236 baseoverlay.dropLink(lnk); … … 305 298 ); 306 299 300 // add discovery node id 301 bool found = false; 302 BOOST_FOREACH( NodeID& value, discovery ) 303 if (value == m->getSourceNode()) { 304 found = true; 305 break; 306 } 307 if (!found) discovery.push_back(m->getSourceNode()); 308 307 309 // check if source node can be added to routing table and setup link 308 if (m->getSourceNode() != nodeid 309 && table->is_insertable(m->getSourceNode())) 310 if (m->getSourceNode() != nodeid) 310 311 setup( dmsg->getEndpoint(), m->getSourceNode() ); 311 312 … … 317 318 // closest node? yes-> split to follow successor and predecessor 318 319 if ( table->is_closest_to(m->getDestinationNode()) ) { 319 320 if ( table->get_successor() != NULL) {320 logging_debug("Discovery split:"); 321 if (!table->get_successor()->isUnspecified()) { 321 322 OverlayMsg omsg(*m); 322 323 dmsg->setType(Discovery::successor); 323 324 omsg.encapsulate(dmsg); 324 route_item* succ_item = table->get(*table->get_successor()); 325 logging_debug("Discovery split: routing discovery message to successor " 326 << succ_item->id.toString() ); 327 send(&omsg, succ_item->info); 325 logging_debug("* Routing to successor " 326 << table->get_successor()->toString() ); 327 baseoverlay.send( &omsg, *table->get_successor() ); 328 328 } 329 329 330 330 // send predecessor message 331 if ( table->get_predesessor() != NULL) {331 if (!table->get_predesessor()->isUnspecified()) { 332 332 OverlayMsg omsg(*m); 333 333 dmsg->setType(Discovery::predecessor); 334 334 omsg.encapsulate(dmsg); 335 route_item* pred_item = table->get( 336 *table->get_predesessor()); 337 logging_debug("Discovery split: routing discovery message to predecessor " 338 << pred_item->id.toString() ); 339 send( &omsg, pred_item->info); 335 logging_debug("* Routing to predecessor " 336 << table->get_predesessor()->toString() ); 337 baseoverlay.send( &omsg, *table->get_predesessor() ); 340 338 } 341 339 } … … 365 363 } 366 364 if (item == NULL) break; 367 logging_debug(" routing discovery message to succ/pred "365 logging_debug("Routing discovery message to succ/pred " 368 366 << item->id.toString() ); 369 367 OverlayMsg omsg(*m); 370 368 omsg.encapsulate(dmsg); 371 369 omsg.setDestinationNode(item->id); 370 omsg.setService(OverlayInterface::OVERLAY_SERVICE_ID); 371 omsg.setRelayed(true); 372 372 baseoverlay.send(&omsg, omsg.getDestinationNode()); 373 373 break; … … 407 407 logging_info("Running stabilization: #links=" 408 408 << table->size() << " #neighbors=" << numNeighbors ); 409 410 // updating neighbors 411 for (int i=0; i<table->size(); i++) { 412 LinkID id = (*table)[i]->info; 413 if (!id.isUnspecified()) discover_neighbors(id); 414 } 409 415 410 416 // sending discovery … … 417 423 send_discovery_to(disc2); 418 424 419 for (int i=0; i<table->size(); i++) {420 LinkID id = (*table)[i]->info;421 if (!id.isUnspecified()) discover_neighbors(id);422 }423 425 424 426 // remove orphan links 425 427 orphan_removal_counter++; 426 428 if (orphan_removal_counter <0 || orphan_removal_counter >= 2) { 429 logging_info("Discovered nodes: "); 430 BOOST_FOREACH( NodeID& id, discovery ) 431 logging_info("* " << id.toString()); 432 discovery.clear(); 427 433 logging_info("Running orphan removal"); 428 434 orphan_removal_counter = 0; -
source/ariba/overlay/modules/chord/Chord.h
r5870 r5876 80 80 vector<LinkID> bootstrapLinks; 81 81 vector<NodeID> pending; 82 vector<NodeID> discovery; 82 83 int discovery_count; 83 84 -
source/ariba/utility/transport/tcpip/protlib/address.cpp
r5284 r5876 431 431 // Otherwise they are not equal. 432 432 if (hostaddress::operator==(ie)) { 433 if (proto!=app->proto) cout << "protocols not matching" << endl;434 if (port !=app->port) cout << "ports not matching" << endl;433 //if (proto!=app->proto) cout << "protocols not matching" << endl; 434 //if (port !=app->port) cout << "ports not matching" << endl; 435 435 436 436 return ((proto==app->proto) && (port==app->port));
Note:
See TracChangeset
for help on using the changeset viewer.