2 *Copyright (c) 2007,西安邮电学院Linux兴趣小组
13 * 说 明:defines.h将被废弃不用,此文件将取代它,在原来的基础上增加了
14 * 四组关于当前用户的统计数据,使STAT命令容易实现。增加关于命令名长度和参数最大长度的声明。
17 #ifndef _XYLFTP_H /*prevent reincluding this file*/
23 #include <sys/types.h>
26 #include <netinet/in.h>
29 #include <sys/socket.h>
30 #include <arpa/inet.h>
38 #include <openssl/md5.h>
40 #include <net/if_arp.h>
41 #include <sys/ioctl.h>
44 int read_configure(void);
45 int write_log(char *message
,int level
);
46 void listen_connect(void);
47 int xyl_listen(short port
);
48 int xyl_accept(int socket_fd
);
49 int xyl_connect(char *server
,short port
);
51 void free_sources(void);
53 typedef unsigned int bool;
59 #define _BUFFER_LENGTH 150
62 #define CONFIG_FILE "../doc/xylftp.conf"
64 #define CONFIG_FILE "/etc/xylftp/xylftp.conf"
67 #define PATH_NAME_LEN 1024
68 #define USER_NAME_LEN 32
69 #define MAX_MSG_LEN 256
70 #define MAX_INTERFACES 16
75 bool anonymous_enable
; /*是否允许匿名登录*/
76 unsigned short ftp_port
; /*FTP使用的端口号*/
77 unsigned int local_umask
; /*上传文件权限*/
78 unsigned int log_file_enable
; /*是否启用日志*/
79 char *log_file
; /*日志文件存储路径*/
80 unsigned int idle_session_timeout
; /*控制链接的最大空闲时间,超时断开链接*/
81 unsigned int data_connection_timeout
; /*数据链接的最大空闲时间,超时断开链接*/
82 char *ftpd_banner
; /*登录欢迎信息*/
83 unsigned int max_clients
; /*允许的最大客户数目*/
84 unsigned int max_connections
; /*允许的最大链接数目*/
85 unsigned int passive_port_max
; /*被动模式下监听的端口范围*/
86 unsigned int passive_port_min
;
87 unsigned int max_port_connections
;
88 char ftp_dir
[PATH_NAME_LEN
]; /*FTP根目录位置*/
89 char *user_pass_file
; /*用户数据文件目录*/
90 char visible_user_name
[USER_NAME_LEN
]; /*用户所看到的文件所有者*/
91 char visible_group_name
[USER_NAME_LEN
]; /*用户所看到的文件所有者所在的用户组*/
97 bool login_in
; /*是否已经登录*/
98 char user_name
[USER_NAME_LEN
]; /*登录的用户名*/
99 unsigned int user_id
; /*登录的用户ID*/
100 unsigned int client_data_port
; /*客户端数据连接使用端口*/
101 char client_ip
[16]; /*客户端ip*/
102 char port_ip
[16]; /*port命令使用的ip*/
103 unsigned short client_port
; /*客户所使用的端口号*/
104 unsigned long login_time
; /*登录时间*/
105 unsigned long last_operation_time
; /*上次操作时间*/
106 char current_path
[PATH_NAME_LEN
]; /*当前路径*/
107 unsigned int enable_upload
; /*是否允许上传*/
108 bool passive_on
; /*是否为被动被模式*/
109 bool ascii_on
; /*是否为ascii码模式*/
110 int connect_fd
; /*控制连接*/
111 int data_fd
; /*数据连接*/
112 unsigned int port_connections
; /*对其它主机使用port命令的次数*/
113 unsigned int upload_files
;
114 unsigned int upload_kbytes
;
115 unsigned int download_files
;
116 unsigned int download_kbytes
; /*以上四项为传输过程中的统计数据*/
121 #endif /*the _XYLFTP_H end*/