1 #ifndef VSF_ONEPROCESS_H
2 #define VSF_ONEPROCESS_H
7 /* vsf_one_process_start()
9 * Called to start FTP login processing using the one process model. Before
10 * processing starts, all possible privileges are dropped.
12 * p_sess - the current session object
14 void vsf_one_process_start(struct vsf_session
* p_sess
);
16 /* vsf_one_process_login()
18 * Called to propose a login using the one process model. Only anonymous
21 * p_sess - the current session object
22 * p_pass_str - the proposed password
24 void vsf_one_process_login(struct vsf_session
* p_sess
,
25 const struct mystr
* p_pass_str
);
27 /* vsf_one_process_get_priv_data_sock()
29 * Get a privileged port 20 bound data socket using the one process model.
31 * p_sess - the current session object
33 * The file descriptor of the privileged socket
35 int vsf_one_process_get_priv_data_sock(struct vsf_session
* p_sess
);
37 /* vsf_one_process_pasv_cleanup()
39 * Clean up any listening passive socket.
41 * p_sess - the current session object
43 void vsf_one_process_pasv_cleanup(struct vsf_session
* p_sess
);
45 /* vsf_one_process_pasv_active()
47 * Determine whether a listening pasv socket is active.
49 * p_sess - the current session object
51 * 1 if active, 0 if not.
53 int vsf_one_process_pasv_active(struct vsf_session
* p_sess
);
55 /* vsf_one_process_listen()
57 * Start listening for an incoming connection.
59 * p_sess - the current session object
61 * The port we listened on.
63 unsigned short vsf_one_process_listen(struct vsf_session
* p_sess
);
65 /* vsf_one_process_get_pasv_fd()
67 * Accept an incoming connection.
69 * p_sess - the current session object
71 * The file descriptor for the incoming connection.
73 int vsf_one_process_get_pasv_fd(struct vsf_session
* p_sess
);
75 /* vsf_one_process_chown_upload()
77 * Change ownership of an uploaded file using the one process model.
79 * p_sess - the current session object
80 * fd - the file descriptor to change ownership on
82 void vsf_one_process_chown_upload(struct vsf_session
* p_sess
, int fd
);
84 #endif /* VSF_ONEPROCESS_H */