#include <TransportAddress.h>

It covers the complete node information, like IP-Address, and port. The information can be sparse, so parts can be omited by setting the property to an unspecified value.
Definition at line 44 of file TransportAddress.h.
Public Types | |
| typedef UNORDERED_SET < TransportAddress, hashFcn > | Set |
| a hashed set of TransportAddresses | |
Public Member Functions | |
| TransportAddress () | |
| Constructs a unspecified TransportAddress. | |
| virtual | ~TransportAddress () |
| Standard destructor. | |
| TransportAddress (const TransportAddress &handle) | |
| Copy constructor. | |
| TransportAddress (const IPvXAddress &ip, int port=-1) | |
| Complete constructor. | |
| bool | operator== (const TransportAddress &rhs) const |
| compares this to a given TransportAddress | |
| bool | operator!= (const TransportAddress &rhs) const |
| compares this to a given TransportAddress | |
| bool | operator< (const TransportAddress &rhs) const |
| compares this to a given TransportAddress | |
| bool | operator> (const TransportAddress &rhs) const |
| compares this to a given TransportAddress | |
| bool | operator<= (const TransportAddress &rhs) const |
| compares this to a given TransportAddress | |
| bool | operator>= (const TransportAddress &rhs) const |
| compares this to a given TransportAddress | |
| TransportAddress & | operator= (const TransportAddress &rhs) |
| assigns ip and port of rhs to this->ip and this->port | |
| void | setAddress (const IPvXAddress &ip, int port=-1) |
| sets this->ip to ip and port to -1 if unspecified | |
| void | setPort (int port) |
| sets this->port to the given port | |
| const IPvXAddress & | getAddress () const |
| returns ip address | |
| int | getPort () const |
| returns port | |
| bool | isUnspecified () const |
| indicates if TransportAddress is specified | |
| size_t | hash () const |
| creates a hash value of ip and port | |
| virtual TransportAddress * | dup () const |
| returns a copy of the TransportAddress | |
Public Attributes | |
| IPvXAddress | ip |
| the ip of this TransportAddress object | |
| int | port |
| the port of this TransportAddress object | |
Static Public Attributes | |
| static const TransportAddress | UNSPECIFIED_NODE |
| TransportAddress without specified ip and port. | |
| static const std::vector < TransportAddress > | UNSPECIFIED_NODES |
Private Member Functions | |
| void | assertUnspecified (const TransportAddress &handle) const |
| throws an opp_error if this or handle is unspecified | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const TransportAddress &n) |
| standard output stream for TransportAddress, gives out ip and port | |
Classes | |
| class | hashFcn |
| defines a hash function for TransportAddress More... | |
| typedef UNORDERED_SET<TransportAddress, hashFcn> TransportAddress::Set |
a hashed set of TransportAddresses
Reimplemented in NodeHandle.
Definition at line 62 of file TransportAddress.h.
| TransportAddress::TransportAddress | ( | ) |
Constructs a unspecified TransportAddress.
Definition at line 46 of file TransportAddress.cc.
Referenced by dup().
00047 { 00048 port = -1; 00049 }
| virtual TransportAddress::~TransportAddress | ( | ) | [inline, virtual] |
| TransportAddress::TransportAddress | ( | const TransportAddress & | handle | ) |
Copy constructor.
| handle | The TransportAddress to copy |
Definition at line 52 of file TransportAddress.cc.
| TransportAddress::TransportAddress | ( | const IPvXAddress & | ip, | |
| int | port = -1 | |||
| ) |
| bool TransportAddress::operator== | ( | const TransportAddress & | rhs | ) | const |
compares this to a given TransportAddress
| rhs | the TransportAddress this is compared to |
Definition at line 82 of file TransportAddress.cc.
00083 { 00084 assertUnspecified(rhs); 00085 return (this->ip == rhs.ip && this->port == rhs.port); 00086 }
| bool TransportAddress::operator!= | ( | const TransportAddress & | rhs | ) | const |
compares this to a given TransportAddress
| rhs | the TransportAddress this is compared to |
Definition at line 89 of file TransportAddress.cc.
00090 { 00091 assertUnspecified(rhs); 00092 return !(this->ip == rhs.ip && this->port == rhs.port ); 00093 }
| bool TransportAddress::operator< | ( | const TransportAddress & | rhs | ) | const |
compares this to a given TransportAddress
| rhs | the TransportAddress this is compared to |
Definition at line 96 of file TransportAddress.cc.
00097 { 00098 assertUnspecified(rhs); 00099 return this->ip < rhs.ip; 00100 }
| bool TransportAddress::operator> | ( | const TransportAddress & | rhs | ) | const |
compares this to a given TransportAddress
| rhs | the TransportAddress this is compared to |
Definition at line 103 of file TransportAddress.cc.
00104 { 00105 assertUnspecified(rhs); 00106 return !(this->ip < rhs.ip || this->ip == rhs.ip); 00107 }
| bool TransportAddress::operator<= | ( | const TransportAddress & | rhs | ) | const |
compares this to a given TransportAddress
| rhs | the TransportAddress this is compared to |
Definition at line 110 of file TransportAddress.cc.
00111 { 00112 assertUnspecified(rhs); 00113 return this->ip < rhs.ip || this->ip == rhs.ip; 00114 }
| bool TransportAddress::operator>= | ( | const TransportAddress & | rhs | ) | const |
compares this to a given TransportAddress
| rhs | the TransportAddress this is compared to |
Definition at line 117 of file TransportAddress.cc.
00118 { 00119 assertUnspecified(rhs); 00120 return !(this->ip < rhs.ip); 00121 }
| TransportAddress & TransportAddress::operator= | ( | const TransportAddress & | rhs | ) |
assigns ip and port of rhs to this->ip and this->port
| rhs | the TransportAddress with the defined ip and port |
Definition at line 73 of file TransportAddress.cc.
| void TransportAddress::setAddress | ( | const IPvXAddress & | ip, | |
| int | port = -1 | |||
| ) |
sets this->ip to ip and port to -1 if unspecified
| ip | the new IPvXAddress | |
| port | the new port |
Definition at line 124 of file TransportAddress.cc.
Referenced by doUnpacking().
| void TransportAddress::setPort | ( | int | port | ) |
sets this->port to the given port
| port | the new port |
Definition at line 132 of file TransportAddress.cc.
| const IPvXAddress & TransportAddress::getAddress | ( | ) | const |
returns ip address
Definition at line 138 of file TransportAddress.cc.
Referenced by RealWorldTestApp::deliver(), doPacking(), and GlobalNodeList::getBootstrapNode().
00139 { 00140 return ip; 00141 }
| int TransportAddress::getPort | ( | ) | const |
returns port
Definition at line 144 of file TransportAddress.cc.
Referenced by doPacking().
00145 { 00146 return port; 00147 }
| bool TransportAddress::isUnspecified | ( | ) | const |
indicates if TransportAddress is specified
Reimplemented in NodeHandle.
Definition at line 67 of file TransportAddress.cc.
Referenced by assertUnspecified(), BasePastry::baseChangeState(), oversim::Chord::changeState(), Pastry::checkProxCache(), Bamboo::doLeafsetMaintenance(), BasePastry::doRoutingTableMaintenance(), PubSubLobby::failedNode(), PastryRoutingTable::failedNode(), PastryLeafSet::failedNode(), PastryRoutingTable::findNextNodeToAsk(), BasePastry::findNode(), Pastry::handleFailedNode(), Kademlia::handleFailedNode(), Bamboo::handleFailedNode(), Vast::handleJoin(), QuonPR::handleJoin(), QuonP::handleJoin(), Broose::handleJoinTimerExpired(), oversim::Chord::handleRpcStabilizeResponse(), Kademlia::handleRpcTimeout(), Pastry::handleStateMessage(), Pastry::joinOverlay(), Kademlia::joinOverlay(), Broose::joinOverlay(), Bamboo::joinOverlay(), operator<<(), BootstrapList::removeBootstrapCandidate(), PastryLeafSet::repair(), BasePastry::sendLeafset(), BasePastry::sendRequest(), BaseRpc::sendRouteRpcCall(), BasePastry::sendRoutingRow(), and BaseRpc::sendRpcResponse().
| size_t TransportAddress::hash | ( | ) | const |
creates a hash value of ip and port
Definition at line 150 of file TransportAddress.cc.
Referenced by TransportAddress::hashFcn::operator()().
00151 { 00152 size_t iphash; 00153 if (ip.isIPv6()) { 00154 uint32_t* addr = (uint32_t*) ip.get6().words(); 00155 iphash = (size_t)(addr[0]^addr[1]^addr[2]^addr[3]); 00156 } else { 00157 iphash = (size_t)ip.get4().getInt(); 00158 } 00159 00160 return (size_t)(iphash^port); 00161 }
| void TransportAddress::assertUnspecified | ( | const TransportAddress & | handle | ) | const [inline, private] |
throws an opp_error if this or handle is unspecified
| handle | the TransportAddress to check |
Definition at line 169 of file TransportAddress.cc.
Referenced by operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().
00170 { 00171 if ( this->isUnspecified() || handle.isUnspecified() ) 00172 opp_error("TransportAddress: Trying to compare unspecified TransportAddress!"); 00173 }
| TransportAddress * TransportAddress::dup | ( | ) | const [virtual] |
returns a copy of the TransportAddress
Reimplemented in NodeHandle.
Definition at line 163 of file TransportAddress.cc.
Referenced by BaseRpc::sendRpcCall().
00164 { 00165 return new TransportAddress(*this); 00166 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const TransportAddress & | n | |||
| ) | [friend] |
standard output stream for TransportAddress, gives out ip and port
| os | the ostream | |
| n | the TransportAddress |
Definition at line 33 of file TransportAddress.cc.
00034 { 00035 if (n.isUnspecified()) { 00036 os << "<unspec>"; 00037 } else { 00038 os << n.ip << ":" << n.port; 00039 } 00040 00041 return os; 00042 };
| IPvXAddress TransportAddress::ip |
the ip of this TransportAddress object
Definition at line 66 of file TransportAddress.h.
Referenced by GlobalNodeList::addPeer(), QuonPR::addSite(), QuonP::addSite(), BasePastry::baseInit(), BaseOverlay::bindToPort(), BaseApp::bindToPort(), I3BaseApp::bootstrapI3(), BootstrapNodeHandle::BootstrapNodeHandle(), BrooseHandle::BrooseHandle(), BaseApp::callRoute(), BaseOverlay::callUpdate(), Vast::changeState(), QuonPR::changeState(), QuonP::changeState(), Gia::changeState(), oversim::Chord::changeState(), Broose::changeState(), Pastry::checkProxCache(), oversim::Chord::closestPreceedingNode(), I3SubIdentifier::compareTo(), QuonPR::deleteSite(), QuonP::deleteSite(), KBRTestApp::deliver(), Scribe::deliverALMDataToGroup(), Broose::displayBucketState(), BasePastry::doRoutingTableMaintenance(), Pastry::doSecondStage(), PastryRoutingTable::failedNode(), PastryNeighborhoodSet::failedNode(), PastryLeafSet::failedNode(), BaseOverlay::findNodeRpc(), KBRTestApp::forward(), getAddress(), BrooseBucket::getClosestNode(), BrooseBucket::getFailedResponses(), BrooseBucket::getLastSeen(), NeighborCache::getNodeContexts(), NeighborCache::getNodeCoordError(), NeighborCache::getNodeCoords(), GlobalNodeList::getPeerInfo(), Gia::getRoute(), BrooseBucket::getRTT(), PubSubMMOG::handleAdoptChildCall(), PubSubMMOG::handleAdoptChildResponse(), Vast::handleAppMessage(), QuonPR::handleAppMessage(), QuonP::handleAppMessage(), BaseOverlay::handleBaseOverlayMessage(), BaseApp::handleCommonAPIMessage(), oversim::Koorde::handleDeBruijnTimerExpired(), Pastry::handleFailedNode(), PubSubMMOG::handleHelpResponse(), PubSubMMOG::handleIntermediateResponse(), Scribe::handleJoinMessage(), Scribe::handleJoinResponse(), KBRTestApp::handleLookupResponse(), BootstrapList::handleLookupResponse(), GIASearchApp::handleLowerMessage(), XmlRpcInterface::handleMessage(), BaseOverlay::handleMessage(), BaseApp::handleMessage(), PubSubMMOG::handleMoveMessage(), Vast::handleNodeLeaveNotification(), QuonPR::handleNodeLeaveNotification(), PubSubMMOG::handlePingCall(), Scribe::handlePublishCall(), Scribe::handlePublishResponse(), SimpleGameClient::handleRealworldPacket(), BasePastry::handleRequestMessage(), oversim::Koorde::handleRpc(), oversim::Chord::handleRpc(), oversim::Koorde::handleRpcNotifyResponse(), oversim::Chord::handleRpcNotifyResponse(), Scribe::handleRpcResponse(), PubSubMMOG::handleRpcResponse(), oversim::Koorde::handleRpcResponse(), KBRTestApp::handleRpcResponse(), oversim::Chord::handleRpcResponse(), Broose::handleRpcResponse(), BootstrapList::handleRpcResponse(), PubSubMMOG::handleRpcTimeout(), PubSubLobby::handleRpcTimeout(), oversim::Koorde::handleRpcTimeout(), Kademlia::handleRpcTimeout(), oversim::Chord::handleRpcTimeout(), Broose::handleRpcTimeout(), Pastry::handleStateMessage(), Bamboo::handleStateMessage(), SimpleGameClient::handleTimerEvent(), Scribe::handleTimerEvent(), Pastry::handleTimerEvent(), GIASearchApp::handleTimerEvent(), Bamboo::handleTimerEvent(), BaseOverlay::handleTransportAddressChangedNotification(), Vast::handleUDPMessage(), QuonPR::handleUDPMessage(), QuonP::handleUDPMessage(), Pastry::handleUDPMessage(), Bamboo::handleUDPMessage(), Scribe::handleUpperMessage(), hash(), I3IPAddress::I3IPAddress(), BrooseBucket::increaseFailedResponses(), BaseOverlay::initialize(), BaseApp::initialize(), SimpleGameClient::initializeApp(), BootstrapList::initializeApp(), NeighborCache::insertNodeContext(), I3::insertTrigger(), BaseRpc::internalHandleRpcMessage(), isUnspecified(), NodeHandle::isUnspecified(), BaseOverlay::join(), I3IPAddress::length(), IterativeLookup::lookup(), SendToKeyListener::lookupFinished(), Pastry::mergeState(), NodeHandle::netPack(), NodeHandle::netUnpack(), BasePastry::newLeafs(), NodeHandle::NodeHandle(), BrooseBucket::nodeInBucket(), operator!=(), NodeHandle::operator!=(), BrooseHandle::operator!=(), operator<(), I3IPAddress::operator<(), operator<<(), operator<=(), operator=(), NodeHandle::operator=(), GiaNode::operator=(), BrooseHandle::operator=(), operator==(), NodeHandle::operator==(), I3IPAddress::operator==(), BrooseHandle::operator==(), operator>(), operator>=(), BrooseBucket::output(), oversim::Chord::pingResponse(), BootstrapList::pingResponse(), BasePastry::pingResponse(), oversim::Chord::pingTimeout(), BootstrapList::pingTimeout(), BasePastry::pingTimeout(), QuonPR::purgeSites(), QuonP::purgeSites(), I3IdentifierStack::push(), I3BaseApp::refreshTriggers(), GlobalNodeList::registerPeer(), BrooseBucket::remove(), GlobalNodeList::removePeer(), BrooseBucket::resetFailedResponses(), BaseOverlay::route(), Vast::sendDiscardNode(), Vast::sendMessage(), QuonPR::sendMessage(), QuonP::sendMessage(), BaseOverlay::sendMessageToUDP(), BaseApp::sendMessageToUDP(), I3::sendPacket(), I3::sendQueryReply(), BasePastry::sendStateTables(), Vast::sendToApp(), QuonPR::sendToApp(), QuonP::sendToApp(), BaseOverlay::sendToKey(), BrooseBucket::setLastSeen(), NeighborCache::setNodeTimeout(), BrooseBucket::setRTT(), PubSubMMOG::startTimer(), Scribe::subscribeToGroup(), TransportAddress(), NeighborCache::updateEntry(), SimpleGameClient::updateNeighbors(), NeighborCache::updateNode(), QuonPR::updateThisSite(), QuonP::updateThisSite(), oversim::Koorde::updateTooltip(), and Broose::updateTooltip().
the port of this TransportAddress object
Definition at line 67 of file TransportAddress.h.
Referenced by BaseOverlay::bindToPort(), BaseApp::bindToPort(), BootstrapNodeHandle::BootstrapNodeHandle(), BrooseHandle::BrooseHandle(), Gia::changeState(), I3SubIdentifier::compareTo(), getPort(), Gia::getRoute(), KBRTestApp::handleTimerEvent(), hash(), I3IPAddress::I3IPAddress(), BaseApp::initialize(), KBRTestApp::initializeApp(), I3::initializeApp(), isUnspecified(), NodeHandle::netPack(), NodeHandle::netUnpack(), NodeHandle::NodeHandle(), operator!=(), NodeHandle::operator!=(), BrooseHandle::operator!=(), I3IPAddress::operator<(), operator<<(), operator=(), NodeHandle::operator=(), GiaNode::operator=(), BrooseHandle::operator=(), operator==(), NodeHandle::operator==(), I3IPAddress::operator==(), BrooseHandle::operator==(), I3IdentifierStack::push(), BaseOverlay::sendMessageToUDP(), BaseApp::sendMessageToUDP(), and TransportAddress().
const TransportAddress TransportAddress::UNSPECIFIED_NODE [static] |
TransportAddress without specified ip and port.
Reimplemented in NodeHandle, and GiaNode.
Definition at line 98 of file TransportAddress.h.
Referenced by PastryRoutingTable::failedNode(), PastryNeighborhoodSet::failedNode(), PastryLeafSet::failedNode(), PastryRoutingTable::findNextNodeToAsk(), PastryRoutingTable::getRandomNode(), PastryLeafSet::getRandomNode(), oversim::Chord::handleRpcStabilizeResponse(), oversim::Chord::initializeOverlay(), BaseApp::internalSendRpcResponse(), PastryStateObject::repair(), PastryRoutingTable::repair(), PastryLeafSet::repair(), BaseRpc::sendInternalRpcCall(), and BaseRpc::sendRouteRpcCall().
const std::vector< TransportAddress > TransportAddress::UNSPECIFIED_NODES [static] |
Definition at line 99 of file TransportAddress.h.
1.5.5