TFTP client. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL TFTP_TRACE_LEVEL |
Functions | |
error_t | tftpClientInit (TftpClientContext *context) |
TFTP client initialization. More... | |
error_t | tftpClientBindToInterface (TftpClientContext *context, NetInterface *interface) |
Bind the TFTP client to a particular network interface. More... | |
error_t | tftpClientConnect (TftpClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort) |
Specify the address of the TFTP server. More... | |
error_t | tftpClientOpenFile (TftpClientContext *context, const char_t *filename, uint_t mode) |
Open a file for reading or writing. More... | |
error_t | tftpClientWriteFile (TftpClientContext *context, const void *data, size_t length, size_t *written, uint_t flags) |
Write data to the file. More... | |
error_t | tftpClientFlushFile (TftpClientContext *context) |
Flush pending write operations. More... | |
error_t | tftpClientReadFile (TftpClientContext *context, void *data, size_t size, size_t *received, uint_t flags) |
Read data from the file. More... | |
error_t | tftpClientCloseFile (TftpClientContext *context) |
Close the file. More... | |
void | tftpClientDeinit (TftpClientContext *context) |
Release TFTP client context. More... | |
Detailed Description
TFTP client.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Description
TFTP is a very simple protocol used to transfer files. Refer to the following RFCs for complete details:
- RFC 1123: Requirements for Internet Hosts
- RFC 1350: The TFTP Protocol (Revision 2)
- RFC 1782: TFTP Option Extension
- RFC 1783: TFTP Blocksize Option
- RFC 1784: TFTP Timeout Interval and Transfer Size Options
- Version
- 2.4.4
Definition in file tftp_client.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL TFTP_TRACE_LEVEL |
Definition at line 42 of file tftp_client.c.
Function Documentation
◆ tftpClientBindToInterface()
error_t tftpClientBindToInterface | ( | TftpClientContext * | context, |
NetInterface * | interface | ||
) |
Bind the TFTP client to a particular network interface.
- Parameters
-
[in] context Pointer to the TFTP client context [in] interface Network interface to be used
- Returns
- Error code
Definition at line 83 of file tftp_client.c.
◆ tftpClientCloseFile()
error_t tftpClientCloseFile | ( | TftpClientContext * | context | ) |
Close the file.
- Parameters
-
[in] context Pointer to the TFTP client context
- Returns
- Error code
Definition at line 524 of file tftp_client.c.
◆ tftpClientConnect()
error_t tftpClientConnect | ( | TftpClientContext * | context, |
const IpAddr * | serverIpAddr, | ||
uint16_t | serverPort | ||
) |
Specify the address of the TFTP server.
- Parameters
-
[in] context Pointer to the TFTP client context [in] serverIpAddr IP address of the TFTP server to connect to [in] serverPort UDP port number
- Returns
- Error code
Definition at line 106 of file tftp_client.c.
◆ tftpClientDeinit()
void tftpClientDeinit | ( | TftpClientContext * | context | ) |
Release TFTP client context.
- Parameters
-
[in] context Pointer to the TFTP client context
Definition at line 546 of file tftp_client.c.
◆ tftpClientFlushFile()
error_t tftpClientFlushFile | ( | TftpClientContext * | context | ) |
Flush pending write operations.
- Parameters
-
[in] context Pointer to the TFTP client context
- Returns
- Error code
Definition at line 357 of file tftp_client.c.
◆ tftpClientInit()
error_t tftpClientInit | ( | TftpClientContext * | context | ) |
TFTP client initialization.
- Parameters
-
[in] context Pointer to the TFTP client context
- Returns
- Error code
Definition at line 59 of file tftp_client.c.
◆ tftpClientOpenFile()
error_t tftpClientOpenFile | ( | TftpClientContext * | context, |
const char_t * | filename, | ||
uint_t | mode | ||
) |
Open a file for reading or writing.
- Parameters
-
[in] context Pointer to the TFTP client context [in] filename NULL-terminated string specifying the filename [in] mode File access mode
- Returns
- Error code
Definition at line 135 of file tftp_client.c.
◆ tftpClientReadFile()
error_t tftpClientReadFile | ( | TftpClientContext * | context, |
void * | data, | ||
size_t | size, | ||
size_t * | received, | ||
uint_t | flags | ||
) |
Read data from the file.
- Parameters
-
[in] context Pointer to the TFTP client context [in] data Pointer to the buffer where to copy the data [in] size Size of the buffer, in bytes [out] received Number of data bytes that have been read [in] flags Reserved parameter
- Returns
- Error code
Definition at line 422 of file tftp_client.c.
◆ tftpClientWriteFile()
error_t tftpClientWriteFile | ( | TftpClientContext * | context, |
const void * | data, | ||
size_t | length, | ||
size_t * | written, | ||
uint_t | flags | ||
) |
Write data to the file.
- Parameters
-
[in] context Pointer to the TFTP client context [in] data Pointer to a buffer containing the data to be written [in] length Number of data bytes to write [in] written Number of bytes that have been written [in] flags Reserved parameter
- Returns
- Error code
Definition at line 270 of file tftp_client.c.