summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2007-01-11 16:14:54 +0100
committerMichael Brown2007-01-11 16:14:54 +0100
commit0010e10ef3d242f0ba92010b63f6222366e5ec05 (patch)
tree90de66f3fbcbd4e0ca4e3223f57673e554664b46 /src/include
parentUse physical address in debug messages; they make more sense to read. (diff)
downloadipxe-0010e10ef3d242f0ba92010b63f6222366e5ec05.tar.gz
ipxe-0010e10ef3d242f0ba92010b63f6222366e5ec05.tar.xz
ipxe-0010e10ef3d242f0ba92010b63f6222366e5ec05.zip
Update TFTP to use a struct buffer rather than a callback.
Add debug autocolourisation to TFTP.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/tftp.h50
1 files changed, 22 insertions, 28 deletions
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 <gpxe/udp.h>
#include <gpxe/async.h>
#include <gpxe/retry.h>
+#include <gpxe/buffer.h>
#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;