#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 |
Definition at line 73 of file TCPTunnel.h.
typedef std::map<u_int32_t, dtn::APIBundle*> dtntunnel::TCPTunnel::TCPTunnel::Connection::ReorderTable [protected] |
dtntunnel::TCPTunnel::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 dtntunnel::TCPTunnel::TCPTunnel::Connection::dest_eid_, and dtn_copy_eid().
dtntunnel::TCPTunnel::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 dtntunnel::TCPTunnel::TCPTunnel::Connection::dest_eid_, and dtn_copy_eid().
dtntunnel::TCPTunnel::TCPTunnel::Connection::~Connection | ( | ) |
Destructor.
Definition at line 266 of file TCPTunnel.cc.
References dtntunnel::TCPTunnel::TCPTunnel::Connection::queue_.
int dtntunnel::TCPTunnel::TCPTunnel::Connection::format | ( | char * | buf, | |
size_t | sz | |||
) | const |
Virtual from Formatter.
Definition at line 276 of file TCPTunnel.cc.
References dtntunnel::TCPTunnel::TCPTunnel::Connection::client_addr_, dtntunnel::TCPTunnel::TCPTunnel::Connection::client_port_, dtntunnel::TCPTunnel::TCPTunnel::Connection::connection_id_, dtntunnel::TCPTunnel::TCPTunnel::Connection::dest_eid_, dtntunnel::TCPTunnel::TCPTunnel::Connection::remote_addr_, dtntunnel::TCPTunnel::TCPTunnel::Connection::remote_port_, and dtn_endpoint_id_t::uri.
void dtntunnel::TCPTunnel::TCPTunnel::Connection::handle_bundle | ( | dtn::APIBundle * | bundle | ) |
Handle a newly arriving bundle.
Definition at line 499 of file TCPTunnel.cc.
References dtntunnel::TCPTunnel::TCPTunnel::Connection::next_seqno_, dtn::APIBundle::payload_, dtntunnel::TCPTunnel::TCPTunnel::Connection::queue_, dtntunnel::TCPTunnel::TCPTunnel::Connection::reorder_table_, and dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::seqno_.
void dtntunnel::TCPTunnel::TCPTunnel::Connection::run | ( | ) | [protected] |
virtual run method
Definition at line 289 of file TCPTunnel.cc.
References ASSERT, dtntunnel::TCPTunnel::TCPTunnel::Connection::client_addr_, dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::client_addr_, dtntunnel::TCPTunnel::TCPTunnel::Connection::client_port_, dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::client_port_, dtntunnel::TCPTunnel::TCPTunnel::Connection::connection_id_, dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::connection_id_, dtntunnel::DTNTunnel::delay(), dtntunnel::TCPTunnel::TCPTunnel::Connection::dest_eid_, DTN_ENOSPACE, dtn_strerror(), DTN_SUCCESS, dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::eof_, errno, dtntunnel::TCPTunnel::kill_connection(), len, dtntunnel::DTNTunnel::max_size(), dtn::APIBundle::payload_, dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::protocol_, dtntunnel::TCPTunnel::TCPTunnel::Connection::queue_, dtntunnel::TCPTunnel::TCPTunnel::Connection::remote_addr_, dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::remote_addr_, dtntunnel::TCPTunnel::TCPTunnel::Connection::remote_port_, dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::remote_port_, dtntunnel::DTNTunnel::send_bundle(), dtntunnel::DTNTunnel::DTNTunnel::BundleHeader::seqno_, dtntunnel::TCPTunnel::TCPTunnel::Connection::sock_, and dtntunnel::TCPTunnel::TCPTunnel::Connection::tcptun_.
friend class TCPTunnel [friend] |
Definition at line 101 of file TCPTunnel.h.
in_addr_t dtntunnel::TCPTunnel::TCPTunnel::Connection::client_addr_ [protected] |
Definition at line 124 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and dtntunnel::TCPTunnel::TCPTunnel::Connection::run().
u_int16_t dtntunnel::TCPTunnel::TCPTunnel::Connection::client_port_ [protected] |
Definition at line 125 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and dtntunnel::TCPTunnel::TCPTunnel::Connection::run().
u_int32_t dtntunnel::TCPTunnel::TCPTunnel::Connection::connection_id_ [protected] |
Definition at line 128 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and dtntunnel::TCPTunnel::TCPTunnel::Connection::run().
dtn_endpoint_id_t dtntunnel::TCPTunnel::TCPTunnel::Connection::dest_eid_ [protected] |
Parameters for the connection.
Definition at line 123 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::Connection(), dtntunnel::TCPTunnel::TCPTunnel::Connection::format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and dtntunnel::TCPTunnel::TCPTunnel::Connection::run().
u_int32_t dtntunnel::TCPTunnel::TCPTunnel::Connection::next_seqno_ [protected] |
Running sequence number counter.
Definition at line 120 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::handle_bundle().
dtn::APIBundleQueue dtntunnel::TCPTunnel::TCPTunnel::Connection::queue_ [protected] |
Queue for bundles on this connection.
Definition at line 113 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::handle_bundle(), dtntunnel::TCPTunnel::TCPTunnel::Connection::run(), and dtntunnel::TCPTunnel::TCPTunnel::Connection::~Connection().
in_addr_t dtntunnel::TCPTunnel::TCPTunnel::Connection::remote_addr_ [protected] |
Definition at line 126 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and dtntunnel::TCPTunnel::TCPTunnel::Connection::run().
u_int16_t dtntunnel::TCPTunnel::TCPTunnel::Connection::remote_port_ [protected] |
Definition at line 127 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::format(), dtntunnel::TCPTunnel::kill_connection(), dtntunnel::TCPTunnel::new_connection(), and dtntunnel::TCPTunnel::TCPTunnel::Connection::run().
ReorderTable dtntunnel::TCPTunnel::TCPTunnel::Connection::reorder_table_ [protected] |
Definition at line 117 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::handle_bundle().
oasys::TCPClient dtntunnel::TCPTunnel::TCPTunnel::Connection::sock_ [protected] |
The tcp socket.
Definition at line 110 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::run().
TCPTunnel* dtntunnel::TCPTunnel::TCPTunnel::Connection::tcptun_ [protected] |
The tcp tunnel object.
Definition at line 107 of file TCPTunnel.h.
Referenced by dtntunnel::TCPTunnel::TCPTunnel::Connection::run().