dtn::StreamConvergenceLayer::Connection Class Reference

Stream connection class. More...

#include <StreamConvergenceLayer.h>

Inheritance diagram for dtn::StreamConvergenceLayer::Connection:
dtn::CLConnection dtn::CLInfo dtn::SerialConvergenceLayer::Connection dtn::TCPConvergenceLayer::Connection

List of all members.

Public Member Functions

 Connection (const char *classname, const char *logpath, StreamConvergenceLayer *cl, StreamLinkParams *params, bool active_connector)
 Constructor.

bool send_pending_data ()
 virtual from CLConnection
void handle_bundles_queued ()
 virtual from CLConnection
void handle_cancel_bundle (Bundle *bundle)
 virtual from CLConnection
void handle_poll_timeout ()
 virtual from CLConnection
void break_contact (ContactEvent::reason_t reason)
 virtual from CLConnection

Protected Member Functions

virtual void send_data ()=0
 Hook used to tell the derived CL class to drain data out of the send buffer.

void initiate_contact ()
 utility functions used by derived classes
void process_data ()
 utility functions used by derived classes
void check_keepalive ()
 utility functions used by derived classes

Protected Attributes

InFlightBundlecurrent_inflight_
 Current bundle that's in flight.
size_t send_segment_todo_
 Bytes left to send of current segment.
size_t recv_segment_todo_
 Bytes left to recv of current segment.
struct timeval data_rcvd_
 Timestamp for idle/keepalive timer.
struct timeval data_sent_
 Timestamp for idle timer.
struct timeval keepalive_sent_
 Timestamp for keepalive timer.
bool breaking_contact_
 Bit to catch multiple calls to break_contact.
bool contact_initiated_

Private Member Functions

StreamLinkParamsstream_lparams ()
 Utility function to downcast the params_ pointer that's stored in the CLConnection parent class.

void note_data_rcvd ()
 utility functions used internally in this class
void note_data_sent ()
 utility functions used internally in this class
bool send_pending_acks ()
 utility functions used internally in this class
bool start_next_bundle ()
 utility functions used internally in this class
bool send_next_segment (InFlightBundle *inflight)
 utility functions used internally in this class
bool send_data_todo (InFlightBundle *inflight)
 utility functions used internally in this class
bool finish_bundle (InFlightBundle *inflight)
 utility functions used internally in this class
void check_completed (InFlightBundle *inflight)
 utility functions used internally in this class
void send_keepalive ()
 utility functions used internally in this class
void handle_contact_initiation ()
 utility functions used internally in this class
bool handle_data_segment (u_int8_t flags)
 utility functions used internally in this class
bool handle_data_todo ()
 utility functions used internally in this class
bool handle_ack_segment (u_int8_t flags)
 utility functions used internally in this class
bool handle_refuse_bundle (u_int8_t flags)
 utility functions used internally in this class
bool handle_keepalive (u_int8_t flags)
 utility functions used internally in this class
bool handle_shutdown (u_int8_t flags)
 utility functions used internally in this class
void check_completed (IncomingBundle *incoming)
 utility functions used internally in this class

Detailed Description

Stream connection class.

Definition at line 187 of file StreamConvergenceLayer.h.


Constructor & Destructor Documentation

dtn::StreamConvergenceLayer::Connection::Connection ( const char *  classname,
const char *  logpath,
StreamConvergenceLayer cl,
StreamLinkParams params,
bool  active_connector 
)

Constructor.

Definition at line 124 of file StreamConvergenceLayer.cc.


Member Function Documentation

void dtn::StreamConvergenceLayer::Connection::break_contact ( ContactEvent::reason_t  reason  )  [virtual]

virtual from CLConnection

Reimplemented from dtn::CLConnection.

Definition at line 1361 of file StreamConvergenceLayer.cc.

