ftpfs.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* ftpfs.h */
  2. #if !defined(__FTPFS_H)
  3. #define __FTPFS_H
  4. struct direntry
  5. {
  6. char *name;
  7. int count;
  8. char *linkname;
  9. char *local_filename, *remote_filename;
  10. int local_is_temp:1;
  11. int freshly_created:1;
  12. struct stat local_stat;
  13. struct stat s;
  14. struct stat *l_stat;
  15. struct connection *bucket;
  16. int data_sock; /* For linear_ operations */
  17. int linear_state;
  18. #define LS_NONLIN 0 /* Not using linear access at all */
  19. #define LS_LINEAR_CLOSED 1 /* Using linear access, but not open, yet */
  20. #define LS_LINEAR_OPEN 2 /* Using linear access, open */
  21. };
  22. struct dir
  23. {
  24. int count;
  25. struct timeval timestamp;
  26. char *remote_path;
  27. struct linklist *file_list;
  28. int symlink_status;
  29. };
  30. /* valid values for dir->symlink_status */
  31. #define FTPFS_NO_SYMLINKS 0
  32. #define FTPFS_UNRESOLVED_SYMLINKS 1
  33. #define FTPFS_RESOLVED_SYMLINKS 2
  34. #define FTPFS_RESOLVING_SYMLINKS 3
  35. struct connection {
  36. char *host;
  37. char *user;
  38. char *current_directory;
  39. char *home;
  40. char *updir;
  41. char *password;
  42. int port;
  43. int sock;
  44. struct linklist *dcache;
  45. ino_t __inode_counter;
  46. int lock;
  47. int failed_on_login; /* used to pass the failure reason to upper levels */
  48. int use_proxy; /* use a proxy server */
  49. int result_pending;
  50. int use_source_route;
  51. int use_passive_connection;
  52. int isbinary;
  53. int cwd_defered; /* current_directory was changed but CWD command hasn't
  54. been sent yet */
  55. int strict_rfc959_list_cmd; /* ftp server doesn't understand
  56. "LIST -la <path>"; use "CWD <path>"/
  57. "LIST" instead */
  58. };
  59. #define qhost(b) (b)->host
  60. #define quser(b) (b)->user
  61. #define qcdir(b) (b)->current_directory
  62. #define qport(b) (b)->port
  63. #define qsock(b) (b)->sock
  64. #define qlock(b) (b)->lock
  65. #define qdcache(b) (b)->dcache
  66. #define qhome(b) (b)->home
  67. #define qupdir(b) (b)->updir
  68. #define qproxy(b) (b)->use_proxy
  69. /* Increased since now we may use C-r to reread the contents */
  70. #define FTPFS_DIRECTORY_TIMEOUT 30 * 60
  71. #define DO_RESOLVE_SYMLINK 1
  72. #define DO_OPEN 2
  73. #define DO_FREE_RESOURCE 4
  74. extern char *ftpfs_anonymous_passwd;
  75. extern char *ftpfs_proxy_host;
  76. extern int ftpfs_directory_timeout;
  77. extern int ftpfs_always_use_proxy;
  78. void ftpfs_init_passwd ();
  79. #endif