IBR-DTNSuite
0.8
|
#include <UDPConvergenceLayer.h>
Public Member Functions | |
UDPConvergenceLayer (ibrcommon::vinterface net, int port, unsigned int mtu=1280) | |
virtual | ~UDPConvergenceLayer () |
void | update (const ibrcommon::vinterface &iface, std::string &name, std::string &data) throw (dtn::net::DiscoveryServiceProvider::NoServiceHereException) |
dtn::core::Node::Protocol | getDiscoveryProtocol () const |
void | queue (const dtn::core::Node &n, const ConvergenceLayer::Job &job) |
UDPConvergenceLayer & | operator>> (dtn::data::Bundle &) |
virtual const std::string | getName () const |
Protected Member Functions | |
virtual void | componentUp () |
virtual void | componentRun () |
virtual void | componentDown () |
void | __cancellation () |
This class implement a ConvergenceLayer for UDP/IP. Each bundle is sent in exact one UDP datagram.
Definition at line 22 of file UDPConvergenceLayer.h.
dtn::net::UDPConvergenceLayer::UDPConvergenceLayer | ( | ibrcommon::vinterface | net, |
int | port, | ||
unsigned int | 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 47 of file UDPConvergenceLayer.cpp.
dtn::net::UDPConvergenceLayer::~UDPConvergenceLayer | ( | ) | [virtual] |
Desktruktor
Definition at line 53 of file UDPConvergenceLayer.cpp.
References componentDown().
void dtn::net::UDPConvergenceLayer::__cancellation | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 275 of file UDPConvergenceLayer.cpp.
References ibrcommon::udpsocket::shutdown().
void dtn::net::UDPConvergenceLayer::componentDown | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 238 of file UDPConvergenceLayer.cpp.
References ibrcommon::JoinableThread::join(), and ibrcommon::JoinableThread::stop().
Referenced by ~UDPConvergenceLayer().
void dtn::net::UDPConvergenceLayer::componentRun | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 244 of file UDPConvergenceLayer.cpp.
References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, dtn::data::ScopeControlHopLimitBlock::increment(), dtn::net::BundleReceivedEvent::raise(), ibrcommon::Exception::what(), and ibrcommon::Thread::yield().
void dtn::net::UDPConvergenceLayer::componentUp | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 223 of file UDPConvergenceLayer.cpp.
References ibrcommon::UnicastSocket::bind(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, ibrcommon::vinterface::toString(), and ibrcommon::Exception::what().
dtn::core::Node::Protocol dtn::net::UDPConvergenceLayer::getDiscoveryProtocol | ( | ) | const [virtual] |
Implements dtn::net::ConvergenceLayer.
Definition at line 59 of file UDPConvergenceLayer.cpp.
References dtn::core::Node::CONN_UDPIP.
const std::string dtn::net::UDPConvergenceLayer::getName | ( | ) | const [virtual] |
Implements dtn::daemon::Component.
Definition at line 281 of file UDPConvergenceLayer.cpp.
UDPConvergenceLayer & dtn::net::UDPConvergenceLayer::operator>> | ( | dtn::data::Bundle & | bundle | ) |
Definition at line 201 of file UDPConvergenceLayer.cpp.
References dtn::core::BundleCore::getInstance(), and ibrcommon::udpsocket::receive().
void dtn::net::UDPConvergenceLayer::queue | ( | const dtn::core::Node & | n, |
const ConvergenceLayer::Job & | job | ||
) | [virtual] |
Implements dtn::net::ConvergenceLayer.
Definition at line 93 of file UDPConvergenceLayer.cpp.
References dtn::net::ConvergenceLayer::Job::_bundle, dtn::net::ConvergenceLayer::Job::_destination, dtn::core::BUNDLE_FORWARDED, dtn::core::Node::CONN_UDPIP, dtn::core::Node::URI::decode(), dtn::data::PrimaryBlock::DONT_FRAGMENT, dtn::data::PrimaryBlock::get(), dtn::storage::BundleStorage::get(), dtn::core::Node::get(), dtn::core::Node::getEID(), dtn::core::BundleCore::getInstance(), dtn::daemon::Configuration::getInstance(), dtn::data::DefaultSerializer::getLength(), dtn::core::BundleCore::getStorage(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, dtn::routing::RequeueBundleEvent::raise(), dtn::net::TransferCompletedEvent::raise(), dtn::net::TransferAbortedEvent::raise(), dtn::core::BundleEvent::raise(), dtn::net::TransferAbortedEvent::REASON_BUNDLE_DELETED, dtn::net::TransferAbortedEvent::REASON_UNDEFINED, and ibrcommon::udpsocket::send().
void dtn::net::UDPConvergenceLayer::update | ( | const ibrcommon::vinterface & | iface, |
std::string & | name, | ||
std::string & | data | ||
) | throw (dtn::net::DiscoveryServiceProvider::NoServiceHereException) [virtual] |
this method updates the given values
Implements dtn::net::DiscoveryServiceProvider.
Definition at line 64 of file UDPConvergenceLayer.cpp.
References ibrcommon::vaddress::VADDRESS_INET.