References breaking_contact_, dtn::ContactEvent::BROKEN, dtn::ContactEvent::CL_ERROR, dtn::ContactEvent::CL_VERSION, dtn::ContactEvent::DISCOVERY, dtn::ContactEvent::IDLE, dtn::ContactEvent::INVALID, dtn::ContactEvent::NO_INFO, dtn::ContactEvent::RECONNECT, send_data(), send_segment_todo_, dtn::CLConnection::sendbuf_, dtn::StreamConvergenceLayer::SHUTDOWN, dtn::ContactEvent::SHUTDOWN, dtn::StreamConvergenceLayer::SHUTDOWN_BUSY, dtn::StreamConvergenceLayer::SHUTDOWN_HAS_REASON, dtn::StreamConvergenceLayer::SHUTDOWN_IDLE_TIMEOUT, dtn::StreamConvergenceLayer::SHUTDOWN_NO_REASON, dtn::StreamConvergenceLayer::SHUTDOWN_VERSION_MISMATCH, dtn::ContactEvent::TIMEOUT, and dtn::ContactEvent::USER.

Referenced by check_completed(), dtn::TCPConvergenceLayer::Connection::connect(), handle_ack_segment(), handle_contact_initiation(), handle_data_segment(), handle_data_todo(), dtn::TCPConvergenceLayer::Connection::handle_poll_activity(), dtn::SerialConvergenceLayer::Connection::handle_poll_activity(), handle_poll_timeout(), dtn::SerialConvergenceLayer::Connection::handle_poll_timeout(), handle_refuse_bundle(), handle_shutdown(), dtn::SerialConvergenceLayer::Connection::initialize_pollfds(), process_data(), dtn::TCPConvergenceLayer::Connection::recv_data(), dtn::SerialConvergenceLayer::Connection::recv_data(), dtn::TCPConvergenceLayer::Connection::send_data(), and dtn::SerialConvergenceLayer::Connection::send_data().

void dtn::StreamConvergenceLayer::Connection::check_completed ( IncomingBundle incoming  )  [private]
void dtn::StreamConvergenceLayer::Connection::check_completed ( InFlightBundle inflight  )  [private]
void dtn::StreamConvergenceLayer::Connection::check_keepalive (  )  [protected]
bool dtn::StreamConvergenceLayer::Connection::finish_bundle ( InFlightBundle inflight  )  [private]

utility functions used internally in this class

Definition at line 701 of file StreamConvergenceLayer.cc.

References ASSERT, check_completed(), current_inflight_, and dtn::CLConnection::InFlightBundle::send_complete_.

Referenced by send_next_segment().

bool dtn::StreamConvergenceLayer::Connection::handle_ack_segment ( u_int8_t  flags  )  [private]
void dtn::StreamConvergenceLayer::Connection::handle_bundles_queued (  )  [virtual]

virtual from CLConnection

Implements dtn::CLConnection.

Definition at line 367 of file StreamConvergenceLayer.cc.

References dtn::CLConnection::contact_.

void dtn::StreamConvergenceLayer::Connection::handle_cancel_bundle ( Bundle bundle  )  [virtual]
void dtn::StreamConvergenceLayer::Connection::handle_contact_initiation (  )  [private]
bool dtn::StreamConvergenceLayer::Connection::handle_data_segment ( u_int8_t  flags  )  [private]
bool dtn::StreamConvergenceLayer::Connection::handle_data_todo (  )  [private]
bool dtn::StreamConvergenceLayer::Connection::handle_keepalive ( u_int8_t  flags  )  [private]

utility functions used internally in this class

Definition at line 1351 of file StreamConvergenceLayer.cc.

References dtn::CLConnection::recvbuf_.

Referenced by process_data().

void dtn::StreamConvergenceLayer::Connection::handle_poll_timeout (  )  [virtual]
bool dtn::StreamConvergenceLayer::Connection::handle_refuse_bundle ( u_int8_t  flags  )  [private]

utility functions used internally in this class

Definition at line 1341 of file StreamConvergenceLayer.cc.

References break_contact(), and dtn::ContactEvent::CL_ERROR.

