#include <TCPTunnel.h>
Definition at line 73 of file TCPTunnel.h.
Public Member Functions | |
Connection (TCPTunnel *t, dtn_endpoint_id_t *dest_eid, in_addr_t client_addr, u_int16_t client_port, in_addr_t remote_addr, u_int16_t remote_port) | |
Constructor called to initiate a connection due to an arriving bundle request. | |
Connection (TCPTunnel *t, dtn_endpoint_id_t *dest_eid, int fd, in_addr_t client_addr, u_int16_t client_port, in_addr_t remote_addr, u_int16_t remote_port) | |
Constructor called when a new connection was accepted. | |
~Connection () | |
Destructor. | |
void | handle_bundle (dtn::APIBundle *bundle) |
Handle a newly arriving bundle. | |
Protected Types | |
typedef std::map < u_int32_t, dtn::APIBundle * > | ReorderTable |
Table for out-of-order bundles. | |
Protected Member Functions | |
void | run () |
virtual run method | |
Protected Attributes | |
TCPTunnel * | tcptun_ |
The tcp tunnel object. | |
oasys::TCPClient | sock_ |
The tcp socket. | |
dtn::APIBundleQueue | queue_ |
Queue for bundles on this connection. | |
ReorderTable | reorder_table_ |
u_int32_t | next_seqno_ |
Running sequence number counter. | |
dtn_endpoint_id_t | dest_eid_ |
Parameters for the connection. | |
in_addr_t | client_addr_ |
u_int16_t | client_port_ |
in_addr_t | remote_addr_ |
u_int16_t | remote_port_ |
Friends | |
class | TCPTunnel |
typedef std::map<u_int32_t, dtn::APIBundle*> dtntunnel::TCPTunnel::Connection::ReorderTable [protected] |
dtntunnel::TCPTunnel::Connection::Connection | ( | TCPTunnel * | t, | |
dtn_endpoint_id_t * | dest_eid, | |||
in_addr_t | client_addr, | |||
u_int16_t | client_port, | |||
in_addr_t | remote_addr, | |||
u_int16_t | remote_port | |||
) |
Constructor called to initiate a connection due to an arriving bundle request.
Definition at line 163 of file TCPTunnel.cc.
References dest_eid_, and dtn_copy_eid().
dtntunnel::TCPTunnel::Connection::Connection | ( | TCPTunnel * | t, | |
dtn_endpoint_id_t * | dest_eid, | |||
int | fd, | |||
in_addr_t | client_addr, | |||
u_int16_t | client_port, | |||
in_addr_t | remote_addr, | |||
u_int16_t | remote_port | |||
) |
Constructor called when a new connection was accepted.
Definition at line 181 of file TCPTunnel.cc.
References dest_eid_, and dtn_copy_eid().
dtntunnel::TCPTunnel::Connection::~Connection | ( | ) |
Destructor.
Definition at line 200 of file TCPTunnel.cc.
References queue_, and oasys::MsgQueue< _elt_t >::try_pop().
void dtntunnel::TCPTunnel::Connection::handle_bundle | ( | dtn::APIBundle * | bundle | ) |
Handle a newly arriving bundle.
Definition at line 407 of file TCPTunnel.cc.
References oasys::ScratchBuffer< _memory_t, _static_size >::buf(), oasys::ExpandableBuffer::len(), log_info, next_seqno_, dtn::APIBundle::payload_, oasys::MsgQueue< _elt_t >::push_back(), queue_, reorder_table_, and dtntunnel::DTNTunnel::BundleHeader::seqno_.
Referenced by dtntunnel::TCPTunnel::handle_bundle().
void dtntunnel::TCPTunnel::Connection::run | ( | ) | [protected, virtual] |
virtual run method
Implements oasys::Thread.
Definition at line 210 of file TCPTunnel.cc.
References ASSERT, oasys::ScratchBuffer< _memory_t, _static_size >::buf(), client_addr_, dtntunnel::DTNTunnel::BundleHeader::client_addr_, client_port_, dtntunnel::DTNTunnel::BundleHeader::client_port_, oasys::IPSocket::close(), oasys::IPSocket::connect(), dtntunnel::DTNTunnel::delay(), dest_eid_, DTN_ENOSPACE, dtn_strerror(), DTN_SUCCESS, oasys::ExpandableBuffer::end(), dtntunnel::DTNTunnel::BundleHeader::eof_, errno, oasys::IPSocket::ESTABLISHED, oasys::IPSocket::fd(), oasys::Time::get_time(), intoa, oasys::IOERROR, dtntunnel::TCPTunnel::kill_connection(), oasys::ExpandableBuffer::len(), log_debug, log_err, log_info, oasys::Logger::logpath_, dtntunnel::DTNTunnel::max_size(), dtn::APIBundle::payload_, oasys::IO::poll_multiple(), oasys::MsgQueue< _elt_t >::pop_blocking(), dtntunnel::DTNTunnel::BundleHeader::protocol_, queue_, oasys::IPClient::read(), oasys::Notifier::read_fd(), remote_addr_, dtntunnel::DTNTunnel::BundleHeader::remote_addr_, remote_port_, dtntunnel::DTNTunnel::BundleHeader::remote_port_, oasys::ScratchBuffer< _memory_t, _static_size >::reserve(), oasys::Time::sec_, dtntunnel::DTNTunnel::send_bundle(), dtntunnel::DTNTunnel::BundleHeader::seqno_, oasys::ExpandableBuffer::set_len(), sock_, oasys::IPSocket::state(), tcptun_, oasys::Time::usec_, and oasys::IPClient::writeall().
friend class TCPTunnel [friend] |
Definition at line 93 of file TCPTunnel.h.
TCPTunnel* dtntunnel::TCPTunnel::Connection::tcptun_ [protected] |
Queue for bundles on this connection.
Definition at line 105 of file TCPTunnel.h.
Referenced by handle_bundle(), run(), and ~Connection().
u_int32_t dtntunnel::TCPTunnel::Connection::next_seqno_ [protected] |
Running sequence number counter.
Definition at line 112 of file TCPTunnel.h.
Referenced by handle_bundle().
Parameters for the connection.
Definition at line 115 of file TCPTunnel.h.
Referenced by Connection(), and run().
in_addr_t dtntunnel::TCPTunnel::Connection::client_addr_ [protected] |
Definition at line 116 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
u_int16_t dtntunnel::TCPTunnel::Connection::client_port_ [protected] |
Definition at line 117 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
in_addr_t dtntunnel::TCPTunnel::Connection::remote_addr_ [protected] |
Definition at line 118 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
u_int16_t dtntunnel::TCPTunnel::Connection::remote_port_ [protected] |
Definition at line 119 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().