12 #define TFTP_PORT 69 /**< Default TFTP server port */
13 #define TFTP_DEFAULT_BLKSIZE 512 /**< Default TFTP data block size */
14 #define TFTP_MAX_BLKSIZE 1432
16 #define TFTP_RRQ 1 /**< Read request opcode */
17 #define TFTP_WRQ 2 /**< Write request opcode */
18 #define TFTP_DATA 3 /**< Data block opcode */
19 #define TFTP_ACK 4 /**< Data block acknowledgement opcode */
20 #define TFTP_ERROR 5 /**< Error opcode */
21 #define TFTP_OACK 6 /**< Options acknowledgement opcode */
23 #define TFTP_ERR_FILE_NOT_FOUND 1 /**< File not found */
24 #define TFTP_ERR_ACCESS_DENIED 2 /**< Access violation */
25 #define TFTP_ERR_DISK_FULL 3 /**< Disk full or allocation exceeded */
26 #define TFTP_ERR_ILLEGAL_OP 4 /**< Illegal TFTP operation */
27 #define TFTP_ERR_UNKNOWN_TID 5 /**< Unknown transfer ID */
28 #define TFTP_ERR_FILE_EXISTS 6 /**< File already exists */
29 #define TFTP_ERR_UNKNOWN_USER 7 /**< No such user */
30 #define TFTP_ERR_BAD_OPTS 8 /**< Option negotiation failed */
32 #define MTFTP_PORT 1759 /**< Default MTFTP server port */
34 /** A TFTP read request (RRQ) packet */
38 } __attribute__ (( packed
));
40 /** A TFTP data (DATA) packet */
45 } __attribute__ (( packed
));
47 /** A TFTP acknowledgement (ACK) packet */
51 } __attribute__ (( packed
));
53 /** A TFTP error (ERROR) packet */
58 } __attribute__ (( packed
));
60 /** A TFTP options acknowledgement (OACK) packet */
64 } __attribute__ (( packed
));
66 /** The common header of all TFTP packets */
69 } __attribute__ (( packed
));
71 /** A union encapsulating all TFTP packet types */
73 struct tftp_common common
;
75 struct tftp_data data
;
77 struct tftp_error error
;
78 struct tftp_oack oack
;
81 extern void tftp_set_request_blksize ( unsigned int blksize
);
83 #endif /* _GPXE_TFTP_H */