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)
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 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 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().


Function Documentation

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 (  ) 

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.

long kilo2byte ( long  n  ) 

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

int main ( int  argc,
char **  argv 
)

long mega2byte ( long  n  ) 

Definition at line 1095 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  argc,
char **  argv 
)

Definition at line 90 of file dtnrecv.c.

void pattern ( char *  outBuf,
int  inBytes 
)

void print_eid ( char *  label,
dtn_endpoint_id_t eid 
)

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 
)

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

References debug.

Referenced by main().


Variable Documentation

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(), and show_options().

int csv_out = 0

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

Referenced by check_options(), and main().

int custody = 0

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

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(), 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.

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.

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

int expiration = 3600

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

int fd

char* file_name_src = INSTALL_LOCALSTATEDIR "/dtn/dtnperf/dtnbuffer.snd"

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

Referenced by main().

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

char* n_arg

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

int n_copies = 1

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

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

char op_mode

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

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

char * p_arg

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

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

char* progname

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

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(), and show_options().

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

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

int use_file = 1

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

Referenced by check_options(), and main().

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.


Generated on Mon Jul 21 14:12:18 2008 for DTN Reference Implementation by  doxygen 1.5.6