Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / vsftpd / logging.h
blob48f88ec998115842339ce9cee2d99e5b52740292
1 #ifndef VSF_LOGGING_H
2 #define VSF_LOGGING_H
4 /* Forward delcarations */
5 struct mystr;
6 struct vsf_session;
8 enum EVSFLogEntryType
10 kVSFLogEntryNull = 1,
11 kVSFLogEntryDownload,
12 kVSFLogEntryUpload,
13 kVSFLogEntryMkdir,
14 kVSFLogEntryLogin,
15 kVSFLogEntryFTPInput,
16 kVSFLogEntryFTPOutput,
17 kVSFLogEntryConnection,
18 kVSFLogEntryDelete,
19 kVSFLogEntryRename,
20 kVSFLogEntryRmdir,
21 kVSFLogEntryChmod,
22 kVSFLogEntryDebug,
25 /* vsf_log_init()
26 * PURPOSE
27 * Initialize the logging services, by opening a writable file descriptor to
28 * the log file (should logging be enabled).
29 * PARAMETERS
30 * p_sess - the current session object
32 void vsf_log_init(struct vsf_session* p_sess);
34 /* vsf_log_start_entry()
35 * PURPOSE
36 * Denote the start of a logged operation. Importantly, timing information
37 * (if applicable) will be taken starting from this call.
38 * PARAMETERS
39 * p_sess - the current session object
40 * what - the type of operation which just started
42 void vsf_log_start_entry(struct vsf_session* p_sess,
43 enum EVSFLogEntryType what);
45 /* vsf_log_entry_pending()
46 * PURPOSE
47 * Determine whether a log entry has been started and not yet closed.
48 * RETURNS
49 * 0 if no log entry is pending; 1 if one is.
51 int vsf_log_entry_pending(struct vsf_session* p_sess);
53 /* vsf_log_clear_entry()
54 * PURPOSE
55 * Clears any pending log entry.
57 void vsf_log_clear_entry(struct vsf_session* p_sess);
59 /* vsf_log_do_log()
60 * PURPOSE
61 * Denote the end of a logged operation, specifying whether the operation
62 * was successful or not.
63 * PARAMETERS
64 * p_sess - the current session object
65 * succeeded - 0 for a failed operation, 1 for a successful operation
67 void vsf_log_do_log(struct vsf_session* p_sess, int succeeded);
69 /* vsf_log_line()
70 * PURPOSE
71 * Logs a single line of information, without disturbing any pending log
72 * operations (e.g. a download log spans a period of time).
73 * This call must be used for any logging calls nested within a call to
74 * the vsf_log_start_entry() function.
75 * PARAMETERS
76 * p_sess - the current session object
77 * what - the type of operation to log
78 * p_str - the string to log
80 void vsf_log_line(struct vsf_session* p_sess, enum EVSFLogEntryType what,
81 struct mystr* p_str);
83 #endif /* VSF_LOGGING_H */