dtn::APIClient Class Reference

Class that implements the API session. More...

#include <APIServer.h>

List of all members.

Public Member Functions

 APIClient (int fd, in_addr_t remote_host, u_int16_t remote_port, APIServer *parent)
virtual ~APIClient ()
virtual void run ()
void close_client ()

Protected Member Functions

int handle_handshake ()
int handle_local_eid ()
int handle_register ()
int handle_unregister ()
int handle_find_registration ()
int handle_bind ()
int handle_unbind ()
int handle_send ()
int handle_cancel ()
int handle_recv ()
int handle_begin_poll ()
int handle_cancel_poll ()
int handle_close ()
int handle_session_update ()
int wait_for_notify (const char *operation, dtn_timeval_t timeout, APIRegistration **recv_ready_reg, APIRegistration **session_ready_reg, bool *sock_ready)
int handle_unexpected_data (const char *operation)
int send_response (int ret)
bool is_bound (u_int32_t regid)

Protected Attributes

char buf_ [DTN_MAX_API_MSG]
XDR xdr_encode_
XDR xdr_decode_
APIRegistrationListbindings_
APIRegistrationListsessions_
oasys::Notifier notifier_
APIServerparent_
size_t total_sent_
size_t total_rcvd_

Detailed Description

Class that implements the API session.

Definition at line 82 of file APIServer.h.


Constructor & Destructor Documentation

dtn::APIClient::APIClient ( int  fd,
in_addr_t  remote_host,
u_int16_t  remote_port,
APIServer parent 
)

Definition at line 185 of file APIServer.cc.

References bindings_, buf_, DTN_MAX_API_MSG, sessions_, xdr_decode_, and xdr_encode_.

dtn::APIClient::~APIClient (  )  [virtual]

Definition at line 202 of file APIServer.cc.

References bindings_, and sessions_.


Member Function Documentation

void dtn::APIClient::close_client (  ) 
int dtn::APIClient::handle_begin_poll (  )  [protected]
int dtn::APIClient::handle_bind (  )  [protected]
int dtn::APIClient::handle_cancel (  )  [protected]
int dtn::APIClient::handle_cancel_poll (  )  [protected]

Definition at line 1532 of file APIServer.cc.

References DTN_SUCCESS.

Referenced by run().

int dtn::APIClient::handle_close (  )  [protected]

Definition at line 1544 of file APIServer.cc.

Referenced by run().

int dtn::APIClient::handle_find_registration (  )  [protected]
int dtn::APIClient::handle_handshake (  )  [protected]

Definition at line 236 of file APIServer.cc.

References DTN_IPC_VERSION, DTN_OPEN, errno, total_rcvd_, and total_sent_.

Referenced by run().

int dtn::APIClient::handle_local_eid (  )  [protected]
int dtn::APIClient::handle_recv (  )  [protected]

Definition at line 1187 of file APIServer.cc.

