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 25 of file FileConvergenceLayer.h.

static const int CURRENT_VERSION = 0x1
 Current version of the file cl protocol.
struct
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 admin address.
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 44 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 114 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 152 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 169 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 192 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 203 of file FileConvergenceLayer.cc.

References dtn::FileConvergenceLayer::FileHeader::bundle_length, dtn::Bundle::bundleid_, CURRENT_VERSION, errno, extract_dir(), fd, 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 admin address.

Pull a filesystem directory out of the next hop ssp.

Definition at line 53 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 92 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 45 of file FileConvergenceLayer.h.

Referenced by 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 Sat Sep 8 08:36:22 2007 for DTN Reference Implementation by  doxygen 1.5.3