#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/file.h>
#include <time.h>
#include <assert.h>
#include "dtn_api.h"
#include "dtn_types.h"
Go to the source code of this file.
Defines | |
#define | MAX_MEM_PAYLOAD 50000 |
#define | ILLEGAL_PAYLOAD 0 |
#define | DEFAULT_PAYLOAD 50000 |
#define | CHECK_SET(_arg, _what) |
Functions | |
void | parse_options (int, char **) |
dtn_endpoint_id_t * | parse_eid (dtn_handle_t handle, dtn_endpoint_id_t *eid, char *str) |
void | print_usage (char *progname) |
void | print_eid (char *label, dtn_endpoint_id_t *eid) |
void | pattern (char *outBuf, int inBytes) |
struct timeval | set (double sec) |
struct timeval | add (double sec) |
void | show_report (u_int buf_len, char *eid, struct timeval start, struct timeval end, int data) |
void | csv_time_report (int b_sent, int payload, struct timeval start, struct timeval end) |
void | csv_data_report (int b_id, int payload, struct timeval start, struct timeval end) |
long | bundles_needed (long data, long pl) |
void | check_options () |
void | show_options () |
void | add_time (struct timeval *tot_time, struct timeval part_time) |
long | mega2byte (long n) |
long | kilo2byte (long n) |
char | findDataUnit (const char *inarg) |
int | main (int argc, char **argv) |
Variables | |
char * | progname |
dtn_bundle_payload_location_t | payload_type = DTN_PAYLOAD_FILE |
int | verbose = 0 |
char | op_mode |
int | debug = 0 |
int | csv_out = 0 |
int | expiration = 3600 |
int | delivery_receipts = 1 |
int | forwarding_receipts = 0 |
int | custody = 0 |
int | custody_receipts = 0 |
int | receive_receipts = 0 |
int | wait_for_report = 1 |
char * | arg_replyto = NULL |
char * | arg_source = NULL |
char * | arg_dest = NULL |
dtn_reg_id_t | regid = DTN_REGID_NONE |
long | bundle_payload = DEFAULT_PAYLOAD |
char * | p_arg |
int | transmission_time = 0 |
long | data_qty = 0 |
char * | n_arg |
int | n_copies = 1 |
int | sleepVal = 0 |
int | use_file = 1 |
char | data_unit |
int | fd |
int | data_written = 0 |
int | data_read = 0 |
char * | file_name_src = INSTALL_LOCALSTATEDIR "/dtn/dtnperf/dtnbuffer.snd" |
#define CHECK_SET | ( | _arg, | |||
_what | ) |
if (_arg == 0) { \ fprintf(stderr, "\nSYNTAX ERROR: %s must be specified\n", _what); \ print_usage(argv[0]); \ exit(1); \ }
#define DEFAULT_PAYLOAD 50000 |
Definition at line 62 of file dtnperf-client.c.
Referenced by check_options().
#define ILLEGAL_PAYLOAD 0 |
Definition at line 61 of file dtnperf-client.c.
Referenced by check_options().
#define MAX_MEM_PAYLOAD 50000 |
Definition at line 60 of file dtnperf-client.c.
Referenced by check_options(), and main().
struct timeval add | ( | double | sec | ) | [read] |
Definition at line 978 of file dtnperf-client.c.
void add_time | ( | struct timeval * | tot_time, | |
struct timeval | part_time | |||
) |
Definition at line 1079 of file dtnperf-client.c.
long bundles_needed | ( | long | data, | |
long | pl | |||
) |
Definition at line 1063 of file dtnperf-client.c.
Referenced by main().
void check_options | ( | ) |
Definition at line 823 of file dtnperf-client.c.
References bundle_payload, csv_out, data_qty, debug, DEFAULT_PAYLOAD, ILLEGAL_PAYLOAD, MAX_MEM_PAYLOAD, n_copies, op_mode, sleepVal, transmission_time, use_file, and verbose.
Referenced by main().
void csv_data_report | ( | int | b_id, | |
int | payload, | |||
struct timeval | start, | |||
struct timeval | end | |||
) |
Definition at line 1045 of file dtnperf-client.c.
Referenced by main().
void csv_time_report | ( | int | b_sent, | |
int | payload, | |||
struct timeval | start, | |||
struct timeval | end | |||
) |
Definition at line 1024 of file dtnperf-client.c.
Referenced by main().
char findDataUnit | ( | const char * | inarg | ) |
Definition at line 1114 of file dtnperf-client.c.
Referenced by parse_options().
long kilo2byte | ( | long | n | ) |
Definition at line 1104 of file dtnperf-client.c.
Referenced by parse_options().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 144 of file dtnperf-client.c.
References arg_dest, arg_replyto, dtn_bundle_payload_t::buf, dtn_bundle_payload_t::buf_len, bundle_id, bundle_payload, bundle_spec, bundles_needed(), check_options(), csv_data_report(), csv_out, csv_time_report(), custody, custody_receipts, data_qty, data_written, debug, 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_build_local_eid(), dtn_close(), dtn_copy_eid(), dtn_errno(), dtn_open(), DTN_PAYLOAD_FILE, DTN_PAYLOAD_MEM, dtn_recv(), DTN_REG_DEFER, dtn_register(), dtn_send(), dtn_set_payload(), dtn_strerror(), DTN_SUCCESS, dtn_reg_info_t::endpoint, errno, dtn_reg_info_t::expiration, expiration, dtn_bundle_spec_t::expiration, fd, file_name_src, dtn_reg_info_t::flags, forwarding_receipts, dtnsim::gettimeofday(), handle, MAX_MEM_PAYLOAD, n_copies, op_mode, parse_eid(), parse_options(), pattern(), receive_receipts, regid, dtn_reg_info_t::regid, reply_payload, reply_spec, dtn_bundle_spec_t::replyto, show_options(), show_report(), sleepVal, dtn_bundle_spec_t::source, transmission_time, dtn_endpoint_id_t::uri, use_file, verbose, and wait_for_report.
long mega2byte | ( | long | n | ) |
Definition at line 1095 of file dtnperf-client.c.
Referenced by parse_options().
dtn_endpoint_id_t* parse_eid | ( | dtn_handle_t | handle, | |
dtn_endpoint_id_t * | eid, | |||
char * | str | |||
) |
Definition at line 917 of file dtnperf-client.c.
References dtn_build_local_eid(), dtn_parse_eid_string(), and verbose.
void parse_options | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 700 of file dtnperf-client.c.
References arg_dest, arg_replyto, bundle_payload, CHECK_SET, csv_out, data_qty, data_unit, debug, DTN_PAYLOAD_MEM, file_name_src, findDataUnit(), forwarding_receipts, kilo2byte(), mega2byte(), n_arg, n_copies, op_mode, p_arg, payload_type, print_usage(), receive_receipts, regid, sleepVal, transmission_time, use_file, and verbose.
void pattern | ( | char * | outBuf, | |
int | inBytes | |||
) |
Definition at line 954 of file dtnperf-client.c.
Referenced by TcaController::ask(), dtn::LinkScheduleEstimator::extract_schedule(), dtn::TcaRouter::fwd_to_all(), TcaController::gate_reg(), dtn::TcaRouter::handle_add_route(), TcaController::handle_coa_sent(), dtn::TcaRouter::handle_get_routes(), main(), and TcaController::route_reg().
void print_eid | ( | char * | label, | |
dtn_endpoint_id_t * | eid | |||
) |
Definition at line 943 of file dtnperf-client.c.
References dtn_endpoint_id_t::uri.
void print_usage | ( | char * | progname | ) |
Definition at line 669 of file dtnperf-client.c.
struct timeval set | ( | double | sec | ) | [read] |
Definition at line 965 of file dtnperf-client.c.
void show_options | ( | ) |
Definition at line 901 of file dtnperf-client.c.
References bundle_payload, data_qty, n_copies, op_mode, sleepVal, and transmission_time.
Referenced by main().
void show_report | ( | u_int | buf_len, | |
char * | eid, | |||
struct timeval | start, | |||
struct timeval | end, | |||
int | data | |||
) |
char* arg_dest = NULL |
Definition at line 96 of file dtnperf-client.c.
char* arg_replyto = NULL |
Definition at line 94 of file dtnperf-client.c.
char* arg_source = NULL |
Definition at line 95 of file dtnperf-client.c.
long bundle_payload = DEFAULT_PAYLOAD |
Definition at line 99 of file dtnperf-client.c.
Referenced by check_options(), main(), parse_options(), and show_options().
int csv_out = 0 |
Definition at line 76 of file dtnperf-client.c.
Referenced by check_options(), main(), and parse_options().
int custody = 0 |
Definition at line 87 of file dtnperf-client.c.
int custody_receipts = 0 |
Definition at line 88 of file dtnperf-client.c.
long data_qty = 0 |
Definition at line 106 of file dtnperf-client.c.
Referenced by check_options(), main(), parse_options(), and show_options().
int data_read = 0 |
Definition at line 117 of file dtnperf-client.c.
char data_unit |
Definition at line 112 of file dtnperf-client.c.
Referenced by parse_options().
int data_written = 0 |
Definition at line 116 of file dtnperf-client.c.
Referenced by main().
int debug = 0 |
Definition at line 75 of file dtnperf-client.c.
int delivery_receipts = 1 |
Definition at line 85 of file dtnperf-client.c.
int expiration = 3600 |
Definition at line 84 of file dtnperf-client.c.
int fd |
Definition at line 115 of file dtnperf-client.c.
Referenced by dtn_recv(), DTNPollChannelCommand::exec(), dtn::BundlePayload::init(), dtn::BundlePayload::init_from_store(), main(), open_serial_source(), dtn::BundlePayload::pin_file(), read_packet_file(), dtn::BundlePayload::replace_with_file(), and dtn::FileConvergenceLayer::send_bundle().
char* file_name_src = INSTALL_LOCALSTATEDIR "/dtn/dtnperf/dtnbuffer.snd" |
Definition at line 118 of file dtnperf-client.c.
Referenced by main(), and parse_options().
int forwarding_receipts = 0 |
Definition at line 86 of file dtnperf-client.c.
char* n_arg |
Definition at line 107 of file dtnperf-client.c.
Referenced by parse_options().
int n_copies = 1 |
Definition at line 109 of file dtnperf-client.c.
Referenced by check_options(), main(), parse_options(), and show_options().
char op_mode |
Definition at line 74 of file dtnperf-client.c.
Referenced by check_options(), main(), parse_options(), and show_options().
char * p_arg |
Definition at line 100 of file dtnperf-client.c.
Referenced by parse_options().
dtn_bundle_payload_location_t payload_type = DTN_PAYLOAD_FILE |
Definition at line 72 of file dtnperf-client.c.
Referenced by fill_payload(), and parse_options().
char* progname |
Definition at line 68 of file dtnperf-client.c.
int receive_receipts = 0 |
Definition at line 89 of file dtnperf-client.c.
dtn_reg_id_t regid = DTN_REGID_NONE |
Definition at line 98 of file dtnperf-client.c.
int sleepVal = 0 |
Definition at line 110 of file dtnperf-client.c.
Referenced by check_options(), main(), parse_options(), and show_options().
int transmission_time = 0 |
Definition at line 103 of file dtnperf-client.c.
Referenced by check_options(), main(), parse_options(), and show_options().
int use_file = 1 |
Definition at line 111 of file dtnperf-client.c.
Referenced by check_options(), main(), and parse_options().
int verbose = 0 |
Definition at line 73 of file dtnperf-client.c.
int wait_for_report = 1 |
Definition at line 91 of file dtnperf-client.c.