Changeset 7744 for source/ariba
- Timestamp:
- Mar 11, 2010, 9:28:24 AM (15 years ago)
- Location:
- source/ariba
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/Makefile.am
r7468 r7744 415 415 utility/types/Locator.cpp \ 416 416 utility/types/NodeID.cpp \ 417 utility/types/PeerID.cpp \ 417 418 utility/types/OverlayParameterSet.cpp \ 418 419 utility/types/QoSParameterSet.cpp \ … … 429 430 utility/types/Locator.h \ 430 431 utility/types/NodeID.h \ 432 utility/types/PeerID.h \ 431 433 utility/types/OverlayParameterSet.h \ 432 434 utility/types/QoSParameterSet.h \ -
source/ariba/communication/BaseCommunication.cpp
r7496 r7744 38 38 39 39 #include "BaseCommunication.h" 40 40 41 #include "networkinfo/AddressDiscovery.h" 42 #include "ariba/utility/types/PeerID.h" 41 43 42 44 #ifdef UNDERLAY_OMNET … … 52 54 namespace ariba { 53 55 namespace communication { 56 57 using ariba::utility::PeerID; 54 58 55 59 use_logging_cpp(BaseCommunication); … … 100 104 currentSeqnum = 0; 101 105 106 // set local peer id 107 localDescriptor.getPeerId() = PeerID::random(); 108 logging_info( "Using PeerID: " << localDescriptor.getPeerId() ); 109 102 110 // creating transports 103 111 logging_info( "Creating transports ..." ); … … 114 122 115 123 logging_info( "Searching for local locators ..." ); 116 if(localDescriptor.getEndpoints().to_string().length() == 0) 117 AddressDiscovery::discover_endpoints( localDescriptor.getEndpoints() ); 124 /** 125 * DONT DO THAT: if(localDescriptor.getEndpoints().to_string().length() == 0) 126 * since addresses are used to initialize transport addresses 127 */ 128 AddressDiscovery::discover_endpoints( localDescriptor.getEndpoints() ); 118 129 logging_info( "Done. Local endpoints = " << localDescriptor.toString() ); 119 130 … … 177 188 AribaBaseMsg baseMsg( AribaBaseMsg::typeLinkRequest, linkid ); 178 189 baseMsg.getLocalDescriptor() = localDescriptor; 190 baseMsg.getRemoteDescriptor().getPeerId() = descriptor.getPeerId(); 179 191 180 192 // serialize and send message … … 338 350 logging_debug( "Received link open request" ); 339 351 352 /// not the correct peer id-> skip request 353 if (!msg->getRemoteDescriptor().getPeerId().isUnspecified() 354 && msg->getRemoteDescriptor().getPeerId() != localDescriptor.getPeerId()) { 355 logging_info("Received link request for " 356 << msg->getRemoteDescriptor().getPeerId().toString() 357 << "but i'm " 358 << localDescriptor.getPeerId() 359 << ": Ignoring!"); 360 break; 361 } 362 340 363 /// only answer the first request 341 364 if (!queryRemoteLink(msg->getLocalLink()).isUnspecified()) { -
source/ariba/communication/EndpointDescriptor.h
r6919 r7744 43 43 #include <set> 44 44 #include "ariba/utility/serialization.h" 45 #include "ariba/utility/types/PeerID.h" 45 46 #include "ariba/utility/addressing/endpoint_set.hpp" 46 47 … … 51 52 using namespace std; 52 53 using namespace ariba::addressing; 54 using ariba::utility::PeerID; 53 55 54 56 class EndpointDescriptor: public VSerializeable { VSERIALIZEABLE … … 120 122 } 121 123 124 /// returns a reference to the peer id 125 PeerID& getPeerId() { 126 return peerId; 127 } 128 129 130 /// returns a reference to the constant peer id 131 const PeerID& getPeerId() const { 132 return peerId; 133 } 122 134 private: 123 135 endpoint_set endpoints; 136 PeerID peerId; 124 137 }; 125 138 … … 127 140 128 141 sznBeginDefault( ariba::communication::EndpointDescriptor, X ){ 129 // serialize endpoints 142 143 // serialize peer id 144 X && &peerId; 145 146 // serialize end-points 130 147 uint16_t len = endpoints.to_bytes_size(); 131 148 X && len; -
source/ariba/communication/networkinfo/AddressDiscovery.cpp
r6919 r7744 107 107 if (addr==NULL) continue; 108 108 109 // ignore tun devices 110 string device = string(i->ifa_name); 111 if(device.find_first_of("tun") == 0) continue; 112 109 113 if (addr->sa_family == AF_INET) { 110 114 // look for ipv4 -
source/ariba/overlay/BaseOverlay.cpp
r7532 r7744 135 135 for (vector<ValueEntry>::iterator i = values.begin(); 136 136 i != values.end(); i++ ) 137 if (i->is_ttl_elapsed()) i = values.erase(i) ;137 if (i->is_ttl_elapsed()) i = values.erase(i)-1; 138 138 } 139 139 }; … … 214 214 // found? yes-> delete entry 215 215 if ( equals(entry.key, key) ) { 216 i = entries.erase(i) ;216 i = entries.erase(i)-1; 217 217 return true; 218 218 } … … 233 233 // value found? yes-> delete 234 234 if (equals(j->get_value(), value)) { 235 j = entry.values.erase(j) ;235 j = entry.values.erase(j)-1; 236 236 return true; 237 237 } … … 252 252 // value found? yes-> delete 253 253 if (j->is_ttl_elapsed()) 254 j = entry.values.erase(j) ;254 j = entry.values.erase(j)-1; 255 255 } 256 256 257 if (entry.values.size()==0) i = entries.erase(i) ;257 if (entry.values.size()==0) i = entries.erase(i)-1; 258 258 } 259 259 } … … 1911 1911 "in the overlay from service " + service.toString() ); 1912 1912 1913 if(message == NULL) return; 1914 message->setReleasePayload(false); 1915 1913 1916 OverlayInterface::NodeList nodes = overlayInterface->getKnownNodes(true); 1914 OverlayInterface::NodeList::iterator i = nodes.begin(); 1915 for(; i != nodes.end(); i++ ) { 1916 if( *i == nodeId) continue; // don't send to ourselfs 1917 sendMessage( message, *i, service ); 1917 for(size_t i=0; i<nodes.size(); i++){ 1918 NodeID& id = nodes.at(i); 1919 if(id == this->nodeId) continue; // don't send to ourselfs 1920 if(i+1 == nodes.size()) message->setReleasePayload(true); // release payload on last send 1921 sendMessage( message, id, service ); 1918 1922 } 1919 1923 } -
source/ariba/overlay/modules/chord/Chord.cpp
r6919 r7744 250 250 logging_info("new routing neighbor: " << remote.toString() 251 251 << " with link " << lnk.toString()); 252 // replace with new link 253 if (item->info!=lnk && item->info.isUnspecified()==false) 254 baseoverlay.dropLink(item->info); 255 item->info = lnk; 252 253 // replace with new link if link is "better" 254 if (item->info!=lnk && item->info.isUnspecified()==false) { 255 if (baseoverlay.compare( item->info, lnk ) == 1) { 256 logging_info("Replacing link due to concurrent link establishment."); 257 baseoverlay.dropLink(item->info); 258 item->info = lnk; 259 } 260 } else { 261 item->info = lnk; 262 } 256 263 257 264 // discover neighbors of new overlay neighbor -
source/ariba/utility/addressing
- Property svn:mergeinfo changed (with no actual effect on merging)
-
source/ariba/utility/bootstrap/modules/bluetoothsdp
- Property svn:mergeinfo changed (with no actual effect on merging)
-
source/ariba/utility/bootstrap/modules/periodicbroadcast
- Property svn:mergeinfo changed (with no actual effect on merging)
-
source/ariba/utility/transport
- Property svn:mergeinfo changed (with no actual effect on merging)
Note:
See TracChangeset
for help on using the changeset viewer.