summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2006-08-09 01:45:52 +0200
committerMichael Brown2006-08-09 01:45:52 +0200
commit3611cb17b74740588059c5fe2d11545c6e11f573 (patch)
tree99449753bd7dfcafbd4269ec5be54d228c486c26 /src/include
parentThe prototype for strcasecmp() is apparently in strings.h. (diff)
downloadipxe-3611cb17b74740588059c5fe2d11545c6e11f573.tar.gz
ipxe-3611cb17b74740588059c5fe2d11545c6e11f573.tar.xz
ipxe-3611cb17b74740588059c5fe2d11545c6e11f573.zip
Initial (untested) implementation of TFTP over the new UDP API.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/tftp.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/include/gpxe/tftp.h b/src/include/gpxe/tftp.h
index f6b738e68..e5c599bc0 100644
--- a/src/include/gpxe/tftp.h
+++ b/src/include/gpxe/tftp.h
@@ -9,6 +9,8 @@
#include <stdint.h>
#include <gpxe/udp.h>
+#include <gpxe/async.h>
+#include <gpxe/retry.h>
#define TFTP_PORT 69 /**< Default TFTP server port */
#define TFTP_DEFAULT_BLKSIZE 512 /**< Default TFTP data block size */
@@ -59,7 +61,7 @@ struct tftp_error {
/** A TFTP options acknowledgement (OACK) packet */
struct tftp_oack {
uint16_t opcode;
- uint8_t data[0];
+ char data[0];
} __attribute__ (( packed ));
/** The common header of all TFTP packets */
@@ -87,6 +89,17 @@ struct tftp_session {
struct udp_connection udp;
/** Filename */
const char *filename;
+
+ /**
+ * Callback function
+ *
+ * @v tftp TFTP connection
+ * @v block Block number
+ * @v data Data
+ * @v len Length of data
+ */
+ void ( * callback ) ( struct tftp_session *tftp, unsigned int block,
+ void *data, size_t len );
/**
* Transfer ID
*
@@ -119,7 +132,12 @@ struct tftp_session {
* TFTP server. If the TFTP server does not support the
* "tsize" option, this value will be zero.
*/
- off_t tsize;
+ unsigned long tsize;
+
+ /** Asynchronous operation for this session */
+ struct async_operation aop;
+ /** Retransmission timer */
+ struct retry_timer timer;
};
#endif /* _GPXE_TFTP_H */