1 Star 0 Fork 0

mamh-mixed/vsftpd-3.0.5

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
logging.h 2.28 KB
一键复制 编辑 原始数据 按行查看 历史
bright.ma 提交于 2022-01-29 15:53 . add code for vsftpd-3.0.5
#ifndef VSF_LOGGING_H
#define VSF_LOGGING_H
/* Forward delcarations */
struct mystr;
struct vsf_session;
enum EVSFLogEntryType
{
kVSFLogEntryNull = 1,
kVSFLogEntryDownload,
kVSFLogEntryUpload,
kVSFLogEntryMkdir,
kVSFLogEntryLogin,
kVSFLogEntryFTPInput,
kVSFLogEntryFTPOutput,
kVSFLogEntryConnection,
kVSFLogEntryDelete,
kVSFLogEntryRename,
kVSFLogEntryRmdir,
kVSFLogEntryChmod,
kVSFLogEntryDebug,
};
/* vsf_log_init()
* PURPOSE
* Initialize the logging services, by opening a writable file descriptor to
* the log file (should logging be enabled).
* PARAMETERS
* p_sess - the current session object
*/
void vsf_log_init(struct vsf_session* p_sess);
/* vsf_log_start_entry()
* PURPOSE
* Denote the start of a logged operation. Importantly, timing information
* (if applicable) will be taken starting from this call.
* PARAMETERS
* p_sess - the current session object
* what - the type of operation which just started
*/
void vsf_log_start_entry(struct vsf_session* p_sess,
enum EVSFLogEntryType what);
/* vsf_log_entry_pending()
* PURPOSE
* Determine whether a log entry has been started and not yet closed.
* RETURNS
* 0 if no log entry is pending; 1 if one is.
*/
int vsf_log_entry_pending(struct vsf_session* p_sess);
/* vsf_log_clear_entry()
* PURPOSE
* Clears any pending log entry.
*/
void vsf_log_clear_entry(struct vsf_session* p_sess);
/* vsf_log_do_log()
* PURPOSE
* Denote the end of a logged operation, specifying whether the operation
* was successful or not.
* PARAMETERS
* p_sess - the current session object
* succeeded - 0 for a failed operation, 1 for a successful operation
*/
void vsf_log_do_log(struct vsf_session* p_sess, int succeeded);
/* vsf_log_line()
* PURPOSE
* Logs a single line of information, without disturbing any pending log
* operations (e.g. a download log spans a period of time).
* This call must be used for any logging calls nested within a call to
* the vsf_log_start_entry() function.
* PARAMETERS
* p_sess - the current session object
* what - the type of operation to log
* p_str - the string to log
*/
void vsf_log_line(struct vsf_session* p_sess, enum EVSFLogEntryType what,
struct mystr* p_str);
#endif /* VSF_LOGGING_H */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mamh-mixed/vsftpd-3.0.5.git
git@gitee.com:mamh-mixed/vsftpd-3.0.5.git
mamh-mixed
vsftpd-3.0.5
vsftpd-3.0.5
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385