Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
tftp.h File Reference

TFTP Client Implementation. More...

#include <zephyr/kernel.h>
#include <zephyr/net/socket.h>

Go to the source code of this file.

Data Structures

struct  tftp_data_param
 Parameters for data event. More...
 
struct  tftp_error_param
 Parameters for error event. More...
 
union  tftp_evt_param
 Defines event parameters notified along with asynchronous events to the application. More...
 
struct  tftp_evt
 Defines TFTP asynchronous event notified to the application. More...
 
struct  tftpc
 TFTP client definition to maintain information relevant to the client. More...
 

Macros

#define TFTP_BLOCK_SIZE   512
 RFC1350: the file is sent in fixed length blocks of 512 bytes.
 
#define TFTP_HEADER_SIZE   4
 RFC1350: For non-request TFTP message, the header contains 2-byte operation code plus 2-byte block number or error code.
 
#define TFTPC_MAX_BUF_SIZE   (TFTP_BLOCK_SIZE + TFTP_HEADER_SIZE)
 Maximum amount of data that can be sent or received.
 
TFTP client error codes.
#define TFTPC_SUCCESS   0
 Success.
 
#define TFTPC_DUPLICATE_DATA   -1
 Duplicate data received.
 
#define TFTPC_BUFFER_OVERFLOW   -2
 User buffer is too small.
 
#define TFTPC_UNKNOWN_FAILURE   -3
 Unknown failure.
 
#define TFTPC_REMOTE_ERROR   -4
 Remote server error.
 
#define TFTPC_RETRIES_EXHAUSTED   -5
 Retries exhausted.
 

Typedefs

typedef void(* tftp_callback_t) (const struct tftp_evt *evt)
 TFTP event notification callback registered by the application.
 

Enumerations

enum  tftp_evt_type { TFTP_EVT_DATA , TFTP_EVT_ERROR }
 TFTP Asynchronous Events notified to the application from the module through the callback registered by the application. More...
 

Functions

int tftp_get (struct tftpc *client, const char *remote_file, const char *mode)
 This function gets data from a "file" on the remote server.
 
int tftp_put (struct tftpc *client, const char *remote_file, const char *mode, const uint8_t *user_buf, uint32_t user_buf_size)
 This function puts data to a "file" on the remote server.
 

Detailed Description

TFTP Client Implementation.