#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 |
char * | p_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 = "/var/lib/dtn/dtnperf/dtnbuffer.snd" |
#define CHECK_SET | ( | _arg, | |||
_what | ) |
Value:
if (_arg == 0) { \ fprintf(stderr, "\nSYNTAX ERROR: %s must be specified\n", _what); \ print_usage(argv[0]); \ exit(1); \ }
#define DEFAULT_PAYLOAD 50000 |
#define ILLEGAL_PAYLOAD 0 |
#define MAX_MEM_PAYLOAD 50000 |
struct timeval add | ( | double | sec | ) | [read] |
Definition at line 975 of file dtnperf-client.c.
void add_time | ( | struct timeval * | tot_time, | |
struct timeval | part_time | |||
) |
Definition at line 1076 of file dtnperf-client.c.
long bundles_needed | ( | long | data, | |
long | pl | |||
) |
void check_options | ( | ) |
Definition at line 820 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 | |||
) |
void csv_time_report | ( | int | b_sent, | |
int | payload, | |||
struct timeval | start, | |||
struct timeval | end | |||
) |
char findDataUnit | ( | const char * | inarg | ) |
Definition at line 1111 of file dtnperf-client.c.
long kilo2byte | ( | long | n | ) |
Definition at line 1101 of file dtnperf-client.c.
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 140 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, dtn_reg_info_t::failure_action, fd, file_name_src, 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 1092 of file dtnperf-client.c.
dtn_endpoint_id_t* parse_eid | ( | dtn_handle_t | handle, | |
dtn_endpoint_id_t * | eid, | |||
char * | str | |||
) |
void pattern | ( | char * | outBuf, | |
int | inBytes | |||
) |
Definition at line 951 of file dtnperf-client.c.
Referenced by TcaController::ask(), dtn::LinkScheduleEstimator::extract_schedule(), dtn::TcaRouter::fwd_to_all(), TcaController::gate_reg(), dtn::LinkStateGraph::getMatchingVertex(), 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 | |||
) |
void print_usage | ( | char * | progname | ) |
Definition at line 666 of file dtnperf-client.c.
struct timeval set | ( | double | sec | ) | [read] |
Definition at line 962 of file dtnperf-client.c.
void show_options | ( | ) |
Definition at line 898 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 92 of file dtnperf-client.c.
char* arg_replyto = NULL |
Definition at line 90 of file dtnperf-client.c.
char* arg_source = NULL |
Definition at line 91 of file dtnperf-client.c.
long bundle_payload = DEFAULT_PAYLOAD |
Definition at line 95 of file dtnperf-client.c.
Referenced by check_options(), main(), and show_options().
int csv_out = 0 |
int custody = 0 |
Definition at line 83 of file dtnperf-client.c.
int custody_receipts = 0 |
Definition at line 84 of file dtnperf-client.c.
long data_qty = 0 |
Definition at line 102 of file dtnperf-client.c.
Referenced by check_options(), main(), and show_options().
int data_read = 0 |
Definition at line 113 of file dtnperf-client.c.
char data_unit |
Definition at line 108 of file dtnperf-client.c.
int data_written = 0 |
int debug = 0 |
Definition at line 71 of file dtnperf-client.c.
int delivery_receipts = 1 |
Definition at line 81 of file dtnperf-client.c.
int expiration = 3600 |
Definition at line 80 of file dtnperf-client.c.
int fd |
Definition at line 111 of file dtnperf-client.c.
Referenced by oasys::FileSystemTable::get_common(), oasys::Bluetooth::hci_get_bdaddr(), oasys::Bluetooth::hci_open_dev(), dtn::BundlePayload::init(), dtn::BundlePayload::init_from_store(), main(), oasys::MmapFile::map(), oasys::IO::open(), open_serial_source(), dtn::BundlePayload::pin_file(), read_packet_file(), dtn::BundlePayload::replace_with_file(), dtn::FileConvergenceLayer::send_bundle(), dtn::TclRegistration::TclRegistration(), and oasys::DurableStore::~DurableStore().
char* file_name_src = "/var/lib/dtn/dtnperf/dtnbuffer.snd" |
int forwarding_receipts = 0 |
Definition at line 82 of file dtnperf-client.c.
char* n_arg |
Definition at line 103 of file dtnperf-client.c.
int n_copies = 1 |
Definition at line 105 of file dtnperf-client.c.
Referenced by check_options(), main(), and show_options().
char op_mode |
Definition at line 70 of file dtnperf-client.c.
Referenced by check_options(), main(), and show_options().
char* p_arg |
Definition at line 104 of file dtnperf-client.c.
char* p_arg |
Definition at line 96 of file dtnperf-client.c.
dtn_bundle_payload_location_t payload_type = DTN_PAYLOAD_FILE |
Definition at line 68 of file dtnperf-client.c.
char* progname |
Definition at line 64 of file dtnperf-client.c.
int receive_receipts = 0 |
Definition at line 85 of file dtnperf-client.c.
dtn_reg_id_t regid = DTN_REGID_NONE |
Definition at line 94 of file dtnperf-client.c.
int sleepVal = 0 |
Definition at line 106 of file dtnperf-client.c.
Referenced by check_options(), main(), and show_options().
int transmission_time = 0 |
Definition at line 99 of file dtnperf-client.c.
Referenced by check_options(), main(), and show_options().
int use_file = 1 |
int verbose = 0 |
Definition at line 69 of file dtnperf-client.c.
int wait_for_report = 1 |
Definition at line 87 of file dtnperf-client.c.