session.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #ifndef VSF_SESSION_H
  2. #define VSF_SESSION_H
  3. #ifndef VSFTP_STR_H
  4. #include "str.h"
  5. #endif
  6. #ifndef VSF_FILESIZE_H
  7. #include "filesize.h"
  8. #endif
  9. struct vsf_sysutil_sockaddr;
  10. struct mystr_list;
  11. /* This struct contains variables specific to the state of the current FTP
  12. * session
  13. */
  14. struct vsf_session
  15. {
  16. /* Details of the control connection */
  17. struct vsf_sysutil_sockaddr* p_local_addr;
  18. struct vsf_sysutil_sockaddr* p_remote_addr;
  19. char* p_control_line_buf;
  20. int idle_timeout;
  21. int data_timeout;
  22. /* Details of the data connection */
  23. int pasv_listen_fd;
  24. struct vsf_sysutil_sockaddr* p_port_sockaddr;
  25. int data_fd;
  26. int data_progress;
  27. unsigned int bw_rate_max;
  28. long bw_send_start_sec;
  29. long bw_send_start_usec;
  30. /* Details of the login */
  31. int is_anonymous;
  32. int is_guest;
  33. struct mystr user_str;
  34. struct mystr anon_pass_str;
  35. /* Details of the FTP protocol state */
  36. filesize_t restart_pos;
  37. int is_ascii;
  38. struct mystr rnfr_filename_str;
  39. int abor_received;
  40. int epsv_all;
  41. /* HTTP hacks */
  42. int is_http;
  43. struct mystr http_get_arg;
  44. /* Details of FTP session state */
  45. struct mystr_list* p_visited_dir_list;
  46. /* Details of userids which are interesting to us */
  47. int anon_ftp_uid;
  48. int guest_user_uid;
  49. int anon_upload_chown_uid;
  50. /* Things we need to cache before we chroot() */
  51. struct mystr banned_email_str;
  52. struct mystr email_passwords_str;
  53. struct mystr userlist_str;
  54. struct mystr banner_str;
  55. int tcp_wrapper_ok;
  56. /* Logging related details */
  57. int xferlog_fd;
  58. int vsftpd_log_fd;
  59. struct mystr remote_ip_str;
  60. unsigned long log_type;
  61. long log_start_sec;
  62. long log_start_usec;
  63. struct mystr log_str;
  64. filesize_t transfer_size;
  65. /* Buffers */
  66. struct mystr ftp_cmd_str;
  67. struct mystr ftp_arg_str;
  68. /* Parent<->child comms channel */
  69. int parent_fd;
  70. int child_fd;
  71. /* Other details */
  72. unsigned int num_clients;
  73. unsigned int num_this_ip;
  74. struct mystr home_str;
  75. /* Secure connections state */
  76. int control_use_ssl;
  77. int data_use_ssl;
  78. void* p_ssl_ctx;
  79. void* p_control_ssl;
  80. void* p_data_ssl;
  81. struct mystr control_cert_digest;
  82. int ssl_slave_active;
  83. int ssl_slave_fd;
  84. int ssl_consumer_fd;
  85. unsigned int login_fails;
  86. };
  87. #endif /* VSF_SESSION_H */