Changeset 4751 for source/ariba/SideportListener.cpp
- Timestamp:
- Jul 6, 2009, 8:14:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/SideportListener.cpp
r4738 r4751 80 80 // 2 = relayed node --> node that we cannot access directly 81 81 static map<NodeID,short> relayingnodes; 82 static map<NodeID,SideportListener::Protocol> protocolnodes; 82 83 83 84 bool SideportListener::isRelayingNode(const NodeID& node){ … … 95 96 96 97 relayingnodes.insert( std::make_pair( node, rand()%3 ) ); 98 } 99 100 SideportListener::Protocol generateRandomProtocol(){ 101 102 if( (rand() % 3) == 0 ){ 103 return SideportListener::rfcomm; 104 } 105 106 int ret = SideportListener::undefined; 107 108 if( (rand() % 2) == 0 ) ret |= SideportListener::ipv4; 109 else ret |= SideportListener::ipv6; 110 111 if( (rand() % 2) == 0 ) ret |= SideportListener::udp; 112 else ret |= SideportListener::tcp; 113 114 return (SideportListener::Protocol)ret; 115 } 116 117 SideportListener::Protocol SideportListener::getReachabilityProtocol(const NodeID& node){ 118 119 map<NodeID,Protocol>::iterator i = protocolnodes.find(node); 120 if(i != protocolnodes.end()) return i->second; 121 122 protocolnodes.insert( std::make_pair(node, generateRandomProtocol()) ); 97 123 } 98 124
Note:
See TracChangeset
for help on using the changeset viewer.