IBR-DTNSuite
0.12
|
#include <LOWPANConvergenceLayer.h>
Public Member Functions | |
LOWPANConvergenceLayer (const ibrcommon::vinterface &net, uint16_t panid, unsigned int mtu=115) | |
virtual | ~LOWPANConvergenceLayer () |
void | onUpdateBeacon (const ibrcommon::vinterface &iface, DiscoveryBeacon &announcement) throw (dtn::net::DiscoveryBeaconHandler::NoServiceHereException) |
void | onAdvertiseBeacon (const ibrcommon::vinterface &iface, const DiscoveryBeacon &beacon) throw () |
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 | send_cb (const char *buf, const size_t len, const ibrcommon::vaddress &addr) |
void | remove (const LOWPANConnection *conn) |
Public Member Functions inherited from dtn::net::ConvergenceLayer | |
virtual | ~ConvergenceLayer ()=0 |
virtual void | open (const dtn::core::Node &) |
virtual void | resetStats () |
virtual void | getStats (ConvergenceLayer::stats_data &data) const |
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 ibrcommon::lowpanstream_callback | |
virtual | ~lowpanstream_callback () |
Public Member Functions inherited from dtn::net::DiscoveryBeaconHandler | |
virtual | ~DiscoveryBeaconHandler ()=0 |
Protected Member Functions | |
virtual void | componentUp () throw () |
virtual void | componentRun () throw () |
virtual void | componentDown () throw () |
void | __cancellation () throw () |
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::pair< string, string > | stats_pair |
typedef std::map< string, string > | stats_data |
This class implements a ConvergenceLayer for LOWPAN.
Definition at line 46 of file LOWPANConvergenceLayer.h.
dtn::net::LOWPANConvergenceLayer::LOWPANConvergenceLayer | ( | const ibrcommon::vinterface & | net, |
uint16_t | panid, | ||
unsigned int | mtu = 115 |
||
) |
Definition at line 54 of file LOWPANConvergenceLayer.cpp.
References AF_IEEE802154.
|
virtual |
Definition at line 65 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 303 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(), dtn::core::BundleCore::getDiscoveryAgent(), dtn::core::BundleCore::getInstance(), ibrcommon::JoinableThread::join(), ibrcommon::JoinableThread::stop(), and dtn::net::DiscoveryAgent::unregisterService().
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 237 of file LOWPANConvergenceLayer.cpp.
References _running, EXTENDED_MASK, dtn::core::BundleCore::getDiscoveryAgent(), dtn::core::BundleCore::getInstance(), dtn::net::LOWPANConnection::getStream(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, dtn::core::BundleCore::local, dtn::net::DiscoveryAgent::obtainBeacon(), dtn::net::DiscoveryAgent::onBeaconReceived(), ibrcommon::lowpanstream::queue(), 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 183 of file LOWPANConvergenceLayer.cpp.
References _running, ibrcommon::vsocket::add(), ibrcommon::LogLevel::error, dtn::core::BundleCore::getDiscoveryAgent(), dtn::core::BundleCore::getInstance(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::net::DiscoveryAgent::registerService(), ibrcommon::vinterface::toString(), ibrcommon::vsocket::up(), and ibrcommon::Exception::what().
|
virtual |
Implements dtn::net::ConvergenceLayer.
Definition at line 70 of file LOWPANConvergenceLayer.cpp.
References dtn::core::Node::CONN_LOWPAN.
|
virtual |
Implements dtn::daemon::Component.
Definition at line 309 of file LOWPANConvergenceLayer.cpp.
|
virtual |
Reimplemented from dtn::net::DiscoveryBeaconHandler.
Definition at line 209 of file LOWPANConvergenceLayer.cpp.
References BUFF_SIZE, ibrcommon::LogLevel::error, IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, and IBRCOMMON_LOGGER_TAG.
|
virtual |
this method updates the given values
Reimplemented from dtn::net::DiscoveryBeaconHandler.
Definition at line 75 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.
|
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 123 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().
void dtn::net::LOWPANConvergenceLayer::remove | ( | const LOWPANConnection * | conn) |
Definition at line 168 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 99 of file LOWPANConvergenceLayer.cpp.
References ibrcommon::vsocket::getAll(), ibrcommon::lowpansocket::sendto(), and ibrcommon::lowpansocket::setAutoAck().