dtntunnel::TCPTunnel Class Reference

Class to manage TCP <-> DTN tunnels. More...

#include <TCPTunnel.h>

Inheritance diagram for dtntunnel::TCPTunnel:

dtntunnel::IPTunnel

List of all members.

Classes

class  Connection
 Helper class to handle an actively proxied connection. More...
struct  ConnKey
 Helper struct used as the index key into the connection table. More...
class  Listener
 Helper class to accept incoming TCP connections. More...

Public Member Functions

 TCPTunnel ()
 Constructor.
void add_listener (in_addr_t listen_addr, u_int16_t listen_port, in_addr_t remote_addr, u_int16_t remote_port)
 Add a new listening to from the given listening address/port to the given remote address/port.
void handle_bundle (dtn::APIBundle *bundle)
 Handle a newly arriving bundle.

Protected Types

typedef std::map< ConnKey,
Connection * > 
ConnTable
 Table of connection classes indexed by the remote address/port.
typedef std::map< ConnKey,
dtn::APIBundleVector * > 
NoConnBundleTable
 Table of bundles that arrive out of order before the connection is set up.

Protected Member Functions

u_int32_t next_connection_id ()
 Return the next connection id.
void new_connection (Connection *c)
 Hook called by the listener when a new connection comes in.
void kill_connection (Connection *c)
 Hook called when a new connection dies.

Protected Attributes

ConnTable connections_
NoConnBundleTable no_conn_bundles_
oasys::SpinLock lock_
 Lock to protect the connections table.
u_int32_t next_connection_id_
 Increasing counter for connection identifiers.


Detailed Description

Class to manage TCP <-> DTN tunnels.

Definition at line 37 of file TCPTunnel.h.


Member Typedef Documentation

typedef std::map<ConnKey, Connection*> dtntunnel::TCPTunnel::ConnTable [protected]

Table of connection classes indexed by the remote address/port.

Definition at line 181 of file TCPTunnel.h.

Table of bundles that arrive out of order before the connection is set up.

Definition at line 186 of file TCPTunnel.h.


Constructor & Destructor Documentation

dtntunnel::TCPTunnel::TCPTunnel (  ) 

Constructor.

Definition at line 29 of file TCPTunnel.cc.


Member Function Documentation

void dtntunnel::TCPTunnel::add_listener ( in_addr_t  listen_addr,
u_int16_t  listen_port,
in_addr_t  remote_addr,
u_int16_t  remote_port 
) [virtual]

Add a new listening to from the given listening address/port to the given remote address/port.

Implements dtntunnel::IPTunnel.

Definition at line 37 of file TCPTunnel.cc.

Referenced by dtntunnel::DTNTunnel::init_tunnel().

void dtntunnel::TCPTunnel::handle_bundle ( dtn::APIBundle bundle  )  [virtual]

void dtntunnel::TCPTunnel::kill_connection ( Connection c  )  [protected]

void dtntunnel::TCPTunnel::new_connection ( Connection c  )  [protected]

u_int32_t dtntunnel::TCPTunnel::next_connection_id (  )  [protected]

Return the next connection id.

Definition at line 46 of file TCPTunnel.cc.

References lock_, and next_connection_id_.

Referenced by dtntunnel::TCPTunnel::TCPTunnel::Listener::accepted().


Member Data Documentation

Definition at line 182 of file TCPTunnel.h.

Referenced by handle_bundle(), kill_connection(), and new_connection().

oasys::SpinLock dtntunnel::TCPTunnel::lock_ [protected]

Lock to protect the connections table.

Definition at line 190 of file TCPTunnel.h.

Referenced by handle_bundle(), kill_connection(), new_connection(), and next_connection_id().

Increasing counter for connection identifiers.

Definition at line 193 of file TCPTunnel.h.

Referenced by next_connection_id().

Definition at line 187 of file TCPTunnel.h.

Referenced by handle_bundle().


The documentation for this class was generated from the following files:

Generated on Fri Jan 30 09:27:05 2009 for DTN Reference Implementation by  doxygen 1.5.8