#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <fcntl.h>
#include <string.h>
#include "serialsource.h"
#include <strings.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <oasys/compat/inttypes.h>
#include "dtn_api.h"
#include <ctype.h>
Go to the source code of this file.
Classes | |
struct | data_packet |
Defines | |
#define | dout stderr |
#define | DATAPACKET_SIZE 22 |
#define | SURGE_PKT 0x11 |
#define | DEBUG_PKT 0x03 |
Typedefs | |
typedef struct data_packet | DATAPACKET |
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 () |
void | print_eid (char *label, dtn_endpoint_id_t *eid) |
void | init_motes () |
void | stderr_msg (serial_source_msg problem) |
void | usage (char *str1, char *str2) |
void | readCommandLineArgs (int argc, char **argv) |
void | hexdump () |
void | read_packet_file (char *filename) |
int | main (int argc, char **argv) |
int | read_packet (char *buf, int *n) |
int | reader_thread (void *p) |
void | hexdump (unsigned char *buf, int n) |
Variables | |
char * | progname |
static char * | msgs [] |
char | arg_dest [128] |
char | arg_target [128] |
char | devicename [128] = "/dev/ttyS0" |
char | baud [128] = "57600" |
char | directory [128] = "send" |
u_int32_t | debug = 0 |
serial_source | src |
int | g_argc |
char ** | g_argv |
#define DATAPACKET_SIZE 22 |
Definition at line 92 of file dtnmoteproxy.c.
#define DEBUG_PKT 0x03 |
#define dout stderr |
#define SURGE_PKT 0x11 |
typedef struct data_packet DATAPACKET |
void hexdump | ( | unsigned char * | buf, | |
int | n | |||
) |
void hexdump | ( | ) |
Referenced by read_packet_file(), and reader_thread().
void init_motes | ( | ) |
Definition at line 357 of file dtnmoteproxy.c.
References baud, devicename, open_serial_source(), reader_thread(), and stderr_msg().
Referenced by main().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 122 of file dtnmoteproxy.c.
References g_argc, g_argv, init_motes(), and readCommandLineArgs().
dtn_endpoint_id_t* parse_eid | ( | dtn_handle_t | handle, | |
dtn_endpoint_id_t * | eid, | |||
char * | str | |||
) |
void print_eid | ( | char * | label, | |
dtn_endpoint_id_t * | eid | |||
) |
void print_usage | ( | ) |
Definition at line 53 of file tca_admin.cc.
int read_packet | ( | char * | buf, | |
int * | n | |||
) |
Definition at line 140 of file dtnmoteproxy.c.
References debug, DEBUG_PKT, read_serial_packet(), and SURGE_PKT.
Referenced by reader_thread().
void read_packet_file | ( | char * | filename | ) |
Definition at line 368 of file dtnmoteproxy.c.
References buf, fd, and hexdump().
Referenced by readCommandLineArgs().
void readCommandLineArgs | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 307 of file dtnmoteproxy.c.
References arg_dest, baud, debug, devicename, read_packet_file(), and usage().
Referenced by main().
int reader_thread | ( | void * | p | ) |
Definition at line 165 of file dtnmoteproxy.c.
References arg_dest, bundle_id, bundle_spec, debug, DEBUG_PKT, dtn_bundle_spec_t::dest, dtn_bundle_spec_t::dopts, DOPTS_DELIVERY_RCPT, dout, dtn_close(), dtn_copy_eid(), dtn_errno(), dtn_open(), DTN_PAYLOAD_MEM, DTN_REG_DEFER, DTN_REGID_NONE, dtn_register(), dtn_send(), dtn_set_payload(), dtn_strerror(), DTN_SUCCESS, dtn_reg_info_t::endpoint, dtn_bundle_spec_t::expiration, dtn_reg_info_t::expiration, dtn_reg_info_t::flags, handle, hexdump(), data_packet::hop_cnt, data_packet::light, data_packet::origin_mote_id, parse_eid(), print_eid(), read_packet(), dtn_reg_info_t::regid, regid, dtn_bundle_spec_t::replyto, dtn_bundle_spec_t::source, data_packet::source_mote_id, data_packet::surge_parent_addr, data_packet::surge_pkt_type, data_packet::surge_seq_no, and data_packet::temp.
Referenced by init_motes().
void stderr_msg | ( | serial_source_msg | problem | ) |
void usage | ( | char * | str1, | |
char * | str2 | |||
) |
Definition at line 341 of file dtnmoteproxy.c.
char arg_dest[128] |
Definition at line 109 of file dtnmoteproxy.c.
char arg_target[128] |
Definition at line 110 of file dtnmoteproxy.c.
char baud[128] = "57600" |
Definition at line 113 of file dtnmoteproxy.c.
Referenced by init_motes(), and readCommandLineArgs().
u_int32_t debug = 0 |
Definition at line 115 of file dtnmoteproxy.c.
Referenced by check_options(), main(), read_packet(), readCommandLineArgs(), reader_thread(), and show_report().
char devicename[128] = "/dev/ttyS0" |
Definition at line 112 of file dtnmoteproxy.c.
Referenced by init_motes(), and readCommandLineArgs().
char directory[128] = "send" |
Definition at line 114 of file dtnmoteproxy.c.
int g_argc |
char** g_argv |
char* msgs[] [static] |
Initial value:
{ "unknown_packet_type", "ack_timeout" , "sync" , "too_long" , "too_short" , "bad_sync" , "bad_crc" , "closed" , "no_memory" , "unix_error" }
Definition at line 57 of file dtnmoteproxy.c.
Referenced by stderr_msg().
char* progname |
Definition at line 55 of file dtnmoteproxy.c.
Definition at line 116 of file dtnmoteproxy.c.
Referenced by dtnsim::NodeCommand::exec(), TcaController::gate_reg(), dtn::BundleDaemon::handle_bundle_inject(), TcaController::handle_coa_sent(), dtn::TcaRouter::is_local_source(), open_serial_source(), and dtn::BundlePayload::replace_with_file().