K2.6 patches and update.
[tomato.git] / release / src / router / vsftpd / oneprocess.h
blobd8e077e3630718a9772675e0eeca10c1dcbe78fb
1 #ifndef VSF_ONEPROCESS_H
2 #define VSF_ONEPROCESS_H
4 struct mystr;
5 struct vsf_session;
7 /* vsf_one_process_start()
8 * PURPOSE
9 * Called to start FTP login processing using the one process model. Before
10 * processing starts, all possible privileges are dropped.
11 * PARAMETERS
12 * p_sess - the current session object
14 void vsf_one_process_start(struct vsf_session* p_sess);
16 /* vsf_one_process_login()
17 * PURPOSE
18 * Called to propose a login using the one process model. Only anonymous
19 * logins supported!
20 * PARAMETERS
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()
28 * PURPOSE
29 * Get a privileged port 20 bound data socket using the one process model.
30 * PARAMETERS
31 * p_sess - the current session object
32 * RETURNS
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()
38 * PURPOSE
39 * Clean up any listening passive socket.
40 * PARAMETERS
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()
46 * PURPOSE
47 * Determine whether a listening pasv socket is active.
48 * PARAMETERS
49 * p_sess - the current session object
50 * RETURNS
51 * 1 if active, 0 if not.
53 int vsf_one_process_pasv_active(struct vsf_session* p_sess);
55 /* vsf_one_process_listen()
56 * PURPOSE
57 * Start listening for an incoming connection.
58 * PARAMETERS
59 * p_sess - the current session object
60 * RETURNS
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()
66 * PURPOSE
67 * Accept an incoming connection.
68 * PARAMETERS
69 * p_sess - the current session object
70 * RETURNS
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()
76 * PURPOSE
77 * Change ownership of an uploaded file using the one process model.
78 * PARAMETERS
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 */