luat_ftp.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef LUAT_FTP_H
  2. #define LUAT_FTP_H
  3. enum
  4. {
  5. FTP_COMMAND_SYST = 1,
  6. FTP_COMMAND_PULL ,
  7. FTP_COMMAND_PUSH ,
  8. FTP_COMMAND_CLOSE ,
  9. };
  10. #define FTP_OK (0)
  11. #define FTP_ERROR_STATE (-1)
  12. #define FTP_ERROR_HEADER (-2)
  13. #define FTP_ERROR_BODY (-3)
  14. #define FTP_ERROR_CONNECT (-4)
  15. #define FTP_ERROR_CLOSE (-5)
  16. #define FTP_ERROR_RX (-6)
  17. #define FTP_ERROR_DOWNLOAD (-7)
  18. #define FTP_ERROR_FILE (-8)
  19. #define FTP_ERROR_NO_MEM (-9)
  20. #define FTP_ERROR_NETWORK (-10)
  21. #define FTP_RX_TIMEOUT (-6)
  22. #define FTP_SOCKET_TIMEOUT (30000)
  23. #define FTP_RESTART_MARKER "110" //Restart marker reply.
  24. #define FTP_SERVICE_MIN_OK "120" //Service ready in nnn minutes.
  25. #define FTP_DATA_CON_OPEN "125" //Data connection already open; transfer starting.
  26. #define FTP_FILE_STATUS_OK "150" //File status okay; about to open data connection.
  27. #define FTP_COMMAND_OK "200" //Command okay.
  28. #define FTP_COM_NOT_IMP "202" //Command not implemented, superfluous at this site.
  29. #define FTP_SYSTEM_STATUS "211" //System status, or system help reply.
  30. #define FTP_DIRECTORY_STATUS "212" //Directory status.
  31. #define FTP_FILE_STATUS "213" //File status.
  32. #define FTP_HELP_MESSAGE "214" //Help message.
  33. #define FTP_SYSTEM_TYPE "215" //NAME system type.
  34. #define FTP_SERVICE_NEW_OK "220" //Service ready for new user.
  35. #define FTP_CLOSE_CONTROL "221" //Service closing control connection.
  36. #define FTP_CLOSE_CONNECT "226" //Closing data connection.
  37. #define FTP_ENTER_PASSIVE "227" //Entering Passive Mode (h1,h2,h3,h4,p1,p2).
  38. #define FTP_LOGIN_OK "230" //User logged in, proceed.
  39. #define FTP_FILE_REQUESTED_OK "250" //Requested file action okay, completed.
  40. #define FTP_PATHNAME_OK "257" //"PATHNAME" created.
  41. #define FTP_USERNAME_OK "331" //User name okay, need password.
  42. #define FTP_DATA_CON_FAIL "425" //Can't open data connection.
  43. #define FTP_CMD_SEND_MAX (128)
  44. #define FTP_CMD_RECV_MAX (1024)
  45. #define PUSH_BUFF_SIZE (4096)
  46. #endif