IBR-DTNSuite
0.10
|
#include <LOWPANConvergenceLayer.h>
Public Member Functions | |
LOWPANConvergenceLayer (const ibrcommon::vinterface &net, uint16_t panid, unsigned int mtu=115) | |
virtual | ~LOWPANConvergenceLayer () |
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 |
virtual void | raiseEvent (const Event *evt) throw () |
virtual void | send_cb (const char *buf, const size_t len, const ibrcommon::vaddress &addr) |
void | remove (const LOWPANConnection *conn) |
![]() | |
DiscoveryAgent (const dtn::daemon::Configuration::Discovery &config) | |
virtual | ~DiscoveryAgent ()=0 |
void | received (const dtn::data::EID &source, const std::list< DiscoveryService > &services, const dtn::data::Number &timeout=0) |
void | addService (dtn::net::DiscoveryServiceProvider *provider) |
![]() | |
virtual | ~ConvergenceLayer ()=0 |
virtual void | open (const dtn::core::Node &) |
virtual void | resetStats () |
virtual const stats_map & | getStats () |
![]() | |
IndependentComponent () | |
virtual | ~IndependentComponent () |
virtual void | initialize () throw () |
virtual void | startup () throw () |
virtual void | terminate () throw () |
![]() | |
virtual | ~Component ()=0 |
![]() | |
virtual | ~lowpanstream_callback () |
![]() | |
virtual | ~EventReceiver ()=0 |
![]() | |
virtual | ~DiscoveryServiceProvider () |
Static Public Attributes | |
static const size_t | BUFF_SIZE = 115 |
Protected Member Functions | |
virtual void | componentUp () throw () |
virtual void | componentRun () throw () |
virtual void | componentDown () throw () |
void | __cancellation () throw () |
virtual void | sendAnnoucement (const uint16_t &sn, std::list< dtn::net::DiscoveryServiceProvider * > &providers) |
![]() | |
void | timeout () |
![]() | |
virtual void | addStats (const std::string &tag, const size_t value) |
virtual void | setStats (const std::string &tag, const size_t value) |
![]() | |
void | run () throw () |
![]() | |
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 | |
![]() | |
typedef std::map< std::string, size_t > | stats_map |
![]() | |
const dtn::daemon::Configuration::Discovery & | _config |
This class implements a ConvergenceLayer for LOWPAN.
Definition at line 48 of file LOWPANConvergenceLayer.h.
dtn::net::LOWPANConvergenceLayer::LOWPANConvergenceLayer | ( | const ibrcommon::vinterface & | net, |
uint16_t | panid, | ||
unsigned int | mtu = 115 |
||
) |
Definition at line 51 of file LOWPANConvergenceLayer.cpp.
References AF_IEEE802154.
|
virtual |
Definition at line 63 of file LOWPANConvergenceLayer.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 317 of file LOWPANConvergenceLayer.cpp.
References _running, and 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 199 of file LOWPANConvergenceLayer.cpp.
References ibrcommon::vsocket::destroy(), ibrcommon::JoinableThread::join(), dtn::core::EventDispatcher< E >::remove(), and ibrcommon::JoinableThread::stop().
Referenced by ~LOWPANConvergenceLayer().
|
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 251 of file LOWPANConvergenceLayer.cpp.
References _running, EXTENDED_MASK, dtn::net::LOWPANConnection::getStream(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, ibrcommon::lowpanstream::queue(), dtn::net::DiscoveryAgent::received(), ibrcommon::lowpansocket::recvfrom(), ibrcommon::vsocket::select(), ibrcommon::vaddress::toString(), and ibrcommon::Thread::yield().
|
protectedvirtual |
Is called in preparation of the component. Before componentRun() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 181 of file LOWPANConvergenceLayer.cpp.
References _running, ibrcommon::vsocket::add(), dtn::core::EventDispatcher< E >::add(), dtn::net::DiscoveryAgent::addService(), ibrcommon::LogLevel::error, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::vinterface::toString(), ibrcommon::vsocket::up(), and ibrcommon::Exception::what().
|
virtual |
Implements dtn::net::ConvergenceLayer.
Definition at line 68 of file LOWPANConvergenceLayer.cpp.
References dtn::core::Node::CONN_LOWPAN.
|
virtual |
Implements dtn::daemon::Component.
Definition at line 323 of file LOWPANConvergenceLayer.cpp.
|
virtual |
Queueing a job for a specific node. Starting point for the DTN core to submit bundles to nodes behind the LoWPAN CL
n | Node reference |
job | Job reference |
Implements dtn::net::ConvergenceLayer.
Definition at line 121 of file LOWPANConvergenceLayer.cpp.
References dtn::net::LOWPANConnection::_sender, sockaddr_ieee802154::addr, AF_IEEE802154, dtn::core::Node::CONN_LOWPAN, dtn::core::Node::URI::decode(), dtn::core::Node::get(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, and dtn::net::LOWPANConnectionSender::queue().
|
virtual |
Implements dtn::core::EventReceiver.
Definition at line 306 of file LOWPANConvergenceLayer.cpp.
References dtn::data::SDNV< E >::get(), dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and dtn::core::TIME_SECOND_TICK.
void dtn::net::LOWPANConvergenceLayer::remove | ( | const LOWPANConnection * | conn | ) |
Definition at line 166 of file LOWPANConvergenceLayer.cpp.
Referenced by dtn::net::LOWPANConnection::finally().
|
virtual |
Callback interface for sending data back from the lowpanstream to the CL
buf | Buffer with a data frame |
len | Length of the buffer |
address | IEEE 802.15.4 short address of the destination |
Implements ibrcommon::lowpanstream_callback.
Definition at line 97 of file LOWPANConvergenceLayer.cpp.
References ibrcommon::vsocket::getAll(), ibrcommon::lowpansocket::sendto(), and ibrcommon::lowpansocket::setAutoAck().
Referenced by sendAnnoucement().
|
protectedvirtual |
Implements dtn::net::DiscoveryAgent.
Definition at line 207 of file LOWPANConvergenceLayer.cpp.
References dtn::net::DiscoveryAnnouncement::clearServices(), dtn::net::DiscoveryAnnouncement::DISCO_VERSION_01, ibrcommon::LogLevel::error, IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::core::BundleCore::local, send_cb(), dtn::net::DiscoveryAnnouncement::setSequencenumber(), and dtn::net::DiscoveryServiceProvider::update().
|
virtual |
this method updates the given values
Implements dtn::net::DiscoveryServiceProvider.
Definition at line 73 of file LOWPANConvergenceLayer.cpp.
References sockaddr_ieee802154::addr, ieee802154_addr::addr_type, ibrcommon::lowpansocket::getAddress(), IEEE802154_ADDR_SHORT, ieee802154_addr::pan_id, and ieee802154_addr::short_addr.
|
static |
Definition at line 85 of file LOWPANConvergenceLayer.h.