tftp.h 544 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _ARPA_TFTP_H
  2. #define _ARPA_TFTP_H
  3. #define SEGSIZE 512
  4. #define RRQ 01
  5. #define WRQ 02
  6. #define DATA 03
  7. #define ACK 04
  8. #define ERROR 05
  9. struct tftphdr {
  10. short th_opcode;
  11. union {
  12. unsigned short tu_block;
  13. short tu_code;
  14. char tu_stuff[1];
  15. } th_u;
  16. char th_data[1];
  17. };
  18. #define th_block th_u.tu_block
  19. #define th_code th_u.tu_code
  20. #define th_stuff th_u.tu_stuff
  21. #define th_msg th_data
  22. #define EUNDEF 0
  23. #define ENOTFOUND 1
  24. #define EACCESS 2
  25. #define ENOSPACE 3
  26. #define EBADOP 4
  27. #define EBADID 5
  28. #define EEXISTS 6
  29. #define ENOUSER 7
  30. #endif