#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include "dtn_api.h"
Go to the source code of this file.
#define CHECK_SET | ( | _arg, | |||
_what | ) |
Value:
if (_arg == 0) { \ fprintf(stderr, "%s: %s must be specified\n", progname, _what); \ print_usage(); \ exit(EXIT_FAILURE); \ }
Referenced by parse_options().
#define DEFAULT_BUNDLE_COUNT 1 |
#define REG_EXPIRE (60 * 60) |
void fill_payload | ( | dtn_bundle_payload_t * | payload | ) |
Definition at line 576 of file dtncat.c.
References buf, DTN_ESIZE, DTN_PAYLOAD_MEM, dtn_set_payload(), MIN, and payload_buf.
Referenced by main(), and to_bundles().
void from_bundles | ( | ) |
Definition at line 148 of file dtncat.c.
References arg_receive, dtn_bundle_payload_t::buf, dtn_bundle_payload_t::buf_len, dtn_bundle_payload_t::buf_val, bundle_count, dtn_copy_eid(), dtn_errno(), DTN_PAYLOAD_MEM, dtn_recv(), DTN_REG_DEFER, DTN_REG_DROP, DTN_SESSION_SUBSCRIBE, dtn_strerror(), dtn_reg_info_t::endpoint, dtn_reg_info_t::expiration, dtn_reg_info_t::flags, handle, info, make_registration(), parse_eid(), progname, REG_EXPIRE, session_flags, dtn_bundle_spec_t::source, dtn_endpoint_id_t::uri, and verbose.
Referenced by main().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 105 of file dtncat.c.
References dtn_close(), dtn_open(), dtn_strerror(), DTN_SUCCESS, errno, from_bundles(), from_bundles_flag, dtnsim::gettimeofday(), handle, info, parse_options(), progname, to_bundles(), and verbose.
void make_registration | ( | dtn_reg_info_t * | reginfo | ) |
Definition at line 602 of file dtncat.c.
References dtn_bind(), DTN_ENOTFOUND, dtn_errno(), dtn_find_registration(), dtn_register(), dtn_strerror(), DTN_SUCCESS, dtn_reg_info_t::endpoint, handle, info, progname, regid, session_flags, and verbose.
Referenced by from_bundles(), and to_bundles().
dtn_endpoint_id_t * parse_eid | ( | dtn_handle_t | handle, | |
dtn_endpoint_id_t * | eid, | |||
char * | str | |||
) |
Definition at line 547 of file dtncat.c.
References dtn_build_local_eid(), dtn_parse_eid_string(), info, and verbose.
Referenced by from_bundles(), main(), reader_thread(), and to_bundles().
void parse_options | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 424 of file dtncat.c.
References arg_dest, arg_receive, arg_replyto, arg_source, bundle_count, CHECK_SET, custody, custody_receipts, DEFAULT_BUNDLE_COUNT, delivery_receipts, expiration, forwarding_receipts, from_bundles_flag, obsoletes_id, print_usage(), progname, receive_receipts, regid, sequence_id, verbose, and wait_for_report.
Referenced by main().
void print_eid | ( | FILE * | dest, | |
char * | label, | |||
dtn_endpoint_id_t * | eid | |||
) |
Definition at line 566 of file dtncat.c.
References dtn_endpoint_id_t::uri.
Referenced by main(), reader_thread(), and to_bundles().
void print_usage | ( | ) |
void to_bundles | ( | ) |
Definition at line 257 of file dtncat.c.
References arg_dest, arg_replyto, arg_source, dtn_bundle_payload_t::buf, dtn_bundle_payload_t::buf_len, custody, custody_receipts, dtn_sequence_id_t::data, dtn_sequence_id_t::data_len, dtn_sequence_id_t::data_val, delivery_receipts, dtn_bundle_spec_t::dest, dtn_bundle_spec_t::dopts, DOPTS_CUSTODY, DOPTS_CUSTODY_RCPT, DOPTS_DELIVERY_RCPT, DOPTS_FORWARD_RCPT, DOPTS_RECEIVE_RCPT, dtn_bind(), dtn_copy_eid(), dtn_errno(), DTN_PAYLOAD_MEM, dtn_recv(), DTN_REG_DEFER, DTN_REGID_NONE, dtn_send(), DTN_SESSION_PUBLISH, dtn_strerror(), DTN_SUCCESS, end, dtn_reg_info_t::endpoint, errno, expiration, dtn_bundle_spec_t::expiration, dtn_reg_info_t::expiration, fill_payload(), dtn_reg_info_t::flags, forwarding_receipts, dtnsim::gettimeofday(), handle, info, make_registration(), dtn_bundle_spec_t::obsoletes_id, obsoletes_id, parse_eid(), print_eid(), progname, receive_receipts, REG_EXPIRE, regid, dtn_bundle_spec_t::replyto, dtn_bundle_spec_t::sequence_id, sequence_id, session_flags, dtn_bundle_spec_t::source, dtn_endpoint_id_t::uri, verbose, and wait_for_report.
Referenced by main().
char* arg_dest = NULL |
Definition at line 72 of file dtncat.c.
Referenced by main(), parse_options(), readCommandLineArgs(), reader_thread(), and to_bundles().
char* arg_receive = NULL |
char* arg_replyto = NULL |
char* arg_source = NULL |
int bundle_count = -1 |
Definition at line 100 of file dtncat.c.
Referenced by _wrap_dtn_bundle_status_report_t_bundle_id_set(), _wrap_dtn_status_report_bundle_id_set(), main(), reader_thread(), TcaController::send_bundle(), dtntunnel::DTNTunnel::send_bundle(), and XS().
int custody = 0 |
Definition at line 52 of file dtncat.c.
Referenced by prophet::BundleEntryList< BundleResponseEntry >::add_entry(), prophet::ResponseTLV::deserialize(), prophet::OfferTLV::deserialize(), main(), parse_options(), and to_bundles().
int custody_receipts = 0 |
int delivery_receipts = 0 |
struct timeval start end |
Definition at line 101 of file dtncat.c.
Referenced by dtn::APIServer::APIServer(), dtn::BundleMappings::contains(), dtnipc_open(), dtnsim::SimCommand::exec(), dtn::BundleMappings::find(), prophet::BundleList::find(), dtn::BlockInfoVec::find_block(), prophet::PointerList< RIBNode >::free(), main(), dtnsim::ConnState::parse_time(), and to_bundles().
int expiration = 3600 |
Definition at line 49 of file dtncat.c.
Referenced by _wrap_dtn_bundle_expiration_set(), _wrap_dtn_bundle_spec_t_expiration_get(), _wrap_dtn_bundle_spec_t_expiration_set(), _wrap_dtn_reg_info_t_expiration_get(), _wrap_dtn_reg_info_t_expiration_set(), doOptions(), main(), parse_options(), to_bundles(), and XS().
int forwarding_receipts = 0 |
Definition at line 95 of file dtncat.c.
Referenced by dtn_begin_poll(), dtn_bind(), dtn_build_local_eid(), dtn_cancel(), dtn_cancel_poll(), dtn_change_registration(), dtn_find_registration(), dtn_open(), dtn_poll_fd(), dtn_recv(), dtn_register(), dtn_send(), dtn_session_update(), dtn_unbind(), dtn_unregister(), DTNOpenCommand::exec(), from_bundles(), main(), make_registration(), open_serial_source(), reader_thread(), and to_bundles().
FILE* info |
Definition at line 85 of file dtncat.c.
Referenced by dtn::TableBasedRouter::check_next_hop(), dtn::BundleProtocol::consume(), dtn::ForwardingLog::dump(), dtn::BundleCommand::exec(), from_bundles(), dtn::TableBasedRouter::fwd_to_nexthop(), dtn::ForwardingLog::get_latest_entry(), dtn::DTLSRRouter::handle_lsa(), dtn::APIClient::handle_send(), dtn::DTLSRRouter::is_dynamic_route(), main(), make_registration(), parse_eid(), dtn::TableBasedRouter::remove_from_deferred(), dtn::BundleRouter::should_fwd(), SWIG_pchar_descriptor(), SWIG_Tcl_MethodCommand(), to_bundles(), and dtn::DTLSRRouter::update_current_lsa().
char* obsoletes_id = 0 |
Definition at line 59 of file dtncat.c.
Referenced by _wrap_dtn_bundle_obsoletes_id_get(), _wrap_dtn_bundle_obsoletes_id_set(), _wrap_dtn_bundle_spec_t_obsoletes_id_set(), dtn_send(), parse_options(), to_bundles(), and XS().
char payload_buf[DTN_MAX_BUNDLE_MEM] |
Definition at line 87 of file dtncat.c.
Referenced by dtn::LoggingRegistration::deliver_bundle(), dtn::AdminRegistration::deliver_bundle(), fill_payload(), and dtn::TclRegistration::parse_bundle_data().
char* progname |
Definition at line 42 of file dtncat.c.
Referenced by doOptions(), from_bundles(), main(), make_registration(), parse_options(), print_usage(), to_bundles(), and usage().
int receive_receipts = 0 |
dtn_reg_id_t regid = DTN_REGID_NONE |
Definition at line 75 of file dtncat.c.
Referenced by _wrap_dtn_reg_info_t_regid_get(), _wrap_dtn_reg_info_t_regid_set(), dtn_find_registration(), dtn_register(), dtn::RegistrationCommand::exec(), dtnsim::NodeCommand::exec(), DTNUnbindCommand::exec(), DTNBindCommand::exec(), DTNUnregisterCommand::exec(), DTNRegisterCommand::exec(), dtn::APIClient::handle_bind(), dtn::APIClient::handle_find_registration(), dtn::APIClient::handle_register(), dtn::APIClient::handle_send(), dtn::APIClient::handle_unbind(), dtn::APIClient::handle_unregister(), dtntunnel::DTNTunnel::init_registration(), main(), make_registration(), parse_options(), reader_thread(), to_bundles(), and XS().
char* sequence_id = 0 |
Definition at line 58 of file dtncat.c.
Referenced by _wrap_dtn_bundle_sequence_id_get(), _wrap_dtn_bundle_sequence_id_set(), _wrap_dtn_bundle_spec_t_sequence_id_set(), dtn_send(), dtn::SequenceIDBlockProcessor::generate(), parse_options(), dtn::SequenceIDBlockProcessor::prepare(), to_bundles(), and XS().
int session_flags = 0 |
Definition at line 57 of file dtncat.c.
Referenced by from_bundles(), dtn::APIClient::handle_register(), dtn::APIClient::handle_session_update(), make_registration(), and to_bundles().
int verbose = 0 |
Definition at line 46 of file dtncat.c.
Referenced by check_options(), from_bundles(), main(), make_registration(), parse_eid(), parse_options(), and to_bundles().
int wait_for_report = 0 |