Changeset 3705
- Timestamp:
- May 26, 2009, 4:27:55 PM (16 years ago)
- Location:
- source/ariba
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/communication/EndpointDescriptor.cpp
r3690 r3705 112 112 bool EndpointDescriptor::operator==(const EndpointDescriptor& rh) const { 113 113 114 if( locator != NULL && rh.locator != NULL ) 115 return ( locator->operator==(*rh.locator) ); 114 if( isUnspecified() && rh.isUnspecified() ) { 116 115 117 if( locator != rh.locator ) 116 // both unspec bit set 117 return true; 118 119 } else if( (!isUnspecified()) && (!rh.isUnspecified()) ) { 120 121 // 122 // both are valid, check locators 123 // 124 125 if( locator == NULL && rh.locator == NULL ){ 126 127 // both locators are invalid, ok true 128 return true; 129 130 } else if( locator == NULL ^ rh.locator == NULL ) { 131 132 // one locator is invalid, the other not, false 133 return false; 134 135 } else { 136 137 // both locators are valid, compare 138 assert( locator != NULL && rh.locator != NULL ); 139 return ( locator->operator==(*rh.locator) ); 140 141 } 142 143 } else { 144 145 // one is unspec, the other not 146 assert( isUnspecified() ^ rh.isUnspecified() ); 118 147 return false; 119 148 120 return (isUnspec == rh.isUnspec); 149 } 150 121 151 } 122 152 -
source/ariba/communication/EndpointDescriptor.h
r3690 r3705 100 100 101 101 sznBeginDefault( ariba::communication::EndpointDescriptor, X ) { 102 X && VO(locator); 102 uint8_t unspec = isUnspec; 103 104 X && unspec && VO(locator); 105 106 // when deserializing reset unspec flag 107 if (X.isDeserializer()) isUnspec = unspec; 103 108 } sznEnd(); 104 109 -
source/ariba/overlay/BaseOverlay.cpp
r3699 r3705 820 820 if( iface->onLinkRequest(sourcenode) ){ 821 821 822 logging_debug("link " << link.toString() << 823 " has been accepted by service " << service.toString()); 824 822 825 // call the notification functions 823 826 iface->onLinkUp( link, sourcenode ); … … 825 828 826 829 } else { 830 831 logging_debug("link " << link.toString() << 832 " has been denied by service " << service.toString() << ", dropping link"); 833 827 834 // prevent onLinkDown calls to the service 828 835 i->second.interface = &CommunicationListener::DEFAULT; -
source/ariba/overlay/modules/OverlayInterface.cpp
r3690 r3705 75 75 bool OverlayInterface::onLinkRequest(const NodeID& remote, 76 76 const DataMessage& msg) { 77 return true; 77 78 } 78 79 -
source/ariba/overlay/modules/onehop/OneHop.cpp
r3690 r3705 59 59 // 60 60 overlayNodes.insert( make_pair(_nodeid, LinkID::UNSPECIFIED) ); 61 62 Timer::setInterval(5000); 63 Timer::start(); 61 64 } 62 65 63 66 OneHop::~OneHop(){ 67 Timer::stop(); 64 68 deleteOverlay(); 65 69 } … … 155 159 156 160 // 157 // close all links, this will indicate the other nodes that we left 161 // send leave messages to all nodes. the nodes 162 // will then drop the links 158 163 // 159 164 … … 162 167 163 168 for( ; i != iend; i++){ 164 if( i->first != nodeid && i->second != LinkID::UNSPECIFIED ) 165 baseoverlay.dropLink( i->second ); 169 if( i->first != nodeid && i->second != LinkID::UNSPECIFIED ){ 170 171 OneHopMessage msg (OneHopMessage::OneHopMessageTypeLeave); 172 baseoverlay.sendMessage( &msg, i->second ); 173 } 166 174 } 167 175 … … 177 185 178 186 // node went down, remove from overlay mapping 179 logging_debug( " node " << remote.toString() << " left overlay structure" );187 logging_debug( "link " << lnk.toString() << " to node " << remote.toString() << " went down, removing node" ); 180 188 181 189 OverlayNodeMapping::iterator i = overlayNodes.begin(); … … 266 274 eventsReceiver->onNodeJoin( remote ); 267 275 268 } // if( request != NULL )276 } // OneHopMessageTypeListingRequest 269 277 270 278 // … … 312 320 } // for( ; i != iend; i++ ) 313 321 314 } // if( reply != NULL ) 322 } // OneHopMessageTypeListingReply 323 324 // 325 // handle node leaves 326 // 327 328 if( onemsg->isType(OneHopMessage::OneHopMessageTypeLeave) ){ 329 330 logging_debug("received leave message from " << 331 remote.toString() << " on link " << lnk.toString()); 332 333 // drop the link to the node 334 baseoverlay.dropLink( lnk ); 335 336 } // OneHopMessageTypeLeave 337 338 // 339 // handle kbr route messages 340 // 315 341 316 342 if( onemsg->isType( OneHopMessage::OneHopMessageTypeRoute) ){ 317 343 logging_debug( "Route message arrived at destination node -> delegate to BaseOverlay" ); 318 344 baseoverlay.incomingRouteMessage( onemsg ); 319 } 320 345 } // OneHopMessageTypeRoute 346 347 } 348 349 void OneHop::eventFunction(){ 350 351 logging_debug("<<<<<<<<<<<<<<<<onehop-table<<<<<<<<<<<<<<<<<<<"); 352 353 OverlayNodeMapping::iterator i = overlayNodes.begin(); 354 OverlayNodeMapping::iterator iend = overlayNodes.end(); 355 356 for( ; i != iend; i++ ){ 357 358 const NodeID node = i->first; 359 const LinkID link = i->second; 360 const EndpointDescriptor& endpoint = baseoverlay.getEndpointDescriptor( link ); 361 362 logging_debug( "node: " << node.toString() << 363 ", link_: " << link.toString() << ", endp: " << endpoint.toString()); 364 } 365 366 logging_debug(">>>>>>>>>>>>>>>>>onehop-table>>>>>>>>>>>>>>>>>>>>>"); 321 367 322 368 } -
source/ariba/overlay/modules/onehop/OneHop.h
r3690 r3705 43 43 #include "ariba/overlay/modules/OverlayInterface.h" 44 44 #include "ariba/utility/logging/Logging.h" 45 #include "ariba/utility/system/Timer.h" 45 46 46 47 using std::map; 48 using ariba::utility::Timer; 47 49 48 50 namespace ariba { 49 51 namespace overlay { 50 52 51 class OneHop : public OverlayInterface{53 class OneHop : public OverlayInterface, protected Timer { 52 54 use_logging_h( OneHop ); 53 55 public: … … 58 60 59 61 protected: 62 63 /// @see Timer.h 64 virtual void eventFunction(); 65 60 66 /// @see OverlayInterface.h 61 67 virtual void createOverlay(); -
source/ariba/overlay/modules/onehop/messages/OneHopMessage.h
r3690 r3705 57 57 OneHopMessageTypeListingRequest = 1, 58 58 OneHopMessageTypeListingReply = 2, 59 OneHopMessageTypeRoute = 3, 59 OneHopMessageTypeLeave = 3, 60 OneHopMessageTypeRoute = 4, 60 61 } OneHopMessageType; 61 62 -
source/ariba/utility/misc/Demultiplexer.hpp
r3690 r3705 80 80 LISTENER_SERVICE_MAP_CITERATOR i = mapListenerService.begin(); 81 81 LISTENER_SERVICE_MAP_CITERATOR iend = mapListenerService.end(); 82 82 83 83 for( ; i != iend; i++ ) 84 84 cout << "xxx" << i->first.toString() << " -> " << i->second << std::endl; … … 88 88 SERVICE_LISTENER_MAP_CITERATOR i = mapServiceListener.begin(); 89 89 SERVICE_LISTENER_MAP_CITERATOR iend = mapServiceListener.end(); 90 90 91 91 for( ; i != iend; i++ ) 92 92 cout << "xxx" << i->first << " -> " << i->second.toString() << std::endl; … … 112 112 void unregisterItem( S id ) { 113 113 T listener = get( id ); 114 114 115 115 { 116 116 boost::mutex::scoped_lock lock( mapMutex ); -
source/ariba/utility/types/Identifier.cpp
r3690 r3705 319 319 } 320 320 bool Identifier::operator==(const Identifier& compKey) const { 321 return compareTo(compKey) == 0; 321 322 if( this->isUnspecified() && compKey.isUnspecified() ) 323 return true; 324 else 325 return compareTo(compKey) == 0; 322 326 } 323 327 bool Identifier::operator!=(const Identifier& compKey) const { … … 599 603 //as mpn_random has no seeding function 600 604 // we mess aroung here a little to achive some randomness 601 // using the rand function that _is_ seeded in the 605 // using the rand function that _is_ seeded in the 602 606 // StartupWrapper::initSystem function 603 607
Note:
See TracChangeset
for help on using the changeset viewer.