⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 miniftp.h

📁 一个LINUX下的服务器的小程序.可供学习.
💻 H
字号:
#ifndef _XYLFTP_H /*prevent reincluding this file*/
#define _XYLFTP_H


#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <syslog.h>
#include <sys/time.h>
#include <time.h>
#include <pwd.h>
#include <grp.h>
#include <dirent.h>
#include <openssl/md5.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <unistd.h>
#include <string.h>

#include "symbol_table.h"
#include<syslog.h>
typedef unsigned int bool;
#define TRUE  1
#define FALSE 0
#define YES 1
#define NO  0
#define MAXFD 65535


//the running environment, read the parms from config file
struct  run_env{
	bool anonymous_enable ; //allow anonymous to login or not ?
	unsigned short ftp_port ;  //ftp port
	unsigned short debut_log_file_enable ;  //write debug log?
	char *debug_log_file ;
	unsigned short error_log_file_enable ;
	char *error_log_file ;
	char *welcome_banner ;
	char ftp_dir[FTP_PATH_NAME_LEN] ;
	char *user_pass_file ;
	unsigned short backlog ;
};



struct user_env{
	bool login_in ;  //whether the user has logined or not
	char user_name[USER_NAME_LEN] ;
	unsigned int user_id ;
	char *client_ip ;
	unsigned short client_data_port ;
	unsigned long login_time ;
	unsigned long last_operation_time ;
	char current_path[PATH_NAME_LEN] ;
	int data_fd ;
	unsigned int connect_fd ;
	unsigned int enable_upload ;
	unsigned int upload_files_num ;
	unsigned int upload_kbytes ;
	unsigned int download_files_num ;
	unsigned int download_kbytes ;
};


#endif /*the _XYLFTP_H end*/




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -