Embedded TCP/IP stack  4.7.0
TFTP server API

Detailed Description

The user application can use the TFTP-server service to download and upload files from/to a remote TFTP client.
Current version of the TFTP server supports maximum of one simultaneously connected TFTP clients.
After the TFTP server is initialized by calling the fnet_tftp_srv_init() function, the user application should call the main service-polling function fnet_service_poll() periodically in the background.
For the TFTP-server service example, refer to the FNET Bootloader source code.

Configuration parameters:

Data Structures

struct  fnet_tftp_srv_params_t
 Input parameters for the fnet_tftp_srv_init() function. More...
 

Typedefs

typedef fnet_return_t(* fnet_tftp_srv_request_handler_t) (fnet_tftp_request_t request_type, const struct fnet_sockaddr *address, fnet_char_t *filename, fnet_char_t *mode, fnet_tftp_error_t *error_code, fnet_char_t **error_message, void *handler_param)
 Prototype of the TFTP-server callback function that is called when the TFTP server has received a new read or write request from a remote TFTP client. More...
 
typedef fnet_int32_t(* fnet_tftp_srv_data_handler_t) (fnet_tftp_request_t request, fnet_uint8_t *data, fnet_size_t data_size, fnet_tftp_error_t *error_code, fnet_char_t **error_message, void *handler_param)
 Prototype of the TFTP-server callback function prototype that is called when the TFTP server has received a new data packet (request_type equals to FNET_TFTP_REQUEST_WRITE). This callback function is also called when the TFTP server is ready to send a new data packet to the TFTP client (request_type equals to FNET_TFTP_REQUEST_READ). More...
 
typedef void(* fnet_tftp_srv_complete_handler_t) (fnet_tftp_request_t request, fnet_return_t status, void *handler_param)
 Prototype of the TFTP-server callback function that is called when the TFTP server has completed file data transfer. More...
 
typedef long fnet_tftp_srv_desc_t
 TFTP server descriptor. More...
 

Enumerations

enum  fnet_tftp_srv_state_t {
  FNET_TFTP_SRV_STATE_DISABLED,
  FNET_TFTP_SRV_STATE_WAITING_REQUEST,
  FNET_TFTP_SRV_STATE_HANDLE_REQUEST,
  FNET_TFTP_SRV_STATE_CLOSE
}
 TFTP server states.
Used mainly for debugging purposes. More...
 

Functions

fnet_tftp_srv_desc_t fnet_tftp_srv_init (fnet_tftp_srv_params_t *params)
 Initializes the TFTP-server service. More...
 
void fnet_tftp_srv_release (fnet_tftp_srv_desc_t desc)
 Releases the TFTP-server service. More...
 
fnet_bool_t fnet_tftp_srv_is_enabled (fnet_tftp_srv_desc_t desc)
 Detects if the TFTP Server service is enabled or disabled. More...
 

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