tftp_client_misc.h
Go to the documentation of this file.
1 /**
2  * @file tftp_client_misc.h
3  * @brief Helper functions for TFTP client
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _TFTP_CLIENT_MISC_H
30 #define _TFTP_CLIENT_MISC_H
31 
32 //Dependencies
33 #include "core/net.h"
34 #include "tftp/tftp_client.h"
35 
36 //C++ guard
37 #ifdef __cplusplus
38  extern "C" {
39 #endif
40 
41 //TFTP client related functions
44 
46 
48  const IpAddr *srcIpAddr, uint16_t srcPort);
49 
51  uint16_t srcPort, const TftpDataPacket *dataPacket, size_t length);
52 
54  uint16_t srcPort, const TftpAckPacket *ackPacket, size_t length);
55 
57  uint16_t srcPort, const TftpErrorPacket *errorPacket, size_t length);
58 
60  const char_t *filename, const char_t *mode);
61 
63  const char_t *filename, const char_t *mode);
64 
67 
69  uint16_t errorCode, const char_t *errorMsg);
70 
72 
73 //C++ guard
74 #ifdef __cplusplus
75  }
76 #endif
77 
78 #endif
TFTP client context.
Definition: tftp_client.h:121
char_t filename[]
Definition: tftp_common.h:89
__start_packed struct @301 TftpAckPacket
Acknowledgment packet (ACK)
void tftpClientProcessDataPacket(TftpClientContext *context, uint16_t srcPort, const TftpDataPacket *dataPacket, size_t length)
Process incoming DATA packet.
char char_t
Definition: compiler_port.h:41
void tftpClientProcessErrorPacket(TftpClientContext *context, uint16_t srcPort, const TftpErrorPacket *errorPacket, size_t length)
Process incoming ERROR packet.
error_t tftpClientOpenConnection(TftpClientContext *context)
Open connection with the TFTP server.
error_t tftpClientSendErrorPacket(TftpClientContext *context, uint16_t errorCode, const char_t *errorMsg)
Send ERROR packet.
TCP/IP stack core.
error_t tftpClientSendWrqPacket(TftpClientContext *context, const char_t *filename, const char_t *mode)
Send WRQ packet.
__start_packed struct @300 TftpDataPacket
Data packet (DATA)
IP network address.
Definition: ip.h:57
error_t tftpClientSendAckPacket(TftpClientContext *context)
Send ACK packet.
void tftpClientCloseConnection(TftpClientContext *context)
Close connection with the TFTP server.
void tftpClientProcessPacket(TftpClientContext *context, const IpAddr *srcIpAddr, uint16_t srcPort)
Process incoming packet.
void tftpClientProcessAckPacket(TftpClientContext *context, uint16_t srcPort, const TftpAckPacket *ackPacket, size_t length)
Process incoming ACK packet.
char_t errorMsg[]
Definition: tftp_common.h:135
uint16_t errorCode
Definition: tftp_common.h:134
error_t tftpClientSendDataPacket(TftpClientContext *context)
Send DATA packet.
error_t tftpClientSendRrqPacket(TftpClientContext *context, const char_t *filename, const char_t *mode)
Send RRQ packet.
Ipv4Addr srcIpAddr
Definition: ipcp.h:75
uint16_t srcPort
Definition: tcp.h:300
error_t
Error codes.
Definition: error.h:40
TFTP client.
uint8_t mode
Definition: sntp_client.h:143
error_t tftpClientProcessEvents(TftpClientContext *context)
Process TFTP client events.
__start_packed struct @302 TftpErrorPacket
Error packet (ERROR)
error_t tftpClientRetransmitPacket(TftpClientContext *context)
Retransmit the last packet.
uint8_t length
Definition: dtls_misc.h:140