#include <source/ariba/communication/BaseCommunication.h>
Its primary task is to provide an abstraction to existing protocols and addressing schemes.
Definition at line 121 of file BaseCommunication.h.
typedef vector<LinkDescriptor> ariba::communication::BaseCommunication::LinkSet [private] |
Link management: list of links
Definition at line 294 of file BaseCommunication.h.
typedef set<CommunicationEvents*> ariba::communication::BaseCommunication::EventListenerSet [private] |
Definition at line 334 of file BaseCommunication.h.
ariba::communication::BaseCommunication::BaseCommunication | ( | ) |
Default ctor that just creates an empty non functional base communication
Definition at line 57 of file BaseCommunication.cpp.
ariba::communication::BaseCommunication::~BaseCommunication | ( | ) | [virtual] |
Default dtor that does nothing
Definition at line 61 of file BaseCommunication.cpp.
ariba::communication::BaseCommunication::use_logging_h | ( | BaseCommunication | ) | [private] |
void ariba::communication::BaseCommunication::start | ( | const NetworkLocator * | _locallocator, | |
const uint16_t | _listenport | |||
) |
Startup the base communication, start modules etc.
Definition at line 64 of file BaseCommunication.cpp.
References ariba::communication::IPv4Locator::ANY, ariba::communication::IPv4Locator::BROADCAST, currentSeqnum, ariba::communication::IPv4Locator::fromString(), ariba::communication::EndpointDescriptor::isUnspec, listenport, localDescriptor, ariba::communication::IPv4Locator::LOCALHOST, ariba::communication::EndpointDescriptor::locator, logging_debug, logging_fatal, logging_info, network, networkMonitor, ariba::communication::NetworkChangeDetection::registerNotification(), ariba::communication::AribaOmnetModule::setServerPort(), ariba::communication::IPv4Locator::toString(), and transport.
Referenced by ariba::Node::initiate(), and ariba::Node::join().
void ariba::communication::BaseCommunication::stop | ( | ) |
stop the base communication, stop modules etc.
Definition at line 150 of file BaseCommunication.cpp.
References logging_info, network, and transport.
Referenced by ariba::Node::leave().
const LinkID ariba::communication::BaseCommunication::establishLink | ( | const EndpointDescriptor & | descriptor, | |
const LinkID & | linkid = LinkID::UNSPECIFIED , |
|||
const QoSParameterSet & | qos = QoSParameterSet::DEFAULT , |
|||
const SecurityParameterSet & | sec = SecurityParameterSet::DEFAULT | |||
) |
Establishes a link to another end-point.
void ariba::communication::BaseCommunication::dropLink | ( | const LinkID | link | ) |
Drops a link.
The | link id of the link that should be dropped |
Definition at line 208 of file BaseCommunication.cpp.
References eventListener, ariba::communication::AribaBaseMsg::LINK_STATE_CLOSE_REQUEST, logging_debug, logging_error, ariba::communication::CommunicationEvents::onLinkDown(), queryLocalLink(), removeLink(), ariba::utility::Identifier::toString(), and transport.
seqnum_t ariba::communication::BaseCommunication::sendMessage | ( | const LinkID | lid, | |
const Message * | message | |||
) |
Sends a message though an existing link to an end-point.
lid | The link identifier | |
message | The message to be sent |
Definition at line 240 of file BaseCommunication.cpp.
References currentSeqnum, Message::encapsulate(), ariba::communication::AribaBaseMsg::LINK_STATE_DATA, logging_debug, logging_error, queryLocalLink(), ariba::utility::Identifier::toString(), and transport.
const EndpointDescriptor & ariba::communication::BaseCommunication::getEndpointDescriptor | ( | const LinkID | link = LinkID::UNSPECIFIED |
) | const |
Returns the end-point descriptor
link | the link id of the requested end-point |
Definition at line 272 of file BaseCommunication.cpp.
References ariba::communication::BaseCommunication::LinkDescriptor::isUnspecified(), localDescriptor, queryLocalLink(), ariba::communication::BaseCommunication::LinkDescriptor::remoteEndpoint, ariba::communication::EndpointDescriptor::UNSPECIFIED, and ariba::utility::LinkID::UNSPECIFIED.
Referenced by ariba::Node::initiate().
LinkIDs ariba::communication::BaseCommunication::getLocalLinks | ( | const EndpointDescriptor & | ep = EndpointDescriptor::UNSPECIFIED |
) | const |
Get local links to the given endpoint of all local link using the default parameter EndpointDescriptor::UNSPECIFIED
ep | The remote endpoint to get all links to. |
Definition at line 564 of file BaseCommunication.cpp.
References linkSet, ariba::communication::EndpointDescriptor::locator, and ariba::communication::EndpointDescriptor::UNSPECIFIED.
void ariba::communication::BaseCommunication::registerMessageReceiver | ( | MessageReceiver * | _receiver | ) |
Registers a receiver.
_receiver | The receiving side |
Definition at line 283 of file BaseCommunication.cpp.
References messageReceiver.
void ariba::communication::BaseCommunication::unregisterMessageReceiver | ( | MessageReceiver * | _receiver | ) |
Unregister a receiver.
_receiver | The receiving side |
Definition at line 287 of file BaseCommunication.cpp.
References messageReceiver.
void ariba::communication::BaseCommunication::registerEventListener | ( | CommunicationEvents * | _events | ) |
void ariba::communication::BaseCommunication::unregisterEventListener | ( | CommunicationEvents * | _events | ) |
bool ariba::communication::BaseCommunication::receiveMessage | ( | const Message * | message, | |
const LinkID & | link, | |||
const NodeID & | node | |||
) | [protected, virtual] |
Called from the Transport when async items from the SystemQueue are delivered
Definition at line 305 of file BaseCommunication.cpp.
References addLink(), ariba::utility::LinkID::create(), eventListener, ariba::communication::AribaBaseMsg::getLocalLink(), ariba::communication::AribaBaseMsg::getRemoteLink(), ariba::communication::AribaBaseMsg::getType(), ariba::communication::AribaBaseMsg::getTypeString(), ariba::communication::BaseCommunication::LinkDescriptor::isUnspecified(), ariba::communication::AribaBaseMsg::LINK_STATE_CLOSE_REQUEST, ariba::communication::AribaBaseMsg::LINK_STATE_DATA, ariba::communication::AribaBaseMsg::LINK_STATE_OPEN_REPLY, ariba::communication::AribaBaseMsg::LINK_STATE_OPEN_REQUEST, ariba::communication::AribaBaseMsg::LINK_STATE_UPDATE, ariba::communication::BaseCommunication::LinkDescriptor::linkup, localDescriptor, ariba::communication::BaseCommunication::LinkDescriptor::localLink, ariba::communication::BaseCommunication::LinkDescriptor::localLocator, ariba::communication::EndpointDescriptor::locator, logging_debug, logging_warn, messageReceiver, ariba::communication::CommunicationEvents::onLinkChanged(), ariba::communication::CommunicationEvents::onLinkDown(), ariba::communication::CommunicationEvents::onLinkRequest(), ariba::communication::CommunicationEvents::onLinkUp(), queryLocalLink(), ariba::communication::BaseCommunication::LinkDescriptor::remoteLink, ariba::communication::BaseCommunication::LinkDescriptor::remoteLocator, removeLink(), ariba::utility::Identifier::toString(), transport, and ariba::utility::NodeID::UNSPECIFIED.
void ariba::communication::BaseCommunication::onNetworkChange | ( | const NetworkChangeInterface::NetworkChangeInfo & | info | ) | [protected, virtual] |
Called when a network interface change happens
Implements ariba::communication::NetworkChangeInterface.
Definition at line 579 of file BaseCommunication.cpp.
References ariba::communication::IPv4Locator::ANY, ariba::communication::IPv4Locator::BROADCAST, ariba::communication::NetworkChangeInterface::EventTypeAddressDelete, ariba::communication::NetworkChangeInterface::EventTypeAddressNew, ariba::communication::AddressInformation::getAddresses(), ariba::communication::NetworkInformation::getInterfaces(), ariba::communication::AribaBaseMsg::LINK_STATE_UPDATE, linkSet, listenport, localDescriptor, ariba::communication::IPv4Locator::LOCALHOST, ariba::communication::BaseCommunication::LinkDescriptor::localLink, ariba::communication::EndpointDescriptor::locator, logging_debug, logging_info, network, ariba::communication::BaseCommunication::LinkDescriptor::remoteLink, ariba::communication::BaseCommunication::LinkDescriptor::remoteLocator, ariba::communication::EndpointDescriptor::toString(), ariba::communication::IPv4Locator::toString(), transport, and ariba::communication::NetworkChangeInterface::_NetworkChangeInfo::type.
void ariba::communication::BaseCommunication::addLink | ( | const LinkDescriptor & | link | ) | [private] |
Link management: add a link
Definition at line 535 of file BaseCommunication.cpp.
References linkSet.
Referenced by receiveMessage().
void ariba::communication::BaseCommunication::removeLink | ( | const LinkID & | localLink | ) | [private] |
Link management: remove alink
Definition at line 539 of file BaseCommunication.cpp.
References linkSet.
Referenced by dropLink(), and receiveMessage().
BaseCommunication::LinkDescriptor & ariba::communication::BaseCommunication::queryLocalLink | ( | const LinkID & | localLink | ) | const [private] |
Link management: get link information using the local link
Definition at line 552 of file BaseCommunication.cpp.
References linkSet, and ariba::communication::BaseCommunication::LinkDescriptor::UNSPECIFIED.
Referenced by dropLink(), getEndpointDescriptor(), receiveMessage(), and sendMessage().
BaseCommunication::LinkDescriptor & ariba::communication::BaseCommunication::queryRemoteLink | ( | const LinkID & | remoteLink | ) | const [private] |
Link management: get link information using the remote link
Definition at line 558 of file BaseCommunication.cpp.
References linkSet, and ariba::communication::BaseCommunication::LinkDescriptor::UNSPECIFIED.
Link management: the set of currently managed links
Definition at line 299 of file BaseCommunication.h.
Referenced by addLink(), getLocalLinks(), onNetworkChange(), queryLocalLink(), queryRemoteLink(), and removeLink().
MessageReceiver* ariba::communication::BaseCommunication::messageReceiver [private] |
The message receiver
Definition at line 304 of file BaseCommunication.h.
Referenced by receiveMessage(), registerMessageReceiver(), and unregisterMessageReceiver().
The local end-point descriptor
Definition at line 309 of file BaseCommunication.h.
Referenced by getEndpointDescriptor(), onNetworkChange(), receiveMessage(), and start().
NetworkProtocol* ariba::communication::BaseCommunication::network [private] |
Network information and protocol
Definition at line 314 of file BaseCommunication.h.
Referenced by onNetworkChange(), start(), and stop().
TransportProtocol* ariba::communication::BaseCommunication::transport [private] |
Transport information and protocol
Definition at line 319 of file BaseCommunication.h.
Referenced by dropLink(), onNetworkChange(), receiveMessage(), sendMessage(), start(), and stop().
Detect changes in the routing/interface, etc. stuff needed for mobility detection
Definition at line 326 of file BaseCommunication.h.
Referenced by start().
uint16_t ariba::communication::BaseCommunication::listenport [private] |
The local listen port
Definition at line 332 of file BaseCommunication.h.
Referenced by onNetworkChange(), and start().
Definition at line 335 of file BaseCommunication.h.
Referenced by dropLink(), receiveMessage(), registerEventListener(), and unregisterEventListener().