Embedded TCP/IP stack: fnet_tftp_cln.h Source File

FNET

fnet_tftp_cln.h
1 /**************************************************************************
2 *
3 * Copyright 2011-2017 by Andrey Butok. FNET Community.
4 * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
9 * not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 ***************************************************************************
21 *
22 * TFTP Client API.
23 *
24 ***************************************************************************/
25 
26 #ifndef _FNET_TFTP_CLN_H_
27 
28 #define _FNET_TFTP_CLN_H_
29 
30 #if FNET_CFG_TFTP_CLN || defined(__DOXYGEN__)
31 
32 #include "fnet_tftp.h"
33 
55 /**************************************************************************/
114 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);
115 
116 
117 /**************************************************************************/
121 {
147 };
148 
149 /**************************************************************************/
153 typedef enum
154 {
168 
169 #if defined(__cplusplus)
170 extern "C" {
171 #endif
172 
173 /***************************************************************************/
195 
196 /***************************************************************************/
211 void fnet_tftp_cln_release(void);
212 
213 /***************************************************************************/
228 
229 #if defined(__cplusplus)
230 }
231 #endif
232 
235 #endif /* FNET_CFG_TFTP_CLN */
236 
237 #endif /* _FNET_TFTP_CLN_H_ */
fnet_uint32_t fnet_time_t
Unsigned integer type representing time uinits. It can be ticks, seconds or milliseconds.
Definition: fnet_timer.h:66
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...
struct fnet_sockaddr server_addr
Socket address of the remote TFTP server to connect to.
fnet_return_t
General return codes, used by most of API functions.
Definition: fnet_stdlib.h:90
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:56
Input parameters for the fnet_tftp_cln_init() function.
Receives or sends DATA packets from/to the remote server.
The TFTP-client service is initialized. Sends Read/Write request (PRQ).
fnet_char_t * file_name
Name of the file to retrieve or create on the remote TFTP server.
fnet_tftp_request_t request_type
Request type (read or write) defined by fnet_tftp_request_t.
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_return_t fnet_tftp_cln_init(struct fnet_tftp_cln_params *params)
Initializes the file transfer with the TFTP-client service.
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.
char fnet_char_t
Type representing the charecter.
Definition: fnet_stdlib.h:76
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:52
fnet_tftp_cln_handler_t handler
Pointer to the callback function defined by fnet_tftp_cln_handler_t().
Socket address structure.
Definition: fnet_socket.h:270

© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net