dtn::FileConvergenceLayer Class Reference

#include <FileConvergenceLayer.h>

Inheritance diagram for dtn::FileConvergenceLayer:

dtn::ConvergenceLayer oasys::Logger List of all members.

Detailed Description

Definition at line 46 of file FileConvergenceLayer.h.
static const int CURRENT_VERSION = 0x1
 Current version of the file cl protocol.
dtn::FileConvergenceLayer::FileHeader packed
 Framing header at the beginning of each bundle file.
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 bool open_contact (const ContactRef &contact)
 Validate that the contact eid specifies a legit directory.
virtual bool close_contact (const ContactRef &contact)
 Close the connnection to the contact.
virtual void send_bundle (const ContactRef &contact, Bundle *bundle)
 Try to send the bundles queued up for the given contact.
bool extract_dir (const char *nexthop, std::string *dirp)
 Pull a filesystem directory out of the next hop ssp.
bool validate_dir (const std::string &dir)
 Validate that a given directory exists and that the permissions are correct.

Public Member Functions

 FileConvergenceLayer ()
 Constructor.

Classes

struct  FileHeader
 Framing header at the beginning of each bundle file. More...
class  Scanner
 Helper class (and thread) that periodically scans a directory for new bundle files. More...


Constructor & Destructor Documentation

dtn::FileConvergenceLayer::FileConvergenceLayer (  ) 

Constructor.

Definition at line 65 of file FileConvergenceLayer.cc.


Member Function Documentation

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

Bring up a new interface.

Reimplemented from dtn::ConvergenceLayer.

Definition at line 135 of file FileConvergenceLayer.cc.

References NOTIMPLEMENTED.

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

Bring down the interface.

Reimplemented from dtn::ConvergenceLayer.

Definition at line 173 of file FileConvergenceLayer.cc.

References dtn::Interface::cl_info(), and dtn::FileConvergenceLayer::Scanner::stop().

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

Validate that the contact eid specifies a legit directory.

Implements dtn::ConvergenceLayer.

Definition at line 190 of file FileConvergenceLayer.cc.

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

Close the connnection to the contact.

Reimplemented from dtn::ConvergenceLayer.

Definition at line 213 of file FileConvergenceLayer.cc.

void dtn::FileConvergenceLayer::send_bundle ( const ContactRef contact,
Bundle bundle 
) [virtual]

Try to send the bundles queued up for the given contact.

Implements dtn::ConvergenceLayer.

Definition at line 224 of file FileConvergenceLayer.cc.

References dtn::FileConvergenceLayer::FileHeader::bundle_length, dtn::Bundle::bundleid_, CURRENT_VERSION, errno, extract_dir(), fd, dtn::BundleProtocol::format_header_blocks(), dtn::FileConvergenceLayer::FileHeader::header_length, dtn::BundlePayload::length(), log_debug, log_err, oasys::Logger::logpath_, NOTIMPLEMENTED, dtn::Bundle::payload_, dtn::BundleDaemon::post(), dtn::FileConvergenceLayer::FileHeader::version, and oasys::IO::writevall().

bool dtn::FileConvergenceLayer::extract_dir ( const char *  nexthop,
std::string *  dirp 
) [protected]

Pull a filesystem directory out of the next hop ssp.

Definition at line 74 of file FileConvergenceLayer.cc.

References oasys::URL::host_, log_err, oasys::URL::path_, oasys::URL::port_, and oasys::URL::valid().

Referenced by send_bundle().

bool dtn::FileConvergenceLayer::validate_dir ( const std::string &  dir  )  [protected]

Validate that a given directory exists and that the permissions are correct.

Definition at line 113 of file FileConvergenceLayer.cc.

References errno, and log_err.


Member Data Documentation

const int dtn::FileConvergenceLayer::CURRENT_VERSION = 0x1 [static, protected]

Current version of the file cl protocol.

Definition at line 66 of file FileConvergenceLayer.h.

Referenced by dtn::FileConvergenceLayer::Scanner::run(), and send_bundle().

struct dtn::FileConvergenceLayer::FileHeader dtn::FileConvergenceLayer::packed [protected]

Framing header at the beginning of each bundle file.


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:04 2006 for DTN Reference Implementation by  doxygen 1.5.1