dtn::ConvergenceLayer Class Reference

The abstract interface for a convergence layer. More...

#include <ConvergenceLayer.h>

Inheritance diagram for dtn::ConvergenceLayer:

dtn::ConnectionConvergenceLayer dtn::FileConvergenceLayer dtn::IPConvergenceLayer dtn::NullConvergenceLayer dtnsim::SimConvergenceLayer dtn::StreamConvergenceLayer dtn::UDPConvergenceLayer dtn::SerialConvergenceLayer dtn::TCPConvergenceLayer

List of all members.

Public Member Functions

 ConvergenceLayer (const char *classname, const char *name)
 Constructor.
virtual ~ConvergenceLayer ()
 Destructor.
virtual bool set_cla_parameters (AttributeVector &params)
 Set CL-specific options.
virtual bool set_interface_defaults (int argc, const char *argv[], const char **invalidp)
 Set default interface options.
virtual bool set_link_defaults (int argc, const char *argv[], const char **invalidp)
 Set default link options.
virtual bool interface_up (Interface *iface, int argc, const char *argv[])
 Bring up a new interface.
virtual bool interface_down (Interface *iface)
 Bring down the interface.
virtual void dump_interface (Interface *iface, oasys::StringBuffer *buf)
 Dump out CL specific interface information.
virtual bool init_link (const LinkRef &link, int argc, const char *argv[])
 Create any CL-specific components of the Link.
virtual void delete_link (const LinkRef &link)
 Delete any CL-specific components of the link (requests pertaining to this link must be ignored gracefully by the CL in the future).
virtual void dump_link (const LinkRef &link, oasys::StringBuffer *buf)
 Dump out CL specific link information.
virtual bool reconfigure_link (const LinkRef &link, int argc, const char *argv[])
 Post-initialization, parse any CL-specific options for the link.
virtual void reconfigure_link (const LinkRef &link, AttributeVector &params)
virtual bool open_contact (const ContactRef &contact)=0
 Open a new contact for the given link.
virtual bool close_contact (const ContactRef &contact)
 Close the open contact.
virtual void bundle_queued (const LinkRef &link, const BundleRef &bundle)=0
 Notify the convergence layer that a bundle was queued on the link.
virtual void cancel_bundle (const LinkRef &link, const BundleRef &bundle)
 Try to cancel transmission of a given bundle on the link.
virtual void is_eid_reachable (const std::string &query_id, Interface *iface, const std::string &endpoint)
 Report if the given endpoint is reachable via the given interface.
virtual void query_link_attributes (const std::string &query_id, const LinkRef &link, const AttributeNameVector &attributes)
 Report the values of the given link attributes.
virtual void query_iface_attributes (const std::string &query_id, Interface *iface, const AttributeNameVector &attributes)
 Report the values of the given interface attributes.
virtual void query_cla_parameters (const std::string &query_id, const AttributeNameVector &parameters)
 Report the values of the convergence layer parameters.
virtual void shutdown ()
 Perform any necessary shutdown procedures.
const char * name ()
 Accessor for the convergence layer name.

Static Public Member Functions

static void init_clayers ()
 Boot-time initialization and registration of statically defined convergence layers.
static void add_clayer (ConvergenceLayer *cl)
static ConvergenceLayerfind_clayer (const char *proto)
 Find the appropriate convergence layer for the given string.
static void shutdown_clayers ()
 Shutdown all registerd convergence layers.

Static Public Attributes

static const u_int32_t MAGIC = 0x64746e21
 Magic number used for DTN convergence layers.

Protected Attributes

const char * name_
 The unique name of this convergence layer.


Detailed Description

The abstract interface for a convergence layer.

Definition at line 40 of file ConvergenceLayer.h.


Constructor & Destructor Documentation

dtn::ConvergenceLayer::ConvergenceLayer ( const char *  classname,
const char *  name 
) [inline]

Constructor.

Definition at line 45 of file ConvergenceLayer.h.

dtn::ConvergenceLayer::~ConvergenceLayer (  )  [virtual]

Destructor.

Definition at line 38 of file ConvergenceLayer.cc.


Member Function Documentation

void dtn::ConvergenceLayer::add_clayer ( ConvergenceLayer cl  )  [static]

Definition at line 44 of file ConvergenceLayer.cc.

Referenced by init_clayers().

