Helper functions for TFTP server. More...
Go to the source code of this file.
Functions | |
void tftpServerTick (TftpServerContext *context) | |
Handle periodic operations. More... | |
TftpClientConnection * tftpServerOpenConnection (TftpServerContext *context, const IpAddr *clientIpAddr, uint16_t clientPort) | |
Create client connection. More... | |
void tftpServerCloseConnection (TftpClientConnection *connection) | |
Close client connection. More... | |
void tftpServerAcceptRequest (TftpServerContext *context) | |
Accept connection request. More... | |
void tftpServerProcessPacket (TftpServerContext *context, TftpClientConnection *connection) | |
Process incoming packet. More... | |
void tftpServerProcessRrqPacket (TftpServerContext *context, const IpAddr *clientIpAddr, uint16_t clientPort, const TftpRrqPacket *rrqPacket, size_t length) | |
Process incoming RRQ packet. More... | |
void tftpServerProcessWrqPacket (TftpServerContext *context, const IpAddr *clientIpAddr, uint16_t clientPort, const TftpWrqPacket *wrqPacket, size_t length) | |
Process incoming WRQ packet. More... | |
void tftpServerProcessDataPacket (TftpClientConnection *connection, const TftpDataPacket *dataPacket, size_t length) | |
Process incoming DATA packet. More... | |
void tftpServerProcessAckPacket (TftpClientConnection *connection, const TftpAckPacket *ackPacket, size_t length) | |
Process incoming ACK packet. More... | |
void tftpServerProcessErrorPacket (TftpClientConnection *connection, const TftpErrorPacket *errorPacket, size_t length) | |
Process incoming ERROR packet. More... | |
error_t tftpServerSendDataPacket (TftpClientConnection *connection) | |
Send DATA packet. More... | |
error_t tftpServerSendAckPacket (TftpClientConnection *connection) | |
Send ACK packet. More... | |
error_t tftpServerSendErrorPacket (TftpClientConnection *connection, uint16_t errorCode, const char_t *errorMsg) | |
Send ERROR packet. More... | |
error_t tftpServerRetransmitPacket (TftpClientConnection *connection) | |
Retransmit the last packet. More... | |
Detailed Description
Helper functions for TFTP server.
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.
- Version
- 2.4.4
Definition in file tftp_server_misc.h.
Function Documentation
◆ tftpServerAcceptRequest()
void tftpServerAcceptRequest | ( | TftpServerContext * | context | ) |
Accept connection request.
- Parameters
-
[in] context Pointer to the TFTP server context
Definition at line 260 of file tftp_server_misc.c.
◆ tftpServerCloseConnection()
void tftpServerCloseConnection | ( | TftpClientConnection * | connection | ) |
Close client connection.
- Parameters
-
[in] connection Pointer to the client connection
Definition at line 219 of file tftp_server_misc.c.
◆ tftpServerOpenConnection()
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 111 of file tftp_server_misc.c.
◆ tftpServerProcessAckPacket()
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 666 of file tftp_server_misc.c.
◆ tftpServerProcessDataPacket()
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 561 of file tftp_server_misc.c.
◆ tftpServerProcessErrorPacket()
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 720 of file tftp_server_misc.c.
◆ tftpServerProcessPacket()
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 315 of file tftp_server_misc.c.
◆ tftpServerProcessRrqPacket()
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 377 of file tftp_server_misc.c.
◆ tftpServerProcessWrqPacket()
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 468 of file tftp_server_misc.c.
◆ tftpServerRetransmitPacket()
error_t tftpServerRetransmitPacket | ( | TftpClientConnection * | connection | ) |
Retransmit the last packet.
- Parameters
-
[in] connection Pointer to the client connection
- Returns
- Error code
Definition at line 944 of file tftp_server_misc.c.
◆ tftpServerSendAckPacket()
error_t tftpServerSendAckPacket | ( | TftpClientConnection * | connection | ) |
Send ACK packet.
- Parameters
-
[in] connection Pointer to the client connection
- Returns
- Error code
Definition at line 853 of file tftp_server_misc.c.
◆ tftpServerSendDataPacket()
error_t tftpServerSendDataPacket | ( | TftpClientConnection * | connection | ) |
Send DATA packet.
- Parameters
-
[in] connection Pointer to the client connection
- Returns
- Error code
Definition at line 756 of file tftp_server_misc.c.
◆ tftpServerSendErrorPacket()
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 895 of file tftp_server_misc.c.
◆ tftpServerTick()
void tftpServerTick | ( | TftpServerContext * | context | ) |
Handle periodic operations.
- Parameters
-
[in] context Pointer to the TFTP server context
Definition at line 48 of file tftp_server_misc.c.