History log of /fuchsia/zircon/system/ulib/tftp/internal.h
Revision Date Author Comments
# 2e94e22d 30-Jan-2018 Josh Conner <joshconner@google.com>

[tftp] Remove NET-186 workaround

Remove tftp_session_set_block_host_endianness() workaround for
NET-186.

Change-Id: I7b1ec1bb1aa4263cd59b9bb77ff863f04c43df2b


# 0a0eafb2 09-Jan-2018 Josh Conner <joshconner@google.com>

[tftp] Add support for BUSY response to requests

If a server is unable to handle a request at the moment, but may
be able to do so if the client waits, it can respond with a
TFTP_ERR_CODE_BUSY error packet. This behavior is induced by a
response of TFTP_ERR_SHOULD_WAIT from a file_open_read() or
file_open_write() call.

ZX-1521

Change-Id: I2551407052d4a33a7e6b6eebcf45d8f4b28b9dab


# aedb3bac 20-Nov-2017 Josh Conner <joshconner@google.com>

[netsvc][bootserver][inet6][libtftp] pull support

Add pull support to libtftp and use it in netcp operations.

NET-287

Change-Id: I9f4ceb23655f27a71405dfb46223cdbab9514e89


# 421bb89c 18-Oct-2017 Sean Klein <smklein@google.com>

[tftp] Increase size of tftp state variables to prevent uint32_t overflow

Without this change, transfers over 4GB cause overflow issues.

Change-Id: Ie4de40df7fe0637ca35945151748f84c1951bb46


# 7e4e926a 18-Sep-2017 Josh Conner <joshconner@google.com>

[libtftp][bootserver] Fix byte order in block #s

libtftp was using host byte ordering for block numbers in DATA and
ACK packets. Change to network byte ordering (as per RFC), but
allow backwards-compatible behavior with
tftp_session_set_block_host_endianness().
Fixes NET-186.

Change-Id: I8a62ef595f7857e2dfc16ec8c84fa996176e1dbe


# 8e95be2f 23-Aug-2017 Josh Conner <joshconner@google.com>

[libtftp] Allow client settings to override host's

In a WRQ packet, when an option is suffixed with a '!' don't attempt
to override it. This allows us two levels of overrides. For normal
write requests, any overrides set by the server take precendence.
For "forceful" write requests, the server will respect the client's
request. This strategy replaces the previous min/max values behavior.

A client sets its default options with tftp_set_options() and any
"forceful" options in tftp_push_file().

A server sets its overrides with tftp_set_options().

Change-Id: I23267138bfafdeeb0d5ba2054abe83d40e181fff


# 2fedbc43 15-Aug-2017 Josh Conner <joshconner@google.com>

[libtftp] Support option negotiation

On the server side, allow the user to specify options that will override
requested options, using tftp_server_set_options().
On the client side, respect alternate settings that are returned in
OACK packets.

Change-Id: I5a13c897f76f8b8acdf2c6ad9d69aa976bbdf972


# a32894c4 11-Aug-2017 Josh Conner <joshconner@google.com>

[libtftp] Cleanup options

Move all non-negotiated settings out of "options" and add some documentation
to make it clear how the options are used in a server and client. This sets
the stage for option negotiation support.

Change-Id: I336e4fc940e863ed9e5f530e24cb7c5a574bde51


# a8278aa7 03-Aug-2017 Josh Conner <joshconner@google.com>

[libtftp] Use opcode prefixes

Use the (previously-unused) upper byte of the opcode to store an index
value that we increment on evidence of transmission failure (e.g.,
unexpected DATA packets, timeouts, or unexpected ACKs). This helps
us to work around an issue with the asix 88179 chipset where invalid
IPv6 checksums are calculated. Adding some variation on retransmission
allows a valid packet to be generated.

Change-Id: If06211707e2861577643fd8467b0edda2e9e9d02


# 04e6a8bf 03-Aug-2017 Josh Conner <joshconner@google.com>

[bootloader][netsvc][libtftp] Add timeout support

Add libtftp support for timeout handing as per TFTP RFC. Also,
sets a limit for the number of consecutive timeouts before a
connection is terminated (configurable using
tftp_set_max_timeouts()).

Change-Id: I9a31605d6f926275afdc32fbd8dbcab141ccc993


# caa6a6e9 14-Jul-2017 Josh Conner <joshconner@google.com>

[libtftp] Add support for large files

* Block indices are 16-bit quantities. To allow > 65536 * block_size bytes of
transfer, allow the block indices to roll over. This is a (reportedly common)
extension of the TFTP protocol.
* Use 16 bits to store window size (as per RFC7440).
* Change a couple of error messages to be slightly more specific.

Change-Id: I64b54aa76bbf0a3ff6497aeca0feb909e4d41406


# 3cfd8127 28-Jun-2017 Josh Conner <joshconner@google.com>

[tftp] Abstract transport layer

Implement a transport abstraction similar to the file abstraction,
using callbacks for send, recv, and timeout_set.

This allows us to create a higher-level API for file handling:
tftp_push_file
tftp_handle_request
tftp_handle_msg
which should signficantly simplify client complexity.

Also adds a file-level test for verifying proper end-to-end handling.

Change-Id: Ib74a9f019a6408c8c1fde975307419c7dff7c2c7


# c752c5cc 14-Apr-2017 Tim Kilbourn <tkilbourn@google.com>

[tftp] Refactor sending to allow for out-of-order ACKs

If the receiving side sends an ACK other than for the end of a window,
the sender should rewind and start a new window based on this ACK. The
previous API did not allow for non-blocking reads in between sends, so
the library no longer attempts to send data.

read and write callbacks are used instead of memcpy and a send callback,
allowing the client of the library to use the tftp data however they
want (e.g., file, vmo, etc).

Timeouts still aren't handled correctly, but require some more
refactoring of the state machine.

Change-Id: I5051f1b425894d5b47bb7558f91d231ffc4883b8


# 8ccf00e4 17-Apr-2017 Tim Kilbourn <tkilbourn@google.com>

Revert "[tftp] Refactor sending to allow for out-of-order ACKs"

This reverts commit 4c835df0cd4562c631869ee59df83db846f05046.

Change-Id: I1986f05f8a01b7a22aae2a6396082c19ba289a2b


# 709591ef 14-Apr-2017 Tim Kilbourn <tkilbourn@google.com>

[tftp] Refactor sending to allow for out-of-order ACKs

If the receiving side sends an ACK other than for the end of a window,
the sender should rewind and start a new window based on this ACK. The
previous API did not allow for non-blocking reads in between sends, so
the library no longer attempts to send data.

read and write callbacks are used instead of memcpy and a send callback,
allowing the client of the library to use the tftp data however they
want (e.g., file, vmo, etc).

Timeouts still aren't handled correctly, but require some more
refactoring of the state machine.

Change-Id: Ie98bdf8d7761ca7835691695ef840ffd9947c4bc


# d9a982c2 16-Feb-2017 Jérôme Poichet <jpoichet@google.com>

[ulib] TFTP library

Implements the protocol part only of RFCs 1350, 2347, 2348, 2349 and
7440, meaning that the transport is left to the client of the library.

Still lots TODO, but this is functional. Tasks for follow-up CLs:
* Read requests are not implemented.
* Library API needs to handle receives in between transmits in windowed
mode.

Change-Id: I31d4b50ec8367e1bf27211973c20eaee85f3ba71