Ignore:
Timestamp:
May 26, 2009, 1:40:23 AM (16 years ago)
Author:
mies
Message:

Merged 20090512-mies-connectors changes r3472:r3689 into trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/modules/onehop/OneHop.cpp

    r3067 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OneHop.h"
    4040#include "ariba/overlay/BaseOverlay.h"
     41
     42#include "ariba/overlay/modules/onehop/messages/OneHopMessage.h"
     43#include "ariba/overlay/modules/onehop/messages/NodeListingRequest.h"
     44#include "ariba/overlay/modules/onehop/messages/NodeListingReply.h"
    4145
    4246namespace ariba {
     
    8488                return;
    8589        }
    86 
    87         baseoverlay.sendMessage( msg, i->second );
    88 }
    89 
    90 void OneHop::createOverlay(){
    91 
     90        OneHopMessage onehopRoute( OneHopMessage::OneHopMessageTypeRoute );
     91        onehopRoute.encapsulate(msg);
     92
     93        baseoverlay.sendMessage( &onehopRoute, i->second );
     94}
     95
     96void OneHop::createOverlay() {
    9297        // don't need to bootstrap against ourselfs.
    9398        // the create and join process is completed now.
    94 
    9599        logging_info( "creating onehop overlay structure" );
    96100        state = OneHopStateCompleted;
     
    119123void OneHop::joinOverlay(const EndpointDescriptor& bootstrapEp){
    120124
    121         logging_info( "joining onehop overlay structure through endpoint " <<
     125        logging_info( "joining onehop overlay structure through end-point " <<
    122126                        (bootstrapEp == EndpointDescriptor::UNSPECIFIED ?
    123127                                        "local" : bootstrapEp.toString()) );
     
    133137
    134138                state = OneHopStateCompleted;
    135 
    136 
    137139        } else {
    138 
    139140                bootstrapLink = baseoverlay.establishLink( bootstrapEp,
    140141                                        OverlayInterface::OVERLAY_SERVICE_ID );
     
    175176        if( state == OneHopStateInvalid ) return;
    176177
    177         //
    178178        // node went down, remove from overlay mapping
    179         //
    180 
    181179        logging_debug( "node " << remote.toString() << " left overlay structure" );
    182180
     
    223221        //
    224222
    225         if( onemsg->isType( OneHopMessage::OneHopMessageTypeListingRequest) ){
     223        if( onemsg->isType( OneHopMessage::OneHopMessageTypeListingRequest ) ){
    226224
    227225                NodeListingRequest* request = onemsg->decapsulate<NodeListingRequest>();
     
    316314        } // if( reply != NULL )
    317315
     316        if( onemsg->isType( OneHopMessage::OneHopMessageTypeRoute) ){
     317                logging_debug( "Route message arrived at destination node -> delegate to BaseOverlay" );
     318                baseoverlay.incomingRouteMessage( onemsg );
     319        }
     320
     321
    318322}
    319323
Note: See TracChangeset for help on using the changeset viewer.