From 0010e10ef3d242f0ba92010b63f6222366e5ec05 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 11 Jan 2007 15:14:54 +0000 Subject: Update TFTP to use a struct buffer rather than a callback. Add debug autocolourisation to TFTP. --- src/include/gpxe/tftp.h | 50 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) (limited to 'src/include') diff --git a/src/include/gpxe/tftp.h b/src/include/gpxe/tftp.h index 68589b524..2359dcc45 100644 --- a/src/include/gpxe/tftp.h +++ b/src/include/gpxe/tftp.h @@ -11,6 +11,7 @@ #include #include #include +#include #define TFTP_PORT 69 /**< Default TFTP server port */ #define TFTP_DEFAULT_BLKSIZE 512 /**< Default TFTP data block size */ @@ -89,17 +90,30 @@ struct tftp_session { struct udp_connection udp; /** Filename */ const char *filename; + /** Data buffer to fill */ + struct buffer *buffer; + /** Requested data block size + * + * This is the "blksize" option requested from the TFTP + * server. It may or may not be honoured. + */ + unsigned int request_blksize; - /** - * Callback function + /** Data block size + * + * This is the "blksize" option negotiated with the TFTP + * server. (If the TFTP server does not support TFTP options, + * this will default to 512). + */ + unsigned int blksize; + /** File size * - * @v tftp TFTP connection - * @v block Block number - * @v data Data - * @v len Length of data + * This is the value returned in the "tsize" option from the + * TFTP server. If the TFTP server does not support the + * "tsize" option, this value will be zero. */ - void ( * callback ) ( struct tftp_session *tftp, unsigned int block, - void *data, size_t len ); + unsigned long tsize; + /** * Transfer ID * @@ -119,26 +133,6 @@ struct tftp_session { * (i.e. that no blocks have yet been received). */ int state; - /** Requested data block size - * - * This is the "blksize" option requested from the TFTP - * server. It may or may not be honoured. - */ - unsigned int request_blksize; - /** Data block size - * - * This is the "blksize" option negotiated with the TFTP - * server. (If the TFTP server does not support TFTP options, - * this will default to 512). - */ - unsigned int blksize; - /** File size - * - * This is the value returned in the "tsize" option from the - * TFTP server. If the TFTP server does not support the - * "tsize" option, this value will be zero. - */ - unsigned long tsize; /** Asynchronous operation for this session */ struct async_operation aop; -- cgit v1.2.3-55-g7522