diff options
author | Michael Brown <mcb30@etherboot.org> | 2008-01-08 16:46:55 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2008-01-08 16:46:55 +0000 |
commit | f6a8158eed215954dafb7f622f6fd345b5b473d2 (patch) | |
tree | 74c855e3fb0a953ec463bfd4b5edb0248bd93ce8 /src/net/udp | |
parent | 74fd544101c8f17f35dfc2cd16738ebd5228d366 (diff) | |
download | ipxe-f6a8158eed215954dafb7f622f6fd345b5b473d2.tar.gz |
Make seek information part of the xfer metadata, rather than an entirely
separate xfer method.
Add missing .alloc_iob entries to several xfer_interface_operations
structures.
Diffstat (limited to 'src/net/udp')
-rw-r--r-- | src/net/udp/dhcp.c | 2 | ||||
-rw-r--r-- | src/net/udp/dns.c | 1 | ||||
-rw-r--r-- | src/net/udp/tftp.c | 10 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index b10c3ee7c..2521f9ac9 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -927,8 +927,8 @@ static int dhcp_deliver_raw ( struct xfer_interface *xfer, static struct xfer_interface_operations dhcp_xfer_operations = { .close = ignore_xfer_close, .vredirect = xfer_vopen, - .seek = ignore_xfer_seek, .window = unlimited_xfer_window, + .alloc_iob = default_xfer_alloc_iob, .deliver_iob = xfer_deliver_as_raw, .deliver_raw = dhcp_deliver_raw, }; diff --git a/src/net/udp/dns.c b/src/net/udp/dns.c index f32b2e055..d82d124b6 100644 --- a/src/net/udp/dns.c +++ b/src/net/udp/dns.c @@ -435,7 +435,6 @@ static void dns_xfer_close ( struct xfer_interface *socket, int rc ) { static struct xfer_interface_operations dns_socket_operations = { .close = dns_xfer_close, .vredirect = xfer_vopen, - .seek = ignore_xfer_seek, .window = unlimited_xfer_window, .alloc_iob = default_xfer_alloc_iob, .deliver_iob = xfer_deliver_as_raw, diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c index d8719acef..4d441909c 100644 --- a/src/net/udp/tftp.c +++ b/src/net/udp/tftp.c @@ -554,6 +554,7 @@ static int tftp_rx_oack ( struct tftp_request *tftp, void *buf, size_t len ) { static int tftp_rx_data ( struct tftp_request *tftp, struct io_buffer *iobuf ) { struct tftp_data *data = iobuf->data; + struct xfer_metadata meta; int block; off_t offset; size_t data_len; @@ -580,8 +581,10 @@ static int tftp_rx_data ( struct tftp_request *tftp, } /* Deliver data */ - xfer_seek ( &tftp->xfer, offset, SEEK_SET ); - rc = xfer_deliver_iob ( &tftp->xfer, iobuf ); + memset ( &meta, 0, sizeof ( meta ) ); + meta.whence = SEEK_SET; + meta.offset = offset; + rc = xfer_deliver_iob_meta ( &tftp->xfer, iobuf, &meta ); iobuf = NULL; if ( rc != 0 ) { DBGC ( tftp, "TFTP %p could not deliver data: %s\n", @@ -763,7 +766,6 @@ static void tftp_socket_close ( struct xfer_interface *socket, int rc ) { static struct xfer_interface_operations tftp_socket_operations = { .close = tftp_socket_close, .vredirect = xfer_vopen, - .seek = ignore_xfer_seek, .window = unlimited_xfer_window, .alloc_iob = default_xfer_alloc_iob, .deliver_iob = tftp_socket_deliver_iob, @@ -811,7 +813,6 @@ static void tftp_mc_socket_close ( struct xfer_interface *mc_socket, static struct xfer_interface_operations tftp_mc_socket_operations = { .close = tftp_mc_socket_close, .vredirect = xfer_vopen, - .seek = ignore_xfer_seek, .window = unlimited_xfer_window, .alloc_iob = default_xfer_alloc_iob, .deliver_iob = tftp_mc_socket_deliver_iob, @@ -838,7 +839,6 @@ static void tftp_xfer_close ( struct xfer_interface *xfer, int rc ) { static struct xfer_interface_operations tftp_xfer_operations = { .close = tftp_xfer_close, .vredirect = ignore_xfer_vredirect, - .seek = ignore_xfer_seek, .window = unlimited_xfer_window, .alloc_iob = default_xfer_alloc_iob, .deliver_iob = xfer_deliver_as_raw, |