dtnperf-client.c File Reference

#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_tparse_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)
timeval set (double sec)
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 Documentation

#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

Definition at line 42 of file dtnperf-client.c.

Referenced by check_options().

#define ILLEGAL_PAYLOAD   0

Definition at line 41 of file dtnperf-client.c.

Referenced by check_options().

#define MAX_MEM_PAYLOAD   50000

Definition at line 40 of file dtnperf-client.c.

Referenced by check_options(), and main().


Function Documentation

struct timeval add ( double  sec  ) 

Definition at line 959 of file dtnperf-client.c.

Referenced by dtn::InterfaceCommand::exec().

void add_time ( struct timeval *  tot_time,
struct timeval  part_time 
)

Definition at line 1060 of file dtnperf-client.c.

long bundles_needed ( long  data,
long  pl 
)

Definition at line 1044 of file dtnperf-client.c.

Referenced by main().

void check_options (  ) 

Definition at line 804 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 1026 of file dtnperf-client.c.

References end.

Referenced by main().

void csv_time_report ( int  b_sent,
int  payload,
struct timeval  start,
struct timeval  end 
)

Definition at line 1005 of file dtnperf-client.c.

References end.

Referenced by main().

char findDataUnit ( const char *  inarg  ) 

Definition at line 1095 of file dtnperf-client.c.

long kilo2byte ( long  n  ) 

Definition at line 1085 of file dtnperf-client.c.

int main ( int  argc,
char **  argv 
)

Definition at line 124 of file dtnperf-client.c.

References arg_dest, arg_replyto, dtn_bundle_payload_t::buf, 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, DOPTS_CUSTODY, DOPTS_CUSTODY_RCPT, DOPTS_DELIVERY_RCPT, DOPTS_FORWARD_RCPT, DOPTS_RECEIVE_RCPT, dtn_build_local_eid(), dtn_bundle_payload_t::dtn_bundle_payload_t_u, 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, errno, expiration, fd, file_name_src, forwarding_receipts, dtnsim::gettimeofday(), handle, MAX_MEM_PAYLOAD, n_copies, op_mode, parse_eid(), parse_options(), pattern(), receive_receipts, regid, reply_payload, reply_spec, set(), 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 1076 of file dtnperf-client.c.

dtn_endpoint_id_t* parse_eid ( dtn_handle_t  handle,
dtn_endpoint_id_t eid,
char *  str 
)

void parse_options ( int  ,
char **   
)

Definition at line 89 of file dtnrecv.c.

void pattern ( char *  outBuf,
int  inBytes 
)

Definition at line 935 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(), dtn::WildcardScheme::match(), dtn::TCAScheme::match(), dtn::StringScheme::match(), dtn::DTNScheme::match(), and TcaController::route_reg().

void print_eid ( char *  label,
dtn_endpoint_id_t eid 
)

void print_usage ( char *  progname  ) 

Definition at line 650 of file dtnperf-client.c.

struct timeval set ( double  sec  ) 

Definition at line 946 of file dtnperf-client.c.

Referenced by main().

void show_options (  ) 

Definition at line 882 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 
)

Definition at line 980 of file dtnperf-client.c.

References debug, and end.

Referenced by main().


Variable Documentation

char* arg_dest = NULL

Definition at line 76 of file dtnperf-client.c.

char* arg_replyto = NULL

Definition at line 74 of file dtnperf-client.c.

char* arg_source = NULL

Definition at line 75 of file dtnperf-client.c.

long bundle_payload = DEFAULT_PAYLOAD

Definition at line 79 of file dtnperf-client.c.

Referenced by check_options(), main(), and show_options().

int csv_out = 0

Definition at line 56 of file dtnperf-client.c.

Referenced by check_options(), and main().

int custody = 0

Definition at line 67 of file dtnperf-client.c.

int custody_receipts = 0

Definition at line 68 of file dtnperf-client.c.

long data_qty = 0

Definition at line 86 of file dtnperf-client.c.

Referenced by check_options(), main(), and show_options().

int data_read = 0

Definition at line 97 of file dtnperf-client.c.

char data_unit

Definition at line 92 of file dtnperf-client.c.

int data_written = 0

Definition at line 96 of file dtnperf-client.c.

Referenced by main().

int debug = 0

Definition at line 55 of file dtnperf-client.c.

int delivery_receipts = 1

Definition at line 65 of file dtnperf-client.c.

int expiration = 3600

Definition at line 64 of file dtnperf-client.c.

int fd

Definition at line 95 of file dtnperf-client.c.

Referenced by oasys::FileSystemTable::get_common(), oasys::Bluetooth::hci_get_bdaddr(), oasys::Bluetooth::hci_open_dev(), main(), oasys::IO::open(), open_serial_source(), oasys::IO::poll_with_notifier(), read_packet_file(), dtn::FileConvergenceLayer::Scanner::run(), dtn::FileConvergenceLayer::send_bundle(), dtn::TclRegistration::TclRegistration(), and oasys::DurableStore::~DurableStore().

char* file_name_src = "/var/lib/dtn/dtnperf/dtnbuffer.snd"

Definition at line 98 of file dtnperf-client.c.

Referenced by main().

int forwarding_receipts = 0

Definition at line 66 of file dtnperf-client.c.

char* n_arg

Definition at line 87 of file dtnperf-client.c.

int n_copies = 1

Definition at line 89 of file dtnperf-client.c.

Referenced by check_options(), main(), and show_options().

char op_mode

Definition at line 54 of file dtnperf-client.c.

Referenced by check_options(), main(), and show_options().

char* p_arg

Definition at line 88 of file dtnperf-client.c.

char* p_arg

Definition at line 80 of file dtnperf-client.c.

dtn_bundle_payload_location_t payload_type = DTN_PAYLOAD_FILE

Definition at line 52 of file dtnperf-client.c.

char* progname

Definition at line 48 of file dtnperf-client.c.

int receive_receipts = 0

Definition at line 69 of file dtnperf-client.c.

dtn_reg_id_t regid = DTN_REGID_NONE

Definition at line 78 of file dtnperf-client.c.

int sleepVal = 0

Definition at line 90 of file dtnperf-client.c.

Referenced by check_options(), doOptions(), main(), and show_options().

int transmission_time = 0

Definition at line 83 of file dtnperf-client.c.

Referenced by check_options(), main(), and show_options().

int use_file = 1

Definition at line 91 of file dtnperf-client.c.

Referenced by check_options(), and main().

int verbose = 0

Definition at line 53 of file dtnperf-client.c.

int wait_for_report = 1

Definition at line 71 of file dtnperf-client.c.


Generated on Fri Dec 22 14:48:01 2006 for DTN Reference Implementation by  doxygen 1.5.1