2024年4月12日发(作者:)

#define _VC

#include

#include

#include

#include

#include

#ifndef MAKEWORD

#define MAKEWORD(l,h) ((WORD)(((BYTE)(l))|(((WORD)(BYTE)(h))<<8)))

#endif

#define WSA_MAJOR_VERSION 1

#define WSA_MINOR_VERSION 1

#define WSA_VERSION MAKEWORD(WSA_MAJOR_VERSION,

WSA_MINOR_VERSION)

/* read/write request packet format

2 bytes string 1 byte string 1 byte

------------------------------------------------

| Opcode | Filename | 0 | Mode | 0 |

------------------------------------------------

*/

#define TFTP_RRQ 1 /*Read request (RRQ)*/

#define TFTP_WRQ 2 /*Write request (WRQ) */

/* DATA packet format

2 bytes 2 bytes n bytes

----------------------------------

| Opcode | block # | Data |