Changeset 5358 for source/ariba/SideportListener.cpp
- Timestamp:
- Jul 26, 2009, 5:17:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/SideportListener.cpp
r5316 r5358 41 41 #include "ariba/overlay/BaseOverlay.h" 42 42 #include "ariba/overlay/LinkDescriptor.h" 43 #include "ariba/utility/addressing/endpoint_set.hpp" 43 44 44 45 using ariba::overlay::LinkDescriptor; … … 82 83 83 84 bool SideportListener::isRelayedNode(const NodeID& node){ 85 if( overlay == NULL ) return false; 84 86 85 87 BOOST_FOREACH( LinkDescriptor* link, overlay->links ){ 86 87 if( (!link->localRelay.isUnspecified()) && link->remoteRelay == node && link->up) { 88 if( (!link->localRelay.isUnspecified()) && link->remoteRelay == node && link->up) 88 89 return true; 89 }90 91 90 } 92 91 … … 95 94 96 95 bool SideportListener::isRelayingNode(const NodeID& node){ 96 if( overlay == NULL ) return false; 97 97 98 98 BOOST_FOREACH( LinkDescriptor* link, overlay->links ){ 99 100 if( (!link->localRelay.isUnspecified()) && link->localRelay == node && link->up) { 99 if( (!link->localRelay.isUnspecified()) && link->localRelay == node && link->up) 101 100 return true; 102 }103 104 101 } 105 102 … … 108 105 109 106 SideportListener::Protocol SideportListener::getReachabilityProtocol(const NodeID& node){ 110 return (SideportListener::Protocol)(ipv4 | tcp); 107 int ret = SideportListener::undefined; 108 if( overlay == NULL ) return (Protocol)ret; 109 110 using namespace ariba::addressing; 111 112 BOOST_FOREACH( LinkDescriptor* link, overlay->links ){ 113 if(link->remoteNode == node){ 114 if(overlay->bc == NULL) continue; 115 116 BaseCommunication::LinkDescriptor& bclink = 117 overlay->bc->queryLocalLink(link->communicationId); 118 119 if(bclink.isUnspecified()) continue; 120 if(bclink.localLocator == NULL) continue; 121 122 const address_v* locator = bclink.remoteLocator; 123 124 if( locator->instanceof<tcpip_endpoint>() ){ 125 126 tcpip_endpoint tcpip = *locator; 127 128 ret |= SideportListener::tcp; 129 130 if( tcpip.address().is_v4() ) 131 ret |= SideportListener::ipv4; 132 133 if( tcpip.address().is_v6() ) 134 ret |= SideportListener::ipv6; 135 136 }else if( locator->instanceof<rfcomm_endpoint>() ){ 137 ret |= SideportListener::rfcomm; 138 } 139 } 140 } 141 142 return (Protocol)ret; 143 //return (SideportListener::Protocol)(ipv4 | tcp); 111 144 } 112 145
Note:
See TracChangeset
for help on using the changeset viewer.