Helper class to handle an actively proxied connection. More...
#include <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, u_int32_t connection_id) | |
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, u_int32_t connection_id) | |
Constructor called when a new connection was accepted. | |
~Connection () | |
Destructor. | |
int | format (char *buf, size_t sz) const |
Virtual from Formatter. | |
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_ |
u_int32_t | connection_id_ |
Friends | |
class | TCPTunnel |
Helper class to handle an actively proxied connection.
Definition at line 73 of file TCPTunnel.h.
typedef std::map<u_int32_t, dtn::APIBundle*> dtntunnel::TCPTunnel::Connection::ReorderTable [protected] |
Table for out-of-order bundles.
Definition at line 116 of file TCPTunnel.h.
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, | |||
u_int32_t | connection_id | |||
) |
Constructor called to initiate a connection due to an arriving bundle request.
Definition at line 225 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, | |||
u_int32_t | connection_id | |||
) |
Constructor called when a new connection was accepted.
Definition at line 245 of file TCPTunnel.cc.
References dest_eid_, and dtn_copy_eid().
dtntunnel::TCPTunnel::Connection::~Connection | ( | ) |
int dtntunnel::TCPTunnel::Connection::format | ( | char * | buf, | |
size_t | sz | |||
) | const |
Virtual from Formatter.
Definition at line 276 of file TCPTunnel.cc.
References client_addr_, client_port_, connection_id_, dest_eid_, remote_addr_, remote_port_, and dtn_endpoint_id_t::uri.
void dtntunnel::TCPTunnel::Connection::handle_bundle | ( | dtn::APIBundle * | bundle | ) |
Handle a newly arriving bundle.
Definition at line 499 of file TCPTunnel.cc.
References next_seqno_, dtn::APIBundle::payload_, queue_, reorder_table_, and dtntunnel::DTNTunnel::BundleHeader::seqno_.
void dtntunnel::TCPTunnel::Connection::run | ( | ) | [protected] |
virtual run method
Definition at line 289 of file TCPTunnel.cc.
References ASSERT, client_addr_, dtntunnel::DTNTunnel::BundleHeader::client_addr_, client_port_, dtntunnel::DTNTunnel::BundleHeader::client_port_, connection_id_, dtntunnel::DTNTunnel::BundleHeader::connection_id_, dtntunnel::DTNTunnel::delay(), dest_eid_, DTN_ENOSPACE, dtn_strerror(), DTN_SUCCESS, dtntunnel::DTNTunnel::BundleHeader::eof_, errno, dtntunnel::TCPTunnel::kill_connection(), len, dtntunnel::DTNTunnel::max_size(), dtn::APIBundle::payload_, dtntunnel::DTNTunnel::BundleHeader::protocol_, queue_, remote_addr_, dtntunnel::DTNTunnel::BundleHeader::remote_addr_, remote_port_, dtntunnel::DTNTunnel::BundleHeader::remote_port_, dtntunnel::DTNTunnel::send_bundle(), dtntunnel::DTNTunnel::BundleHeader::seqno_, sock_, and tcptun_.
friend class TCPTunnel [friend] |
Definition at line 101 of file TCPTunnel.h.
in_addr_t dtntunnel::TCPTunnel::Connection::client_addr_ [protected] |
Definition at line 124 of file TCPTunnel.h.
Referenced by format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
u_int16_t dtntunnel::TCPTunnel::Connection::client_port_ [protected] |
Definition at line 125 of file TCPTunnel.h.
Referenced by format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
u_int32_t dtntunnel::TCPTunnel::Connection::connection_id_ [protected] |
Definition at line 128 of file TCPTunnel.h.
Referenced by format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
Parameters for the connection.
Definition at line 123 of file TCPTunnel.h.
Referenced by Connection(), format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
u_int32_t dtntunnel::TCPTunnel::Connection::next_seqno_ [protected] |
Running sequence number counter.
Definition at line 120 of file TCPTunnel.h.
Referenced by handle_bundle().
Queue for bundles on this connection.
Definition at line 113 of file TCPTunnel.h.
Referenced by handle_bundle(), run(), and ~Connection().
in_addr_t dtntunnel::TCPTunnel::Connection::remote_addr_ [protected] |
Definition at line 126 of file TCPTunnel.h.
Referenced by format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
u_int16_t dtntunnel::TCPTunnel::Connection::remote_port_ [protected] |
Definition at line 127 of file TCPTunnel.h.
Referenced by format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and run().
Definition at line 117 of file TCPTunnel.h.
Referenced by handle_bundle().
oasys::TCPClient dtntunnel::TCPTunnel::Connection::sock_ [protected] |
TCPTunnel* dtntunnel::TCPTunnel::Connection::tcptun_ [protected] |