oneprocess.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef VSF_ONEPROCESS_H
  2. #define VSF_ONEPROCESS_H
  3. struct mystr;
  4. struct vsf_session;
  5. /* vsf_one_process_start()
  6. * PURPOSE
  7. * Called to start FTP login processing using the one process model. Before
  8. * processing starts, all possible privileges are dropped.
  9. * PARAMETERS
  10. * p_sess - the current session object
  11. */
  12. void vsf_one_process_start(struct vsf_session* p_sess);
  13. /* vsf_one_process_login()
  14. * PURPOSE
  15. * Called to propose a login using the one process model. Only anonymous
  16. * logins supported!
  17. * PARAMETERS
  18. * p_sess - the current session object
  19. * p_pass_str - the proposed password
  20. */
  21. void vsf_one_process_login(struct vsf_session* p_sess,
  22. const struct mystr* p_pass_str);
  23. /* vsf_one_process_get_priv_data_sock()
  24. * PURPOSE
  25. * Get a privileged port 20 bound data socket using the one process model.
  26. * PARAMETERS
  27. * p_sess - the current session object
  28. * RETURNS
  29. * The file descriptor of the privileged socket
  30. */
  31. int vsf_one_process_get_priv_data_sock(struct vsf_session* p_sess);
  32. /* vsf_one_process_pasv_cleanup()
  33. * PURPOSE
  34. * Clean up any listening passive socket.
  35. * PARAMETERS
  36. * p_sess - the current session object
  37. */
  38. void vsf_one_process_pasv_cleanup(struct vsf_session* p_sess);
  39. /* vsf_one_process_pasv_active()
  40. * PURPOSE
  41. * Determine whether a listening pasv socket is active.
  42. * PARAMETERS
  43. * p_sess - the current session object
  44. * RETURNS
  45. * 1 if active, 0 if not.
  46. */
  47. int vsf_one_process_pasv_active(struct vsf_session* p_sess);
  48. /* vsf_one_process_listen()
  49. * PURPOSE
  50. * Start listening for an incoming connection.
  51. * PARAMETERS
  52. * p_sess - the current session object
  53. * RETURNS
  54. * The port we listened on.
  55. */
  56. unsigned short vsf_one_process_listen(struct vsf_session* p_sess);
  57. /* vsf_one_process_get_pasv_fd()
  58. * PURPOSE
  59. * Accept an incoming connection.
  60. * PARAMETERS
  61. * p_sess - the current session object
  62. * RETURNS
  63. * The file descriptor for the incoming connection.
  64. */
  65. int vsf_one_process_get_pasv_fd(struct vsf_session* p_sess);
  66. /* vsf_one_process_chown_upload()
  67. * PURPOSE
  68. * Change ownership of an uploaded file using the one process model.
  69. * PARAMETERS
  70. * p_sess - the current session object
  71. * fd - the file descriptor to change ownership on
  72. */
  73. void vsf_one_process_chown_upload(struct vsf_session* p_sess, int fd);
  74. #endif /* VSF_ONEPROCESS_H */