Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
tftp_server.h File Reference
TFTP server. More...
Go to the source code of this file.
Data Structures | |
| struct | TftpServerSettings |
| TFTP server settings. More... | |
| struct | _TftpClientConnection |
| TFTP client connection. More... | |
| struct | _TftpServerContext |
| TFTP server context. More... | |
Typedefs | |
| typedef void *(* | TftpServerOpenFileCallback )(const char_t *filename, const char_t *mode, bool_t writeAccess) |
| Open file callback function. | |
| typedef error_t(* | TftpServerWriteFileCallback )(void *file, size_t offset, const uint8_t *data, size_t length) |
| Write file callback function. | |
| typedef error_t(* | TftpServerReadFileCallback )(void *file, size_t offset, uint8_t *data, size_t size, size_t *length) |
| Read file callback function. | |
| typedef void(* | TftpServerCloseFileCallback )(void *file) |
| Close file callback function. | |
Enumerations | |
| enum | TftpConnectionState |
TFTP connection state. More... | |
Functions | |
| void | tftpServerGetDefaultSettings (TftpServerSettings *settings) |
| Initialize settings with default values. | |
| error_t | tftpServerInit (TftpServerContext *context, const TftpServerSettings *settings) |
| TFTP server initialization. | |
| error_t | tftpServerStart (TftpServerContext *context) |
| Start TFTP server. | |
| void | tftpServerTask (TftpServerContext *context) |
| TFTP server task. | |
| void | tftpServerTick (TftpServerContext *context) |
| Handle periodic operations. | |
| void | tftpServerAcceptRequest (TftpServerContext *context) |
| Accept connection request. | |
| void | tftpServerProcessPacket (TftpServerContext *context, TftpClientConnection *connection) |
| Process incoming packet. | |
| void | tftpServerProcessRrqPacket (TftpServerContext *context, const IpAddr *clientIpAddr, uint16_t clientPort, const TftpRrqPacket *rrqPacket, size_t length) |
| Process incoming RRQ packet. | |
| void | tftpServerProcessWrqPacket (TftpServerContext *context, const IpAddr *clientIpAddr, uint16_t clientPort, const TftpWrqPacket *wrqPacket, size_t length) |
| Process incoming WRQ packet. | |
| void | tftpServerProcessDataPacket (TftpClientConnection *connection, const TftpDataPacket *dataPacket, size_t length) |
| Process incoming DATA packet. | |
| void | tftpServerProcessAckPacket (TftpClientConnection *connection, const TftpAckPacket *ackPacket, size_t length) |
| Process incoming ACK packet. | |
| void | tftpServerProcessErrorPacket (TftpClientConnection *connection, const TftpErrorPacket *errorPacket, size_t length) |
| Process incoming ERROR packet. | |
| error_t | tftpServerSendDataPacket (TftpClientConnection *connection) |
| Send DATA packet. | |
| error_t | tftpServerSendAckPacket (TftpClientConnection *connection) |
| Send ACK packet. | |
| error_t | tftpServerSendErrorPacket (TftpClientConnection *connection, uint16_t errorCode, const char_t *errorMsg) |
| Send ERROR packet. | |
| error_t | tftpServerRetransmitPacket (TftpClientConnection *connection) |
| Retransmit the last packet. | |
| TftpClientConnection * | tftpServerOpenConnection (TftpServerContext *context, const IpAddr *clientIpAddr, uint16_t clientPort) |
| Create client connection. | |
| void | tftpServerCloseConnection (TftpClientConnection *connection) |
| Close client connection. | |
Detailed Description
TFTP server.
License
Copyright (C) 2010-2017 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.
- Version:
- 1.7.6
Definition in file tftp_server.h.
Typedef Documentation
| typedef void(* TftpServerCloseFileCallback)(void *file) |
Close file callback function.
Definition at line 152 of file tftp_server.h.
| typedef void*(* TftpServerOpenFileCallback)(const char_t *filename, const char_t *mode, bool_t writeAccess) |
Open file callback function.
Definition at line 128 of file tftp_server.h.
| typedef error_t(* TftpServerReadFileCallback)(void *file, size_t offset, uint8_t *data, size_t size, size_t *length) |
Read file callback function.
Definition at line 144 of file tftp_server.h.
| typedef error_t(* TftpServerWriteFileCallback)(void *file, size_t offset, const uint8_t *data, size_t length) |
Write file callback function.
Definition at line 136 of file tftp_server.h.
Enumeration Type Documentation
| enum TftpConnectionState |
TFTP connection state.
Definition at line 113 of file tftp_server.h.
Function Documentation
| void tftpServerAcceptRequest | ( | TftpServerContext * | context ) |
Accept connection request.
- Parameters:
-
[in] context Pointer to the TFTP server context
Definition at line 324 of file tftp_server.c.
| void tftpServerCloseConnection | ( | TftpClientConnection * | connection ) |
Close client connection.
- Parameters:
-
[in] connection Pointer to the client connection
Definition at line 1135 of file tftp_server.c.
| void tftpServerGetDefaultSettings | ( | TftpServerSettings * | settings ) |
Initialize settings with default values.
- Parameters:
-
[out] settings Structure that contains TFTP server settings
Definition at line 55 of file tftp_server.c.
| error_t tftpServerInit | ( | TftpServerContext * | context, |
| const TftpServerSettings * | settings | ||
| ) |
TFTP server initialization.
- Parameters:
-
[in] context Pointer to the TFTP server context [in] settings TFTP server specific settings
- Returns:
- Error code
Definition at line 81 of file tftp_server.c.
| TftpClientConnection* tftpServerOpenConnection | ( | TftpServerContext * | context, |
| const IpAddr * | clientIpAddr, | ||
| uint16_t | clientPort | ||
| ) |
Create client connection.
- Parameters:
-
[in] context Pointer to the TFTP server context [in] clientIpAddr IP address of the client [in] clientPort Port number used by the client
- Returns:
- Pointer to the structure describing the connection
Definition at line 1028 of file tftp_server.c.
| void tftpServerProcessAckPacket | ( | TftpClientConnection * | connection, |
| const TftpAckPacket * | ackPacket, | ||
| size_t | length | ||
| ) |
Process incoming ACK packet.
- Parameters:
-
[in] connection Pointer to the client connection [in] ackPacket Pointer to the ACK packet [in] length Length of the packet, in bytes
Definition at line 730 of file tftp_server.c.
| void tftpServerProcessDataPacket | ( | TftpClientConnection * | connection, |
| const TftpDataPacket * | dataPacket, | ||
| size_t | length | ||
| ) |
Process incoming DATA packet.
- Parameters:
-
[in] connection Pointer to the client connection [in] dataPacket Pointer to the DATA packet [in] length Length of the packet, in bytes
Definition at line 625 of file tftp_server.c.
| void tftpServerProcessErrorPacket | ( | TftpClientConnection * | connection, |
| const TftpErrorPacket * | errorPacket, | ||
| size_t | length | ||
| ) |
Process incoming ERROR packet.
- Parameters:
-
[in] connection Pointer to the client connection [in] errorPacket Pointer to the ERROR packet [in] length Length of the packet, in bytes
Definition at line 779 of file tftp_server.c.
| void tftpServerProcessPacket | ( | TftpServerContext * | context, |
| TftpClientConnection * | connection | ||
| ) |
Process incoming packet.
- Parameters:
-
[in] context Pointer to the TFTP server context [in] connection Pointer to the client connection
Definition at line 379 of file tftp_server.c.
| void tftpServerProcessRrqPacket | ( | TftpServerContext * | context, |
| const IpAddr * | clientIpAddr, | ||
| uint16_t | clientPort, | ||
| const TftpRrqPacket * | rrqPacket, | ||
| size_t | length | ||
| ) |
Process incoming RRQ packet.
- Parameters:
-
[in] context Pointer to the TFTP server context [in] clientIpAddr IP address of the client [in] clientPort Port number used by the client [in] rrqPacket Pointer to the RRQ packet [in] length Length of the packet, in bytes
Definition at line 441 of file tftp_server.c.
| void tftpServerProcessWrqPacket | ( | TftpServerContext * | context, |
| const IpAddr * | clientIpAddr, | ||
| uint16_t | clientPort, | ||
| const TftpWrqPacket * | wrqPacket, | ||
| size_t | length | ||
| ) |
Process incoming WRQ packet.
- Parameters:
-
[in] context Pointer to the TFTP server context [in] clientIpAddr IP address of the client [in] clientPort Port number used by the client [in] wrqPacket Pointer to the WRQ packet [in] length Length of the packet, in bytes
Definition at line 532 of file tftp_server.c.
| error_t tftpServerRetransmitPacket | ( | TftpClientConnection * | connection ) |
Retransmit the last packet.
- Parameters:
-
[in] connection Pointer to the client connection
- Returns:
- Error code
Definition at line 1003 of file tftp_server.c.
| error_t tftpServerSendAckPacket | ( | TftpClientConnection * | connection ) |
Send ACK packet.
- Parameters:
-
[in] connection Pointer to the client connection
- Returns:
- Error code
Definition at line 912 of file tftp_server.c.
| error_t tftpServerSendDataPacket | ( | TftpClientConnection * | connection ) |
Send DATA packet.
- Parameters:
-
[in] connection Pointer to the client connection
- Returns:
- Error code
Definition at line 815 of file tftp_server.c.
| error_t tftpServerSendErrorPacket | ( | TftpClientConnection * | connection, |
| uint16_t | errorCode, | ||
| const char_t * | errorMsg | ||
| ) |
Send ERROR packet.
- Parameters:
-
[in] connection Pointer to the client connection [in] errorCode Integer indicating the nature of the error [in] errorMsg Error message intended for human consumption
- Returns:
- Error code
Definition at line 954 of file tftp_server.c.
| error_t tftpServerStart | ( | TftpServerContext * | context ) |
Start TFTP server.
- Parameters:
-
[in] context Pointer to the TFTP server context
- Returns:
- Error code
Definition at line 155 of file tftp_server.c.
| void tftpServerTask | ( | TftpServerContext * | context ) |
TFTP server task.
- Parameters:
-
[in] context Pointer to the TFTP server context
Definition at line 184 of file tftp_server.c.
| void tftpServerTick | ( | TftpServerContext * | context ) |
Handle periodic operations.
- Parameters:
-
[in] context Pointer to the TFTP server context
Definition at line 264 of file tftp_server.c.
Generated on Tue Jul 12 2022 17:10:23 by
1.7.2