Changeset 7532 for source/ariba/overlay


Ignore:
Timestamp:
Feb 4, 2010, 5:29:37 PM (14 years ago)
Author:
Christoph Mayer
Message:

-von außen konfigurierbare bootstrap module, -periodicbroadcast crash fix

Location:
source/ariba/overlay
Files:
4 edited

Legend:

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

    r7018 r7532  
    824824        }
    825825
    826 
    827826        //ovl.visShowNodeBubble ( ovlId, nodeId, "joining..." );
    828827        logging_info( "Starting to join spovnet " << id.toString() <<
     
    830829
    831830        if(bootstrapEp.isUnspecified() && state == BaseOverlayStateInvalid){
     831
     832                //** FIRST STEP - MANDATORY */
    832833
    833834                // bootstrap against ourselfs
     
    842843                //ovl.visChangeNodeColor( ovlId, nodeId, OvlVis::NODE_COLORS_GREEN );
    843844
    844                 logging_debug("starting overlay bootstrap module");
    845                 overlayBootstrap.start(this, spovnetId, nodeId);
    846                 overlayBootstrap.publish(bc->getEndpointDescriptor());
    847 
    848845        } else {
     846
     847                //** SECOND STEP - OPTIONAL */
    849848
    850849                // bootstrap against another node
     
    857856}
    858857
    859 void BaseOverlay::leaveSpoVNet() {
    860 
    861         logging_info( "Leaving spovnet " << spovnetId );
    862         bool ret = ( state != this->BaseOverlayStateInvalid );
    863 
     858
     859void BaseOverlay::startBootstrapModules(vector<pair<BootstrapManager::BootstrapType,string> > modules){
     860        logging_debug("starting overlay bootstrap module");
     861        overlayBootstrap.start(this, spovnetId, nodeId, modules);
     862        overlayBootstrap.publish(bc->getEndpointDescriptor());
     863}
     864
     865void BaseOverlay::stopBootstrapModules(){
    864866        logging_debug("stopping overlay bootstrap module");
    865867        overlayBootstrap.stop();
    866868        overlayBootstrap.revoke();
     869}
     870
     871void BaseOverlay::leaveSpoVNet() {
     872
     873        logging_info( "Leaving spovnet " << spovnetId );
     874        bool ret = ( state != this->BaseOverlayStateInvalid );
    867875
    868876        logging_debug( "Dropping all auto-links" );
  • source/ariba/overlay/BaseOverlay.h

    r6961 r7532  
    274274
    275275        /**
     276         * Start the bootstrap modules
     277         */
     278        void startBootstrapModules(vector<pair<BootstrapManager::BootstrapType,string> > modules);
     279
     280        /**
     281         * Stop the bootstrap modules
     282         */
     283        void stopBootstrapModules();
     284
     285        /**
    276286         * Let the node leave the SpoVNet.
    277287         */
  • source/ariba/overlay/OverlayBootstrap.cpp

    r7491 r7532  
    6666}
    6767
    68 void OverlayBootstrap::start(BaseOverlay* _overlay, const SpoVNetID& _spovnetid, const NodeID& _nodeid){
     68void OverlayBootstrap::start(BaseOverlay* _overlay,
     69                const SpoVNetID& _spovnetid, const NodeID& _nodeid,
     70                vector<pair<BootstrapManager::BootstrapType,string> > modules){
    6971        overlay = _overlay;
    7072        spovnetid = _spovnetid;
     
    7476
    7577        manager.registerCallback( this );
    76         manager.registerModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
    77         //manager.registerModule( BootstrapManager::BootstrapTypeBluetoothSdp );
    78         //manager.registerModule( BootstrapManager::BootstrapTypeMulticastDns );
     78
     79        typedef pair<BootstrapManager::BootstrapType,string> X;
     80        BOOST_FOREACH( X i, modules){
     81                manager.registerModule( i.first, i.second );
     82        }
    7983
    8084        watchtimer.startWatchdog();
     
    8993
    9094        manager.unregisterCallback( this );
    91         manager.unregisterModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
    92         //manager.unregisterModule( BootstrapManager::BootstrapTypeBluetoothSdp );
    93         //manager.unregisterModule( BootstrapManager::BootstrapTypeMulticastDns );
     95        manager.unregisterAllModules();
    9496
    9597        watchtimer.stopWatchdog();
  • source/ariba/overlay/OverlayBootstrap.h

    r6919 r7532  
    4444#include <ctime>
    4545#include <deque>
     46#include <vector>
    4647#include <algorithm>
    4748#include <boost/thread/mutex.hpp>
     49#include <boost/foreach.hpp>
    4850#include "ariba/utility/logging/Logging.h"
    4951#include "ariba/utility/types.h"
     
    6062using std::deque;
    6163using std::string;
     64using std::vector;
     65using std::pair;
    6266using std::ostringstream;
    6367using ariba::utility::SpoVNetID;
     
    8387        virtual ~OverlayBootstrap();
    8488
    85         void start(BaseOverlay* _overlay, const SpoVNetID& _spovnetid, const NodeID& _nodeid);
     89        void start(
     90                        BaseOverlay* _overlay,
     91                        const SpoVNetID& _spovnetid,
     92                        const NodeID& _nodeid,
     93                        vector<pair<BootstrapManager::BootstrapType,string> > modules
     94                        );
    8695        void stop();
    8796
Note: See TracChangeset for help on using the changeset viewer.