- Timestamp:
- Jul 4, 2009, 7:03:55 PM (15 years ago)
- Location:
- source/ariba
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/SideportListener.cpp
r3374 r4738 71 71 } 72 72 73 //****************************************************** 74 // 75 // JUST EXPERIMENTAL WITH RANDOM RESULTS 76 // 77 78 // 0 = normal node --> directly accessible 79 // 1 = relaying node --> node that is relaying for us (must also be 0) 80 // 2 = relayed node --> node that we cannot access directly 81 static map<NodeID,short> relayingnodes; 82 83 bool SideportListener::isRelayingNode(const NodeID& node){ 84 85 map<NodeID,short>::iterator i = relayingnodes.find(node); 86 if(i != relayingnodes.end()) return (i->second == 1); 87 88 relayingnodes.insert( std::make_pair( node, rand()%3 ) ); 89 } 90 91 bool SideportListener::isRelayedNode(const NodeID& node){ 92 93 map<NodeID,short>::iterator i = relayingnodes.find(node); 94 if(i != relayingnodes.end()) return (i->second == 2); 95 96 relayingnodes.insert( std::make_pair( node, rand()%3 ) ); 97 } 98 99 // 100 // 101 //****************************************************** 102 73 103 void SideportListener::configure( overlay::BaseOverlay* _overlay ) { 74 104 overlay = _overlay; -
source/ariba/SideportListener.h
r3374 r4738 41 41 42 42 #include <vector> 43 #include <map> 43 44 #include "Identifiers.h" 44 45 #include "CommunicationListener.h" 45 46 47 using std::map; 46 48 using std::vector; 47 49 … … 131 133 ) const; 132 134 135 /** 136 * Is this node acting as a relay for us 137 * 138 * @param The node in question 139 * @return true, if this node is relaying for us 140 */ 141 bool isRelayingNode(const NodeID& node); 142 143 /** 144 * Is this node only reachable for us through a relay? 145 * 146 * @param The node in question 147 * @return true, if we reach this node only over a relay 148 */ 149 bool isRelayedNode(const NodeID& node); 150 133 151 protected: 134 152
Note:
See TracChangeset
for help on using the changeset viewer.