IBR-DTNSuite  0.10
dtn::net::DatagramConvergenceLayer Class Reference

#include <DatagramConvergenceLayer.h>

Inheritance diagram for dtn::net::DatagramConvergenceLayer:
Inheritance graph
Collaboration diagram for dtn::net::DatagramConvergenceLayer:
Collaboration graph

Public Types

enum  HEADER_FLAGS {
  HEADER_UNKOWN = 0, HEADER_BROADCAST = 1, HEADER_SEGMENT = 2, HEADER_ACK = 4,
  HEADER_NACK = 8
}
 
- Public Types inherited from dtn::net::ConvergenceLayer
typedef std::map< std::string,
size_t > 
stats_map
 

Public Member Functions

 DatagramConvergenceLayer (DatagramService *ds)
 
virtual ~DatagramConvergenceLayer ()
 
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 dtn::core::Event *evt) throw ()
 
- Public Member Functions inherited from dtn::net::ConvergenceLayer
virtual ~ConvergenceLayer ()=0
 
virtual void open (const dtn::core::Node &)
 
virtual void resetStats ()
 
virtual const stats_mapgetStats ()
 
- 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::core::EventReceiver
virtual ~EventReceiver ()=0
 
- Public Member Functions inherited from dtn::net::DatagramConnectionCallback
virtual ~DatagramConnectionCallback ()
 

Static Public Attributes

static const std::string TAG = "DatagramConvergenceLayer"
 

Protected Member Functions

virtual void componentUp () throw ()
 
virtual void componentRun () throw ()
 
virtual void componentDown () throw ()
 
void __cancellation () throw ()
 
void sendAnnoucement ()
 
void callback_send (DatagramConnection &connection, const char &flags, const unsigned int &seqno, const std::string &destination, const char *buf, const dtn::data::Length &len) throw (DatagramException)
 
void callback_ack (DatagramConnection &connection, const unsigned int &seqno, const std::string &destination) throw (DatagramException)
 
void connectionUp (const DatagramConnection *conn)
 
void connectionDown (const DatagramConnection *conn)
 
- 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

Detailed Description

Definition at line 41 of file DatagramConvergenceLayer.h.

Member Enumeration Documentation

Enumerator
HEADER_UNKOWN 
HEADER_BROADCAST 
HEADER_SEGMENT 
HEADER_ACK 
HEADER_NACK 

Definition at line 47 of file DatagramConvergenceLayer.h.

Constructor & Destructor Documentation

dtn::net::DatagramConvergenceLayer::DatagramConvergenceLayer ( DatagramService ds)

Definition at line 43 of file DatagramConvergenceLayer.cpp.

References dtn::net::ConvergenceLayer::addStats().

Here is the call graph for this function:

dtn::net::DatagramConvergenceLayer::~DatagramConvergenceLayer ( )
virtual

Definition at line 51 of file DatagramConvergenceLayer.cpp.

References ibrcommon::JoinableThread::join(), and ibrcommon::Conditional::wait().

Here is the call graph for this function:

Member Function Documentation

void dtn::net::DatagramConvergenceLayer::__cancellation ( ) throw ()
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 332 of file DatagramConvergenceLayer.cpp.

References dtn::net::DatagramService::shutdown().

Here is the call graph for this function:

void dtn::net::DatagramConvergenceLayer::callback_ack ( DatagramConnection connection,
const unsigned int &  seqno,
const std::string &  destination 
) throw (DatagramException)
protectedvirtual

Implements dtn::net::DatagramConnectionCallback.

Definition at line 80 of file DatagramConvergenceLayer.cpp.

void dtn::net::DatagramConvergenceLayer::callback_send ( DatagramConnection connection,
const char &  flags,
const unsigned int &  seqno,
const std::string &  destination,
const char *  buf,
const dtn::data::Length len 
) throw (DatagramException)
protectedvirtual

callback send for connections

Parameters
connection
destination
buf
len

Implements dtn::net::DatagramConnectionCallback.

Definition at line 68 of file DatagramConvergenceLayer.cpp.

void dtn::net::DatagramConvergenceLayer::componentDown ( ) throw ()
protectedvirtual

This method is called if the component should stop. Clean-up code should be inserted here.

Implements dtn::daemon::IndependentComponent.

Definition at line 177 of file DatagramConvergenceLayer.cpp.

References ibrcommon::RWMutex::LOCK_READONLY, and dtn::core::EventDispatcher< E >::remove().

Here is the call graph for this function:

void dtn::net::DatagramConvergenceLayer::componentUp ( ) throw ()
protectedvirtual
void dtn::net::DatagramConvergenceLayer::connectionDown ( const DatagramConnection conn)
protectedvirtual
void dtn::net::DatagramConvergenceLayer::connectionUp ( const DatagramConnection conn)
protectedvirtual

Implements dtn::net::DatagramConnectionCallback.

Definition at line 138 of file DatagramConvergenceLayer.cpp.

References dtn::net::DatagramConnection::getIdentifier(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, and TAG.

Here is the call graph for this function:

dtn::core::Node::Protocol dtn::net::DatagramConvergenceLayer::getDiscoveryProtocol ( ) const
virtual

Returns the protocol identifier

Returns

Implements dtn::net::ConvergenceLayer.

Definition at line 63 of file DatagramConvergenceLayer.cpp.

References dtn::net::DatagramService::getProtocol().

Here is the call graph for this function:

const std::string dtn::net::DatagramConvergenceLayer::getName ( ) const
virtual
See Also
Component::getName()

Implements dtn::daemon::Component.

Definition at line 338 of file DatagramConvergenceLayer.cpp.

References TAG.

void dtn::net::DatagramConvergenceLayer::queue ( const dtn::core::Node n,
const dtn::net::BundleTransfer job 
)
virtual

Queueing a job for a specific node. Starting point for the DTN core to submit bundles to nodes behind the convergence layer

Parameters
nNode reference
jobJob reference

Implements dtn::net::ConvergenceLayer.

Definition at line 89 of file DatagramConvergenceLayer.cpp.

References dtn::core::Node::get(), dtn::core::Node::getEID(), dtn::net::DatagramService::getProtocol(), dtn::data::EID::getString(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, ibrcommon::RWMutex::LOCK_READONLY, dtn::net::DatagramConnection::queue(), TAG, and dtn::core::Node::URI::value.

Here is the call graph for this function:

void dtn::net::DatagramConvergenceLayer::raiseEvent ( const dtn::core::Event evt) throw ()
virtual

Public method for event callbacks

Parameters
evt

Implements dtn::core::EventReceiver.

Definition at line 321 of file DatagramConvergenceLayer.cpp.

References dtn::data::SDNV< E >::get(), dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and dtn::core::TIME_SECOND_TICK.

Here is the call graph for this function:

Member Data Documentation

const std::string dtn::net::DatagramConvergenceLayer::TAG = "DatagramConvergenceLayer"
static

The documentation for this class was generated from the following files: