public.h

来自「Linux下的ftp服务器」· C头文件 代码 · 共 65 行

H
65
字号
#ifndef __PUBLIC_H
#define __PUBLIC_H

#undef LISTEN_BACKLOG
#define LISTEN_BACKLOG 10

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/time.h>
#include <errno.h>
#include <shadow.h>
#include <pwd.h>
#include <grp.h>
#include <dirent.h>
#include <ctype.h>

#ifndef MAX_SIZE
#define MAX_SIZE 32
#endif
#ifndef MAX_PATH
#define MAX_PATH 260
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define USER_MASK 0777
#define USER_LEN 21
#define PASS_LEN 15
#define CMD_LEN 15
#define ARG_LEN 129
#define IPV4_LEN 16
#define CHILD_QUIT 0xFFFF
#define PASV 0x8000
#define PORT 0x4000

#define die(msg) do{ perror(msg); fflush(stdout); exit(EXIT_FAILURE);}while(0)

typedef struct myftp_conf
{
	int is_allowed_anoymous;//TRUE-》允许,FALSE-》不允许
	unsigned int file_trans_rate;//限速,单位为KB
	time_t timeout_val;//
	unsigned short listen_port;//监听端口号
	int is_allowed_root;//是否运行超级用户登录。TRUE-->允许;FALSE---》不允许

}MYFTP_CONF,*pMYFTP_CONF;

MYFTP_CONF myftp_conf;

//const char* zjwftp_logfile="zjwftp.log";//日志文件

#endif /*public.h*/

⌨️ 快捷键说明

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