/* * structures and defines for the tftp protocol */ #ifndef __TFTP_H__ #define __TFTP_H__ /* opcodes */ enum { RRQ = 1, WRQ, DATA, ACK, ERROR }; /* errors */ enum { errUNDEF = 0, errNOFILE, errACCESS, errDISKFULL, errOPCODE, errTID, errEXIST, errNOUSER }; typedef struct { int opcode; char data[2]; } rrq_packet, wrq_packet; typedef struct { int opcode; int block; char data[2]; } data_packet; typedef struct ack_packet { int opcode; int block; } ack_packet; typedef struct { int opcode; int error; char message[2]; } error_packet; #endif