Embedded TCP/IP stack  4.7.0
fnet_tftp_cln.h
1 /**************************************************************************
2 *
3 * Copyright 2008-2018 by Andrey Butok. FNET Community
4 *
5 ***************************************************************************
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ***************************************************************************
20 *
21 * TFTP Client API.
22 *
23 ***************************************************************************/
24 
25 #ifndef _FNET_TFTP_CLN_H_
26 
27 #define _FNET_TFTP_CLN_H_
28 
29 #if FNET_CFG_TFTP_CLN || defined(__DOXYGEN__)
30 
31 #include "fnet_tftp.h"
32 
54 /**************************************************************************/
113 typedef fnet_int32_t(*fnet_tftp_cln_handler_t)(fnet_tftp_request_t request_type, fnet_uint8_t *data, fnet_size_t data_size, fnet_return_t tftp_result, void *handler_param);
114 
115 
116 /**************************************************************************/
119 typedef struct
120 {
123  struct fnet_sockaddr server_addr;
147 
148 /**************************************************************************/
152 typedef enum
153 {
167 
168 #if defined(__cplusplus)
169 extern "C" {
170 #endif
171 
172 /***************************************************************************/
194 
195 /***************************************************************************/
210 void fnet_tftp_cln_release(void);
211 
212 /***************************************************************************/
227 
228 #if defined(__cplusplus)
229 }
230 #endif
231 
234 #endif /* FNET_CFG_TFTP_CLN */
235 
236 #endif /* _FNET_TFTP_CLN_H_ */
fnet_return_t fnet_tftp_cln_init(fnet_tftp_cln_params_t *params)
Initializes the file transfer with the TFTP-client service.
fnet_uint32_t fnet_time_t
Unsigned integer type representing time uinits. It can be seconds or milliseconds.
Definition: fnet_timer.h:64
fnet_tftp_cln_state_t
TFTP-client states. Used mainly for debugging purposes.
void * handler_param
Optional application-specific parameter. It is passed to the handler callback function as an input p...
fnet_return_t
General return codes, used by most of API functions.
Definition: fnet_stdlib.h:89
The TFTP-client service is not initialized or released.
void fnet_tftp_cln_release(void)
Aborts the transfer and releases the TFTP-client service.
unsigned long fnet_size_t
Unsigned integer type representing the size in bytes.
Definition: fnet_stdlib.h:55
fnet_char_t * file_name
Name of the file to retrieve or create on the remote TFTP server.
Receives or sends DATA packets from/to the remote server.
Input parameters for the fnet_tftp_cln_init() function.
The TFTP-client service is initialized. Sends Read/Write request (PRQ).
The DATA transfer is completed, or received error, or terminated by the application. Frees the allocated resources.
fnet_int32_t(* fnet_tftp_cln_handler_t)(fnet_tftp_request_t request_type, fnet_uint8_t *data, fnet_size_t data_size, fnet_return_t tftp_result, void *handler_param)
TFTP-client event handler callback function prototype, that is called when the TFTP client has receiv...
fnet_time_t timeout
Timeout for the TFTP server response in seconds. If no response from a TFTP server is received durin...
fnet_tftp_cln_state_t fnet_tftp_cln_state(void)
Retrieves the current state of the TFTP-client service.
fnet_tftp_cln_handler_t handler
Pointer to the callback function defined by fnet_tftp_cln_handler_t().
char fnet_char_t
Type representing the charecter.
Definition: fnet_stdlib.h:75
fnet_tftp_request_t
The TFTP request type. It defines a TFTP service behavior, if it will read or write a file from/to a ...
Definition: fnet_tftp.h:51
fnet_tftp_request_t request_type
Request type (read or write) defined by fnet_tftp_request_t.
Socket address structure.
Definition: fnet_socket.h:268

© 2005-2020 by Andrej Butok. http://fnet.sourceforge.net