OverSim
|
This class implements a node handle. More...
#include <NodeHandle.h>
Public Member Functions | |
NodeHandle () | |
Constructs an unspecified NodeHandle. | |
virtual | ~NodeHandle () |
Standard destructor. | |
NodeHandle (const NodeHandle &handle) | |
Copy constructor. | |
NodeHandle (const OverlayKey &key, const IPvXAddress &ip, int port) | |
Complete constructor. | |
NodeHandle (const TransportAddress &ta) | |
Constructor to generate a NodeHandle from a TransportAddress. | |
NodeHandle (const OverlayKey &key, const TransportAddress &ta) | |
Constructor to generate a NodeHandle from an existing OverlayKey and TransportAddress. | |
bool | operator== (const NodeHandle &rhs) const |
compares this NodeHandle to another given NodeHandle | |
bool | operator!= (const NodeHandle &rhs) const |
compares this NodeHandle to another given NodeHandle | |
bool | operator< (const NodeHandle &rhs) const |
compares this to a given NodeHandle | |
bool | operator> (const NodeHandle &rhs) const |
compares this to a given NodeHandle | |
bool | operator<= (const NodeHandle &rhs) const |
compares this to a given NodeHandle | |
bool | operator>= (const NodeHandle &rhs) const |
compares this to a given NodeHandle | |
NodeHandle & | operator= (const NodeHandle &rhs) |
assigns key, ip and port of rhs to this->key, this->ip and this->port | |
void | setKey (const OverlayKey &key) |
saves given key to NodeHandle::key | |
const OverlayKey & | getKey () const |
returns key of this NodeHandle | |
bool | isUnspecified () const |
indicates if this NodeHandle is specified | |
virtual void | netPack (cCommBuffer *b) |
serializes the object into a buffer | |
virtual void | netUnpack (cCommBuffer *b) |
deserializes the object from a buffer | |
virtual TransportAddress * | dup () const |
returns a copy of the NodeHandle | |
Public Member Functions inherited from TransportAddress | |
TransportAddress () | |
Constructs a unspecified TransportAddress. | |
virtual | ~TransportAddress () |
Standard destructor. | |
TransportAddress (const TransportAddress &handle) | |
Copy constructor. | |
TransportAddress (const IPvXAddress &ip, int port=-1, NatType natType=UNKNOWN_NAT) | |
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 | setIp (const IPvXAddress &ip, int port=-1, NatType natType=UNKNOWN_NAT) |
Sets the ip address, port and NAT type. | |
void | setAddress (const IPvXAddress &ip, int port=-1, NatType natType=UNKNOWN_NAT) __attribute((deprecated)) |
Sets the ip address, port and NAT type. | |
void | appendSourceRoute (const TransportAddress &sourceRoute) |
Appends a source route to this TransportAddress. | |
void | clearSourceRoute () |
Clears the source route of this TransportAddress. | |
void | setPort (int port) |
sets this->port to the given port | |
const IPvXAddress & | getIp () const |
returns ip address | |
const IPvXAddress & | getAddress () const __attribute((deprecated)) |
returns ip address. | |
int | getPort () const |
returns port | |
NatType | getNatType () const |
returns the type of NAT this node is behind | |
size_t | getSourceRouteSize () const |
Returns the length of the source route to reach this node. | |
const TransportAddressVector & | getSourceRoute () const |
Returns source route used to reach this node. | |
size_t | hash () const |
creates a hash value of ip and port |
Static Public Attributes | |
static const NodeHandle | UNSPECIFIED_NODE |
the unspecified NodeHandle | |
Static Public Attributes inherited from TransportAddress | |
static const TransportAddress | UNSPECIFIED_NODE |
TransportAddress without specified ip and port. | |
static const TransportAddressVector | UNSPECIFIED_NODES |
Protected Attributes | |
OverlayKey | key |
the OverlayKey of this NodeHandle | |
Protected Attributes inherited from TransportAddress | |
IPvXAddress | ip |
the ip of this TransportAddress object | |
int | port |
the port of this TransportAddress object |
Private Member Functions | |
void | assertUnspecified (const NodeHandle &handle) const |
throws an opp_error if this or handle is unspecified |
Friends | |
std::ostream & | operator<< (std::ostream &os, const NodeHandle &n) |
standard output stream for NodeHandle, gives out ip, port and key |
Additional Inherited Members | |
Public Types inherited from TransportAddress | |
enum | NatType { UNKNOWN_NAT = 0, NO_NAT = 1, FULL_CONE_NAT = 2, PORT_RESTRICTED_NAT = 3, SYMMETRIC_NAT = 4 } |
typedef UNORDERED_SET < TransportAddress, hashFcn > | Set |
a hashed set of TransportAddresses |
This class implements a node handle.
It covers the complete node information, like IP-Address, port, NodeKey and some additional flags for Simulation behaviour. The information can be sparse, so parts can be omited by setting the property to an unspecified value.
Definition at line 50 of file NodeHandle.h.
NodeHandle::NodeHandle | ( | ) |
Constructs an unspecified NodeHandle.
Definition at line 50 of file NodeHandle.cc.
Referenced by dup().
|
inlinevirtual |
NodeHandle::NodeHandle | ( | const NodeHandle & | handle | ) |
Copy constructor.
handle | The NodeHandle to copy |
Definition at line 57 of file NodeHandle.cc.
NodeHandle::NodeHandle | ( | const OverlayKey & | key, |
const IPvXAddress & | ip, | ||
int | port | ||
) |
Complete constructor.
key | The OverlayKey |
ip | The IPvXAddress |
port | The UDP-Port |
Definition at line 72 of file NodeHandle.cc.
NodeHandle::NodeHandle | ( | const TransportAddress & | ta | ) |
Constructor to generate a NodeHandle from a TransportAddress.
The key will be unspecified.
ta | transport address |
Definition at line 64 of file NodeHandle.cc.
NodeHandle::NodeHandle | ( | const OverlayKey & | key, |
const TransportAddress & | ta | ||
) |
Constructor to generate a NodeHandle from an existing OverlayKey and TransportAddress.
key | the overlay key |
ta | transport address |
Definition at line 80 of file NodeHandle.cc.
|
inlineprivate |
throws an opp_error if this or handle is unspecified
handle | the NodeHandle to check |
Definition at line 184 of file NodeHandle.cc.
Referenced by operator!=(), operator<(), operator==(), and operator>().
|
virtual |
returns a copy of the NodeHandle
Reimplemented from TransportAddress.
Definition at line 207 of file NodeHandle.cc.
const OverlayKey & NodeHandle::getKey | ( | ) | const |
returns key of this NodeHandle
Definition at line 177 of file NodeHandle.cc.
Referenced by BrooseBucket::add(), GiaMessageBookkeeping::addMessage(), PastryRoutingTable::addRow(), IterativeLookup::addSibling(), Quon::addSite(), oversim::ChordSuccessorList::addSuccessor(), BasePastry::baseChangeState(), BasePastry::baseInit(), BootstrapNodeHandle::BootstrapNodeHandle(), BrooseHandle::BrooseHandle(), Gia::changeState(), Bamboo::changeState(), Quon::changeState(), Pastry::changeState(), Vast::changeState(), TreeManagement::checkParentValid(), Pastry::checkProxCache(), oversim::Chord::closestPreceedingNode(), GiaNeighborCandidateList::contains(), Nps::coordsReqRpcResponse(), KBRTestApp::createDestKey(), BasePastry::createStateMessage(), Quon::deleteSite(), KBRTestApp::deliver(), Bamboo::doGlobalTuning(), Bamboo::doLocalTuning(), Pastry::doRoutingTableMaintenance(), Pastry::doSecondStage(), PastryLeafSet::estimateMeanDistance(), ConnectivityProbe::extractTopology(), PastryRoutingTable::findCloserNode(), oversim::Koorde::findDeBruijnHop(), MyOverlay::findNode(), BasePastry::finishOverlay(), Gia::forwardMessage(), Gia::forwardSearchResponseMessage(), PastryLeafSet::getBiggestKey(), PastryLeafSet::getDestinationNode(), Quon::getKey(), TreeManagement::getResponsibleDomainKey(), Gia::getRoute(), PastryLeafSet::getSmallestKey(), NTree::handleAddMessage(), Vast::handleAppMessage(), Quon::handleAppMessage(), oversim::Nice::handleAppMessage(), BaseOverlay::handleBaseOverlayMessage(), Kademlia::handleBucketRefreshTimerExpired(), Pastry::handleFailedNode(), Quon::handleInvalidNode(), KBRTestApp::handleLookupResponse(), BootstrapList::handleLookupResponse(), Quon::handleNodeLeave(), Vast::handleNodeLeaveNotification(), Quon::handleNodeMove(), Pastry::handlePastryJoinCall(), Pastry::handlePastryJoinResponse(), BasePastry::handleRequestLeafSetCall(), Bamboo::handleRequestLeafSetResponse(), Pastry::handleRequestLeafSetResponse(), BasePastry::handleRequestLeafSetResponse(), Pastry::handleRequestRepairCall(), Pastry::handleRequestRepairResponse(), BasePastry::handleRequestRoutingRowCall(), Pastry::handleRequestRoutingRowResponse(), BasePastry::handleRequestRoutingRowResponse(), Pastry::handleRequestStateCall(), Pastry::handleRequestStateResponse(), IterativePathLookup::handleResponse(), Pastry::handleRpcCall(), BasePastry::handleRpcCall(), DiscoveryMode::handleRpcResponse(), Bamboo::handleRpcResponse(), Pastry::handleRpcResponse(), KBRTestApp::handleRpcResponse(), Kademlia::handleRpcResponse(), BasePastry::handleRpcResponse(), oversim::Chord::handleRpcStabilizeResponse(), TreeManagement::handleRpcTimeout(), Pastry::handleRpcTimeout(), KBRTestApp::handleRpcTimeout(), Kademlia::handleRpcTimeout(), BasePastry::handleRpcTimeout(), Pastry::handleStateMessage(), Bamboo::handleStateMessage(), MyOverlay::handleTimerEvent(), Pastry::handleTimerEvent(), Bamboo::handleTimerEvent(), NeighborCache::handleTimerEvent(), Vast::handleUDPMessage(), Quon::handleUDPMessage(), Pastry::handleUDPMessage(), Gia::handleUDPMessage(), SimpleGameClient::initializeApp(), BrooseBucket::initializeBucket(), PastryLeafSet::insertLeaf(), BaseRpc::internalHandleRpcMessage(), BaseApp::internalSendRpcResponse(), BaseOverlay::internalSendRpcResponse(), PastryStateObject::isCloser(), PastryLeafSet::isClosestNode(), MyOverlay::isSiblingFor(), Broose::isSiblingFor(), BasePastry::isSiblingFor(), Kademlia::isSiblingFor(), oversim::Chord::isSiblingFor(), oversim::Chord::joinForeignPartition(), Kademlia::joinOverlay(), KeyExtractor< LookupEntry >::key(), KeyExtractor< NodeHandle >::key(), KeyExtractor< ProxNodeHandle >::key(), KeyExtractor< KademliaBucketEntry >::key(), KeyExtractor< MarkedNodeHandle >::key(), BrooseBucket::keyInRange(), BootstrapList::locateBootstrapNode(), IterativeLookup::lookup(), Bamboo::lookupFinished(), PastryRoutingTable::lookupNextHop(), PastryLeafSet::mergeNode(), PastryRoutingTable::mergeNode(), Pastry::mergeState(), BasePastry::newLeafs(), BrooseHandle::operator!=(), operator<<(), GiaNode::operator=(), BrooseHandle::operator=(), BrooseHandle::operator==(), BrooseBucket::output(), BasePastry::pingNodes(), Pastry::pingResponse(), NeighborCache::prepareOverlay(), Quon::processAliveTimer(), Gia::processSearchMessage(), Pastry::processState(), BasePastry::proxCallback(), Quon::purgeSites(), Kademlia::routingAdd(), Kademlia::routingBucketIndex(), Kademlia::routingInit(), oversim::Chord::rpcNotify(), Vast::sendDiscardNode(), Quon::sendMessage(), Vast::sendMessage(), TreeManagement::sendMessageToParent(), DiscoveryMode::sendNewRequest(), IterativePathLookup::sendRpc(), BaseRpc::sendRpcResponse(), Gia::sendSearchResponseMessage(), Kademlia::sendSiblingFindNodeCall(), Quon::sendToApp(), Vast::sendToApp(), Kademlia::setBucketUsage(), NeighborCache::setCbrNodeId(), PastryStateObject::specialCloserCondition(), GlobalViewBuilder::spreadGlobalView(), DiscoveryMode::start(), IterativeLookup::start(), DiscoveryMode::stop(), IterativeLookup::stop(), Scribe::update(), DHT::update(), P2pns::updateIdCacheWithNewTransport(), oversim::ChordSuccessorList::updateList(), NeighborCache::updateNcsInfo(), Gia::updateNeighborList(), NeighborCache::updateNode(), and Quon::updateThisSite().
bool NodeHandle::isUnspecified | ( | ) | const |
indicates if this NodeHandle is specified
Reimplemented from TransportAddress.
Definition at line 88 of file NodeHandle.cc.
Referenced by Gia::acceptNode(), GiaNeighborCandidateList::add(), assertUnspecified(), Vast::buildVoronoi(), BaseOverlay::callUpdate(), Gia::changeState(), Scribe::checkGroupEmpty(), TreeManagement::checkParentValid(), oversim::Chord::closestPreceedingNode(), BasePastry::createLookup(), Pastry::endProcessingState(), PubSubLobby::failedNode(), PastryRoutingTable::findCloserNode(), PastryLeafSet::findCloserNode(), PastryRoutingTable::findCloserNodes(), BasePastry::findNode(), Gia::forwardMessage(), Gia::forwardSearchResponseMessage(), GiaNeighbors::get(), GlobalNodeList::getBootstrapNode(), TreeManagement::handleChildCheckRpcCall(), BaseApp::handleCommonAPIMessage(), GlobalViewBuilder::handleCoordinateRpcCall(), GlobalViewBuilder::handleCoordSendTimer(), NTree::handleDivideResponse(), PubSubMMOG::handleIntermediateResponse(), PubSubLobby::handleJoin(), PubSubMMOG::handleJoinResponse(), PubSubMMOG::handleMove(), TreeManagement::handleParentRequestRpcResponse(), PubSubMMOG::handlePingCallTimeout(), CBRDHT::handlePutRequest(), DHT::handlePutRequest(), Pastry::handleRequestLeafSetResponse(), Pastry::handleRequestRoutingRowResponse(), PubSubLobby::handleRespCall(), oversim::Chord::handleRpcFixfingersResponse(), oversim::Chord::handleRpcJoinResponse(), oversim::Chord::handleRpcStabilizeResponse(), TreeManagement::handleRpcTimeout(), PubSubMMOG::handleSubscriptionBackup(), Scribe::handleTimerEvent(), Gia::handleTimerEvent(), PubSubMMOG::handleUnsubscribeBackup(), BaseRpc::internalHandleRpcMessage(), BaseApp::internalSendRpcResponse(), BaseOverlay::internalSendRpcResponse(), PastryStateObject::isCloser(), TreeManagement::isParent(), TreeManagement::isRoot(), Gia::joinOverlay(), BootstrapList::locateBootstrapNode(), PastryRoutingTable::lookupNextHop(), BrooseHandle::operator!=(), operator<<(), BrooseHandle::operator==(), BasePastry::pingNodes(), BootstrapList::pingResponse(), BasePastry::prePing(), TreeManagement::removeParentConnection(), PastryRoutingTable::repair(), Kademlia::routingAdd(), oversim::Chord::rpcJoin(), oversim::Chord::rpcNotify(), Vast::sendMessage(), PubSubMMOG::sendMessageToChildren(), BaseOverlay::sendToKey(), PubSubMMOG::unsubscribeChild(), and P2pns::updateIdCacheWithNewTransport().
|
virtual |
serializes the object into a buffer
b | the buffer |
Definition at line 191 of file NodeHandle.cc.
Referenced by doPacking().
|
virtual |
deserializes the object from a buffer
b | the buffer |
Definition at line 199 of file NodeHandle.cc.
Referenced by doUnpacking().
bool NodeHandle::operator!= | ( | const NodeHandle & | rhs | ) | const |
compares this NodeHandle to another given NodeHandle
rhs | the NodeHandle this is compared to |
Definition at line 112 of file NodeHandle.cc.
bool NodeHandle::operator< | ( | const NodeHandle & | rhs | ) | const |
compares this to a given NodeHandle
rhs | the NodeHandle this is compared to |
Definition at line 119 of file NodeHandle.cc.
Referenced by operator>=().
bool NodeHandle::operator<= | ( | const NodeHandle & | rhs | ) | const |
compares this to a given NodeHandle
rhs | the NodeHandle this is compared to |
Definition at line 159 of file NodeHandle.cc.
NodeHandle & NodeHandle::operator= | ( | const NodeHandle & | rhs | ) |
assigns key, ip and port of rhs to this->key, this->ip and this->port
rhs | the NodeHandle with the defined key, ip and port |
Reimplemented in GiaNode.
Definition at line 94 of file NodeHandle.cc.
bool NodeHandle::operator== | ( | const NodeHandle & | rhs | ) | const |
compares this NodeHandle to another given NodeHandle
rhs | the NodeHandle this is compared to |
Definition at line 104 of file NodeHandle.cc.
Referenced by operator!=().
bool NodeHandle::operator> | ( | const NodeHandle & | rhs | ) | const |
compares this to a given NodeHandle
rhs | the NodeHandle this is compared to |
Definition at line 139 of file NodeHandle.cc.
Referenced by operator<=().
bool NodeHandle::operator>= | ( | const NodeHandle & | rhs | ) | const |
compares this to a given NodeHandle
rhs | the NodeHandle this is compared to |
Definition at line 165 of file NodeHandle.cc.
void NodeHandle::setKey | ( | const OverlayKey & | key | ) |
saves given key to NodeHandle::key
key | the given key |
Definition at line 171 of file NodeHandle.cc.
Referenced by Vast::initializeOverlay(), Quon::initializeOverlay(), MyOverlay::joinOverlay(), NodeHandle(), Vast::sendDiscardNode(), NeighborCache::setCbrNodeId(), and MyOverlay::setOwnNodeID().
|
friend |
standard output stream for NodeHandle, gives out ip, port and key
os | the ostream |
n | the NodeHandle |
Definition at line 31 of file NodeHandle.cc.
|
protected |
the OverlayKey of this NodeHandle
Definition at line 56 of file NodeHandle.h.
Referenced by BootstrapNodeHandle::BootstrapNodeHandle(), BrooseHandle::BrooseHandle(), getKey(), isUnspecified(), netPack(), netUnpack(), NodeHandle(), BrooseHandle::operator!=(), operator<(), operator<<(), GiaNode::operator=(), BrooseHandle::operator=(), operator=(), BrooseHandle::operator==(), operator==(), operator>(), and setKey().
|
static |
the unspecified NodeHandle
Definition at line 107 of file NodeHandle.h.
Referenced by PastryLeafSet::balanceLeafSet(), oversim::Koorde::changeState(), oversim::Chord::changeState(), TreeManagement::cleanup(), oversim::Chord::closestPreceedingNode(), NTree::collapseTree(), Nps::coordsReqRpcResponse(), PastryLeafSet::failedNode(), PastryRoutingTable::failedNode(), PastryNeighborhoodSet::findCloserNode(), PastryRoutingTable::findCloserNode(), PastryLeafSet::findCloserNode(), GiaNeighborCandidateList::get(), BootstrapList::getBootstrapNode(), GlobalNodeList::getBootstrapNode(), NTreeNode::getChildForPos(), PastryStateObject::getDestinationNode(), PastryLeafSet::getDestinationNode(), LoginCache::getLoginNode(), GiaMessageBookkeeping::getNextHop(), GlobalNodeList::getRandomNode(), DHTDataStorage::getSourceNode(), oversim::ChordSuccessorList::getSuccessor(), PubSubMMOG::handleBackupCallTimeout(), BaseApp::handleCommonAPIMessage(), oversim::ChordFingerTable::handleFailedNode(), oversim::Koorde::handleFailedNode(), oversim::Chord::handleFailedNode(), IterativePathLookup::handleFailedNodeResponse(), PubSubMMOG::handlePingCallTimeout(), Scribe::handlePublishResponse(), TreeManagement::handleRpcTimeout(), oversim::Chord::handleStabilizeTimerExpired(), IterativePathLookup::handleTimeout(), PastryLeafSet::initializeSet(), BaseRpc::internalHandleRpcMessage(), BaseApp::internalSendRpcResponse(), BaseOverlay::internalSendRpcResponse(), PastryRoutingTable::lookupNextHop(), PubSubSubspace::PubSubSubspace(), PubSubSubspaceResponsible::PubSubSubspaceResponsible(), QuonSite::QuonSite(), oversim::ChordFingerTable::removeFinger(), TreeManagement::removeParentConnection(), ScribeGroup::ScribeGroup(), oversim::ChordFingerTable::setFinger(), Site::Site(), oversim::ChordFingerTable::updateFinger(), and oversim::Koorde::walkDeBruijnList().