IBR-DTNSuite
0.8
|
#include <LOWPANConvergenceLayer.h>
Public Member Functions | |
LOWPANConvergenceLayer (ibrcommon::vinterface net, int panid, unsigned int mtu=115) | |
virtual | ~LOWPANConvergenceLayer () |
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) |
virtual const std::string | getName () const |
virtual void | raiseEvent (const Event *evt) |
virtual void | send_cb (char *buf, int len, unsigned int address) |
void | remove (const LOWPANConnection *conn) |
Static Public Attributes | |
static const size_t | BUFF_SIZE = 113 |
Protected Member Functions | |
virtual void | componentUp () |
virtual void | componentRun () |
virtual void | componentDown () |
void | __cancellation () |
virtual void | sendAnnoucement (const u_int16_t &sn, std::list< dtn::net::DiscoveryService > &services) |
This class implements a ConvergenceLayer for LOWPAN.
Definition at line 25 of file LOWPANConvergenceLayer.h.
dtn::net::LOWPANConvergenceLayer::LOWPANConvergenceLayer | ( | ibrcommon::vinterface | net, |
int | panid, | ||
unsigned int | mtu = 115 |
||
) |
Definition at line 30 of file LOWPANConvergenceLayer.cpp.
Definition at line 37 of file LOWPANConvergenceLayer.cpp.
References componentDown().
void dtn::net::LOWPANConvergenceLayer::__cancellation | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 290 of file LOWPANConvergenceLayer.cpp.
References _running, and ibrcommon::lowpansocket::shutdown().
void dtn::net::LOWPANConvergenceLayer::componentDown | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 175 of file LOWPANConvergenceLayer.cpp.
References dtn::core::TimeEvent::className, ibrcommon::JoinableThread::join(), ibrcommon::JoinableThread::stop(), and dtn::core::EventReceiver::unbindEvent().
Referenced by ~LOWPANConvergenceLayer().
void dtn::net::LOWPANConvergenceLayer::componentRun | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 227 of file LOWPANConvergenceLayer.cpp.
References _running, EXTENDED_MASK, dtn::net::LOWPANConnection::getStream(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, ibrcommon::lowpanstream::queue(), ibrcommon::lowpansocket::receive(), dtn::net::DiscoveryAgent::received(), and ibrcommon::Thread::yield().
void dtn::net::LOWPANConvergenceLayer::componentUp | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 157 of file LOWPANConvergenceLayer.cpp.
References dtn::net::DiscoveryAgent::addService(), ibrcommon::UnicastSocketLowpan::bind(), dtn::core::EventReceiver::bindEvent(), dtn::core::TimeEvent::className, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, ibrcommon::vinterface::toString(), and ibrcommon::Exception::what().
dtn::core::Node::Protocol dtn::net::LOWPANConvergenceLayer::getDiscoveryProtocol | ( | ) | const [virtual] |
Implements dtn::net::ConvergenceLayer.
Definition at line 43 of file LOWPANConvergenceLayer.cpp.
References dtn::core::Node::CONN_LOWPAN.
const std::string dtn::net::LOWPANConvergenceLayer::getName | ( | ) | const [virtual] |
Implements dtn::daemon::Component.
Definition at line 296 of file LOWPANConvergenceLayer.cpp.
void dtn::net::LOWPANConvergenceLayer::queue | ( | const dtn::core::Node & | n, |
const ConvergenceLayer::Job & | job | ||
) | [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 104 of file LOWPANConvergenceLayer.cpp.
References dtn::net::LOWPANConnection::_sender, dtn::core::Node::CONN_LOWPAN, dtn::core::Node::URI::decode(), dtn::core::Node::get(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, and dtn::net::LOWPANConnectionSender::queue().
void dtn::net::LOWPANConvergenceLayer::raiseEvent | ( | const Event * | evt | ) | [virtual] |
Implements dtn::core::EventReceiver.
Definition at line 279 of file LOWPANConvergenceLayer.cpp.
References dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), dtn::core::TIME_SECOND_TICK, and dtn::net::DiscoveryAgent::timeout().
void dtn::net::LOWPANConvergenceLayer::remove | ( | const LOWPANConnection * | conn | ) |
Definition at line 142 of file LOWPANConvergenceLayer.cpp.
Referenced by dtn::net::LOWPANConnection::finally().
void dtn::net::LOWPANConvergenceLayer::send_cb | ( | char * | buf, |
int | len, | ||
unsigned int | address | ||
) | [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 73 of file LOWPANConvergenceLayer.cpp.
References sockaddr_ieee802154::addr, ibrcommon::lowpansocket::getAddress(), ibrcommon::lowpansocket::getPeer(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, ieee802154_addr::pan_id, ibrcommon::lowpansocket::peer::send(), and ieee802154_addr::short_addr.
Referenced by sendAnnoucement().
void dtn::net::LOWPANConvergenceLayer::sendAnnoucement | ( | const u_int16_t & | sn, |
std::list< dtn::net::DiscoveryService > & | services | ||
) | [protected, virtual] |
Implements dtn::net::DiscoveryAgent.
Definition at line 182 of file LOWPANConvergenceLayer.cpp.
References dtn::net::DiscoveryAnnouncement::addService(), dtn::net::DiscoveryAnnouncement::clearServices(), dtn::net::DiscoveryAnnouncement::DISCO_VERSION_01, IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, dtn::core::BundleCore::local, send_cb(), dtn::net::DiscoveryAnnouncement::setSequencenumber(), and dtn::net::DiscoveryService::update().
void dtn::net::LOWPANConvergenceLayer::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 48 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.
const size_t dtn::net::LOWPANConvergenceLayer::BUFF_SIZE = 113 [static] |
Definition at line 61 of file LOWPANConvergenceLayer.h.