tftp_client_misc.h File Reference

Helper functions for TFTP client. More...

#include "core/net.h"
#include "tftp/tftp_client.h"

Go to the source code of this file.

Functions

error_t tftpClientOpenConnection (TftpClientContext *context)
 Open connection with the TFTP server. More...
 
void tftpClientCloseConnection (TftpClientContext *context)
 Close connection with the TFTP server. More...
 
error_t tftpClientProcessEvents (TftpClientContext *context)
 Process TFTP client events. More...
 
void tftpClientProcessPacket (TftpClientContext *context, const IpAddr *srcIpAddr, uint16_t srcPort)
 Process incoming packet. More...
 
void tftpClientProcessDataPacket (TftpClientContext *context, uint16_t srcPort, const TftpDataPacket *dataPacket, size_t length)
 Process incoming DATA packet. More...
 
void tftpClientProcessAckPacket (TftpClientContext *context, uint16_t srcPort, const TftpAckPacket *ackPacket, size_t length)
 Process incoming ACK packet. More...
 
void tftpClientProcessErrorPacket (TftpClientContext *context, uint16_t srcPort, const TftpErrorPacket *errorPacket, size_t length)
 Process incoming ERROR packet. More...
 
error_t tftpClientSendRrqPacket (TftpClientContext *context, const char_t *filename, const char_t *mode)
 Send RRQ packet. More...
 
error_t tftpClientSendWrqPacket (TftpClientContext *context, const char_t *filename, const char_t *mode)
 Send WRQ packet. More...
 
error_t tftpClientSendDataPacket (TftpClientContext *context)
 Send DATA packet. More...
 
error_t tftpClientSendAckPacket (TftpClientContext *context)
 Send ACK packet. More...
 
error_t tftpClientSendErrorPacket (TftpClientContext *context, uint16_t errorCode, const char_t *errorMsg)
 Send ERROR packet. More...
 
error_t tftpClientRetransmitPacket (TftpClientContext *context)
 Retransmit the last packet. More...
 

Detailed Description

Helper functions for TFTP client.

License

Copyright (C) 2010-2018 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file tftp_client_misc.h.

Function Documentation

◆ tftpClientCloseConnection()

void tftpClientCloseConnection ( TftpClientContext context)

Close connection with the TFTP server.

Parameters
[in]contextPointer to the TFTP client context

Definition at line 93 of file tftp_client_misc.c.

◆ tftpClientOpenConnection()

error_t tftpClientOpenConnection ( TftpClientContext context)

Open connection with the TFTP server.

Parameters
[in]contextPointer to the TFTP client context
Returns
Error code

Definition at line 47 of file tftp_client_misc.c.

◆ tftpClientProcessAckPacket()

void tftpClientProcessAckPacket ( TftpClientContext context,
uint16_t  srcPort,
const TftpAckPacket ackPacket,
size_t  length 
)

Process incoming ACK packet.

Parameters
[in]contextPointer to the TFTP client context
[in]srcPortSource port number
[in]ackPacketPointer to the ACK packet
[in]lengthLength of the packet, in bytes

Definition at line 307 of file tftp_client_misc.c.

◆ tftpClientProcessDataPacket()

void tftpClientProcessDataPacket ( TftpClientContext context,
uint16_t  srcPort,
const TftpDataPacket dataPacket,
size_t  length 
)

Process incoming DATA packet.

Parameters
[in]contextPointer to the TFTP client context
[in]srcPortSource port number
[in]dataPacketPointer to the DATA packet
[in]lengthLength of the packet, in bytes

Definition at line 238 of file tftp_client_misc.c.

◆ tftpClientProcessErrorPacket()

void tftpClientProcessErrorPacket ( TftpClientContext context,
uint16_t  srcPort,
const TftpErrorPacket errorPacket,
size_t  length 
)

Process incoming ERROR packet.

Parameters
[in]contextPointer to the TFTP client context
[in]srcPortSource port number
[in]errorPacketPointer to the ERROR packet
[in]lengthLength of the packet, in bytes

Definition at line 393 of file tftp_client_misc.c.

◆ tftpClientProcessEvents()

error_t tftpClientProcessEvents ( TftpClientContext context)

Process TFTP client events.

Parameters
[in]contextPointer to the TFTP client context
Returns
Error code

Definition at line 111 of file tftp_client_misc.c.

◆ tftpClientProcessPacket()

void tftpClientProcessPacket ( TftpClientContext context,
const IpAddr srcIpAddr,
uint16_t  srcPort 
)

Process incoming packet.

Parameters
[in]contextPointer to the TFTP client context
[in]srcIpAddrSource IP address
[in]srcPortSource port number

Definition at line 185 of file tftp_client_misc.c.

◆ tftpClientRetransmitPacket()

error_t tftpClientRetransmitPacket ( TftpClientContext context)

Retransmit the last packet.

Parameters
[in]contextPointer to the TFTP client context
Returns
Error code

Definition at line 672 of file tftp_client_misc.c.

◆ tftpClientSendAckPacket()

error_t tftpClientSendAckPacket ( TftpClientContext context)

Send ACK packet.

Parameters
[in]contextPointer to the TFTP client context
Returns
Error code

Definition at line 581 of file tftp_client_misc.c.

◆ tftpClientSendDataPacket()

error_t tftpClientSendDataPacket ( TftpClientContext context)

Send DATA packet.

Parameters
[in]contextPointer to the TFTP client context
Returns
Error code

Definition at line 541 of file tftp_client_misc.c.

◆ tftpClientSendErrorPacket()

error_t tftpClientSendErrorPacket ( TftpClientContext context,
uint16_t  errorCode,
const char_t errorMsg 
)

Send ERROR packet.

Parameters
[in]contextPointer to the TFTP client context
[in]errorCodeInteger indicating the nature of the error
[in]errorMsgError message intended for human consumption
Returns
Error code

Definition at line 623 of file tftp_client_misc.c.

◆ tftpClientSendRrqPacket()

error_t tftpClientSendRrqPacket ( TftpClientContext context,
const char_t filename,
const char_t mode 
)

Send RRQ packet.

Parameters
[in]contextPointer to the TFTP client context
[in]filenameNULL-terminated string specifying the filename
[in]modeNULL-terminated string specifying the transfer mode
Returns
Error code

Definition at line 431 of file tftp_client_misc.c.

◆ tftpClientSendWrqPacket()

error_t tftpClientSendWrqPacket ( TftpClientContext context,
const char_t filename,
const char_t mode 
)

Send WRQ packet.

Parameters
[in]contextPointer to the TFTP client context
[in]filenameNULL-terminated string specifying the filename
[in]modeNULL-terminated string specifying the transfer mode
Returns
Error code

Definition at line 487 of file tftp_client_misc.c.