virtual void dtn::ConvergenceLayer::bundle_queued ( const LinkRef link,
const BundleRef bundle 
) [pure virtual]

Notify the convergence layer that a bundle was queued on the link.

In some cases (e.g. TCP) this just kicks the other thread to notice that there are bundles to send out. In others (e.g. UDP) there is no per-contact thread, so this callback is used to send the bundle.

Implemented in dtn::ConnectionConvergenceLayer, dtn::NullConvergenceLayer, and dtn::UDPConvergenceLayer.

void dtn::ConvergenceLayer::cancel_bundle ( const LinkRef link,
const BundleRef bundle 
) [virtual]

Try to cancel transmission of a given bundle on the link.

Reimplemented in dtn::ConnectionConvergenceLayer, and dtn::NullConvergenceLayer.

Definition at line 230 of file ConvergenceLayer.cc.

bool dtn::ConvergenceLayer::close_contact ( const ContactRef contact  )  [virtual]

Close the open contact.

Mainly used to clean the state that is associated with this contact. This is called by the link->close() function.

Note that this function should NOT post a ContactDownEvent, as this function is only called to clean up the contact state after it has been closed (i.e. after the ContactDownEvent has been generated by some other part of the system).

Reimplemented in dtn::ConnectionConvergenceLayer, dtn::FileConvergenceLayer, and dtn::UDPConvergenceLayer.

Definition at line 221 of file ConvergenceLayer.cc.

Referenced by dtn::Link::close().

void dtn::ConvergenceLayer::delete_link ( const LinkRef link  )  [virtual]

Delete any CL-specific components of the link (requests pertaining to this link must be ignored gracefully by the CL in the future).

Reimplemented in dtn::ConnectionConvergenceLayer, dtn::NullConvergenceLayer, and dtn::UDPConvergenceLayer.

Definition at line 184 of file ConvergenceLayer.cc.

References ASSERT.

Referenced by dtn::Link::delete_link().

void dtn::ConvergenceLayer::dump_interface ( Interface iface,
oasys::StringBuffer *  buf 
) [virtual]

Dump out CL specific interface information.

Reimplemented in dtn::TCPConvergenceLayer, and dtn::UDPConvergenceLayer.

Definition at line 165 of file ConvergenceLayer.cc.

Referenced by dtn::InterfaceTable::list().

void dtn::ConvergenceLayer::dump_link ( const LinkRef link,
oasys::StringBuffer *  buf 
) [virtual]

Dump out CL specific link information.

Reimplemented in dtn::ConnectionConvergenceLayer, dtn::SerialConvergenceLayer, dtn::StreamConvergenceLayer, dtn::TCPConvergenceLayer, and dtn::UDPConvergenceLayer.

Definition at line 193 of file ConvergenceLayer.cc.

Referenced by dtn::Link::dump().

ConvergenceLayer * dtn::ConvergenceLayer::find_clayer ( const char *  proto  )  [static]

void dtn::ConvergenceLayer::init_clayers (  )  [static]

Boot-time initialization and registration of statically defined convergence layers.

Definition at line 51 of file ConvergenceLayer.cc.

References add_clayer().

Referenced by dtn::DTNServer::init_components().

bool dtn::ConvergenceLayer::init_link ( const LinkRef link,
int  argc,
const char *  argv[] 
) [virtual]

Create any CL-specific components of the Link.

Reimplemented in dtn::ConnectionConvergenceLayer, dtn::NullConvergenceLayer, and dtn::UDPConvergenceLayer.

Definition at line 173 of file ConvergenceLayer.cc.

bool dtn::ConvergenceLayer::interface_down ( Interface iface  )  [virtual]

Bring down the interface.

Reimplemented in dtn::FileConvergenceLayer, dtn::TCPConvergenceLayer, and dtn::UDPConvergenceLayer.

Definition at line 156 of file ConvergenceLayer.cc.

References dtn::Interface::name().

Referenced by dtn::InterfaceTable::del().

bool dtn::ConvergenceLayer::interface_up ( Interface iface,
int  argc,
const char *  argv[] 
) [virtual]

Bring up a new interface.

Reimplemented in dtn::FileConvergenceLayer, dtn::TCPConvergenceLayer, and dtn::UDPConvergenceLayer.

Definition at line 144 of file ConvergenceLayer.cc.

References dtn::Interface::name().

Referenced by dtn::InterfaceTable::add().

