- Timestamp:
- Feb 18, 2009, 1:39:08 PM (16 years ago)
- Location:
- source/ariba
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/AribaModule.cpp
r2452 r2454 58 58 namespace ariba { 59 59 60 AribaModule::BootstrapNode::~BootstrapNode() {61 if (desc!=NULL) delete desc;62 }63 64 60 AribaModule::AribaModule() { 65 61 … … 85 81 i++; 86 82 } 83 o << "}"; 87 84 } 88 85 return o.str(); … … 102 99 string data = nav[i][robject_data].str(); 103 100 data = data.substr(1, data.size() - 2); 104 Name name = type;101 Name name(type); 105 102 EndpointDescriptor* desc = EndpointDescriptor::fromString(data); 106 103 addBootstrapNode(name, desc); -
source/ariba/AribaModule.h
r2452 r2454 141 141 class BootstrapNode { 142 142 public: 143 inline BootstrapNode() : timestamp(0), desc(NULL) { 143 inline BootstrapNode() : 144 timestamp(0), desc(NULL) { 144 145 146 } 147 inline BootstrapNode(const BootstrapNode& copy) : 148 timestamp(copy.timestamp), desc(copy.desc) { 145 149 } 146 150 inline BootstrapNode(uint32_t timestamp, 147 151 communication::EndpointDescriptor* desc) : 148 152 timestamp(timestamp), desc(desc) { 149 150 153 } 151 ~BootstrapNode();152 154 uint32_t timestamp; 153 155 communication::EndpointDescriptor* desc; … … 157 159 class BootstrapInfo { 158 160 public: 161 BootstrapInfo() : 162 spovnetName(), nodes() { 163 164 } 165 166 BootstrapInfo(const BootstrapInfo& copy) : 167 spovnetName(copy.spovnetName), nodes(copy.nodes) { 168 169 } 170 159 171 Name spovnetName; 160 172 vector<BootstrapNode> nodes; -
source/ariba/Name.cpp
r2437 r2454 62 62 if (copy) { 63 63 64 if ( (name!=NULL) && (len>0)){64 if ( (name!=NULL) && (len>0) ){ 65 65 _bytes = new uint8_t[len]; 66 66 memcpy( _bytes, name, len ); 67 67 } else { 68 68 len = 0; 69 _bytes = NULL; 69 _bytes = NULL; 70 70 } 71 71 … … 79 79 } 80 80 81 Name::Name() 81 Name::Name() 82 82 : _bytes( NULL ), _length( 0 ), _copy( false ), _hreadable( false) { 83 83 } 84 84 85 Name::Name(const char* name, int len, bool copy) 85 Name::Name(const char* name, int len, bool copy) 86 86 : _bytes( NULL ), _length( 0 ), _copy( false ), _hreadable( false) { 87 87 init(name, len, copy, len == -1); 88 88 } 89 89 90 Name::Name(string name) 90 Name::Name(string name) 91 91 : _bytes( NULL ), _length( 0 ), _copy( false ), _hreadable( false) { 92 92 init(name.c_str(), name.length(), true, true); 93 93 } 94 94 95 Name::Name(const Name& name) 95 Name::Name(const Name& name) 96 96 : _bytes( NULL ), _length( 0 ), _copy( false ), _hreadable( false) { 97 97 init((const char*)name.bytes(), name.length(), true, name._hreadable); … … 104 104 _length = 0; 105 105 } 106 } 107 108 Name& Name::operator=( const Name& name ) { 109 init((const char*)name.bytes(), name.length(), true, name._hreadable); 106 110 } 107 111 … … 119 123 if (_bytes == NULL && name._bytes == NULL && 120 124 length() == name.length()) return true; 121 125 122 126 // specified name objects 123 127 if (_bytes == NULL || name._bytes == NULL) return false; -
source/ariba/Name.h
r2437 r2454 113 113 114 114 /** 115 * The common assign operator 116 */ 117 Name& operator=( const Name& name ); 118 119 /** 115 120 * The common implementation of the "equal" operator. 116 121 */ -
source/ariba/Node.cpp
r2439 r2454 45 45 #include "ariba/interface/ServiceInterface.h" 46 46 #include "ariba/interface/UnderlayAbstraction.h" 47 47 #include "ariba/communication/EndpointDescriptor.h" 48 49 using ariba::communication::EndpointDescriptor; 48 50 using ariba::interface::UnderlayAbstraction; 49 51 … … 125 127 126 128 Node::Node(AribaModule& ariba_mod, const Name& node_name) : 127 ariba_mod( ariba_mod ), name( node_name ), context( NULL ){129 ariba_mod(ariba_mod), name(node_name), context(NULL) { 128 130 } 129 131 … … 133 135 void Node::join(const Name& vnetname) { 134 136 spovnetId = vnetname.toSpoVNetId(); 135 nodeId = generateNodeId( name);137 nodeId = generateNodeId(name); 136 138 this->context = ariba_mod.underlay_abs->joinSpoVNet(spovnetId, 137 139 *ariba_mod.getBootstrapNode(name), nodeId); … … 139 141 140 142 void Node::initiate(const Name& vnetname, const SpoVNetProperties& parm) { 141 utility::OverlayParameterSet ovrpset = 142 (utility::OverlayParameterSet::_OverlayStructure) parm.getBaseOverlayType(); 143 utility::OverlayParameterSet 144 ovrpset = 145 (utility::OverlayParameterSet::_OverlayStructure) parm.getBaseOverlayType(); 143 146 spovnetId = vnetname.toSpoVNetId(); 144 nodeId = generateNodeId( name);147 nodeId = generateNodeId(name); 145 148 this->context = ariba_mod.underlay_abs->createSpoVNet(spovnetId, nodeId, 146 149 ariba_mod.ip_addr, ariba_mod.tcp_port); 150 ariba_mod.addBootstrapNode(vnetname, 151 new EndpointDescriptor(this->context->getBaseCommunication().getEndpointDescriptor())); 147 152 } 148 153 … … 173 178 174 179 NodeID Node::generateNodeId(const Name& name) const { 175 if( name == Name::UNSPECIFIED ) 176 return Name::random().toNodeId(); 177 else 178 return name.toNodeId(); 180 if (name == Name::UNSPECIFIED) return Name::random().toNodeId(); 181 else return name.toNodeId(); 179 182 } 180 183 … … 190 193 seqnum_t Node::sendMessage(const DataMessage& msg, const NodeID& nid, 191 194 const ServiceID& sid, const LinkProperties& req) { 192 return context->getOverlay().sendMessage((Message*) msg, nid, sid);195 return context->getOverlay().sendMessage((Message*) msg, nid, sid); 193 196 } 194 197 195 198 seqnum_t Node::sendMessage(const DataMessage& msg, const LinkID& lnk) { 196 return context->getOverlay().sendMessage((Message*) msg, lnk);199 return context->getOverlay().sendMessage((Message*) msg, lnk); 197 200 } 198 201 -
source/ariba/communication/EndpointDescriptor.cpp
r2452 r2454 92 92 string ip = nav[i][robject_data].str(); 93 93 ip = ip.substr(1,ip.size()-2); 94 cout << "ep-ip = " << ip << endl;94 cout << "ep-ip = " << ip << endl; 95 95 ep = new EndpointDescriptor(); 96 96 ep->locator = new IPv4Locator(); 97 cout << "1" << endl; 97 98 ep->locator->setIP(ip); 99 cout << "2" << endl; 98 100 ep->isUnspec = false; 101 cout << "3" << endl; 99 102 } else 100 103 if (type=="tcp") { 104 cout << "4" << endl; 101 105 string port = nav[i][robject_data][rfields][1].str(); 102 106 port = port.substr(1,port.size()-2); 103 107 cout << "ep-tcp-port = " << port << endl; 108 cout << "5" << endl; 104 109 ep->locator->setPort(stoi(port)); 105 110 }
Note:
See TracChangeset
for help on using the changeset viewer.