Code Search for Developers
 
 
  

tcpxfer_shared.h from EmStar at Krugle


Show tcpxfer_shared.h syntax highlighted

#ifndef _TCPXFER_SHARED_H_
#define _TCPXFER_SHARED_H_


#define XFER_SEND_DEVICE "/dev/xfer/.send"
#define XFER_RECEIVED_DEVICE "/dev/xfer/.received"

/*
 * Recevie stats from tcpxfer to filemover...
 */

typedef struct tcpxfer_done_stats_packet {
  uint32_t to_node;
  uint32_t to_ip;
  uint32_t from_node;
  uint32_t from_ip;
  unsigned long total_xfer_time; /* in msecs */
  unsigned long total_time_beforesend;
  uint16_t retries;
  float bandwidth;
  unsigned long diskspace;
} __attribute__ ((packed)) tcpxfer_done_stats_packet_t;

typedef struct tcpxfer_status_file_done {
  char file[2048];
  tcpxfer_done_stats_packet_t stats;
} __attribute__ ((packed)) tcpxfer_status_file_done_t;

typedef struct tcpxfer_bin_status {
  char justfile[256];
  char addr[16];
  uint64_t currbyte;
  uint64_t totalsize;
  uint8_t status;
  uint16_t retries;
  unsigned long starttime;
  unsigned long retrysince;
  unsigned long totaltime;
} __attribute__ ((packed)) tcpxfer_bin_status_t;


/*
 * Query and response between filemover and tcpxfer
 */
#if 0 /* REMOVE QUERY */
#define QUERY_FILE_SIZE 2048
#define TCPXFER_QUERY_SUCESS 0
#define TCPXFER_QUERY_INVALID 1
#define TCPXFER_QUERY_ALREADY 2
#define TCPXFER_QUERY_MD5ERROR 3
#define TCPXFER_QUERY_EFAULT 4
#define TCPXFER_QUERY_EPROTO 5
#define TCPXFER_QUERY_ERETRY 6 /* lost connection */
#define TCPXFER_QUERY_CLIENTCLOSE 7
#define TCPXFER_QUERY_TIMEDOUT 8

typedef struct xfer_query {
  if_id_t dst;
  char filename[QUERY_FILE_SIZE];
} xfer_query_t;

typedef struct xfer_query_return {
  int return_code;
} xfer_query_return_t;
#endif


#define SEND_FILE_SIZE 2048

#define TCPXFER_SEND_MAX_CHANNELS 6
#define TCPXFER_SEND_CHANNEL_FILEMOVER 0
#define TCPXFER_SEND_CHANNEL_DTS 1
#define TCPXFER_SEND_CHANNEL_FILEDEL 2
#define TCPXFER_SEND_CHANNEL_STATUSDEV 3

#define TCPXFER_SEND_CMD_SEND 0
#define TCPXFER_SEND_CMD_CANCEL 1

#define TCPXFER_SEND_SUCESS 0
#define TCPXFER_SEND_INVALID 1
#define TCPXFER_SEND_ALREADY 2
#define TCPXFER_SEND_MD5ERROR 3
#define TCPXFER_SEND_EFAULT 4
#define TCPXFER_SEND_EPROTO 5
#define TCPXFER_SEND_ERETRY 6 /* lost connection */
#define TCPXFER_SEND_CLIENTCLOSE 7
#define TCPXFER_SEND_TIMEDOUT 8
#define TCPXFER_SEND_CHANINUSE 9
#define TCPXFER_SEND_CLIENTCANCEL 10
/* do not use EAGAIN 11 ... might get it from device */

#define TCPXFER_SEND_CHANNEL_IDLE 0
#define TCPXFER_SEND_CHANNEL_TRANSFERING 1
#define TCPXFER_SEND_CHANNEL_ERROR 2
#define TCPXFER_SEND_CHANNEL_DONE 3

typedef struct xfer_send {
  uint8_t send_channel;
  uint8_t command;
  if_id_t dst;
  char filename[SEND_FILE_SIZE];
} xfer_send_t;

typedef struct xfer_send_channel_status {
  uint8_t channel_status;
  uint8_t return_code;
  char filename[SEND_FILE_SIZE];
  char addr[17];;
} xfer_send_channel_status_t;


#endif




See more files for this project here

EmStar

EmStar is a software system for developing and deploying wireless sensor networks involving Linux-based platforms. As the wireless sensor network community has attempted to deploy more complex designs---large-scale, long-lived systems that need self-organization and adaptivity---a number of difficult software design issues have arisen. Advances in software design have not kept pace with the capabilities of hardware. This is because designing for an adaptive, efficient, and useful sensor network has turned out to be surprisingly complex and difficult. EmStar is a Linux-based software framework, whose goal is to dramatically reduce this complexity, enabling work to be shared and reused, and simplifying and speeding the design of new sensor network applications.

Project homepage: http://cvs.cens.ucla.edu/emstar/
Programming language(s): C,Shell Script
License: other

  dts_shared.h
  dts_sink.h
  dts_util.h
  filemover_shared.h
  tcpxfer_shared.h