Ignore:
Timestamp:
Aug 12, 2009, 12:04:09 AM (15 years ago)
Author:
mies
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/BaseOverlay.cpp

    r5871 r5876  
    211211}
    212212
     213/// shows the current link state
    213214void BaseOverlay::showLinks() {
    214215        int i=0;
     
    220221        logging_info("----------------------------------------------");
    221222}
     223
     224/// compares two arbitrary links to the same node
     225int 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
    222238
    223239// internal message delivery ---------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.