TFTP support library. More...

Detailed Description

The TFTP module add's support for the TFTP protocol. It implements the following RFC's:

Author
Nick van IJzendoorn nijze.nosp@m.ndoo.nosp@m.rn@en.nosp@m.gine.nosp@m.ering.nosp@m.-spi.nosp@m.rit.n.nosp@m.l

Definition in file tftp.h.

#include <inttypes.h>
#include "byteorder.h"
#include "kernel_types.h"
#include "net/ipv6/addr.h"
#include "net/gnrc/nettype.h"
+ Include dependency graph for tftp.h:

Go to the source code of this file.

Macros

#define GNRC_TFTP_MAX_FILENAME_LEN   (64)
 The maximum allowed length of the transfer filename.
 
#define GNRC_TFTP_DEFAULT_SRC_PORT   (10690)
 The base source port to be used by TFTP.
 
#define GNRC_TFTP_DEFAULT_DST_PORT   (69)
 The default destination port of the TFTP server.
 
#define GNRC_TFTP_MAX_TRANSFER_UNIT   (512)
 The maximum allowed data bytes in the data packet.
 
#define GNRC_TFTP_MAX_RETRIES   (5)
 The number of retries that must be made before stopping a transfer.
 
#define GNRC_TFTP_DEFAULT_TIMEOUT   (1 * US_PER_SEC)
 The default timeout of a data packet.
 

Typedefs

typedef bool(* tftp_start_cb_t) (tftp_action_t action, tftp_mode_t mode, const char *file_name, size_t *data_len)
 callback define which is called when a new server request is placed or when an client read request is made and the data length option is received More...
 
typedef int(* tftp_data_cb_t) (uint32_t offset, void *data, size_t data_len)
 callback define which is called to get or set data from/to the user application
 
typedef void(* tftp_stop_cb_t) (tftp_event_t event, const char *msg)
 callback define which is called when an transfer is stopped
 

Enumerations

enum  tftp_action_t { TFTP_READ, TFTP_WRITE }
 TFTP action to perform.
 
enum  tftp_mode_t { TTM_ASCII, TTM_OCTET, TTM_MAIL }
 TFTP Transfer modes.
 
enum  tftp_event_t { TFTP_SUCCESS, TFTP_PEER_ERROR, TFTP_INTERN_ERROR }
 TFTP stop / finish events. More...
 

Functions

int gnrc_tftp_server (tftp_data_cb_t data_cb, tftp_start_cb_t start_cb, tftp_stop_cb_t stop_cb, bool use_options)
 Start the TFTP server. More...
 
int gnrc_tftp_server_stop (void)
 Stop the TFTP server. More...
 
int gnrc_tftp_client_read (ipv6_addr_t *addr, const char *file_name, tftp_mode_t mode, tftp_data_cb_t data_cb, tftp_start_cb_t start_cb, tftp_stop_cb_t stop_cb, bool use_option)
 Start an TFTP client read action from the given destination. More...
 
int gnrc_tftp_client_write (ipv6_addr_t *addr, const char *file_name, tftp_mode_t mode, tftp_data_cb_t data_cb, size_t total_size, tftp_stop_cb_t stop_cb, bool use_option)
 Start an TFTP client write action to the given destination. More...