Changeset 3718
- Timestamp:
- May 27, 2009, 8:13:08 AM (16 years ago)
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/pingpong/PingPong.cpp
r3071 r3718 69 69 node->start(); 70 70 71 // when initiating, you can define the overlay type, default is Chord [CHORD_OVERLAY] 72 SpoVNetProperties params; 73 //params.setBaseOverlayType( SpoVNetProperties::ONE_HOP_OVERLAY ); // alternative: OneHop 74 71 75 // initiate or join the spovnet 72 76 if (!isInitiator) node->join(spovnetName); 73 else node->initiate(spovnetName );77 else node->initiate(spovnetName, params); 74 78 75 79 // ping pong started up... -
source/ariba/Node.cpp
r3578 r3718 64 64 ariba_mod.getBootstrapNode(vnetname); 65 65 if( ep == NULL ) { 66 std::cout << "no bootstrap node defined" << std::endl; 66 std::cout << "no bootstrap node defined" << std::endl; 67 67 return; 68 68 } … … 73 73 74 74 void Node::initiate(const Name& vnetname, const SpoVNetProperties& parm) { 75 utility::OverlayParameterSet ovrpset = 75 utility::OverlayParameterSet ovrpset; 76 ovrpset.setOverlayStructure( 76 77 (utility::OverlayParameterSet::_OverlayStructure) 77 parm.getBaseOverlayType(); 78 parm.getBaseOverlayType() 79 ); 78 80 79 81 spovnetId = vnetname.toSpoVNetId(); … … 83 85 84 86 base_overlay->start( *ariba_mod.base_comm, nodeId ); 85 base_overlay->createSpoVNet( spovnetId );87 base_overlay->createSpoVNet( spovnetId, ovrpset ); 86 88 87 89 ariba_mod.addBootstrapNode(vnetname, -
source/ariba/SpoVNetProperties.h
r3690 r3718 69 69 ONE_HOP_OVERLAY = 0, 70 70 CHORD_OVERLAY = 1, 71 KADEMLIA_OVERLAY = 2,72 71 }; 73 72 … … 131 130 } 132 131 133 134 132 /** 135 133 * Returns the overlay type. … … 140 138 this->type = type; 141 139 } 142 143 140 144 141 /** -
source/ariba/overlay/BaseOverlay.cpp
r3713 r3718 726 726 joiningNodes.push_back( overlayMsg->getSourceNode() ); 727 727 728 // 728 729 // send back our spovnetid, default overlay parameters, join allow 729 730 // result, and ourself as the end-point to bootstrap the overlay against 731 // 732 733 assert( overlayInterface != NULL ); 734 OverlayParameterSet parameters = overlayInterface->getParameters(); 735 730 736 OverlayMsg retmsg( OverlayMsg::OverlayMessageTypeJoinReply, nodeId ); 731 JoinReply replyMsg( spovnetId, OverlayParameterSet::DEFAULT,737 JoinReply replyMsg( spovnetId, parameters, 732 738 allow, getEndpointDescriptor() ); 733 739 -
source/ariba/overlay/modules/OverlayFactory.cpp
r3690 r3718 53 53 54 54 switch( param.getOverlayStructure() ){ 55 case OverlayParameterSet::OverlayStructureOneHop:56 return new OneHop( baseoverlay, nodeid, routeReceiver );57 55 58 56 case OverlayParameterSet::OverlayStructureChord: 59 return new Chord( baseoverlay, nodeid, routeReceiver );57 return new Chord( baseoverlay, nodeid, routeReceiver, param ); 60 58 61 case OverlayParameterSet::OverlayStructure Kademlia:62 return NULL;59 case OverlayParameterSet::OverlayStructureOneHop: 60 return new OneHop( baseoverlay, nodeid, routeReceiver, param ); 63 61 64 62 default: -
source/ariba/overlay/modules/OverlayInterface.cpp
r3705 r3718 46 46 ServiceID OverlayInterface::OVERLAY_SERVICE_ID(0); 47 47 48 OverlayInterface::OverlayInterface(BaseOverlay& _baseoverlay, 49 const NodeID& _nodeid, OverlayStructureEvents* _eventsReceiver) : 50 baseoverlay(_baseoverlay), nodeid(_nodeid), eventsReceiver(_eventsReceiver) { 48 OverlayInterface::OverlayInterface(BaseOverlay& _baseoverlay, const NodeID& _nodeid, 49 OverlayStructureEvents* _eventsReceiver, OverlayParameterSet _parameters) : 50 baseoverlay(_baseoverlay), nodeid(_nodeid), 51 eventsReceiver(_eventsReceiver), parameters(_parameters) { 51 52 52 53 _baseoverlay.bind(this, OVERLAY_SERVICE_ID); … … 82 83 } 83 84 85 const OverlayParameterSet& OverlayInterface::getParameters() const { 86 return parameters; 87 } 88 84 89 }} // namespace ariba, overlay -
source/ariba/overlay/modules/OverlayInterface.h
r3690 r3718 45 45 #include "ariba/utility/types/NodeID.h" 46 46 #include "ariba/utility/types/ServiceID.h" 47 #include "ariba/utility/types/OverlayParameterSet.h" 47 48 48 49 using ariba::CommunicationListener; … … 51 52 using ariba::utility::NodeID; 52 53 using ariba::utility::ServiceID; 54 using ariba::utility::OverlayParameterSet; 53 55 54 56 namespace ariba { … … 75 77 BaseOverlay& _baseoverlay, 76 78 const NodeID& _nodeid, 77 OverlayStructureEvents* _eventsReceiver ); 79 OverlayStructureEvents* _eventsReceiver, 80 OverlayParameterSet _parameters 81 ); 78 82 79 83 /** … … 154 158 const LinkID& lnk = LinkID::UNSPECIFIED); 155 159 160 161 const OverlayParameterSet& getParameters() const; 162 156 163 protected: 157 164 158 165 /// Reference to an active base overlay 159 166 BaseOverlay& baseoverlay; 167 168 /// The parameters of the overlay structure 169 OverlayParameterSet parameters; 160 170 161 171 /// The node identifier to use with this overlay -
source/ariba/overlay/modules/chord/Chord.cpp
r3713 r3718 53 53 54 54 Chord::Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid, 55 OverlayStructureEvents* _eventsReceiver ) :56 OverlayInterface(_baseoverlay, _nodeid, _eventsReceiver ) {55 OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param) : 56 OverlayInterface(_baseoverlay, _nodeid, _eventsReceiver, param) { 57 57 58 58 // create routing table -
source/ariba/overlay/modules/chord/Chord.h
r3690 r3718 89 89 public: 90 90 Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid, 91 OverlayStructureEvents* _eventsReceiver );91 OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param); 92 92 virtual ~Chord(); 93 93 -
source/ariba/overlay/modules/onehop/OneHop.cpp
r3705 r3718 49 49 use_logging_cpp( OneHop ); 50 50 51 OneHop::OneHop(BaseOverlay& _baseoverlay, const NodeID& _nodeid, OverlayStructureEvents* _eventsReceiver) 52 : OverlayInterface( _baseoverlay, _nodeid, _eventsReceiver ), 51 OneHop::OneHop(BaseOverlay& _baseoverlay, const NodeID& _nodeid, 52 OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param) 53 : OverlayInterface( _baseoverlay, _nodeid, _eventsReceiver, param ), 53 54 state ( OneHopStateInvalid ), 54 55 bootstrapLink ( LinkID::UNSPECIFIED ), -
source/ariba/overlay/modules/onehop/OneHop.h
r3705 r3718 55 55 public: 56 56 OneHop(BaseOverlay& _overlay, const NodeID& _nodeid, 57 OverlayStructureEvents* _eventsReceiver );57 OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param); 58 58 59 59 virtual ~OneHop(); -
source/ariba/utility/system/StartupWrapper.cpp
r3712 r3718 103 103 { 104 104 log4cxx::LoggerPtr logger(log4cxx::Logger::getRootLogger()); 105 logger->setLevel(log4cxx::Level::get Debug());105 logger->setLevel(log4cxx::Level::getInfo()); 106 106 } 107 107 -
source/ariba/utility/types/OverlayParameterSet.cpp
r3690 r3718 55 55 } 56 56 57 void OverlayParameterSet:: getOverlayStructure(OverlayStructure _structure){57 void OverlayParameterSet::setOverlayStructure(OverlayStructure _structure){ 58 58 structure = (uint8_t)_structure; 59 59 } -
source/ariba/utility/types/OverlayParameterSet.h
r3690 r3718 55 55 OverlayStructureOneHop = 0, 56 56 OverlayStructureChord = 1, 57 OverlayStructureKademlia = 2,58 57 } OverlayStructure; 59 58 … … 62 61 63 62 OverlayStructure getOverlayStructure() const; 64 void getOverlayStructure( OverlayStructure _structure );63 void setOverlayStructure( OverlayStructure _structure ); 65 64 66 65 private:
Note:
See TracChangeset
for help on using the changeset viewer.