void dtn::ConvergenceLayer::is_eid_reachable ( const std::string &  query_id,
Interface iface,
const std::string &  endpoint 
) [virtual]

Report if the given endpoint is reachable via the given interface.

Definition at line 238 of file ConvergenceLayer.cc.

References dtn::BundleDaemon::post().

Referenced by dtn::BundleDaemon::handle_eid_reachable_query().

const char* dtn::ConvergenceLayer::name (  )  [inline]

virtual bool dtn::ConvergenceLayer::open_contact ( const ContactRef contact  )  [pure virtual]

Open a new contact for the given link.

The implementation will create a new Contact object (or find one that already exists), establish any CL specific connections, then post a ContactUpEvent when the contact is successfully initiated.

Implemented in dtn::ConnectionConvergenceLayer, dtn::FileConvergenceLayer, dtn::NullConvergenceLayer, and dtn::UDPConvergenceLayer.

Referenced by dtn::Link::open().

void dtn::ConvergenceLayer::query_cla_parameters ( const std::string &  query_id,
const AttributeNameVector parameters 
) [virtual]

Report the values of the convergence layer parameters.

Definition at line 282 of file ConvergenceLayer.cc.

References dtn::BundleDaemon::post().

Referenced by dtn::BundleDaemon::handle_cla_parameters_query().

void dtn::ConvergenceLayer::query_iface_attributes ( const std::string &  query_id,
Interface iface,
const AttributeNameVector attributes 
) [virtual]

Report the values of the given interface attributes.

Definition at line 269 of file ConvergenceLayer.cc.

References dtn::BundleDaemon::post().

Referenced by dtn::BundleDaemon::handle_iface_attributes_query().

void dtn::ConvergenceLayer::query_link_attributes ( const std::string &  query_id,
const LinkRef link,
const AttributeNameVector attributes 
) [virtual]

Report the values of the given link attributes.

Definition at line 250 of file ConvergenceLayer.cc.

References ASSERT, and dtn::BundleDaemon::post().

void dtn::ConvergenceLayer::reconfigure_link ( const LinkRef link,
AttributeVector params 
) [virtual]

Definition at line 211 of file ConvergenceLayer.cc.

bool dtn::ConvergenceLayer::reconfigure_link ( const LinkRef link,
int  argc,
const char *  argv[] 
) [virtual]

Post-initialization, parse any CL-specific options for the link.

Reimplemented in dtn::ConnectionConvergenceLayer, and dtn::NullConvergenceLayer.

Definition at line 201 of file ConvergenceLayer.cc.

Referenced by dtn::Link::reconfigure_link().

bool dtn::ConvergenceLayer::set_cla_parameters ( AttributeVector params  )  [virtual]

Set CL-specific options.

Definition at line 108 of file ConvergenceLayer.cc.

References dtn::BundleDaemon::post().

Referenced by dtn::BundleDaemon::handle_cla_set_params().

bool dtn::ConvergenceLayer::set_interface_defaults ( int  argc,
const char *  argv[],
const char **  invalidp 
) [virtual]

Set default interface options.

Definition at line 118 of file ConvergenceLayer.cc.

bool dtn::ConvergenceLayer::set_link_defaults ( int  argc,
const char *  argv[],
const char **  invalidp 
) [virtual]

Set default link options.

Reimplemented in dtn::SerialConvergenceLayer, and dtn::TCPConvergenceLayer.

Definition at line 131 of file ConvergenceLayer.cc.

Referenced by dtn::LinkCommand::exec().

virtual void dtn::ConvergenceLayer::shutdown (  )  [inline, virtual]

Perform any necessary shutdown procedures.

Definition at line 182 of file ConvergenceLayer.h.

void dtn::ConvergenceLayer::shutdown_clayers (  )  [static]

Shutdown all registerd convergence layers.

Definition at line 95 of file ConvergenceLayer.cc.

Referenced by dtn::BundleDaemon::handle_shutdown_request().


Member Data Documentation

const u_int32_t dtn::ConvergenceLayer::MAGIC = 0x64746e21 [static]

const char* dtn::ConvergenceLayer::name_ [protected]

The unique name of this convergence layer.

Definition at line 216 of file ConvergenceLayer.h.

Referenced by name().


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

Generated on Fri Jan 30 09:43:14 2009 for DTN Reference Implementation by  doxygen 1.5.8