#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "dtn_api.h"
Go to the source code of this file.
Defines | |
#define | BUFSIZE 16 |
#define | BLOCKSIZE 8192 |
#define | COUNTER_MAX_DIGITS 9 |
#define | PATH_MAX 1024 |
Functions | |
void | usage () |
void | parse_options (int argc, char **argv) |
static void | print_data (char *buffer, u_int length) |
int | buildfilename (char *template, char *newfilename, int counter) |
int | handle_file_transfer (dtn_bundle_spec_t spec, dtn_bundle_payload_t payload, int *total_bytes, int counter) |
int | main (int argc, char **argv) |
Variables | |
const char * | progname |
int | verbose = 0 |
int | quiet = 0 |
char * | endpoint = NULL |
dtn_reg_id_t | regid = DTN_REGID_NONE |
int | expiration = 30 |
int | count = 0 |
int | failure_action = DTN_REG_DEFER |
char * | failure_script = "" |
int | register_only = 0 |
int | change = 0 |
int | unregister = 0 |
int | recv_timeout = -1 |
int | no_find_reg = 0 |
char | filename [PATH_MAX] |
dtn_bundle_payload_location_t | bundletype = DTN_PAYLOAD_MEM |
#define BLOCKSIZE 8192 |
#define COUNTER_MAX_DIGITS 9 |
#define PATH_MAX 1024 |
Definition at line 44 of file dtnrecv.c.
Referenced by dtn_recv(), DTNRecvCommand::exec(), handle_file_transfer(), dtn::APIClient::handle_send(), main(), and parse_options().
int buildfilename | ( | char * | template, | |
char * | newfilename, | |||
int | counter | |||
) |
Definition at line 248 of file dtnrecv.c.
References COUNTER_MAX_DIGITS.
Referenced by handle_file_transfer().
int handle_file_transfer | ( | dtn_bundle_spec_t | spec, | |
dtn_bundle_payload_t | payload, | |||
int * | total_bytes, | |||
int | counter | |||
) |
Definition at line 291 of file dtnrecv.c.
References BLOCKSIZE, buildfilename(), errno, dtn_bundle_payload_t::filename, filename, dtn_bundle_payload_t::filename_val, PATH_MAX, dtn_bundle_spec_t::source, and dtn_endpoint_id_t::uri.
Referenced by main().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 355 of file dtnrecv.c.
References dtn_bundle_spec_t::blocks, dtn_bundle_spec_t::blocks_len, dtn_bundle_spec_t::blocks_val, dtn_bundle_payload_t::buf, dtn_bundle_payload_t::buf_len, dtn_bundle_payload_t::buf_val, bundletype, change, count, dtn_extension_block_t::data, dtn_extension_block_t::data_len, dtn_extension_block_t::data_val, dtn_bind(), dtn_build_local_eid(), dtn_change_registration(), dtn_close(), dtn_copy_eid(), DTN_ENOTFOUND, dtn_errno(), dtn_find_registration(), dtn_free_payload(), dtn_open(), dtn_parse_eid_string(), DTN_PAYLOAD_FILE, dtn_recv(), DTN_REGID_NONE, dtn_register(), dtn_strerror(), DTN_SUCCESS, dtn_unregister(), dtn_reg_info_t::endpoint, endpoint, expiration, dtn_reg_info_t::expiration, failure_action, failure_script, dtn_reg_info_t::flags, handle, handle_file_transfer(), dtn_bundle_spec_t::metadata, dtn_bundle_spec_t::metadata_len, dtn_bundle_spec_t::metadata_val, no_find_reg, parse_options(), print_data(), progname, quiet, recv_timeout, dtn_reg_info_t::regid, regid, register_only, dtn_reg_info_t::script, dtn_reg_info_t::script_len, dtn_reg_info_t::script_val, dtn_bundle_spec_t::source, unregister, dtn_endpoint_id_t::uri, and verbose.
void parse_options | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 90 of file dtnrecv.c.
References arg_dest, arg_receive, arg_replyto, arg_source, bundle_count, bundletype, change, CHECK_SET, count, custody, custody_receipts, DEFAULT_BUNDLE_COUNT, delivery_receipts, DTN_PAYLOAD_FILE, DTN_REG_DEFER, DTN_REG_DROP, DTN_REG_EXEC, DTN_REGID_NONE, endpoint, expiration, failure_action, failure_script, filename, forwarding_receipts, from_bundles_flag, no_find_reg, obsoletes_id, PATH_MAX, print_usage(), progname, quiet, receive_receipts, recv_timeout, regid, register_only, sequence_id, unregister, usage(), verbose, and wait_for_report.
Referenced by main().
static void print_data | ( | char * | buffer, | |
u_int | length | |||
) | [static] |
dtn_bundle_payload_location_t bundletype = DTN_PAYLOAD_MEM |
int change = 0 |
Definition at line 58 of file dtnrecv.c.
Referenced by dtn::LinkScheduleEstimator::badness_of_match(), main(), and parse_options().
int expiration = 30 |
int failure_action = DTN_REG_DEFER |
Definition at line 55 of file dtnrecv.c.
Referenced by dtn::APIClient::handle_register(), main(), and parse_options().
char* failure_script = "" |
char filename[PATH_MAX] |
Definition at line 62 of file dtnrecv.c.
Referenced by dtn_recv(), handle_file_transfer(), dtn::APIClient::handle_send(), main(), and parse_options().
int no_find_reg = 0 |
int quiet = 0 |
int recv_timeout = -1 |
dtn_reg_id_t regid = DTN_REGID_NONE |
int register_only = 0 |
int unregister = 0 |