This source file contains the implementation of a Trivial File Transfer Protocol (TFTP) client library.
More...
|
#define | UDP_PORT_BASE 3180 |
|
#define | PACKET_FIRST_TIMEOUT_MILLISECONDS 400L |
|
#define | TFTP_WINDOW_SIZE_MIN 1 |
|
#define | TFTP_BLOCK_SIZE_MIN 8 |
|
#define | TFTP_BLOCK_SIZE_MAX 65464 |
|
#define | TFTP_BLOCK_SIZE_OPTION "blksize" |
|
#define | TFTP_WINDOW_SIZE_OPTION "windowsize" |
|
#define | TFTP_DECIMAL_BASE 10 |
|
#define | TFTP_DEFAULT_SERVER_PORT 69 |
|
#define | TFTP_RFC7440_DATA_RETRANSMISSIONS 6 |
|
#define | TFTP_RFC7440_TIMEOUT_MILLISECONDS 1000 |
|
#define | TFTP_OPCODE_RRQ 1 |
|
#define | TFTP_OPCODE_WRQ 2 |
|
#define | TFTP_OPCODE_DATA 3 |
|
#define | TFTP_OPCODE_ACK 4 |
|
#define | TFTP_OPCODE_ERROR 5 |
|
#define | TFTP_OPCODE_OACK 6 |
|
#define | TFTP_ERROR_CODE_NOT_DEFINED 0 |
|
#define | TFTP_ERROR_CODE_NOT_FOUND 1 |
|
#define | TFTP_ERROR_CODE_NO_ACCESS 2 |
|
#define | TFTP_ERROR_CODE_DISK_FULL 3 |
|
#define | TFTP_ERROR_CODE_ILLEGAL 4 |
|
#define | TFTP_ERROR_CODE_UNKNOWN_ID 5 |
|
#define | TFTP_ERROR_CODE_FILE_EXISTS 6 |
|
#define | TFTP_ERROR_CODE_NO_USER 7 |
|
#define | TFTP_ERROR_CODE_OPTION_NEGO 8 |
|
#define | GOT_EXPECTED_PACKET 0 |
|
#define | GOT_DUPLICATE_OF_CURRENT_PACKET -1 |
|
#define | GOT_OLD_PACKET -2 |
|
#define | GOT_FIRST_OUT_OF_ORDER_PACKET -3 |
|
#define | GET_PACKET_DONT_WAIT -1 |
|
#define | DO_NOT_SEND_PACKET 0 |
|
#define | PKT_SIZE_FROM_BLK_SIZE(_blksize) ((_blksize) + 2 * sizeof (uint16_t)) |
|
#define | BLK_SIZE_FROM_PKT_SIZE(_pktsize) ((_pktsize) - 2 * sizeof (uint16_t)) |
|
#define | MUST_SEND_OPTIONS(_options) |
|
|
void | tftp_initialize_net_config (tftp_net_config *config) |
| Set all members of a tftp_net_config structure to their default values.
|
|
int | tftp_open (const char *hostname, const char *path, bool is_for_reading, const tftp_net_config *config, void **tftp_handle) |
| Opens and starts a TFTP client session to read or write a single file.
|
|
ssize_t | tftp_read (void *tftp_handle, void *buffer, size_t count) |
| Read data from a TFTP server.
|
|
int | tftp_close (void *tftp_handle) |
| Close a TFTP client connection.
|
|
ssize_t | tftp_write (void *tftp_handle, const void *buffer, size_t count) |
| Write data to a TFTP server.
|
|
void | _Tftp_Destroy (void *tftp_handle) |
| Free the resources associated with a TFTP client connection.
|
|
This source file contains the implementation of a Trivial File Transfer Protocol (TFTP) client library.
The code in this file provides the ability to read files from and to write files to remote servers using the Trivial File Transfer Protocol (TFTP). It is used by the TFTP file system and tested through its test suite. The following RFCs are implemented:
- RFC 1350 "The TFTP Protocol (Revision 2)"
- RFC 2347 "TFTP Option Extension"
- RFC 2348 "TFTP Blocksize Option"
- RFC 7440 "TFTP Windowsize Option"