Mistake on this page?
Report an issue in GitHub or email us
Data Fields
tftp_context Struct Reference

TFTP context containing callback functions for TFTP transfers. More...

#include <tftp_server.h>

Data Fields

void *(* open )(const char *fname, const char *mode, u8_t write)
 Open file for read/write. More...
 
void(* close )(void *handle)
 Close file handle. More...
 
int(* read )(void *handle, void *buf, int bytes)
 Read from file. More...
 
int(* write )(void *handle, struct pbuf *p)
 Write to file. More...
 

Detailed Description

TFTP context containing callback functions for TFTP transfers.

Definition at line 55 of file tftp_server.h.

Field Documentation

void(* close) (void *handle)

Close file handle.

Parameters
handleFile handle returned by open()

Definition at line 68 of file tftp_server.h.

void*(* open) (const char *fname, const char *mode, u8_t write)

Open file for read/write.

Parameters
fnameFilename
modeMode string from TFTP RFC 1350 (netascii, octet, mail)
writeFlag indicating read (0) or write (!= 0) access
Returns
File handle supplied to other functions

Definition at line 63 of file tftp_server.h.

int(* read) (void *handle, void *buf, int bytes)

Read from file.

Parameters
handleFile handle returned by open()
bufTarget buffer to copy read data to
bytesNumber of bytes to copy to buf
Returns
>= 0: Success; < 0: Error

Definition at line 76 of file tftp_server.h.

int(* write) (void *handle, struct pbuf *p)

Write to file.

Parameters
handleFile handle returned by open()
pbufPBUF adjusted such that payload pointer points to the beginning of write data. In other words, TFTP headers are stripped off.
Returns
>= 0: Success; < 0: Error

Definition at line 85 of file tftp_server.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.