dtncat.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 <time.h>
#include "dtn_api.h"

Go to the source code of this file.

Defines

#define DEFAULT_BUNDLE_COUNT   1
#define FAILURE_SCRIPT   ""
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
#define REG_EXPIRE   (60 * 60)
#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 ()
void print_eid (FILE *, char *label, dtn_endpoint_id_t *eid)
int fill_payload (dtn_bundle_payload_t *payload)
void to_bundles ()
void from_bundles ()
void make_registration (dtn_reg_info_t *)
int main (int argc, char **argv)

Variables

char * progname
int copies = 1
int verbose = 0
int expiration = 3600
int delivery_receipts = 0
int forwarding_receipts = 0
int custody = 0
int custody_receipts = 0
int receive_receipts = 0
int wait_for_report = 0
int bundle_count = -1
int session_flags = 0
char * sequence_id = 0
char * obsoletes_id = 0
char * arg_replyto = NULL
char * arg_source = NULL
char * arg_dest = NULL
char * arg_receive = NULL
dtn_reg_id_t regid = DTN_REGID_NONE
FILE * info
char payload_buf [DTN_MAX_BUNDLE_MEM]
int from_bundles_flag
dtn_handle_t handle
dtn_bundle_spec_t bundle_spec
dtn_bundle_spec_t reply_spec
dtn_bundle_payload_t primary_payload
dtn_bundle_payload_t reply_payload
dtn_bundle_id_t bundle_id
struct timeval start end


Define Documentation

#define CHECK_SET ( _arg,
_what   ) 

Value:

if (_arg == 0) {                                                    \
        fprintf(stderr, "%s: %s must be specified\n", progname, _what); \
        print_usage();                                                  \
        exit(EXIT_FAILURE);                                             \
    }

Referenced by parse_options().

#define DEFAULT_BUNDLE_COUNT   1

Definition at line 61 of file dtncat.c.

Referenced by parse_options().

#define FAILURE_SCRIPT   ""

Definition at line 62 of file dtncat.c.

#define MIN ( a,
 )     ((a) < (b) ? (a) : (b))

Definition at line 67 of file dtncat.c.

#define REG_EXPIRE   (60 * 60)

Definition at line 86 of file dtncat.c.

Referenced by from_bundles(), and to_bundles().


Function Documentation

void fill_payload ( dtn_bundle_payload_t payload  ) 

Definition at line 576 of file dtncat.c.

References buf, DTN_ESIZE, DTN_PAYLOAD_MEM, dtn_set_payload(), MIN, and payload_buf.

Referenced by main(), and to_bundles().

void from_bundles (  ) 

int main ( int  argc,
char **  argv 
)

void make_registration ( dtn_reg_info_t reginfo  ) 

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

Definition at line 547 of file dtncat.c.

References dtn_build_local_eid(), dtn_parse_eid_string(), info, and verbose.

Referenced by from_bundles(), main(), reader_thread(), and to_bundles().

void parse_options ( int  argc,
char **  argv 
)

void print_eid ( FILE *  dest,
char *  label,
dtn_endpoint_id_t eid 
)

Definition at line 566 of file dtncat.c.

References dtn_endpoint_id_t::uri.

Referenced by main(), reader_thread(), and to_bundles().

void print_usage (  ) 

Definition at line 391 of file dtncat.c.

References progname.

Referenced by parse_options().

void to_bundles (  ) 


Variable Documentation

char* arg_dest = NULL

Definition at line 72 of file dtncat.c.

Referenced by main(), parse_options(), readCommandLineArgs(), reader_thread(), and to_bundles().

char* arg_receive = NULL

Definition at line 73 of file dtncat.c.

Referenced by from_bundles(), and parse_options().

char* arg_replyto = NULL

Definition at line 70 of file dtncat.c.

Referenced by main(), parse_options(), and to_bundles().

char* arg_source = NULL

Definition at line 71 of file dtncat.c.

Referenced by main(), parse_options(), and to_bundles().

int bundle_count = -1

Definition at line 56 of file dtncat.c.

Referenced by from_bundles(), and parse_options().

Definition at line 96 of file dtncat.c.

Referenced by main(), and reader_thread().

int copies = 1

Definition at line 45 of file dtncat.c.

Referenced by main().

int custody = 0

Definition at line 53 of file dtncat.c.

Referenced by main(), parse_options(), and to_bundles().

Definition at line 50 of file dtncat.c.

Referenced by main(), parse_options(), and to_bundles().

struct timeval start end

int expiration = 3600

Definition at line 51 of file dtncat.c.

Referenced by main(), parse_options(), and to_bundles().

Definition at line 89 of file dtncat.c.

Referenced by main(), and parse_options().

FILE* info

char* obsoletes_id = 0

char payload_buf[DTN_MAX_BUNDLE_MEM]

Definition at line 98 of file dtncat.c.

char* progname

Definition at line 54 of file dtncat.c.

Referenced by main(), parse_options(), and to_bundles().

dtn_reg_id_t regid = DTN_REGID_NONE

Definition at line 99 of file dtncat.c.

Referenced by main().

Definition at line 97 of file dtncat.c.

Referenced by main().

char* sequence_id = 0

int session_flags = 0

int verbose = 0

int wait_for_report = 0

Definition at line 55 of file dtncat.c.

Referenced by main(), parse_options(), and to_bundles().


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