home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / arpa / h / tftp < prev   
Encoding:
Text File  |  1995-01-11  |  2.1 KB  |  65 lines

  1. /*
  2.  * $Header: /ax/networking:include/arpa/tftp.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/arpa/tftp.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    tftp.h,v $
  8.  * Revision 1.1  95/01/11  10:14:21  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.3  88/06/19  15:20:22  beta
  12.  * Acorn Unix initial beta version
  13.  * 
  14.  */
  15. /*
  16.  * Copyright (c) 1983 Regents of the University of California.
  17.  * All rights reserved.  The Berkeley software License Agreement
  18.  * specifies the terms and conditions for redistribution.
  19.  *
  20.  *      @(#)tftp.h      5.1 (Berkeley) 5/30/85
  21.  */
  22.  
  23. /*
  24.  * Trivial File Transfer Protocol (IEN-133)
  25.  */
  26. #define SEGSIZE         512             /* data segment size */
  27.  
  28. /*
  29.  * Packet types.
  30.  */
  31. #define RRQ     01                      /* read request */
  32. #define WRQ     02                      /* write request */
  33. #define DATA    03                      /* data packet */
  34. #define ACK     04                      /* acknowledgement */
  35. #define ERROR   05                      /* error code */
  36.  
  37. struct  tftphdr {
  38.     union {
  39.         struct { u_short opcode; char stuff[514]; } _rrq;
  40.         struct { u_short opcode, block; char data[512]; } _data;
  41.         struct { u_short opcode, block; } _ack;
  42.         struct { u_short opcode, code;  char msg[512]; } _err;
  43.     } th_u;
  44. };
  45. #define th_opcode       th_u._rrq.opcode
  46. #define th_block        th_u._data.block
  47. #define th_code         th_u._err.code
  48. #define th_stuff        th_u._rrq.stuff
  49. #define th_data         th_u._data.data
  50. #define th_msg          th_u._err.msg
  51.  
  52. /*
  53.  * Error codes.
  54.  */
  55. #define EUNDEF          0               /* not defined */
  56. #define ENOTFOUND       1               /* file not found */
  57. #define EACCESS         2               /* access violation */
  58. #define ENOSPACE        3               /* disk full or allocation exceeded */
  59. #define EBADOP          4               /* illegal TFTP operation */
  60. #define EBADID          5               /* unknown transfer ID */
  61. #define EEXISTS         6               /* file already exists */
  62. #define ENOUSER         7               /* no such user */
  63.  
  64. /* EOF tftp.h */
  65.