#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 FAILURE_SCRIPT "" |
#define REG_EXPIRE (60 * 60) |
void fill_payload | ( | dtn_bundle_payload_t * | payload | ) |
Definition at line 521 of file dtncat.c.
References DTN_ESIZE, DTN_PAYLOAD_MEM, dtn_set_payload(), MIN, and payload_buf.
Referenced by main(), and to_bundles().
void from_bundles | ( | ) |
Definition at line 141 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_strerror(), handle, info, make_registration(), parse_eid(), primary_payload, progname, dtn_bundle_spec_t::source, dtn_endpoint_id_t::uri, and verbose.
Referenced by main().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 98 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 * | ) |
Definition at line 547 of file dtncat.c.
References dtn_bind(), DTN_ENOTFOUND, dtn_errno(), dtn_find_registration(), DTN_REG_DEFER, dtn_register(), dtn_strerror(), DTN_SUCCESS, dtn_reg_info_t::endpoint, dtn_reg_info_t::expiration, dtn_reg_info_t::failure_action, FAILURE_SCRIPT, handle, info, progname, REG_EXPIRE, dtn_reg_info_t::regid, regid, dtn_reg_info_t::script, dtn_reg_info_t::script_len, dtn_reg_info_t::script_val, 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 492 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 | , | |
char ** | ||||
) |
Definition at line 375 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, print_usage(), progname, receive_receipts, regid, verbose, and wait_for_report.
Referenced by main().
void print_eid | ( | FILE * | , | |
char * | label, | |||
dtn_endpoint_id_t * | eid | |||
) |
Definition at line 511 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 239 of file dtncat.c.
References arg_dest, arg_replyto, arg_source, bundle_id, bundle_spec, custody, custody_receipts, delivery_receipts, DOPTS_CUSTODY, DOPTS_CUSTODY_RCPT, DOPTS_DELIVERY_RCPT, DOPTS_FORWARD_RCPT, DOPTS_RECEIVE_RCPT, dtn_copy_eid(), dtn_errno(), DTN_PAYLOAD_MEM, dtn_recv(), dtn_send(), dtn_strerror(), end, errno, expiration, fill_payload(), forwarding_receipts, dtnsim::gettimeofday(), handle, info, make_registration(), parse_eid(), primary_payload, print_eid(), progname, receive_receipts, reply_payload, reply_spec, verbose, and wait_for_report.
Referenced by main().
char* arg_dest = NULL |
Definition at line 65 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 93 of file dtncat.c.
Referenced by main(), reader_thread(), TcaController::send_bundle(), dtntunnel::DTNTunnel::send_bundle(), and to_bundles().
int custody = 0 |
Definition at line 48 of file dtncat.c.
Referenced by dtn::BundleTLV::deserialize(), dtn::RIBTLV::deserialize(), dtn::ProphetEncounter::handle_bundle_tlv(), main(), parse_options(), and to_bundles().
int custody_receipts = 0 |
int delivery_receipts = 0 |
struct timeval start end |
Definition at line 94 of file dtncat.c.
Referenced by dtn::APIServer::APIServer(), oasys::SMTP::client_session(), csv_data_report(), csv_time_report(), dtn::PrimaryBlockProcessor::debug_dump_dictionary(), dtnipc_open(), oasys::StringHashSet::dump(), oasys::StringSet::dump(), oasys::BoundedPriorityQueue< dtn::Bundle *, dtn::BundleSz, dtn::QueueComp >::enforce_bound(), dtnsim::SimCommand::exec(), dtnsim::NodeCommand::exec(), dtnsim::ConnCommand::exec(), dtn::BlockInfoVec::find_block(), dtn::PointerList< T >::free(), oasys::UnitTester::init(), oasys::BoundedPriorityQueue< dtn::Bundle *, dtn::BundleSz, dtn::QueueComp >::init(), oasys::Log::log_multiline(), dtnsim::ConnState::parse_bw(), oasys::URL::parse_internal(), dtnsim::ConnState::parse_time(), oasys::SMTP::process_response(), show_report(), dtn::RouteEntryVec::sort_by_priority(), to_bundles(), and oasys::tokenize().
int expiration = 3600 |
Definition at line 45 of file dtncat.c.
Referenced by doOptions(), main(), parse_options(), and to_bundles().
int forwarding_receipts = 0 |
Definition at line 88 of file dtncat.c.
Referenced by dtn_begin_poll(), dtn_bind(), dtn_build_local_eid(), dtn_cancel_poll(), dtn_change_registration(), dtn_close(), dtn_find_registration(), dtn_open(), dtn_recv(), dtn_register(), dtn_send(), dtn_unbind(), dtn_unregister(), dtnipc_close(), dtnipc_open(), dtnipc_recv(), dtnipc_send(), dtnipc_send_recv(), DTNOpenCommand::exec(), from_bundles(), main(), make_registration(), open_serial_source(), reader_thread(), and to_bundles().
FILE* info |
Definition at line 78 of file dtncat.c.
Referenced by dtn::BundleProtocol::consume(), dtn::ForwardingLog::dump(), from_bundles(), dtn::ForwardingLog::get_latest_entry(), dtn::APIClient::handle_send(), dtnsim::SimConvergenceLayer::init_link(), main(), make_registration(), oasys::IOHandlerBase::monitor(), parse_eid(), oasys::StackTrace::print_trace(), dtnsim::SimConvergenceLayer::send_bundle(), dtn::TableBasedRouter::should_fwd(), dtn::ProphetDecider::should_fwd(), dtn::ProphetEncounter::should_fwd(), and to_bundles().
char payload_buf[DTN_MAX_BUNDLE_MEM] |
Definition at line 80 of file dtncat.c.
Referenced by dtn::LoggingRegistration::deliver_bundle(), dtn::LinkStateRouter::LSRegistration::deliver_bundle(), dtn::AdminRegistration::deliver_bundle(), fill_payload(), dtn::AnnounceBundle::parse_announce_bundle(), and dtn::TclRegistration::parse_bundle_data().
char* progname |
Definition at line 38 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 68 of file dtncat.c.
Referenced by dtn::RegistrationCommand::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_unbind(), dtn::APIClient::handle_unregister(), dtntunnel::DTNTunnel::init_registration(), main(), make_registration(), parse_options(), and reader_thread().
int verbose = 0 |
Definition at line 42 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 |