References dtn_bundle_status_report_t::ack_by_app_ts, dtn::BundleStatusReport::data_t::ack_by_app_tv_, ASSERT, dtn_bundle_spec_t::blocks, dtn_bundle_spec_t::blocks_len, dtn_bundle_spec_t::blocks_val, dtn_bundle_payload_t::buf, buf, dtn_bundle_payload_t::buf_len, dtn_bundle_payload_t::buf_val, dtn_bundle_status_report_t::bundle_id, dtn::APIRegistration::bundle_list(), dtn::Bundle::bundleid(), dtn::BundlePayload::copy_file(), dtn::EndpointID::copyto(), dtn_bundle_id_t::creation_ts, dtn::Bundle::creation_ts(), dtn_bundle_spec_t::creation_ts, dtn::Bundle::custody_rcpt(), dtn::Bundle::custody_requested(), dtn_bundle_status_report_t::custody_ts, dtn::BundleStatusReport::data_t::custody_tv_, dtn_extension_block_t::data, dtn_sequence_id_t::data, dtn_extension_block_t::data_len, dtn_sequence_id_t::data_len, dtn_extension_block_t::data_val, dtn_sequence_id_t::data_val, dtn::Bundle::deletion_rcpt(), dtn_bundle_status_report_t::deletion_ts, dtn::BundleStatusReport::data_t::deletion_tv_, dtn::Bundle::delivery_rcpt(), dtn_bundle_spec_t::delivery_regid, dtn_bundle_status_report_t::delivery_ts, dtn::BundleStatusReport::data_t::delivery_tv_, dtn_bundle_spec_t::dest, dtn::Bundle::dest(), dtn_bundle_spec_t::dopts, DOPTS_CUSTODY, DOPTS_CUSTODY_RCPT, DOPTS_DELETE_RCPT, DOPTS_DELIVERY_RCPT, DOPTS_FORWARD_RCPT, DOPTS_RECEIVE_RCPT, DTN_EINTERNAL, DTN_EINVAL, DTN_EXDR, DTN_MAX_BUNDLE_MEM, DTN_PAYLOAD_FILE, DTN_PAYLOAD_MEM, DTN_SUCCESS, dtn::SequenceID::empty(), errno, dtn::Bundle::expiration(), dtn_bundle_spec_t::expiration, dtn_bundle_payload_t::filename, dtn_bundle_payload_t::filename_len, dtn_bundle_payload_t::filename_val, dtn_bundle_status_report_t::flags, dtn_extension_block_t::flags, dtn::Bundle::forward_rcpt(), dtn_bundle_status_report_t::forwarding_ts, dtn::BundleStatusReport::data_t::forwarding_tv_, dtn_bundle_id_t::frag_offset, handle_unexpected_data(), dtn::BundlePayload::length(), dtn_bundle_payload_t::location, dtn_bundle_spec_t::metadata, dtn::BundleProtocol::METADATA_BLOCK, dtn_bundle_spec_t::metadata_len, dtn_bundle_spec_t::metadata_val, dtn_bundle_spec_t::obsoletes_id, dtn::Bundle::obsoletes_id(), dtn::BundleStatusReport::data_t::orig_creation_tv_, dtn::BundleStatusReport::data_t::orig_frag_length_, dtn::BundleStatusReport::data_t::orig_frag_offset_, dtn_bundle_id_t::orig_length, dtn::BundleStatusReport::data_t::orig_source_eid_, dtn::BundleStatusReport::parse_status_report(), dtn::Bundle::payload(), dtn::BundleProtocol::PAYLOAD_BLOCK, dtn::BundleList::pop_front(), dtn::BundleDaemon::post(), dtn::BundleProtocol::PRIMARY_BLOCK, dtn::BundlePayload::read_data(), dtn_bundle_status_report_t::reason, dtn::BundleStatusReport::data_t::reason_code_, dtn_bundle_status_report_t::receipt_ts, dtn::BundleStatusReport::data_t::receipt_tv_, dtn::Bundle::receive_rcpt(), dtn::Bundle::recv_blocks(), dtn::Bundle::recv_metadata(), dtn::Registration::regid(), dtn_bundle_spec_t::replyto, dtn::Bundle::replyto(), dtn::BundleTimestamp::seconds_, dtn_timestamp_t::secs, dtn_timestamp_t::seqno, dtn::BundleTimestamp::seqno_, dtn_bundle_spec_t::sequence_id, dtn::Bundle::sequence_id(), dtn_bundle_id_t::source, dtn_bundle_spec_t::source, dtn::Bundle::source(), dtn::BundleStatusReport::data_t::status_flags_, dtn_bundle_payload_t::status_report, dtn::SequenceID::to_str(), dtn_extension_block_t::type, wait_for_notify(), xdr_decode_, xdr_dtn_bundle_payload_location_t(), xdr_dtn_bundle_payload_t(), xdr_dtn_bundle_spec_t(), xdr_dtn_timeval_t(), and xdr_encode_.

Referenced by run().

int dtn::APIClient::handle_register (  )  [protected]
int dtn::APIClient::handle_send (  )  [protected]
int dtn::APIClient::handle_session_update (  )  [protected]
int dtn::APIClient::handle_unbind (  )  [protected]
int dtn::APIClient::handle_unexpected_data ( const char *  operation  )  [protected]

Definition at line 1789 of file APIServer.cc.

References DTN_ECOMM.

Referenced by handle_recv(), and handle_session_update().

int dtn::APIClient::handle_unregister (  )  [protected]
bool dtn::APIClient::is_bound ( u_int32_t  regid  )  [protected]

Definition at line 456 of file APIServer.cc.

References bindings_.

Referenced by handle_unregister().

void dtn::APIClient::run (  )  [virtual]
int dtn::APIClient::send_response ( int  ret  )  [protected]
int dtn::APIClient::wait_for_notify ( const char *  operation,
dtn_timeval_t  timeout,
APIRegistration **  recv_ready_reg,
APIRegistration **  session_ready_reg,
bool sock_ready 
) [protected]

Member Data Documentation

char dtn::APIClient::buf_[DTN_MAX_API_MSG] [protected]

Definition at line 127 of file APIServer.h.

Referenced by APIClient(), run(), and send_response().

oasys::Notifier dtn::APIClient::notifier_ [protected]

Definition at line 132 of file APIServer.h.

Referenced by handle_register(), handle_send(), and handle_unregister().

Definition at line 133 of file APIServer.h.

Referenced by close_client().

Definition at line 131 of file APIServer.h.

Referenced by APIClient(), close_client(), handle_register(), wait_for_notify(), and ~APIClient().

size_t dtn::APIClient::total_rcvd_ [protected]

Definition at line 135 of file APIServer.h.

Referenced by handle_begin_poll(), handle_handshake(), run(), and send_response().

size_t dtn::APIClient::total_sent_ [protected]

Definition at line 134 of file APIServer.h.

Referenced by handle_handshake(), run(), and send_response().

XDR dtn::APIClient::xdr_decode_ [protected]
XDR dtn::APIClient::xdr_encode_ [protected]

The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:40:55 2010 for DTN Reference Implementation by  doxygen 1.6.3