Changeset 5916 for source/ariba
- Timestamp:
- Aug 13, 2009, 1:26:27 PM (15 years ago)
- Location:
- source/ariba/overlay
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r5912 r5916 201 201 } 202 202 203 204 std::string BaseOverlay::getLinkHTMLInfo() { 205 std::ostringstream s; 206 207 s << "<h2 color=\"#606060\">Links</h2>"; 208 s << "<table cellpadding=\"0\" border=\"0\" cellspacing=\"0\">"; 209 s << "<tr background=\"#e0e0e0\">"; 210 s << "<td>Id</td><td>Remote</td><td>Path</td>"; 211 s << "</tr>"; 212 213 BOOST_FOREACH( LinkDescriptor* ld, links ) { 214 if (!ld->isVital() || ld->service != OverlayInterface::OVERLAY_SERVICE_ID) continue; 215 s << "<tr>"; 216 s << "<td>" << ld->overlayId.toString().substr(0,4) << "..</td>"; 217 s << "<td>" << ld->remoteNode.toString().substr(0,4) << "..</td>"; 218 s << "<td>"; 219 if (ld->routeRecord.size()>0) { 220 for (size_t i=0; i<ld->routeRecord.size(); i++) 221 s << ld->routeRecord[i].toString().substr(0,4) << ".. "; 222 } 223 s << "</td>"; 224 s << "</tr>"; 225 } 226 s << "</table>"; 227 228 return s.str(); 229 } 230 203 231 /// shows the current link state 204 232 void BaseOverlay::showLinks() { … … 278 306 return bc->sendMessage(next_link->communicationId, message); 279 307 } else { 280 logging_ error("Could not send message. No relay hop found to "308 logging_warn("Could not send message. No relay hop found to " 281 309 << destination) 282 310 return -1; … … 289 317 LinkID next_id = overlayInterface->getNextLinkId( destination ); 290 318 if (next_id.isUnspecified()) { 291 logging_ error("Could not send message. No next hop found to " <<319 logging_warn("Could not send message. No next hop found to " << 292 320 destination ); 293 321 return -1; … … 303 331 // no-> error, dropping message 304 332 else { 305 logging_ error("Could not send message. Link not known or up");333 logging_warn("Could not send message. Link not known or up"); 306 334 return -1; 307 335 } … … 386 414 relay_route& route = *i; 387 415 LinkDescriptor* ld = getDescriptor(route.link); 416 417 // relay link still used and alive? 388 418 if (ld==NULL 389 || !ld->up 390 || ld->keepAliveMissed != 0 391 || !ld->communicationUp 392 || difftime(route.used, time(NULL)) > 4) { 419 || !ld->isDirectVital() 420 || difftime(route.used, time(NULL)) > 8) { 393 421 logging_info("Forgetting relay information to node " 394 422 << route.node.toString() ); … … 449 477 // refresh timer 450 478 route.used = time(NULL); 451 452 // route has a shorter hop count? yes-> replace 453 if (route.hops > message->getNumHops() ) { 479 LinkDescriptor* rld = getDescriptor(route.link); 480 481 // route has a shorter hop count or old link is dead? yes-> replace 482 if (route.hops > message->getNumHops() 483 || rld == NULL 484 || !rld->isDirectVital()) { 454 485 logging_info("Updating relay information to node " 455 486 << route.node.toString() … … 480 511 if (route.node == remote ) { 481 512 LinkDescriptor* ld = getDescriptor( route.link ); 482 if (ld==NULL || !ld-> up || !ld->communicationUp) return NULL; else {513 if (ld==NULL || !ld->isDirectVital()) return NULL; else { 483 514 route.used = time(NULL); 484 515 return ld; -
source/ariba/overlay/BaseOverlay.h
r5882 r5916 347 347 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 348 348 349 std::string getLinkHTMLInfo(); 349 350 350 351 private: -
source/ariba/overlay/LinkDescriptor.h
r5873 r5916 66 66 bool fromRemote; ///< flag, whether this link was requested from remote 67 67 NodeID remoteNode; ///< remote end-point node 68 bool isVital() { 69 return up && keepAliveMissed == 0; 70 } 71 bool isDirectVital() { 72 return isVital() && communicationUp && !relayed; 73 } 74 68 75 69 76 // link identifiers --------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.