IBR-DTNSuite
0.10
|
#include <UDPConvergenceLayer.h>
Public Member Functions | |
UDPConvergenceLayer (ibrcommon::vinterface net, int port, dtn::data::Length mtu=1280) | |
virtual | ~UDPConvergenceLayer () |
void | update (const ibrcommon::vinterface &iface, DiscoveryAnnouncement &announcement) throw (dtn::net::DiscoveryServiceProvider::NoServiceHereException) |
dtn::core::Node::Protocol | getDiscoveryProtocol () const |
void | queue (const dtn::core::Node &n, const dtn::net::BundleTransfer &job) |
virtual const std::string | getName () const |
void | eventNotify (const ibrcommon::LinkEvent &evt) |
Public Member Functions inherited from dtn::net::ConvergenceLayer | |
virtual | ~ConvergenceLayer ()=0 |
virtual void | open (const dtn::core::Node &) |
virtual void | resetStats () |
virtual const stats_map & | getStats () |
Public Member Functions inherited from dtn::daemon::IndependentComponent | |
IndependentComponent () | |
virtual | ~IndependentComponent () |
virtual void | initialize () throw () |
virtual void | startup () throw () |
virtual void | terminate () throw () |
Public Member Functions inherited from dtn::daemon::Component | |
virtual | ~Component ()=0 |
Public Member Functions inherited from dtn::net::DiscoveryServiceProvider | |
virtual | ~DiscoveryServiceProvider () |
Public Member Functions inherited from ibrcommon::LinkManager::EventCallback | |
virtual | ~EventCallback () |
Protected Member Functions | |
virtual void | componentUp () throw () |
virtual void | componentRun () throw () |
virtual void | componentDown () throw () |
void | __cancellation () throw () |
Protected Member Functions inherited from dtn::net::ConvergenceLayer | |
virtual void | addStats (const std::string &tag, const size_t value) |
virtual void | setStats (const std::string &tag, const size_t value) |
Protected Member Functions inherited from dtn::daemon::IndependentComponent | |
void | run () throw () |
Protected Member Functions inherited from ibrcommon::JoinableThread | |
virtual | ~JoinableThread ()=0 |
void | join (void) throw (ThreadException) |
bool | isRunning (void) |
void | start (int priority=0) throw (ThreadException) |
void | stop () throw () |
JoinableThread (size_t size=DEFAULT_STACKSIZE) | |
Additional Inherited Members | |
Public Types inherited from dtn::net::ConvergenceLayer | |
typedef std::map< std::string, size_t > | stats_map |
This class implement a ConvergenceLayer for UDP/IP. Each bundle is sent in exact one UDP datagram.
Definition at line 43 of file UDPConvergenceLayer.h.
dtn::net::UDPConvergenceLayer::UDPConvergenceLayer | ( | ibrcommon::vinterface | net, |
int | port, | ||
dtn::data::Length | mtu = 1280 |
||
) |
Constructor
[in] | bind_addr | The address to bind. |
[in] | port | The udp port to use. |
[in] | broadcast | If true, the broadcast feature for this socket is enabled. |
[in] | mtu | The maximum bundle size. |
Definition at line 60 of file UDPConvergenceLayer.cpp.
References dtn::net::ConvergenceLayer::addStats().
|
virtual |
Desktruktor
Definition at line 68 of file UDPConvergenceLayer.cpp.
References componentDown().
|
protectedvirtual |
This method is called after componentDown() and should should guarantee that blocking calls in componentRun() will unblock.
Implements dtn::daemon::IndependentComponent.
Definition at line 427 of file UDPConvergenceLayer.cpp.
References ibrcommon::vsocket::down().
|
protectedvirtual |
This method is called if the component should stop. Clean-up code should be inserted here.
Implements dtn::daemon::IndependentComponent.
Definition at line 393 of file UDPConvergenceLayer.cpp.
References ibrcommon::vsocket::destroy(), ibrcommon::LinkManager::getInstance(), ibrcommon::JoinableThread::join(), ibrcommon::LinkManager::removeEventListener(), and ibrcommon::JoinableThread::stop().
Referenced by ~UDPConvergenceLayer().
|
protectedvirtual |
This is the run method. The component should loop in there until componentDown() or __cancellation() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 403 of file UDPConvergenceLayer.cpp.
References IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::net::BundleReceivedEvent::raise(), ibrcommon::LogLevel::warning, ibrcommon::Exception::what(), and ibrcommon::Thread::yield().
|
protectedvirtual |
Is called in preparation of the component. Before componentRun() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 355 of file UDPConvergenceLayer.cpp.
References ibrcommon::vsocket::add(), ibrcommon::LinkManager::addEventListener(), ibrcommon::LogLevel::error, ibrcommon::vaddress::family(), ibrcommon::vinterface::getAddresses(), ibrcommon::LinkManager::getInstance(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::vaddress::setService(), ibrcommon::vsocket::up(), ibrcommon::LogLevel::warning, and ibrcommon::Exception::what().
|
virtual |
Implements ibrcommon::LinkManager::EventCallback.
Definition at line 301 of file UDPConvergenceLayer.cpp.
References ibrcommon::LinkEvent::ACTION_ADDRESS_ADDED, ibrcommon::LinkEvent::ACTION_ADDRESS_REMOVED, ibrcommon::LinkEvent::ACTION_LINK_DOWN, ibrcommon::vsocket::add(), ibrcommon::vaddress::address(), ibrcommon::udpsocket::down(), ibrcommon::vsocket::get(), ibrcommon::udpsocket::get_address(), ibrcommon::LinkEvent::getAction(), ibrcommon::LinkEvent::getAddress(), ibrcommon::vsocket::getAll(), ibrcommon::LinkEvent::getInterface(), ibrcommon::vsocket::remove(), ibrcommon::vaddress::setService(), and ibrcommon::udpsocket::up().
|
virtual |
Implements dtn::net::ConvergenceLayer.
Definition at line 73 of file UDPConvergenceLayer.cpp.
References dtn::core::Node::CONN_UDPIP.
|
virtual |
Implements dtn::daemon::Component.
Definition at line 433 of file UDPConvergenceLayer.cpp.
|
virtual |
Implements dtn::net::ConvergenceLayer.
Definition at line 144 of file UDPConvergenceLayer.cpp.
References dtn::net::BundleTransfer::abort(), dtn::net::BundleTransfer::complete(), dtn::core::Node::CONN_UDPIP, dtn::core::Node::URI::decode(), dtn::data::PrimaryBlock::DONT_FRAGMENT, dtn::storage::BundleStorage::get(), dtn::data::PrimaryBlock::get(), dtn::core::Node::get(), dtn::net::BundleTransfer::getBundle(), dtn::core::BundleCore::getInstance(), dtn::daemon::Configuration::getInstance(), dtn::data::DefaultSerializer::getLength(), dtn::core::BundleCore::getStorage(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, dtn::net::TransferAbortedEvent::REASON_BUNDLE_DELETED, dtn::net::TransferAbortedEvent::REASON_CONNECTION_DOWN, and dtn::net::TransferAbortedEvent::REASON_UNDEFINED.
|
virtual |
this method updates the given values
Implements dtn::net::DiscoveryServiceProvider.
Definition at line 78 of file UDPConvergenceLayer.cpp.
References ibrcommon::vaddress::address(), dtn::daemon::Configuration::Discovery::enableCrosslayer(), ibrcommon::vaddress::family(), dtn::daemon::Configuration::getDiscovery(), dtn::daemon::Configuration::getInstance(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, ibrcommon::vaddress::scope(), ibrcommon::vaddress::SCOPE_GLOBAL, and ibrcommon::Exception::what().