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

📄 tftp.h

📁 tftp-1.0源码
💻 H
字号:
/**********************************************************Date: 		OCT 28, 2006Project :	TFTP ServerProgramer:	Reza Rahmanian, Craig HolmesFile:		Header FilesPurpose:	This file contains all the needed header files 		for the implementation of the TFTP client and servers.***********************************************************/#include <stdio.h>		/*for input and output */#include <string.h>		/*for string functions */#include <stdlib.h> 		/**/#include <unistd.h> 		/**/#include <sys/types.h>		/*used for the socket function */#include <sys/socket.h>		/*for socket functions */#include <netdb.h>		/*for address information and conversions, also holds the hostent structure */#include <netinet/in.h>		/*for internet addresses */#include <arpa/inet.h> 		/**/#include <errno.h>#include <sys/wait.h>#include <dirent.h>#define ERROR -1#define RRQ 1#define WRQ 2#define DATA 3#define ACK 0x04#define ERR 0x05#define TIMEOUT 2000 /*amount of time to wait for an ACK/Data Packet in 1000microseconds 1000 = 1 second*/#define RETRIES 3 /* Number of times to resend a data OR ack packet beforing giving up */#define MAXACKFREQ 16 /* Maximum number of packets before ack */#define MAXDATASIZE 1024 /* Maximum data size allowed */static char buf[BUFSIZ];	/*a buffer for the messages passed between the client and the server */char err_msg [7][40] = {"Not defined, see error message if any",                        "File not fount",                        "Access Violation",                        "Disk full, or allocation exceeded",                        "Illegal TFTP operation",                        "Unknown transfer ID",                        "File already exists"};

⌨️ 快捷键说明

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