home *** CD-ROM | disk | FTP | other *** search
/ ftp.urbanrage.com / 2015-02-07.ftp.urbanrage.com.tar / ftp.urbanrage.com / pub / tftp.h < prev   
C/C++ Source or Header  |  2007-02-15  |  917b  |  50 lines

  1. #ifndef _ee_tftp_h_
  2. #define _ee_tftp_h_
  3.  
  4. enum { NONE, RRQ, WRQ, DATA, ACK, ERR };
  5. typedef struct _tf_rwrq_t {
  6.   unsigned short op;
  7.   char           buffer[2048];
  8. } tf_rwrq_t;
  9.  
  10. typedef struct _tf_data_t {
  11.   unsigned short op;
  12.   unsigned short block;
  13.   unsigned char  data[512];
  14. } tf_data_t;
  15.  
  16. typedef struct _tf_ack_t {
  17.   unsigned short op;
  18.   unsigned short block;
  19. } tf_ack_t;
  20.  
  21. typedef struct _tf_err_t {
  22.   unsigned short op;
  23.   unsigned short error;
  24.   char           errmsg[2048];
  25. } tf_err_t;
  26.  
  27. typedef struct _tftp_t {
  28.   union {
  29.     unsigned short op;
  30.     tf_rwrq_t      req;
  31.     tf_data_t      data;
  32.     tf_ack_t       ack;
  33.     tf_err_t       err;
  34.   };
  35.   int size;
  36. } tftp_t;
  37.  
  38. typedef struct _active_t {
  39.   int                fd;
  40.   unsigned long      block;
  41.   unsigned int       ip;
  42.   unsigned short     port;
  43.   time_t             retransmit;
  44.   time_t             drop;
  45.   tftp_t             last;
  46.   
  47. } active_t;
  48.  
  49. #endif
  50.