
#define TFTP_PORT 69
#define TFTP_GET 1
#define TFTP_PUT 2

#define TFTP_RRQ   1
#define TFTP_WRQ   2
#define TFTP_DATA  3
#define TFTP_ACK   4
#define TFTP_ERROR 5

typedef struct {
    byte op1, op2;
    char filename[ 128 ];
} RRQ_Packet;

typedef struct {
    byte op1, op2;
    word block;
    char data[ 512 ];
} DATA_Packet;

typedef struct {
    byte op1, op2;
    word block;
} ACK_Packet;

typedef struct {
    byte op1, op2;
    byte err1, err2;
    char errmsg[1];
} ERROR_Packet;

void tftpdthread( DWORD dummy );
int tftp( DWORD host, int op, char * file );