Referenced by process_data().

bool dtn::StreamConvergenceLayer::Connection::handle_shutdown ( u_int8_t  flags  )  [private]
void dtn::StreamConvergenceLayer::Connection::initiate_contact (  )  [protected]
void dtn::StreamConvergenceLayer::Connection::note_data_rcvd (  )  [private]

utility functions used internally in this class

Definition at line 1046 of file StreamConvergenceLayer.cc.

References data_rcvd_, and dtnsim::gettimeofday().

Referenced by process_data().

void dtn::StreamConvergenceLayer::Connection::note_data_sent (  )  [private]

utility functions used internally in this class

Definition at line 1054 of file StreamConvergenceLayer.cc.

References data_sent_, and dtnsim::gettimeofday().

Referenced by initiate_contact(), send_data_todo(), and send_pending_acks().

void dtn::StreamConvergenceLayer::Connection::process_data (  )  [protected]
virtual void dtn::StreamConvergenceLayer::Connection::send_data (  )  [protected, pure virtual]

Hook used to tell the derived CL class to drain data out of the send buffer.

Implemented in dtn::SerialConvergenceLayer::Connection, and dtn::TCPConvergenceLayer::Connection.

Referenced by break_contact(), initiate_contact(), send_data_todo(), send_keepalive(), and send_pending_acks().

bool dtn::StreamConvergenceLayer::Connection::send_data_todo ( InFlightBundle inflight  )  [private]
void dtn::StreamConvergenceLayer::Connection::send_keepalive (  )  [private]

utility functions used internally in this class

Definition at line 746 of file StreamConvergenceLayer.cc.

References ASSERT, dtnsim::gettimeofday(), dtn::StreamConvergenceLayer::KEEPALIVE, keepalive_sent_, send_data(), send_segment_todo_, and dtn::CLConnection::sendbuf_.

Referenced by check_keepalive().

bool dtn::StreamConvergenceLayer::Connection::send_next_segment ( InFlightBundle inflight  )  [private]
bool dtn::StreamConvergenceLayer::Connection::send_pending_acks (  )  [private]
bool dtn::StreamConvergenceLayer::Connection::send_pending_data (  )  [virtual]
bool dtn::StreamConvergenceLayer::Connection::start_next_bundle (  )  [private]
StreamLinkParams* dtn::StreamConvergenceLayer::Connection::stream_lparams (  )  [inline, private]

Utility function to downcast the params_ pointer that's stored in the CLConnection parent class.

Definition at line 245 of file StreamConvergenceLayer.h.

References ASSERT, and dtn::CLConnection::params_.

Referenced by handle_contact_initiation(), initiate_contact(), and send_next_segment().


Member Data Documentation

Bit to catch multiple calls to break_contact.

Definition at line 259 of file StreamConvergenceLayer.h.

Referenced by break_contact().

Current bundle that's in flight.

Definition at line 253 of file StreamConvergenceLayer.h.

Referenced by check_completed(), finish_bundle(), handle_cancel_bundle(), send_pending_data(), and start_next_bundle().

Timestamp for idle timer.

Definition at line 257 of file StreamConvergenceLayer.h.

Referenced by check_keepalive(), handle_poll_timeout(), initiate_contact(), and note_data_sent().

Timestamp for keepalive timer.

Definition at line 258 of file StreamConvergenceLayer.h.

Referenced by check_keepalive(), handle_poll_timeout(), initiate_contact(), and send_keepalive().

Bytes left to recv of current segment.

Definition at line 255 of file StreamConvergenceLayer.h.

Referenced by handle_data_segment(), handle_data_todo(), and process_data().

Bytes left to send of current segment.

Definition at line 254 of file StreamConvergenceLayer.h.

Referenced by break_contact(), check_keepalive(), handle_cancel_bundle(), send_data_todo(), send_keepalive(), send_next_segment(), and send_pending_data().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:41:06 2010 for DTN Reference Implementation by  doxygen 1.6.3