#include <source/ariba/overlay/BaseOverlay.h>
Inherits ariba::utility::MessageReceiver, ariba::communication::CommunicationEvents, ariba::overlay::OverlayStructureEvents, and ariba::utility::Timer.
Classes | |
class | relay_route |
relay route definitions More... | |
Public Member Functions | |
BaseOverlay () | |
virtual | ~BaseOverlay () |
void | start (BaseCommunication &_basecomm, const NodeID &_nodeid) |
void | stop () |
bool | isStarted () |
const LinkID | establishLink (const EndpointDescriptor &ep, const NodeID &node, const ServiceID &service) |
Tries to establish a direct or overlay link. | |
const LinkID | establishLink (const NodeID &remote, const ServiceID &service=OverlayInterface::OVERLAY_SERVICE_ID) |
establishes a link between two arbitrary nodes | |
const LinkID | establishDirectLink (const EndpointDescriptor &endpoint, const ServiceID &service=OverlayInterface::OVERLAY_SERVICE_ID) |
call base communication's establish link and add link mapping | |
void | dropLink (const LinkID &link) |
drops a link | |
seqnum_t | sendMessage (const Message *message, const LinkID &link) |
sends a message over an existing link | |
seqnum_t | sendMessage (const Message *message, const NodeID &remote, const ServiceID &service=OverlayInterface::OVERLAY_SERVICE_ID) |
sends a message to a node and a specific service | |
void | broadcastMessage (Message *message, const ServiceID &service) |
const EndpointDescriptor & | getEndpointDescriptor (const LinkID &link=LinkID::UNSPECIFIED) const |
vector< NodeID > | getOverlayNeighbors (bool deep=true) const |
return the overlay neighbors | |
const EndpointDescriptor & | getEndpointDescriptor (const NodeID &node) const |
bool | bind (CommunicationListener *listener, const ServiceID &sid) |
bool | unbind (CommunicationListener *listener, const ServiceID &sid) |
bool | bind (NodeListener *listener) |
bool | unbind (NodeListener *listener) |
bool | registerSidePort (SideportListener *_sideport) |
bool | unregisterSidePort (SideportListener *_sideport) |
const NodeID & | getNodeID (const LinkID &lid=LinkID::UNSPECIFIED) const |
vector< LinkID > | getLinkIDs (const NodeID &nid=NodeID::UNSPECIFIED) const |
void | joinSpoVNet (const SpoVNetID &id, const EndpointDescriptor &boot=EndpointDescriptor::UNSPECIFIED()) |
void | createSpoVNet (const SpoVNetID &id, const OverlayParameterSet ¶m=OverlayParameterSet::DEFAULT, const SecurityParameterSet &sec=SecurityParameterSet::DEFAULT, const QoSParameterSet &qos=QoSParameterSet::DEFAULT) |
void | startBootstrapModules (vector< pair< BootstrapManager::BootstrapType, string > > modules) |
void | stopBootstrapModules () |
void | leaveSpoVNet () |
void | dhtPut (const Data &key, const Data &value, int ttl=0, bool replace=false, bool no_local_refresh=false) |
put a value to the DHT with a ttl given in seconds | |
void | dhtRemove (const Data &key, const Data &value) |
removes a key value pair from the DHT | |
void | dhtRemove (const Data &key) |
removes all data stored at the given key | |
void | dhtGet (const Data &key, const ServiceID &service) |
requests data stored using key | |
Protected Member Functions | |
virtual void | onLinkUp (const LinkID &id, const address_v *local, const address_v *remote) |
virtual void | onLinkDown (const LinkID &id, const address_v *local, const address_v *remote) |
virtual void | onLinkChanged (const LinkID &id, const address_v *oldlocal, const address_v *newlocal, const address_v *oldremote, const address_v *newremote) |
virtual void | onLinkFail (const LinkID &id, const address_v *local, const address_v *remote) |
virtual void | onLinkQoSChanged (const LinkID &id, const address_v *local, const address_v *remote, const QoSParameterSet &qos) |
virtual bool | onLinkRequest (const LinkID &id, const address_v *local, const address_v *remote) |
virtual bool | receiveMessage (const Message *message, const LinkID &link, const NodeID &) |
handles a message from base communication | |
virtual void | onNodeJoin (const NodeID &node) |
virtual void | eventFunction () |
std::string | getLinkHTMLInfo () |
Private Types | |
enum | _BaseOverlayState { BaseOverlayStateInvalid = 0, BaseOverlayStateCompleted = 1 } |
The state of the BaseOverlay. More... | |
typedef enum ariba::overlay::BaseOverlay::_BaseOverlayState | BaseOverlayState |
The state of the BaseOverlay. | |
typedef vector< NodeListener * > | NodeListenerVector |
the node listeners | |
typedef vector< NodeID > | JoiningNodes |
Private Member Functions | |
use_logging_h (BaseOverlay) | |
CommunicationListener * | getListener (const ServiceID &id) |
bool | handleMessage (const Message *message, LinkDescriptor *ld, const LinkID bcLink=LinkID::UNSPECIFIED) |
demultiplexes a incoming message with link descriptor | |
bool | handleData (OverlayMsg *msg, LinkDescriptor *ld) |
bool | handleSignaling (OverlayMsg *msg, LinkDescriptor *ld) |
bool | handleJoinRequest (OverlayMsg *msg, const LinkID &bcLink) |
Handle spovnet instance join requests. | |
bool | handleJoinReply (OverlayMsg *msg, const LinkID &bcLink) |
Handle replies to spovnet instance join requests. | |
bool | handleDHTMessage (OverlayMsg *msg) |
bool | handleLinkRequest (OverlayMsg *msg, LinkDescriptor *ld) |
handle a link request and reply | |
bool | handleLinkReply (OverlayMsg *msg, LinkDescriptor *ld) |
bool | handleLinkUpdate (OverlayMsg *msg, LinkDescriptor *ld) |
bool | handleLinkDirect (OverlayMsg *msg, LinkDescriptor *ld) |
handle a direct link message | |
bool | handleLinkAlive (OverlayMsg *msg, LinkDescriptor *ld) |
handle a keep-alive message for a link | |
void | eraseDescriptor (const LinkID &link, bool communication=false) |
erases a link descriptor | |
LinkDescriptor * | getDescriptor (const LinkID &link, bool communication=false) |
returns a link descriptor for the given id | |
const LinkDescriptor * | getDescriptor (const LinkID &link, bool communication=false) const |
returns a link descriptor for the given id | |
LinkDescriptor * | getAutoDescriptor (const NodeID &node, const ServiceID &service) |
returns a auto-link descriptor for the given node and service id | |
LinkDescriptor * | addDescriptor (const LinkID &link=LinkID::UNSPECIFIED) |
adds a new link descriptor or uses an existing one | |
void | stabilizeLinks () |
stabilizes link information | |
void | showLinks () |
print the currently known links | |
int | compare (const LinkID &lhs, const LinkID &rhs) |
compares two arbitrary links to the same node | |
void | stabilizeRelays () |
stabilize relay information | |
void | refreshRelayInformation (const OverlayMsg *message, LinkDescriptor *ld) |
refreshes relay information | |
LinkDescriptor * | getRelayLinkTo (const NodeID &remote) |
returns a known relay link | |
void | removeRelayLink (const LinkID &link) |
removes relay link information | |
void | removeRelayNode (const NodeID &link) |
removes relay node information | |
void | route (OverlayMsg *message) |
routes a message to its destination node | |
seqnum_t | send (OverlayMsg *message, const NodeID &destination) |
sends a raw message to another node, delivers it to the base overlay class | |
seqnum_t | send (OverlayMsg *message, LinkDescriptor *ld, bool ignore_down=false) |
send a raw message using a link descriptor, delivers it to the base overlay class | |
seqnum_t | send_node (OverlayMsg *message, const NodeID &remote, const ServiceID &service=OverlayInterface::OVERLAY_SERVICE_ID) |
seqnum_t | send_link (OverlayMsg *message, const LinkID &link, bool ignore_down=false) |
void | initDHT () |
void | destroyDHT () |
void | stabilizeDHT () |
stabilize DHT state | |
void | dhtSend (OverlayMsg *msg, const NodeID &dest) |
std::string | debugInformation () |
void | updateVisual () |
Private Attributes | |
bool | started |
is the base overlay started yet | |
BaseOverlayState | state |
Current Base-Overlay state. | |
BaseCommunication * | bc |
reference to the base communication | |
NodeID | nodeId |
the node id of this node | |
SpoVNetID | spovnetId |
the spovnet id of the currently joined overlay | |
vector< LinkID > | bootstrapLinks |
the link id of the link to the initiator node | |
NodeID | spovnetInitiator |
The initiator node. | |
Demultiplexer < CommunicationListener *, ServiceID > | communicationListeners |
the service id communication listeners | |
NodeListenerVector | nodeListeners |
SideportListener * | sideport |
the sideport listener | |
OverlayInterface * | overlayInterface |
the used overlay structure | |
OverlayBootstrap | overlayBootstrap |
Bootstrapper for our spovnet. | |
int | counter |
link state information counter | |
vector< LinkDescriptor * > | links |
The link mapping of the node. | |
vector< relay_route > | relay_routes |
DHT * | dht |
DHT * | localDHT |
int | republishCounter |
JoiningNodes | joiningNodes |
Friends | |
class | OneHop |
class | Chord |
class | ariba::SideportListener |
Definition at line 119 of file BaseOverlay.h.
typedef enum ariba::overlay::BaseOverlay::_BaseOverlayState ariba::overlay::BaseOverlay::BaseOverlayState [private] |
The state of the BaseOverlay.
typedef vector<NodeID> ariba::overlay::BaseOverlay::JoiningNodes [private] |
nodes with pending joines. TODO: should be cleaned every some seconds, add timestamps to each, and check on occasion
Definition at line 527 of file BaseOverlay.h.
typedef vector<NodeListener*> ariba::overlay::BaseOverlay::NodeListenerVector [private] |
the node listeners
Definition at line 388 of file BaseOverlay.h.
enum ariba::overlay::BaseOverlay::_BaseOverlayState [private] |
The state of the BaseOverlay.
Definition at line 371 of file BaseOverlay.h.
ariba::overlay::BaseOverlay::BaseOverlay | ( | ) |
Constructs an empty non-functional base overlay instance
Definition at line 758 of file BaseOverlay.cpp.
References initDHT().
ariba::overlay::BaseOverlay::~BaseOverlay | ( | ) | [virtual] |
Destructs a base overlay instance
Definition at line 767 of file BaseOverlay.cpp.
References destroyDHT().
LinkDescriptor * ariba::overlay::BaseOverlay::addDescriptor | ( | const LinkID & | link = LinkID::UNSPECIFIED |
) | [private] |
adds a new link descriptor or uses an existing one
adds a link descriptor
Definition at line 307 of file BaseOverlay.cpp.
References getDescriptor(), ariba::utility::Identifier::isUnspecified(), links, and ariba::overlay::LinkDescriptor::overlayId.
Referenced by establishDirectLink(), establishLink(), handleLinkRequest(), and onLinkUp().
bool ariba::overlay::BaseOverlay::bind | ( | NodeListener * | listener | ) |
Definition at line 1224 of file BaseOverlay.cpp.
References logging_debug, logging_warn, and nodeListeners.
bool ariba::overlay::BaseOverlay::bind | ( | CommunicationListener * | listener, | |
const ServiceID & | sid | |||
) |
Definition at line 1189 of file BaseOverlay.cpp.
References communicationListeners, logging_debug, logging_error, and ariba::utility::ServiceID::toString().
Referenced by ariba::Node::bind(), and ariba::overlay::OverlayInterface::OverlayInterface().
Send out a message to all nodes that are known in the overlay structure. Depending on the structure of the overlay, this can be very different.
Definition at line 1910 of file BaseOverlay.cpp.
References ariba::overlay::OverlayInterface::getKnownNodes(), logging_debug, nodeId, overlayInterface, sendMessage(), and ariba::utility::ServiceID::toString().
Referenced by ariba::Node::sendBroadcastMessage().
compares two arbitrary links to the same node
Definition at line 469 of file BaseOverlay.cpp.
References getDescriptor(), ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::remoteLink, ariba::overlay::LinkDescriptor::remoteNode, and ariba::overlay::LinkDescriptor::up.
Referenced by ariba::overlay::Chord::onLinkUp().
void ariba::overlay::BaseOverlay::createSpoVNet | ( | const SpoVNetID & | id, | |
const OverlayParameterSet & | param = OverlayParameterSet::DEFAULT , |
|||
const SecurityParameterSet & | sec = SecurityParameterSet::DEFAULT , |
|||
const QoSParameterSet & | qos = QoSParameterSet::DEFAULT | |||
) |
Initiates a new spontaneous virtual network. This makes this BaseOverlay to the SpoVNet-Initiator.
id | The spovnet identifier |
Definition at line 912 of file BaseOverlay.cpp.
References BaseOverlayStateInvalid, ariba::overlay::OverlayFactory::create(), logging_fatal, logging_info, nodeId, nodeListeners, ariba::NodeListener::onJoinFailed(), overlayInterface, spovnetId, state, ariba::utility::Identifier::toString(), visual, visualIdBase, and visualIdOverlay.
Referenced by ariba::Node::initiate().
std::string ariba::overlay::BaseOverlay::debugInformation | ( | ) | [private] |
Definition at line 2325 of file BaseOverlay.cpp.
References ariba::overlay::OverlayInterface::debugInformation(), links, and overlayInterface.
Referenced by getEndpointDescriptor(), and send().
void ariba::overlay::BaseOverlay::destroyDHT | ( | ) | [private] |
Definition at line 2119 of file BaseOverlay.cpp.
Referenced by ~BaseOverlay().
requests data stored using key
Definition at line 2287 of file BaseOverlay.cpp.
References dhtSend(), DataTpl< T, DataModel >::getBuffer(), DataTpl< T, DataModel >::getLength(), logging_info, ariba::overlay::OverlayMsg::setService(), ariba::utility::Identifier::sha1(), ariba::utility::ServiceID::toString(), and ariba::overlay::OverlayMsg::typeDHTGet.
Referenced by ariba::Node::get().
void ariba::overlay::BaseOverlay::dhtPut | ( | const Data & | key, | |
const Data & | value, | |||
int | ttl = 0 , |
|||
bool | replace = false , |
|||
bool | no_local_refresh = false | |||
) |
put a value to the DHT with a ttl given in seconds
Definition at line 2230 of file BaseOverlay.cpp.
References dhtSend(), DataTpl< T, DataModel >::getBuffer(), DataTpl< T, DataModel >::getLength(), localDHT, logging_info, ariba::overlay::DHT::put(), ariba::overlay::DHT::remove(), ariba::utility::Identifier::sha1(), and ariba::overlay::OverlayMsg::typeDHTPut.
Referenced by ariba::Node::put(), and stabilizeDHT().
void ariba::overlay::BaseOverlay::dhtRemove | ( | const Data & | key | ) |
removes all data stored at the given key
Definition at line 2272 of file BaseOverlay.cpp.
References dhtSend(), DataTpl< T, DataModel >::getBuffer(), DataTpl< T, DataModel >::getLength(), logging_info, ariba::utility::Identifier::sha1(), and ariba::overlay::OverlayMsg::typeDHTRemove.
removes a key value pair from the DHT
Definition at line 2257 of file BaseOverlay.cpp.
References dhtSend(), DataTpl< T, DataModel >::getBuffer(), DataTpl< T, DataModel >::getLength(), localDHT, ariba::overlay::DHT::remove(), ariba::utility::Identifier::sha1(), and ariba::overlay::OverlayMsg::typeDHTRemove.
void ariba::overlay::BaseOverlay::dhtSend | ( | OverlayMsg * | msg, | |
const NodeID & | dest | |||
) | [private] |
set source and destination
Definition at line 2303 of file BaseOverlay.cpp.
References data_serialize(), ariba::overlay::OverlayMsg::getDestinationNode(), handleDHTMessage(), ariba::overlay::OverlayInterface::isClosestNodeTo(), logging_info, nodeId, overlayInterface, send(), ariba::overlay::OverlayMsg::setDestinationNode(), ariba::overlay::OverlayMsg::setSourceNode(), and ariba::utility::Identifier::toString().
Referenced by dhtGet(), dhtPut(), dhtRemove(), and handleDHTMessage().
void ariba::overlay::BaseOverlay::dropLink | ( | const LinkID & | link | ) |
drops a link
drops an established link
Definition at line 1014 of file BaseOverlay.cpp.
References bc, ariba::communication::BaseCommunication::dropLink(), eraseDescriptor(), getDescriptor(), logging_info, logging_warn, ariba::SideportListener::onLinkDown(), sideport, and ariba::utility::Identifier::toString().
Referenced by ariba::Node::dropLink(), ariba::overlay::Chord::eventFunction(), handleLinkUpdate(), leaveSpoVNet(), ariba::overlay::Chord::onLinkUp(), ariba::overlay::OneHop::onMessage(), ariba::overlay::Chord::onMessage(), and stabilizeLinks().
void ariba::overlay::BaseOverlay::eraseDescriptor | ( | const LinkID & | link, | |
bool | communication = false | |||
) | [private] |
erases a link descriptor
Definition at line 295 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::communicationId, links, and ariba::overlay::LinkDescriptor::overlayId.
Referenced by dropLink(), handleLinkDirect(), and onLinkDown().
const LinkID ariba::overlay::BaseOverlay::establishDirectLink | ( | const EndpointDescriptor & | endpoint, | |
const ServiceID & | service = OverlayInterface::OVERLAY_SERVICE_ID | |||
) |
call base communication's establish link and add link mapping
Starts a link establishment procedure to the specified endpoint and to the specified service
find a service listener
establish link and add mapping
Definition at line 952 of file BaseOverlay.cpp.
References addDescriptor(), bc, ariba::overlay::LinkDescriptor::communicationId, communicationListeners, ariba::communication::BaseCommunication::establishLink(), ariba::overlay::LinkDescriptor::listener, logging_error, logging_info, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::service, ariba::communication::EndpointDescriptor::toString(), ariba::utility::Identifier::toString(), ariba::utility::ServiceID::toString(), and ariba::utility::LinkID::UNSPECIFIED.
Referenced by establishLink(), ariba::overlay::OneHop::joinOverlay(), and ariba::overlay::OneHop::onMessage().
const LinkID ariba::overlay::BaseOverlay::establishLink | ( | const NodeID & | remote, | |
const ServiceID & | service = OverlayInterface::OVERLAY_SERVICE_ID | |||
) |
establishes a link between two arbitrary nodes
Starts a link establishment procedure to the specfied node for the service with id service
node | Destination node id | |
service | Service to connect to | |
linkid | Link identifier to be used with this link |
Definition at line 978 of file BaseOverlay.cpp.
References addDescriptor(), getListener(), ariba::overlay::LinkDescriptor::listener, logging_info, nodeId, ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::remoteNode, send_node(), ariba::overlay::LinkDescriptor::service, ariba::overlay::OverlayMsg::setRegisterRelay(), ariba::overlay::OverlayMsg::setRelayed(), ariba::overlay::OverlayMsg::setSourceLink(), ariba::utility::ServiceID::toString(), ariba::utility::Identifier::toString(), ariba::overlay::OverlayMsg::typeLinkRequest, and ariba::utility::LinkID::UNSPECIFIED.
const LinkID ariba::overlay::BaseOverlay::establishLink | ( | const EndpointDescriptor & | ep, | |
const NodeID & | node, | |||
const ServiceID & | service | |||
) |
Tries to establish a direct or overlay link.
Definition at line 941 of file BaseOverlay.cpp.
References establishDirectLink(), and ariba::utility::Identifier::isUnspecified().
Referenced by ariba::Node::establishLink(), sendMessage(), and ariba::overlay::Chord::setup().
void ariba::overlay::BaseOverlay::eventFunction | ( | ) | [protected, virtual] |
Timer Event method
Reimplemented from ariba::utility::Timer.
Definition at line 1964 of file BaseOverlay.cpp.
References stabilizeDHT(), stabilizeLinks(), stabilizeRelays(), and updateVisual().
LinkDescriptor * ariba::overlay::BaseOverlay::getAutoDescriptor | ( | const NodeID & | node, | |
const ServiceID & | service | |||
) | [private] |
returns a auto-link descriptor for the given node and service id
returns a auto-link descriptor
Definition at line 318 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::autolink, ariba::overlay::LinkDescriptor::keepAliveMissed, links, ariba::overlay::LinkDescriptor::remoteNode, ariba::overlay::LinkDescriptor::service, and ariba::overlay::LinkDescriptor::up.
Referenced by sendMessage().
const LinkDescriptor * ariba::overlay::BaseOverlay::getDescriptor | ( | const LinkID & | link, | |
bool | communication = false | |||
) | const [private] |
returns a link descriptor for the given id
Definition at line 287 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::communicationId, links, and ariba::overlay::LinkDescriptor::overlayId.
LinkDescriptor * ariba::overlay::BaseOverlay::getDescriptor | ( | const LinkID & | link, | |
bool | communication = false | |||
) | [private] |
returns a link descriptor for the given id
Definition at line 280 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::communicationId, links, and ariba::overlay::LinkDescriptor::overlayId.
Referenced by addDescriptor(), compare(), dropLink(), getEndpointDescriptor(), getNodeID(), getRelayLinkTo(), handleLinkAlive(), handleLinkDirect(), handleLinkReply(), onLinkChanged(), onLinkDown(), onLinkFail(), onLinkQoSChanged(), onLinkUp(), receiveMessage(), refreshRelayInformation(), send(), send_link(), sendMessage(), and stabilizeRelays().
const EndpointDescriptor & ariba::overlay::BaseOverlay::getEndpointDescriptor | ( | const NodeID & | node | ) | const |
Returns a end-endpoint descriptor of a overlay neighbor. If the node is not known -- an unspecified endpoint descriptor is returned.
node | The node identifer of a overlay neighbor. |
Definition at line 1137 of file BaseOverlay.cpp.
References bc, ariba::overlay::LinkDescriptor::communicationId, ariba::overlay::LinkDescriptor::communicationUp, debugInformation(), ariba::communication::BaseCommunication::getEndpointDescriptor(), ariba::utility::Identifier::isUnspecified(), links, logging_error, logging_warn, nodeId, overlayInterface, ariba::overlay::LinkDescriptor::remoteNode, and ariba::communication::EndpointDescriptor::UNSPECIFIED().
const EndpointDescriptor & ariba::overlay::BaseOverlay::getEndpointDescriptor | ( | const LinkID & | link = LinkID::UNSPECIFIED |
) | const |
Returns the end-point descriptor of a link.
link | the link id of the requested end-point |
Definition at line 1122 of file BaseOverlay.cpp.
References bc, ariba::overlay::LinkDescriptor::communicationId, getDescriptor(), ariba::communication::BaseCommunication::getEndpointDescriptor(), ariba::utility::Identifier::isUnspecified(), and ariba::communication::EndpointDescriptor::UNSPECIFIED().
Referenced by ariba::utility::PathloadMeasurement::blockingFunction(), ariba::overlay::Chord::discover_neighbors(), ariba::overlay::OneHop::eventFunction(), ariba::SideportListener::getEndpointDescription(), handleJoinRequest(), ariba::overlay::OneHop::onMessage(), ariba::overlay::OneHop::resolveNode(), ariba::overlay::Chord::resolveNode(), ariba::overlay::Chord::send_discovery_to(), and showLinks().
std::string ariba::overlay::BaseOverlay::getLinkHTMLInfo | ( | ) | [protected] |
Definition at line 413 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::isVital(), links, ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::remoteNode, ariba::overlay::LinkDescriptor::routeRecord, ariba::overlay::LinkDescriptor::service, and ariba::utility::Identifier::toString().
Referenced by ariba::SideportListener::getHtmlLinks().
vector< LinkID > ariba::overlay::BaseOverlay::getLinkIDs | ( | const NodeID & | nid = NodeID::UNSPECIFIED |
) | const |
Return all Links for the specified remote nodeid, or all links when the node id given is set to unspecified
nid | The node id to request links for, or unspecified for all links |
Definition at line 1943 of file BaseOverlay.cpp.
References links, ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::remoteNode, and ariba::utility::NodeID::UNSPECIFIED.
Referenced by ariba::SideportListener::getLinkIDs().
CommunicationListener * ariba::overlay::BaseOverlay::getListener | ( | const ServiceID & | id | ) | [private] |
Definition at line 268 of file BaseOverlay.cpp.
References communicationListeners, logging_info, and ariba::utility::ServiceID::toString().
Referenced by establishLink(), handleData(), handleDHTMessage(), handleLinkReply(), handleLinkRequest(), and onLinkDown().
const NodeID & ariba::overlay::BaseOverlay::getNodeID | ( | const LinkID & | lid = LinkID::UNSPECIFIED |
) | const |
Returns the own nodeID or the NodeID of the specified link
lid | The link identifier |
Definition at line 1936 of file BaseOverlay.cpp.
References getDescriptor(), nodeId, ariba::overlay::LinkDescriptor::remoteNode, ariba::utility::NodeID::UNSPECIFIED, and ariba::utility::LinkID::UNSPECIFIED.
Referenced by ariba::SideportListener::getNodeID(), and ariba::Node::getNodeId().
vector< NodeID > ariba::overlay::BaseOverlay::getOverlayNeighbors | ( | bool | deep = true |
) | const |
return the overlay neighbors
Get a list of overlay neighbors.
Definition at line 1928 of file BaseOverlay.cpp.
References ariba::overlay::OverlayInterface::getKnownNodes(), nodeId, and overlayInterface.
Referenced by ariba::overlay::OverlayBootstrap::checkOverlayStatus(), ariba::Node::getNeighborNodes(), ariba::SideportListener::getOverlayNeighbors(), and updateVisual().
LinkDescriptor * ariba::overlay::BaseOverlay::getRelayLinkTo | ( | const NodeID & | remote | ) | [private] |
returns a known relay link
returns a known "vital" relay link which is up and running
Definition at line 736 of file BaseOverlay.cpp.
References getDescriptor(), ariba::overlay::LinkDescriptor::isDirectVital(), ariba::overlay::BaseOverlay::relay_route::link, ariba::overlay::BaseOverlay::relay_route::node, relay_routes, route(), and ariba::overlay::BaseOverlay::relay_route::used.
Referenced by send().
bool ariba::overlay::BaseOverlay::handleData | ( | OverlayMsg * | msg, | |
LinkDescriptor * | ld | |||
) | [private] |
Definition at line 1571 of file BaseOverlay.cpp.
References ariba::overlay::OverlayMsg::getDestinationLink(), getListener(), ariba::overlay::OverlayMsg::getService(), ariba::overlay::OverlayMsg::getSourceNode(), logging_debug, ariba::utility::Identifier::toString(), and ariba::utility::ServiceID::toString().
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::handleDHTMessage | ( | OverlayMsg * | msg | ) | [private] |
Definition at line 2148 of file BaseOverlay.cpp.
References dht, dhtSend(), ariba::overlay::DHTMessage::doReplace(), ariba::overlay::DHT::get(), ariba::overlay::OverlayMsg::getDestinationNode(), ariba::overlay::DHTMessage::getKey(), getListener(), ariba::overlay::OverlayMsg::getService(), ariba::overlay::OverlayMsg::getSourceNode(), ariba::overlay::DHTMessage::getTTL(), ariba::overlay::OverlayMsg::getType(), ariba::overlay::DHTMessage::getValues(), ariba::overlay::DHTMessage::hasValues(), ariba::overlay::OverlayInterface::isClosestNodeTo(), logging_debug, logging_error, logging_info, overlayInterface, ariba::overlay::DHT::put(), ariba::overlay::DHT::remove(), route(), ariba::overlay::OverlayMsg::setType(), ariba::overlay::OverlayMsg::swapRoles(), ariba::utility::ServiceID::toString(), ariba::overlay::OverlayMsg::typeDHTData, ariba::overlay::OverlayMsg::typeDHTGet, ariba::overlay::OverlayMsg::typeDHTPut, and ariba::overlay::OverlayMsg::typeDHTRemove.
Referenced by dhtSend(), and handleMessage().
bool ariba::overlay::BaseOverlay::handleJoinReply | ( | OverlayMsg * | msg, | |
const LinkID & | bcLink | |||
) | [private] |
Handle replies to spovnet instance join requests.
Definition at line 1467 of file BaseOverlay.cpp.
References BaseOverlayStateCompleted, bc, bootstrapLinks, ariba::overlay::OverlayFactory::create(), ariba::overlay::OverlayInterface::createOverlay(), ariba::communication::BaseCommunication::dropLink(), ariba::overlay::JoinReply::getBootstrapEndpoint(), ariba::overlay::JoinReply::getJoinAllowed(), ariba::overlay::JoinReply::getParam(), ariba::overlay::JoinReply::getSpoVNetID(), ariba::utility::Identifier::isUnspecified(), ariba::overlay::OverlayInterface::joinOverlay(), logging_debug, logging_error, logging_info, nodeId, nodeListeners, ariba::NodeListener::onJoinCompleted(), ariba::NodeListener::onJoinFailed(), overlayBootstrap, overlayInterface, ariba::overlay::OverlayBootstrap::recordJoin(), spovnetId, state, ariba::communication::EndpointDescriptor::toString(), and ariba::utility::Identifier::toString().
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::handleJoinRequest | ( | OverlayMsg * | msg, | |
const LinkID & | bcLink | |||
) | [private] |
Handle spovnet instance join requests.
Definition at line 1426 of file BaseOverlay.cpp.
References bc, getEndpointDescriptor(), ariba::overlay::OverlayInterface::getParameters(), ariba::overlay::OverlayMsg::getSourceNode(), ariba::overlay::JoinRequest::getSpoVNetID(), joiningNodes, logging_debug, logging_error, logging_info, nodeId, ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, overlayInterface, ariba::communication::BaseCommunication::sendMessage(), spovnetId, ariba::utility::Identifier::toString(), and ariba::overlay::OverlayMsg::typeJoinReply.
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::handleLinkAlive | ( | OverlayMsg * | msg, | |
LinkDescriptor * | ld | |||
) | [private] |
handle a keep-alive message for a link
Definition at line 1775 of file BaseOverlay.cpp.
References getDescriptor(), ariba::overlay::OverlayMsg::getDestinationLink(), ariba::overlay::OverlayMsg::getRouteRecord(), ariba::overlay::OverlayMsg::isRouteRecord(), logging_debug, logging_error, ariba::overlay::LinkDescriptor::routeRecord, and ariba::overlay::LinkDescriptor::setAlive().
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::handleLinkDirect | ( | OverlayMsg * | msg, | |
LinkDescriptor * | ld | |||
) | [private] |
handle a direct link message
get destination overlay link
Definition at line 1792 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::communicationId, ariba::overlay::LinkDescriptor::communicationUp, eraseDescriptor(), getDescriptor(), ariba::overlay::OverlayMsg::getDestinationLink(), logging_debug, logging_error, logging_info, ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::setAlive(), and ariba::overlay::LinkDescriptor::setAutoUsed().
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::handleLinkReply | ( | OverlayMsg * | msg, | |
LinkDescriptor * | ld | |||
) | [private] |
Definition at line 1713 of file BaseOverlay.cpp.
References bc, ariba::overlay::LinkDescriptor::communicationId, ariba::overlay::LinkDescriptor::endpoint, ariba::communication::BaseCommunication::establishLink(), getDescriptor(), ariba::overlay::OverlayMsg::getDestinationLink(), getListener(), ariba::overlay::OverlayMsg::getService(), ariba::overlay::OverlayMsg::getSourceEndpoint(), ariba::overlay::OverlayMsg::getSourceLink(), ariba::overlay::OverlayMsg::getSourceNode(), ariba::overlay::LinkDescriptor::listener, logging_debug, logging_error, logging_info, logging_warn, ariba::overlay::LinkDescriptor::messageQueue, ariba::CommunicationListener::onLinkUp(), ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::remoteLink, ariba::overlay::LinkDescriptor::remoteNode, ariba::overlay::LinkDescriptor::retryCounter, sendMessage(), ariba::overlay::LinkDescriptor::service, ariba::overlay::LinkDescriptor::setAlive(), ariba::overlay::LinkDescriptor::setAutoUsed(), ariba::communication::EndpointDescriptor::toString(), ariba::utility::ServiceID::toString(), ariba::utility::Identifier::toString(), and ariba::overlay::LinkDescriptor::up.
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::handleLinkRequest | ( | OverlayMsg * | msg, | |
LinkDescriptor * | ld | |||
) | [private] |
handle a link request and reply
Definition at line 1675 of file BaseOverlay.cpp.
References addDescriptor(), bc, ariba::communication::BaseCommunication::getEndpointDescriptor(), getListener(), ariba::overlay::OverlayMsg::getService(), ariba::overlay::OverlayMsg::getSourceLink(), ariba::overlay::OverlayMsg::getSourceNode(), logging_info, send(), ariba::overlay::OverlayMsg::setRelayed(), ariba::overlay::OverlayMsg::setSourceEndpoint(), ariba::overlay::OverlayMsg::setSourceLink(), ariba::overlay::OverlayMsg::setType(), ariba::overlay::OverlayMsg::swapRoles(), and ariba::overlay::OverlayMsg::typeLinkReply.
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::handleLinkUpdate | ( | OverlayMsg * | msg, | |
LinkDescriptor * | ld | |||
) | [private] |
Definition at line 1591 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::autolink, communicationListeners, ariba::CommunicationListener::DEFAULT, dropLink(), ariba::overlay::OverlayMsg::getService(), ariba::overlay::OverlayMsg::getSourceLink(), ariba::overlay::OverlayMsg::getSourceNode(), ariba::overlay::OverlayMsg::isAutoLink(), ariba::overlay::LinkDescriptor::listener, logging_debug, logging_info, logging_warn, ariba::overlay::LinkDescriptor::messageQueue, nodeId, ariba::CommunicationListener::onLinkRequest(), ariba::SideportListener::onLinkUp(), ariba::CommunicationListener::onLinkUp(), ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::remoteLink, ariba::overlay::LinkDescriptor::remoteNode, send(), sendMessage(), ariba::overlay::LinkDescriptor::service, ariba::overlay::LinkDescriptor::setAlive(), ariba::overlay::LinkDescriptor::setAutoUsed(), ariba::overlay::OverlayMsg::setService(), ariba::overlay::OverlayMsg::setSourceLink(), ariba::overlay::OverlayMsg::setSourceNode(), sideport, ariba::overlay::OverlayMsg::swapRoles(), ariba::utility::ServiceID::toString(), ariba::utility::Identifier::toString(), and ariba::overlay::LinkDescriptor::up.
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::handleMessage | ( | const Message * | message, | |
LinkDescriptor * | ld, | |||
const LinkID | bcLink = LinkID::UNSPECIFIED | |||
) | [private] |
demultiplexes a incoming message with link descriptor
handles an incoming message
Definition at line 1819 of file BaseOverlay.cpp.
References handleData(), handleDHTMessage(), handleJoinReply(), handleJoinRequest(), handleLinkAlive(), handleLinkDirect(), handleLinkReply(), handleLinkRequest(), handleLinkUpdate(), logging_debug, logging_error, ariba::overlay::OverlayMsg::maskDHTResponse, nodeId, ariba::overlay::OverlayInterface::onMessage(), overlayInterface, refreshRelayInformation(), route(), ariba::overlay::OverlayMsg::typeData, ariba::overlay::OverlayMsg::typeJoinReply, ariba::overlay::OverlayMsg::typeJoinRequest, ariba::overlay::OverlayMsg::typeLinkAlive, ariba::overlay::OverlayMsg::typeLinkDirect, ariba::overlay::OverlayMsg::typeLinkReply, ariba::overlay::OverlayMsg::typeLinkRequest, ariba::overlay::OverlayMsg::typeLinkUpdate, ariba::overlay::OverlayMsg::typeSignalingEnd, ariba::overlay::OverlayMsg::typeSignalingStart, ariba::utility::LinkID::UNSPECIFIED, and ariba::utility::NodeID::UNSPECIFIED.
Referenced by receiveMessage(), route(), and send().
bool ariba::overlay::BaseOverlay::handleSignaling | ( | OverlayMsg * | msg, | |
LinkDescriptor * | ld | |||
) | [private] |
void ariba::overlay::BaseOverlay::initDHT | ( | ) | [private] |
Definition at line 2113 of file BaseOverlay.cpp.
References dht, localDHT, and republishCounter.
Referenced by BaseOverlay().
bool ariba::overlay::BaseOverlay::isStarted | ( | ) |
Is the BaseOverlay instance started up yet
Definition at line 812 of file BaseOverlay.cpp.
References started.
Referenced by ariba::Node::initiate(), and ariba::Node::join().
void ariba::overlay::BaseOverlay::joinSpoVNet | ( | const SpoVNetID & | id, | |
const EndpointDescriptor & | boot = EndpointDescriptor::UNSPECIFIED() | |||
) |
Join a existing sponaneous virtual network (spovnet).
id | A spovnet identifier | |
boot | A bootstrap node |
Definition at line 818 of file BaseOverlay.cpp.
References BaseOverlayStateCompleted, BaseOverlayStateInvalid, bc, bootstrapLinks, ariba::communication::BaseCommunication::establishLink(), ariba::communication::EndpointDescriptor::isUnspecified(), ariba::overlay::OverlayInterface::joinOverlay(), logging_error, logging_info, nodeId, nodeListeners, ariba::NodeListener::onJoinCompleted(), overlayInterface, spovnetId, state, ariba::communication::EndpointDescriptor::toString(), and ariba::utility::Identifier::toString().
Referenced by ariba::overlay::OverlayBootstrap::checkOverlayStatus(), ariba::overlay::OverlayBootstrap::handleSystemEvent(), and ariba::Node::join().
void ariba::overlay::BaseOverlay::leaveSpoVNet | ( | ) |
Let the node leave the SpoVNet.
Definition at line 871 of file BaseOverlay.cpp.
References BaseOverlayStateInvalid, bc, bootstrapLinks, ariba::communication::BaseCommunication::dropLink(), dropLink(), ariba::overlay::OverlayInterface::leaveOverlay(), links, logging_debug, logging_info, nodeId, nodeListeners, ariba::NodeListener::onLeaveCompleted(), ariba::NodeListener::onLeaveFailed(), ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, ariba::overlay::LinkDescriptor::overlayId, overlayInterface, ariba::overlay::LinkDescriptor::service, spovnetId, state, visual, visualIdBase, and visualIdOverlay.
Referenced by ariba::Node::leave().
void ariba::overlay::BaseOverlay::onLinkChanged | ( | const LinkID & | id, | |
const address_v * | oldlocal, | |||
const address_v * | newlocal, | |||
const address_v * | oldremote, | |||
const address_v * | newremote | |||
) | [protected, virtual] |
Reimplemented from ariba::communication::CommunicationEvents.
Definition at line 1364 of file BaseOverlay.cpp.
References getDescriptor(), ariba::overlay::LinkDescriptor::listener, logging_debug, nodeId, ariba::SideportListener::onLinkChanged(), ariba::CommunicationListener::onLinkChanged(), ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::remoteNode, ariba::overlay::LinkDescriptor::setAutoUsed(), and sideport.
void ariba::overlay::BaseOverlay::onLinkDown | ( | const LinkID & | id, | |
const address_v * | local, | |||
const address_v * | remote | |||
) | [protected, virtual] |
Reimplemented from ariba::communication::CommunicationEvents.
Definition at line 1330 of file BaseOverlay.cpp.
References bootstrapLinks, ariba::overlay::LinkDescriptor::communicationUp, eraseDescriptor(), ariba::overlay::LinkDescriptor::flushQueue(), getDescriptor(), getListener(), ariba::utility::ServiceID::isUnspecified(), logging_info, logging_warn, ariba::overlay::LinkDescriptor::messageQueue, nodeId, ariba::SideportListener::onLinkDown(), ariba::CommunicationListener::onLinkDown(), ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::remoteNode, removeRelayLink(), ariba::overlay::LinkDescriptor::service, and sideport.
void ariba::overlay::BaseOverlay::onLinkFail | ( | const LinkID & | id, | |
const address_v * | local, | |||
const address_v * | remote | |||
) | [protected, virtual] |
Reimplemented from ariba::communication::CommunicationEvents.
Definition at line 1381 of file BaseOverlay.cpp.
References bootstrapLinks, getDescriptor(), ariba::overlay::LinkDescriptor::listener, logging_debug, nodeId, ariba::SideportListener::onLinkFail(), ariba::CommunicationListener::onLinkFail(), ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::remoteNode, sideport, and ariba::utility::Identifier::toString().
void ariba::overlay::BaseOverlay::onLinkQoSChanged | ( | const LinkID & | id, | |
const address_v * | local, | |||
const address_v * | remote, | |||
const QoSParameterSet & | qos | |||
) | [protected, virtual] |
Reimplemented from ariba::communication::CommunicationEvents.
Definition at line 1399 of file BaseOverlay.cpp.
References getDescriptor(), logging_debug, ariba::overlay::LinkDescriptor::overlayId, and ariba::utility::Identifier::toString().
bool ariba::overlay::BaseOverlay::onLinkRequest | ( | const LinkID & | id, | |
const address_v * | local, | |||
const address_v * | remote | |||
) | [protected, virtual] |
Reimplemented from ariba::communication::CommunicationEvents.
Definition at line 1409 of file BaseOverlay.cpp.
References logging_debug, and ariba::addressing::address_v::to_string().
void ariba::overlay::BaseOverlay::onLinkUp | ( | const LinkID & | id, | |
const address_v * | local, | |||
const address_v * | remote | |||
) | [protected, virtual] |
Reimplemented from ariba::communication::CommunicationEvents.
Definition at line 1257 of file BaseOverlay.cpp.
References addDescriptor(), ariba::overlay::LinkDescriptor::autolink, bc, bootstrapLinks, ariba::overlay::LinkDescriptor::communicationId, ariba::overlay::LinkDescriptor::communicationUp, ariba::overlay::LinkDescriptor::fromRemote, getDescriptor(), logging_debug, logging_info, nodeId, ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::remoteLink, send_link(), ariba::communication::BaseCommunication::sendMessage(), ariba::overlay::LinkDescriptor::service, ariba::overlay::LinkDescriptor::setAlive(), ariba::overlay::LinkDescriptor::setAutoUsed(), ariba::overlay::OverlayMsg::setDestinationLink(), ariba::overlay::OverlayMsg::setSourceLink(), spovnetId, ariba::utility::ServiceID::toString(), ariba::utility::Identifier::toString(), ariba::overlay::OverlayMsg::typeJoinRequest, ariba::overlay::OverlayMsg::typeLinkDirect, ariba::overlay::OverlayMsg::typeLinkUpdate, and ariba::overlay::LinkDescriptor::up.
void ariba::overlay::BaseOverlay::onNodeJoin | ( | const NodeID & | node | ) | [protected, virtual] |
This method is called, when a new node joined the network
Reimplemented from ariba::overlay::OverlayStructureEvents.
Definition at line 1954 of file BaseOverlay.cpp.
References joiningNodes, logging_info, and ariba::utility::Identifier::toString().
bool ariba::overlay::BaseOverlay::receiveMessage | ( | const Message * | message, | |
const LinkID & | link, | |||
const NodeID & | ||||
) | [protected, virtual] |
handles a message from base communication
Processes a received message from BaseCommunication
In case of a message routed by the overlay the source identifies the node the message came from!
Definition at line 1416 of file BaseOverlay.cpp.
References getDescriptor(), and handleMessage().
void ariba::overlay::BaseOverlay::refreshRelayInformation | ( | const OverlayMsg * | message, | |
LinkDescriptor * | ld | |||
) | [private] |
refreshes relay information
Definition at line 674 of file BaseOverlay.cpp.
References getDescriptor(), ariba::overlay::OverlayMsg::getDestinationNode(), ariba::overlay::OverlayMsg::getNumHops(), ariba::overlay::OverlayMsg::getSourceNode(), ariba::overlay::BaseOverlay::relay_route::hops, ariba::overlay::LinkDescriptor::isDirectVital(), ariba::overlay::OverlayMsg::isRegisterRelay(), ariba::overlay::OverlayMsg::isRelayed(), ariba::overlay::BaseOverlay::relay_route::link, logging_info, ariba::overlay::BaseOverlay::relay_route::node, nodeId, ariba::overlay::LinkDescriptor::overlayId, relay_routes, ariba::overlay::LinkDescriptor::relayed, route(), ariba::overlay::LinkDescriptor::setRelaying(), ariba::utility::Identifier::toString(), and ariba::overlay::BaseOverlay::relay_route::used.
Referenced by handleMessage().
bool ariba::overlay::BaseOverlay::registerSidePort | ( | SideportListener * | _sideport | ) |
Definition at line 1176 of file BaseOverlay.cpp.
References ariba::SideportListener::configure(), and sideport.
Referenced by ariba::Node::bind().
void ariba::overlay::BaseOverlay::removeRelayLink | ( | const LinkID & | link | ) | [private] |
removes relay link information
Definition at line 657 of file BaseOverlay.cpp.
References ariba::overlay::BaseOverlay::relay_route::link, relay_routes, and route().
Referenced by onLinkDown().
void ariba::overlay::BaseOverlay::removeRelayNode | ( | const NodeID & | link | ) | [private] |
removes relay node information
Definition at line 665 of file BaseOverlay.cpp.
References ariba::overlay::BaseOverlay::relay_route::node, relay_routes, and route().
Referenced by route().
void ariba::overlay::BaseOverlay::route | ( | OverlayMsg * | message | ) | [private] |
routes a message to its destination node
Definition at line 486 of file BaseOverlay.cpp.
References ariba::overlay::OverlayMsg::getDestinationNode(), ariba::overlay::OverlayMsg::getNumHops(), ariba::overlay::OverlayMsg::getTimeToLive(), handleMessage(), logging_warn, nodeId, removeRelayNode(), and send().
Referenced by getRelayLinkTo(), handleDHTMessage(), handleMessage(), ariba::overlay::Chord::onMessage(), refreshRelayInformation(), removeRelayLink(), removeRelayNode(), and stabilizeRelays().
seqnum_t ariba::overlay::BaseOverlay::send | ( | OverlayMsg * | message, | |
LinkDescriptor * | ld, | |||
bool | ignore_down = false | |||
) | [private] |
send a raw message using a link descriptor, delivers it to the base overlay class
send a message using a link descriptor, delivers it to the base overlay class
Definition at line 569 of file BaseOverlay.cpp.
References bc, ariba::overlay::LinkDescriptor::communicationId, ariba::overlay::LinkDescriptor::communicationUp, debugInformation(), getRelayLinkTo(), logging_debug, logging_error, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::remoteNode, ariba::communication::BaseCommunication::sendMessage(), ariba::overlay::OverlayMsg::setRelayed(), ariba::overlay::LinkDescriptor::setRelaying(), and ariba::overlay::LinkDescriptor::up.
seqnum_t ariba::overlay::BaseOverlay::send | ( | OverlayMsg * | message, | |
const NodeID & | destination | |||
) | [private] |
sends a raw message to another node, delivers it to the base overlay class
sends a message to another node, delivers it to the base overlay class
Definition at line 512 of file BaseOverlay.cpp.
References bc, ariba::overlay::LinkDescriptor::communicationId, debugInformation(), getDescriptor(), ariba::overlay::OverlayInterface::getNextLinkId(), getRelayLinkTo(), handleMessage(), ariba::overlay::OverlayMsg::isRelayed(), ariba::utility::Identifier::isUnspecified(), logging_error, logging_warn, nodeId, overlayInterface, ariba::communication::BaseCommunication::sendMessage(), ariba::overlay::LinkDescriptor::setRelaying(), and ariba::overlay::LinkDescriptor::up.
Referenced by dhtSend(), handleLinkRequest(), handleLinkUpdate(), ariba::overlay::Chord::onMessage(), route(), send_link(), and send_node().
seqnum_t ariba::overlay::BaseOverlay::send_link | ( | OverlayMsg * | message, | |
const LinkID & | link, | |||
bool | ignore_down = false | |||
) | [private] |
send a message using a node id using overlay routing using a link sets necessary fields in the overlay message!
Definition at line 619 of file BaseOverlay.cpp.
References getDescriptor(), logging_error, nodeId, ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::remoteLink, ariba::overlay::LinkDescriptor::remoteNode, send(), ariba::overlay::LinkDescriptor::service, ariba::overlay::OverlayMsg::setDestinationLink(), ariba::overlay::OverlayMsg::setDestinationNode(), ariba::overlay::OverlayMsg::setRelayed(), ariba::overlay::OverlayMsg::setService(), ariba::overlay::OverlayMsg::setSourceLink(), ariba::overlay::OverlayMsg::setSourceNode(), and ariba::utility::Identifier::toString().
Referenced by onLinkUp(), ariba::overlay::Chord::send(), sendMessage(), and stabilizeLinks().
seqnum_t ariba::overlay::BaseOverlay::send_node | ( | OverlayMsg * | message, | |
const NodeID & | remote, | |||
const ServiceID & | service = OverlayInterface::OVERLAY_SERVICE_ID | |||
) | [private] |
send a message using a node id using overlay routing sets necessary fields in the overlay message!
Definition at line 611 of file BaseOverlay.cpp.
References nodeId, send(), ariba::overlay::OverlayMsg::setDestinationNode(), ariba::overlay::OverlayMsg::setService(), and ariba::overlay::OverlayMsg::setSourceNode().
Referenced by establishLink(), and ariba::overlay::Chord::send_discovery_to().
seqnum_t ariba::overlay::BaseOverlay::sendMessage | ( | const Message * | message, | |
const NodeID & | remote, | |||
const ServiceID & | service = OverlayInterface::OVERLAY_SERVICE_ID | |||
) |
sends a message to a node and a specific service
Definition at line 1084 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::autolink, establishLink(), getAutoDescriptor(), getDescriptor(), logging_debug, logging_error, logging_info, ariba::overlay::LinkDescriptor::overlayId, sendMessage(), ariba::overlay::LinkDescriptor::setAutoUsed(), ariba::utility::ServiceID::toString(), and ariba::utility::Identifier::toString().
sends a message over an existing link
internal send message, always use this functions to send messages over links
Definition at line 1051 of file BaseOverlay.cpp.
References data_serialize(), getDescriptor(), logging_debug, logging_error, logging_info, send_link(), ariba::utility::Identifier::toString(), and ariba::overlay::OverlayMsg::typeData.
Referenced by broadcastMessage(), handleLinkReply(), handleLinkUpdate(), ariba::overlay::OneHop::leaveOverlay(), ariba::overlay::OneHop::onLinkUp(), ariba::overlay::OneHop::onMessage(), ariba::overlay::OneHop::routeMessage(), sendMessage(), and ariba::Node::sendMessage().
void ariba::overlay::BaseOverlay::showLinks | ( | ) | [private] |
print the currently known links
shows the current link state
Definition at line 454 of file BaseOverlay.cpp.
References getEndpointDescriptor(), ariba::overlay::LinkDescriptor::isDirectVital(), links, logging_info, ariba::overlay::LinkDescriptor::remoteNode, and ariba::communication::EndpointDescriptor::toString().
Referenced by stabilizeLinks().
void ariba::overlay::BaseOverlay::stabilizeDHT | ( | ) | [private] |
stabilize DHT state
Definition at line 2125 of file BaseOverlay.cpp.
References dht, dhtPut(), ariba::overlay::DHT::entries, ariba::overlay::DHTEntry::erase_expired_entries(), ariba::overlay::ValueEntry::get_ttl(), ariba::overlay::ValueEntry::get_value(), ariba::overlay::DHTEntry::key, localDHT, republishCounter, and ariba::overlay::DHTEntry::values.
Referenced by eventFunction().
void ariba::overlay::BaseOverlay::stabilizeLinks | ( | ) | [private] |
stabilizes link information
Definition at line 331 of file BaseOverlay.cpp.
References ariba::overlay::LinkDescriptor::autolink, bc, ariba::overlay::LinkDescriptor::communicationId, ariba::overlay::LinkDescriptor::communicationUp, counter, ariba::overlay::LinkDescriptor::dropAfterRelaying, dropLink(), ariba::overlay::LinkDescriptor::endpoint, ariba::communication::BaseCommunication::establishLink(), ariba::overlay::LinkDescriptor::keepAliveMissed, ariba::overlay::LinkDescriptor::keepAliveTime, ariba::overlay::LinkDescriptor::lastuse, links, logging_info, nodeId, ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, ariba::overlay::LinkDescriptor::overlayId, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::relaying, ariba::overlay::LinkDescriptor::remoteNode, ariba::overlay::LinkDescriptor::retryCounter, send_link(), ariba::overlay::OverlayMsg::setRouteRecord(), showLinks(), ariba::overlay::LinkDescriptor::timeRelaying, ariba::overlay::OverlayMsg::typeLinkAlive, and ariba::overlay::LinkDescriptor::up.
Referenced by eventFunction().
void ariba::overlay::BaseOverlay::stabilizeRelays | ( | ) | [private] |
stabilize relay information
Definition at line 639 of file BaseOverlay.cpp.
References getDescriptor(), ariba::overlay::LinkDescriptor::isDirectVital(), ariba::overlay::BaseOverlay::relay_route::link, logging_info, ariba::overlay::BaseOverlay::relay_route::node, relay_routes, route(), ariba::utility::Identifier::toString(), and ariba::overlay::BaseOverlay::relay_route::used.
Referenced by eventFunction().
void ariba::overlay::BaseOverlay::start | ( | BaseCommunication & | _basecomm, | |
const NodeID & | _nodeid | |||
) |
Starts the Base Overlay instance
Definition at line 773 of file BaseOverlay.cpp.
References BaseOverlayStateInvalid, bc, logging_info, nodeId, ariba::communication::BaseCommunication::registerEventListener(), ariba::communication::BaseCommunication::registerMessageReceiver(), ariba::utility::Timer::setInterval(), ariba::utility::Timer::start(), started, and state.
Referenced by ariba::Node::initiate(), and ariba::Node::join().
void ariba::overlay::BaseOverlay::startBootstrapModules | ( | vector< pair< BootstrapManager::BootstrapType, string > > | modules | ) |
Start the bootstrap modules
Definition at line 859 of file BaseOverlay.cpp.
References bc, ariba::communication::BaseCommunication::getEndpointDescriptor(), logging_debug, nodeId, overlayBootstrap, ariba::overlay::OverlayBootstrap::publish(), spovnetId, and ariba::overlay::OverlayBootstrap::start().
Referenced by ariba::Node::join().
void ariba::overlay::BaseOverlay::stop | ( | ) |
Stops the Base Overlay instance
Reimplemented from ariba::utility::Timer.
Definition at line 792 of file BaseOverlay.cpp.
References BaseOverlayStateInvalid, bc, logging_info, overlayInterface, started, state, ariba::communication::BaseCommunication::unregisterEventListener(), and ariba::communication::BaseCommunication::unregisterMessageReceiver().
Referenced by ariba::Node::leave().
void ariba::overlay::BaseOverlay::stopBootstrapModules | ( | ) |
Stop the bootstrap modules
Definition at line 865 of file BaseOverlay.cpp.
References logging_debug, overlayBootstrap, ariba::overlay::OverlayBootstrap::revoke(), and ariba::overlay::OverlayBootstrap::stop().
Referenced by ariba::Node::leave().
bool ariba::overlay::BaseOverlay::unbind | ( | NodeListener * | listener | ) |
Definition at line 1240 of file BaseOverlay.cpp.
References logging_debug, logging_warn, and nodeListeners.
bool ariba::overlay::BaseOverlay::unbind | ( | CommunicationListener * | listener, | |
const ServiceID & | sid | |||
) |
Definition at line 1204 of file BaseOverlay.cpp.
References communicationListeners, logging_debug, logging_warn, and ariba::utility::ServiceID::toString().
Referenced by ariba::Node::unbind(), and ariba::overlay::OverlayInterface::~OverlayInterface().
bool ariba::overlay::BaseOverlay::unregisterSidePort | ( | SideportListener * | _sideport | ) |
Definition at line 1182 of file BaseOverlay.cpp.
References ariba::SideportListener::DEFAULT, and sideport.
void ariba::overlay::BaseOverlay::updateVisual | ( | ) | [private] |
Definition at line 1971 of file BaseOverlay.cpp.
References getOverlayNeighbors(), ariba::overlay::LinkDescriptor::isVital(), links, nodeId, ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, ariba::overlay::LinkDescriptor::relayed, ariba::overlay::LinkDescriptor::remoteNode, ariba::overlay::LinkDescriptor::routeRecord, ariba::overlay::LinkDescriptor::service, ariba::utility::NodeID::UNSPECIFIED, visual, visualIdBase, and visualIdOverlay.
Referenced by eventFunction().
ariba::overlay::BaseOverlay::use_logging_h | ( | BaseOverlay | ) | [private] |
Reimplemented from ariba::utility::Timer.
friend class ariba::SideportListener [friend] |
Definition at line 126 of file BaseOverlay.h.
friend class Chord [friend] |
Definition at line 125 of file BaseOverlay.h.
friend class OneHop [friend] |
Definition at line 124 of file BaseOverlay.h.
BaseCommunication* ariba::overlay::BaseOverlay::bc [private] |
reference to the base communication
Definition at line 377 of file BaseOverlay.h.
Referenced by dropLink(), establishDirectLink(), getEndpointDescriptor(), ariba::SideportListener::getReachabilityProtocol(), handleJoinReply(), handleJoinRequest(), handleLinkReply(), handleLinkRequest(), joinSpoVNet(), leaveSpoVNet(), onLinkUp(), send(), stabilizeLinks(), start(), startBootstrapModules(), and stop().
vector<LinkID> ariba::overlay::BaseOverlay::bootstrapLinks [private] |
the link id of the link to the initiator node
Definition at line 380 of file BaseOverlay.h.
Referenced by handleJoinReply(), joinSpoVNet(), leaveSpoVNet(), onLinkDown(), onLinkFail(), and onLinkUp().
Demultiplexer<CommunicationListener*, ServiceID> ariba::overlay::BaseOverlay::communicationListeners [private] |
the service id communication listeners
Definition at line 384 of file BaseOverlay.h.
Referenced by bind(), establishDirectLink(), getListener(), handleLinkUpdate(), and unbind().
int ariba::overlay::BaseOverlay::counter [private] |
link state information counter
Definition at line 428 of file BaseOverlay.h.
Referenced by stabilizeLinks().
DHT* ariba::overlay::BaseOverlay::dht [private] |
Definition at line 510 of file BaseOverlay.h.
Referenced by destroyDHT(), handleDHTMessage(), initDHT(), and stabilizeDHT().
Definition at line 528 of file BaseOverlay.h.
Referenced by handleJoinRequest(), and onNodeJoin().
vector<LinkDescriptor*> ariba::overlay::BaseOverlay::links [private] |
The link mapping of the node.
Definition at line 431 of file BaseOverlay.h.
Referenced by addDescriptor(), debugInformation(), eraseDescriptor(), getAutoDescriptor(), getDescriptor(), getEndpointDescriptor(), getLinkHTMLInfo(), getLinkIDs(), ariba::SideportListener::getReachabilityProtocol(), ariba::SideportListener::isRelayedNode(), ariba::SideportListener::isRelayingNode(), leaveSpoVNet(), showLinks(), stabilizeLinks(), and updateVisual().
DHT* ariba::overlay::BaseOverlay::localDHT [private] |
Definition at line 511 of file BaseOverlay.h.
Referenced by destroyDHT(), dhtPut(), dhtRemove(), initDHT(), and stabilizeDHT().
NodeID ariba::overlay::BaseOverlay::nodeId [private] |
the node id of this node
Definition at line 378 of file BaseOverlay.h.
Referenced by broadcastMessage(), createSpoVNet(), dhtSend(), establishLink(), getEndpointDescriptor(), getNodeID(), getOverlayNeighbors(), handleJoinReply(), handleJoinRequest(), handleLinkUpdate(), handleMessage(), joinSpoVNet(), leaveSpoVNet(), onLinkChanged(), onLinkDown(), onLinkFail(), onLinkUp(), refreshRelayInformation(), route(), send(), send_link(), send_node(), stabilizeLinks(), start(), startBootstrapModules(), and updateVisual().
Definition at line 389 of file BaseOverlay.h.
Referenced by bind(), createSpoVNet(), handleJoinReply(), joinSpoVNet(), leaveSpoVNet(), and unbind().
Bootstrapper for our spovnet.
Definition at line 398 of file BaseOverlay.h.
Referenced by handleJoinReply(), startBootstrapModules(), and stopBootstrapModules().
the used overlay structure
Definition at line 395 of file BaseOverlay.h.
Referenced by broadcastMessage(), createSpoVNet(), debugInformation(), dhtSend(), getEndpointDescriptor(), getOverlayNeighbors(), handleDHTMessage(), handleJoinReply(), handleJoinRequest(), handleMessage(), joinSpoVNet(), leaveSpoVNet(), send(), and stop().
vector<relay_route> ariba::overlay::BaseOverlay::relay_routes [private] |
Definition at line 469 of file BaseOverlay.h.
Referenced by getRelayLinkTo(), refreshRelayInformation(), removeRelayLink(), removeRelayNode(), and stabilizeRelays().
int ariba::overlay::BaseOverlay::republishCounter [private] |
Definition at line 512 of file BaseOverlay.h.
Referenced by initDHT(), and stabilizeDHT().
the sideport listener
Definition at line 392 of file BaseOverlay.h.
Referenced by dropLink(), handleLinkUpdate(), onLinkChanged(), onLinkDown(), onLinkFail(), registerSidePort(), and unregisterSidePort().
the spovnet id of the currently joined overlay
Definition at line 379 of file BaseOverlay.h.
Referenced by createSpoVNet(), handleJoinReply(), handleJoinRequest(), joinSpoVNet(), leaveSpoVNet(), onLinkUp(), and startBootstrapModules().
The initiator node.
Definition at line 381 of file BaseOverlay.h.
bool ariba::overlay::BaseOverlay::started [private] |
is the base overlay started yet
Definition at line 368 of file BaseOverlay.h.
Referenced by isStarted(), start(), and stop().
Current Base-Overlay state.
Definition at line 376 of file BaseOverlay.h.
Referenced by createSpoVNet(), handleJoinReply(), joinSpoVNet(), leaveSpoVNet(), start(), and stop().