dtn::BluetoothConvergenceLayer::Connection Class Reference

#include <BluetoothConvergenceLayer.h>

Inheritance diagram for dtn::BluetoothConvergenceLayer::Connection:

dtn::CLInfo oasys::Thread oasys::Logger List of all members.

Detailed Description

Helper class that wraps the sender-side per-contact state.

Definition at line 216 of file BluetoothConvergenceLayer.h.

Public Member Functions

 Connection (BluetoothConvergenceLayer *cl, bdaddr_t remote_addr, Params *params)
 Constructor for the active connection side of a connection.
 Connection (BluetoothConvergenceLayer *cl, int fd, bdaddr_t remote_addr, u_int8_t channel, Params *params)
 Constructor for the passive accept side of a connection.
 ~Connection ()
 Destructor.
void set_contact (const ContactRef &c)
bool passive ()
 Was this object formed by active or passive connect?
void interrupt_from_io ()
 Interrupt from IO operations.

Public Attributes

BluetoothConvergenceLayer::Params params_
 Per-connection parameters.

Protected Types

typedef std::list< InFlightBundleInFlightList
 Typedef for the list of in-flight bundles.

Protected Member Functions

virtual void run ()
 The main loop for a connection.
void recv_loop ()
void send_loop ()
 The sender side main loop.
void break_contact (ContactEvent::reason_t reason)
 Send an event to the system indicating that this contact is broken and close this side of the connection.
bool connect ()
 Active (MASTER) connect side of the initial handshake.
bool accept ()
 Passive (SLAVE) accept side of initial handshake.
bool send_contact_header ()
 Helper function to format and send a contact header.
bool recv_contact_header (int timeout)
 Helper function to receive a contact header (and potentially the local identifier), verifying the version and magic bits and doing parameter negotiation.
bool send_address ()
bool recv_address (int timeout)
bool send_bundle (Bundle *bundle)
 Send one bundle over the wire.
bool send_announce ()
 Send announcement bundle to bluetooth address.
bool recv_bundle ()
 Receive one bundle over the wire.
void recv_announce ()
 Receive bundle (expected to be response Bundle Announcement).
bool handle_reply ()
 Handle an incoming message from the receiver side (i.e.
int handle_ack ()
 Handle an incoming ack from the receive buffer.
bool send_ack (u_int32_t bundle_id, size_t acked_len)
 Send an ack message.
bool send_keepalive ()
 Send a keepalive byte.
void note_data_rcvd ()
 Note that we observed some data inbound on this connection.

Protected Attributes

Listenerlistener_
 only used by passive
BluetoothConvergenceLayercl_
 Pointer to the CL instance.
bool initiate_
 Do we initiate the connection.
oasys::RFCOMMClientsock_
 The socket.
ContactRef contact_
 Contact for sender-side.
oasys::StreamBuffer rcvbuf_
 Buffer for incoming data.
oasys::ScratchBuffer< u_char * > sndbuf_
 Buffer outgoing bundle data.
BlockingBundleListqueue_
 Queue of bundles.
InFlightList inflight_
 List of bundles to be acked.
oasys::Notifierevent_notifier_
 Notifier for BD event synch.
BundleRef announce_
 contains AnnounceBundle, if used
timeval data_rcvd_
 Timestamp for idle timer.
timeval keepalive_sent_
 Timestamp for keepalive timer.

Friends

class BluetoothConvergenceLayer
class NeighborDiscovery
class ConnectionManager
class Listener

Classes

struct  InFlightBundle
 Struct used to record bundles that are in-flight along with their transmission times. More...


Member Typedef Documentation

typedef std::list<InFlightBundle> dtn::BluetoothConvergenceLayer::Connection::InFlightList [protected]

Typedef for the list of in-flight bundles.

Definition at line 302 of file BluetoothConvergenceLayer.h.


Constructor & Destructor Documentation

dtn::BluetoothConvergenceLayer::Connection::Connection ( BluetoothConvergenceLayer cl,
bdaddr_t  remote_addr,
Params params 
)

Constructor for the active connection side of a connection.

Definition at line 595 of file BluetoothConvergenceLayer.cc.

References oasys::Bluetooth::batostr(), event_notifier_, oasys::IOHandlerBase::get_notifier(), dtn::BluetoothConvergenceLayer::Params::local_addr_, oasys::Logger::logpath_, oasys::Logger::logpath_appendf(), oasys::Logger::logpathf(), dtn::BlockingBundleList::notifier(), queue_, oasys::BluetoothSocket::set_local_addr(), oasys::BluetoothSocket::set_logfd(), oasys::IOHandlerBase::set_notifier(), oasys::BluetoothSocket::set_remote_addr(), and sock_.

dtn::BluetoothConvergenceLayer::Connection::Connection ( BluetoothConvergenceLayer cl,
int  fd,
bdaddr_t  remote_addr,
u_int8_t  channel,
Params params 
)

Constructor for the passive accept side of a connection.

Definition at line 625 of file BluetoothConvergenceLayer.cc.

References oasys::Bluetooth::batostr(), event_notifier_, oasys::IOHandlerBase::get_notifier(), dtn::BluetoothConvergenceLayer::Params::local_addr_, oasys::Logger::logpath_, oasys::Logger::logpathf(), queue_, oasys::BluetoothSocket::set_local_addr(), oasys::BluetoothSocket::set_logfd(), oasys::IOHandlerBase::set_notifier(), and sock_.

dtn::BluetoothConvergenceLayer::Connection::~Connection (  ) 

Destructor.

Definition at line 654 of file BluetoothConvergenceLayer.cc.

References event_notifier_, queue_, and sock_.


Member Function Documentation

void dtn::BluetoothConvergenceLayer::Connection::set_contact ( const ContactRef c  )  [inline]

Definition at line 246 of file BluetoothConvergenceLayer.h.

References contact_.

Referenced by dtn::BluetoothConvergenceLayer::open_contact().

bool dtn::BluetoothConvergenceLayer::Connection::passive (  )  [inline]

Was this object formed by active or passive connect?

Definition at line 251 of file BluetoothConvergenceLayer.h.

References initiate_.

void dtn::BluetoothConvergenceLayer::Connection::interrupt_from_io (  )  [inline]

Interrupt from IO operations.

Definition at line 256 of file BluetoothConvergenceLayer.h.

References oasys::IOHandlerBase::interrupt_from_io(), and sock_.

Referenced by dtn::BluetoothConvergenceLayer::close_contact().

void dtn::BluetoothConvergenceLayer::Connection::run (  )  [protected, virtual]

The main loop for a connection.

Based on the initial construction state, it either initiates a connection to the other side, or accepts one, then calls main_loop.

The whole thing is wrapped in a big loop so the active side of the connection is restarted if it's supposed to be, e.g. for links that are configured as ALWAYSON but end up breaking the connection.

Implements oasys::Thread.

Definition at line 672 of file BluetoothConvergenceLayer.cc.

References accept(), ASSERT, break_contact(), dtn::ContactEvent::BROKEN, connect(), contact_, oasys::IOHandlerBase::get_notifier(), initiate_, log_debug, log_err, log_info, dtn::BluetoothConvergenceLayer::Params::max_retry_interval_, dtn::BluetoothConvergenceLayer::Params::min_retry_interval_, dtn::Link::OPENING, dtn::Link::OPPORTUNISTIC, params_, recv_loop(), dtn::BluetoothConvergenceLayer::Params::retry_interval_, send_loop(), dtn::Link::set_state(), oasys::Thread::should_stop(), sock_, dtn::Link::state(), and dtn::Link::type().

void dtn::BluetoothConvergenceLayer::Connection::recv_loop (  )  [protected]

Definition at line 1923 of file BluetoothConvergenceLayer.cc.

References ASSERT, break_contact(), dtn::ContactEvent::BROKEN, dtn::BluetoothConvergenceLayer::BUNDLE_DATA, oasys::StreamBuffer::consume(), oasys::StreamBuffer::data(), oasys::StreamBuffer::end(), oasys::StreamBuffer::fill(), oasys::StreamBuffer::fullbytes(), oasys::IOEOF, oasys::IOERROR, oasys::IOTIMEOUT, dtn::BluetoothConvergenceLayer::KEEPALIVE, dtn::BluetoothConvergenceLayer::Params::keepalive_interval_, log_debug, log_err, log_info, note_data_rcvd(), params_, rcvbuf_, dtn::BluetoothConvergenceLayer::Params::readbuf_len_, recv_bundle(), oasys::StreamBuffer::reserve(), send_keepalive(), dtn::ContactEvent::SHUTDOWN, dtn::BluetoothConvergenceLayer::SHUTDOWN, sock_, oasys::StreamBuffer::start(), oasys::StreamBuffer::tailbytes(), and oasys::BluetoothClient::timeout_read().

Referenced by run().

void dtn::BluetoothConvergenceLayer::Connection::send_loop (  )  [protected]

The sender side main loop.

Definition at line 1747 of file BluetoothConvergenceLayer.cc.

References ASSERT, break_contact(), dtn::ContactEvent::BROKEN, contact_, data_rcvd_, oasys::BluetoothSocket::ESTABLISHED, event_notifier_, oasys::BluetoothSocket::fd(), oasys::IOHandlerBase::get_notifier(), dtnsim::gettimeofday(), handle_reply(), dtn::ContactEvent::IDLE, inflight_, oasys::IOINTR, oasys::IOTIMEOUT, dtn::BluetoothConvergenceLayer::Params::keepalive_interval_, keepalive_sent_, log_debug, log_info, oasys::Logger::logpath_, dtn::BlockingBundleList::notifier(), dtn::Link::ONDEMAND, params_, oasys::IO::poll_multiple(), dtn::BundleList::pop_front(), dtn::BundleDaemon::post_and_wait(), queue_, rcvbuf_, oasys::Notifier::read_fd(), dtn::BluetoothConvergenceLayer::Params::readbuf_len_, oasys::ScratchBuffer< _memory_t, _static_size >::reserve(), oasys::StreamBuffer::reserve(), send_bundle(), send_keepalive(), oasys::Thread::set_should_stop(), oasys::Thread::should_stop(), sndbuf_, sock_, oasys::BluetoothSocket::state(), TIMEVAL_DIFF_MSEC, dtn::ContactEvent::USER, and dtn::BluetoothConvergenceLayer::Params::writebuf_len_.

Referenced by run().

void dtn::BluetoothConvergenceLayer::Connection::break_contact ( ContactEvent::reason_t  reason  )  [protected]

Send an event to the system indicating that this contact is broken and close this side of the connection.

This results in the Connection thread stopping and the system calling the link->close() call which cleans up the connection.

If this is the sender-side, we keep a pointer to the contact and assuming the contact isn't in the process of being closed, we post a request that it be closed

Definition at line 1588 of file BluetoothConvergenceLayer.cc.

References ASSERT, oasys::BluetoothSocket::close(), oasys::BluetoothSocket::CLOSED, contact_, event_notifier_, dtn::ContactEvent::IDLE, inflight_, initiate_, log_notice, log_warn, dtn::BundleDaemon::post(), dtn::BundleDaemon::post_and_wait(), queue_, oasys::BluetoothClient::set_nonblocking(), oasys::Thread::set_should_stop(), oasys::Thread::should_stop(), dtn::BluetoothConvergenceLayer::SHUTDOWN, dtn::BundleList::size(), sock_, oasys::BluetoothSocket::state(), dtn::ContactEvent::USER, oasys::Notifier::wait(), and oasys::BluetoothClient::write().

Referenced by handle_ack(), handle_reply(), recv_announce(), recv_bundle(), recv_loop(), run(), send_bundle(), send_keepalive(), and send_loop().

bool dtn::BluetoothConvergenceLayer::Connection::connect (  )  [protected]

Active (MASTER) connect side of the initial handshake.

First connect to the peer side, then exchange ContactHeaders and negotiate session parameters.

Definition at line 1516 of file BluetoothConvergenceLayer.cc.

References ASSERT, oasys::Bluetooth::batostr(), BDADDR_ANY, oasys::BluetoothSocket::channel(), oasys::BluetoothSocket::close(), oasys::BluetoothSocket::ESTABLISHED, oasys::IOHandlerBase::interrupt_from_io(), oasys::Thread::is_stopped(), oasys::BluetoothServer::listen(), listener_, log_debug, params_, oasys::RFCOMMServerThread::rc_bind(), oasys::RFCOMMClient::rc_connect(), recv_contact_header(), oasys::BluetoothSocket::remote_addr(), dtn::BluetoothConvergenceLayer::Params::rtt_timeout_, send_contact_header(), oasys::Thread::set_should_stop(), sock_, oasys::Thread::start(), oasys::BluetoothSocket::state(), and oasys::Thread::yield().

Referenced by run(), and send_announce().

bool dtn::BluetoothConvergenceLayer::Connection::accept (  )  [protected]

Passive (SLAVE) accept side of initial handshake.

Definition at line 1564 of file BluetoothConvergenceLayer.cc.

References ASSERT, contact_, log_debug, params_, recv_contact_header(), dtn::BluetoothConvergenceLayer::Params::rtt_timeout_, and send_contact_header().

Referenced by run().

bool dtn::BluetoothConvergenceLayer::Connection::send_contact_header (  )  [protected]

Helper function to format and send a contact header.

Definition at line 1427 of file BluetoothConvergenceLayer.cc.

References dtn::BluetoothConvergenceLayer::BTCL_VERSION, dtn::BluetoothConvergenceLayer::BUNDLE_ACK_ENABLED, dtn::BluetoothConvergenceLayer::Params::bundle_ack_enabled_, errno, dtn::BluetoothConvergenceLayer::BTCLHeader::flags, dtn::BluetoothConvergenceLayer::BTCLHeader::keepalive_interval, dtn::BluetoothConvergenceLayer::Params::keepalive_interval_, log_err, dtn::ConvergenceLayer::MAGIC, dtn::BluetoothConvergenceLayer::BTCLHeader::magic, params_, dtn::BluetoothConvergenceLayer::BTCLHeader::partial_ack_len, dtn::BluetoothConvergenceLayer::Params::partial_ack_len_, sock_, dtn::BluetoothConvergenceLayer::BTCLHeader::version, oasys::BluetoothClient::writeall(), and dtn::BluetoothConvergenceLayer::BTCLHeader::xx__unused.

Referenced by accept(), and connect().

bool dtn::BluetoothConvergenceLayer::Connection::recv_contact_header ( int  timeout  )  [protected]

Helper function to receive a contact header (and potentially the local identifier), verifying the version and magic bits and doing parameter negotiation.

Definition at line 1458 of file BluetoothConvergenceLayer.cc.

References ASSERT, dtn::BluetoothConvergenceLayer::BTCL_VERSION, dtn::BluetoothConvergenceLayer::BUNDLE_ACK_ENABLED, dtn::BluetoothConvergenceLayer::Params::bundle_ack_enabled_, errno, oasys::IOTIMEOUT, dtn::BluetoothConvergenceLayer::Params::keepalive_interval_, log_err, log_warn, dtn::ConvergenceLayer::MAGIC, MIN, note_data_rcvd(), params_, dtn::BluetoothConvergenceLayer::Params::partial_ack_len_, sock_, and oasys::BluetoothClient::timeout_readall().

Referenced by accept(), and connect().

bool dtn::BluetoothConvergenceLayer::Connection::send_address (  )  [protected]

bool dtn::BluetoothConvergenceLayer::Connection::recv_address ( int  timeout  )  [protected]

bool dtn::BluetoothConvergenceLayer::Connection::send_bundle ( Bundle bundle  )  [protected]

Send one bundle over the wire.

Return true if the bundle was sent successfully, false if not.

Definition at line 871 of file BluetoothConvergenceLayer.cc.

References ASSERT, break_contact(), dtn::ContactEvent::BROKEN, oasys::ScratchBuffer< _memory_t, _static_size >::buf(), oasys::ExpandableBuffer::buf_len(), dtn::BluetoothConvergenceLayer::Params::bundle_ack_enabled_, dtn::BluetoothConvergenceLayer::BUNDLE_DATA, dtn::BluetoothConvergenceLayer::BundleDataHeader::bundle_id, contact_, dtn::SDNV::encode(), dtn::SDNV::encoding_len(), errno, dtn::BundleProtocol::format_header_blocks(), handle_reply(), inflight_, oasys::IOINTR, oasys::IOTIMEOUT, dtn::BundlePayload::KEEP_FILE_OPEN, dtn::BundlePayload::length(), log_debug, log_err, log_info, params_, dtn::AnnounceBundle::parse_announce_bundle(), dtn::Bundle::payload_, oasys::BluetoothSocket::poll_sockfd(), dtn::BundleDaemon::post(), sndbuf_, sock_, dtn::BluetoothConvergenceLayer::BundleDataHeader::total_length, dtn::ContactEvent::USER, oasys::BluetoothClient::writeall(), dtn::BluetoothConvergenceLayer::Params::writebuf_len_, and oasys::BluetoothClient::writevall().

Referenced by send_announce(), and send_loop().

bool dtn::BluetoothConvergenceLayer::Connection::send_announce (  )  [protected]

Send announcement bundle to bluetooth address.

Definition at line 773 of file BluetoothConvergenceLayer.cc.

References announce_, oasys::StringBuffer::appendf(), ASSERT, oasys::Bluetooth::batostr(), BDADDR_ANY, oasys::StringBuffer::c_str(), connect(), dtn::AnnounceBundle::create_announce_bundle(), oasys::BluetoothSocket::ESTABLISHED, dtn::BundleDaemon::instance(), dtn::BundleDaemon::local_eid(), oasys::LOG_DEBUG, log_debug, oasys::Logger::log_multiline(), oasys::Ref< _Type >::object(), params_, rcvbuf_, dtn::BluetoothConvergenceLayer::Params::readbuf_len_, oasys::BluetoothSocket::remote_addr(), oasys::ScratchBuffer< _memory_t, _static_size >::reserve(), oasys::StreamBuffer::reserve(), send_bundle(), sndbuf_, sock_, oasys::BluetoothSocket::state(), and dtn::BluetoothConvergenceLayer::Params::writebuf_len_.

Referenced by recv_bundle(), and dtn::BluetoothConvergenceLayer::NeighborDiscovery::send_announce().

bool dtn::BluetoothConvergenceLayer::Connection::recv_bundle (  )  [protected]

Receive one bundle over the wire.

Note that immediately before this call, we have just consumed the one byte BUNDLE_DATA typecode off the wire.

Definition at line 1038 of file BluetoothConvergenceLayer.cc.

References announce_, dtn::BundlePayload::append_data(), oasys::StringBuffer::appendf(), ASSERT, oasys::Bluetooth::batostr(), break_contact(), dtn::ContactEvent::BROKEN, dtn::BluetoothConvergenceLayer::Params::bundle_ack_enabled_, dtn::BluetoothConvergenceLayer::BundleDataHeader::bundle_id, oasys::StringBuffer::c_str(), dtn::EndpointID::c_str(), cl_, oasys::StreamBuffer::consume(), dtn::BundleDaemon::contactmgr(), oasys::StreamBuffer::data(), dtn::SDNV::decode(), oasys::StreamBuffer::end(), errno, dtn::EVENTSRC_PEER, oasys::StreamBuffer::fill(), oasys::StreamBuffer::fullbytes(), dtn::BundleDaemon::instance(), oasys::IOEOF, oasys::IOTIMEOUT, dtn::BundlePayload::length(), log_debug, log_err, oasys::LOG_INFO, log_info, oasys::Logger::log_multiline(), log_warn, dtn::BluetoothConvergenceLayer::Params::neighbor_poll_interval_, dtn::ContactManager::new_opportunistic_link(), note_data_rcvd(), params_, dtn::AnnounceBundle::parse_announce_bundle(), dtn::BundleProtocol::parse_header_blocks(), dtn::BluetoothConvergenceLayer::Params::partial_ack_len_, dtn::Bundle::payload_, dtn::BundleDaemon::post(), rcvbuf_, oasys::BluetoothSocket::remote_addr(), oasys::StreamBuffer::reserve(), dtn::BluetoothConvergenceLayer::Params::rtt_timeout_, send_ack(), send_announce(), oasys::Thread::set_should_stop(), oasys::StreamBuffer::size(), sock_, oasys::StreamBuffer::start(), oasys::StreamBuffer::tailbytes(), and oasys::BluetoothClient::timeout_read().

Referenced by handle_reply(), recv_announce(), and recv_loop().

void dtn::BluetoothConvergenceLayer::Connection::recv_announce (  )  [protected]

Receive bundle (expected to be response Bundle Announcement).

Definition at line 822 of file BluetoothConvergenceLayer.cc.

References ASSERT, break_contact(), dtn::ContactEvent::BROKEN, dtn::BluetoothConvergenceLayer::BUNDLE_DATA, oasys::StreamBuffer::consume(), oasys::StreamBuffer::data(), oasys::StreamBuffer::end(), oasys::StreamBuffer::fill(), oasys::StreamBuffer::fullbytes(), oasys::IOEOF, oasys::IOERROR, oasys::IOTIMEOUT, dtn::BluetoothConvergenceLayer::Params::keepalive_interval_, log_debug, log_info, note_data_rcvd(), params_, rcvbuf_, recv_bundle(), sock_, oasys::StreamBuffer::start(), oasys::StreamBuffer::tailbytes(), and oasys::BluetoothClient::timeout_read().

Referenced by dtn::BluetoothConvergenceLayer::NeighborDiscovery::send_announce().

bool dtn::BluetoothConvergenceLayer::Connection::handle_reply (  )  [protected]

Handle an incoming message from the receiver side (i.e.

an ack, keepalive, or shutdown. We expect that the caller just completed a poll() such that data is waiting on the socket, therefore read as much as is available into the receive buffer and process until the end of complete messages.

Definition at line 1678 of file BluetoothConvergenceLayer.cc.

References break_contact(), dtn::ContactEvent::BROKEN, dtn::BluetoothConvergenceLayer::BUNDLE_ACK, dtn::BluetoothConvergenceLayer::BUNDLE_DATA, oasys::StreamBuffer::consume(), oasys::StreamBuffer::end(), oasys::StreamBuffer::fill(), oasys::StreamBuffer::fullbytes(), handle_ack(), initiate_, oasys::IOINTR, dtn::BluetoothConvergenceLayer::KEEPALIVE, log_err, log_info, note_data_rcvd(), rcvbuf_, oasys::BluetoothClient::read(), recv_bundle(), oasys::StreamBuffer::reserve(), send_keepalive(), dtn::ContactEvent::SHUTDOWN, dtn::BluetoothConvergenceLayer::SHUTDOWN, sock_, oasys::StreamBuffer::start(), oasys::StreamBuffer::tailbytes(), and dtn::ContactEvent::USER.

Referenced by send_bundle(), and send_loop().

int dtn::BluetoothConvergenceLayer::Connection::handle_ack (  )  [protected]

Handle an incoming ack from the receive buffer.

Definition at line 1359 of file BluetoothConvergenceLayer.cc.

References dtn::BluetoothConvergenceLayer::Connection::InFlightBundle::acked_len_, dtn::BluetoothConvergenceLayer::BundleAckHeader::acked_length, dtn::Link::AVAILABLE, break_contact(), dtn::ContactEvent::BROKEN, dtn::BluetoothConvergenceLayer::Connection::InFlightBundle::bundle_, dtn::BluetoothConvergenceLayer::BundleAckHeader::bundle_id, dtn::Bundle::bundleid_, dtn::Link::BUSY, oasys::StreamBuffer::consume(), contact_, event_notifier_, oasys::StreamBuffer::fullbytes(), inflight_, dtn::BundlePayload::length(), log_debug, log_err, dtn::ContactEvent::NO_INFO, oasys::Ref< _Type >::object(), dtn::Bundle::payload_, dtn::BundleDaemon::post(), dtn::BundleDaemon::post_and_wait(), rcvbuf_, and oasys::StreamBuffer::start().

Referenced by handle_reply().

bool dtn::BluetoothConvergenceLayer::Connection::send_ack ( u_int32_t  bundle_id,
size_t  acked_len 
) [protected]

Send an ack message.

Definition at line 1291 of file BluetoothConvergenceLayer.cc.

References dtn::BluetoothConvergenceLayer::BundleAckHeader::acked_length, dtn::BluetoothConvergenceLayer::BUNDLE_ACK, dtn::BluetoothConvergenceLayer::BundleAckHeader::bundle_id, errno, log_info, sock_, and oasys::BluetoothClient::writevall().

Referenced by recv_bundle().

bool dtn::BluetoothConvergenceLayer::Connection::send_keepalive (  )  [protected]

Send a keepalive byte.

Definition at line 1323 of file BluetoothConvergenceLayer.cc.

References break_contact(), dtn::ContactEvent::BROKEN, oasys::IOINTR, dtn::BluetoothConvergenceLayer::KEEPALIVE, log_info, sock_, dtn::ContactEvent::USER, and oasys::BluetoothClient::write().

Referenced by handle_reply(), recv_loop(), and send_loop().

void dtn::BluetoothConvergenceLayer::Connection::note_data_rcvd (  )  [protected]

Note that we observed some data inbound on this connection.

Definition at line 1348 of file BluetoothConvergenceLayer.cc.

References data_rcvd_, dtnsim::gettimeofday(), and log_debug.

Referenced by handle_reply(), recv_announce(), recv_bundle(), recv_contact_header(), and recv_loop().


Friends And Related Function Documentation

friend class BluetoothConvergenceLayer [friend]

Definition at line 259 of file BluetoothConvergenceLayer.h.

friend class NeighborDiscovery [friend]

Definition at line 260 of file BluetoothConvergenceLayer.h.

friend class ConnectionManager [friend]

Definition at line 261 of file BluetoothConvergenceLayer.h.

friend class Listener [friend]

Definition at line 262 of file BluetoothConvergenceLayer.h.


Member Data Documentation

BluetoothConvergenceLayer::Params dtn::BluetoothConvergenceLayer::Connection::params_

Per-connection parameters.

Definition at line 244 of file BluetoothConvergenceLayer.h.

Referenced by accept(), connect(), recv_announce(), recv_bundle(), recv_contact_header(), recv_loop(), run(), send_announce(), send_bundle(), send_contact_header(), and send_loop().

Listener* dtn::BluetoothConvergenceLayer::Connection::listener_ [protected]

only used by passive

Definition at line 304 of file BluetoothConvergenceLayer.h.

Referenced by dtn::BluetoothConvergenceLayer::Listener::accepted(), connect(), and dtn::BluetoothConvergenceLayer::ConnectionManager::connection().

BluetoothConvergenceLayer* dtn::BluetoothConvergenceLayer::Connection::cl_ [protected]

Pointer to the CL instance.

Definition at line 305 of file BluetoothConvergenceLayer.h.

Referenced by recv_bundle().

bool dtn::BluetoothConvergenceLayer::Connection::initiate_ [protected]

Do we initiate the connection.

Definition at line 306 of file BluetoothConvergenceLayer.h.

Referenced by break_contact(), handle_reply(), passive(), and run().

oasys::RFCOMMClient* dtn::BluetoothConvergenceLayer::Connection::sock_ [protected]

The socket.

Definition at line 307 of file BluetoothConvergenceLayer.h.

Referenced by break_contact(), connect(), Connection(), handle_reply(), interrupt_from_io(), recv_announce(), recv_bundle(), recv_contact_header(), recv_loop(), run(), send_ack(), send_announce(), send_bundle(), send_contact_header(), send_keepalive(), send_loop(), and ~Connection().

ContactRef dtn::BluetoothConvergenceLayer::Connection::contact_ [protected]

Contact for sender-side.

Definition at line 308 of file BluetoothConvergenceLayer.h.

Referenced by accept(), break_contact(), handle_ack(), run(), send_bundle(), send_loop(), and set_contact().

oasys::StreamBuffer dtn::BluetoothConvergenceLayer::Connection::rcvbuf_ [protected]

Buffer for incoming data.

Definition at line 309 of file BluetoothConvergenceLayer.h.

Referenced by handle_ack(), handle_reply(), recv_announce(), recv_bundle(), recv_loop(), send_announce(), and send_loop().

oasys::ScratchBuffer<u_char*> dtn::BluetoothConvergenceLayer::Connection::sndbuf_ [protected]

Buffer outgoing bundle data.

Definition at line 310 of file BluetoothConvergenceLayer.h.

Referenced by send_announce(), send_bundle(), and send_loop().

BlockingBundleList* dtn::BluetoothConvergenceLayer::Connection::queue_ [protected]

Queue of bundles.

Definition at line 311 of file BluetoothConvergenceLayer.h.

Referenced by break_contact(), Connection(), send_loop(), and ~Connection().

InFlightList dtn::BluetoothConvergenceLayer::Connection::inflight_ [protected]

List of bundles to be acked.

Definition at line 312 of file BluetoothConvergenceLayer.h.

Referenced by break_contact(), handle_ack(), send_bundle(), and send_loop().

oasys::Notifier* dtn::BluetoothConvergenceLayer::Connection::event_notifier_ [protected]

Notifier for BD event synch.

Definition at line 313 of file BluetoothConvergenceLayer.h.

Referenced by break_contact(), Connection(), handle_ack(), send_loop(), and ~Connection().

BundleRef dtn::BluetoothConvergenceLayer::Connection::announce_ [protected]

contains AnnounceBundle, if used

Definition at line 314 of file BluetoothConvergenceLayer.h.

Referenced by recv_bundle(), and send_announce().

struct timeval dtn::BluetoothConvergenceLayer::Connection::data_rcvd_ [protected]

Timestamp for idle timer.

Definition at line 316 of file BluetoothConvergenceLayer.h.

Referenced by note_data_rcvd(), and send_loop().

struct timeval dtn::BluetoothConvergenceLayer::Connection::keepalive_sent_ [protected]

Timestamp for keepalive timer.

Definition at line 317 of file BluetoothConvergenceLayer.h.

Referenced by send_loop().


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