Barrelfish
Typedefs | Functions
tftp.h File Reference

TFTP library. More...

Typedefs

typedef errval_t(* tfpt_server_cb_f_t) (void)
 < server request callback function
 

Functions

errval_t tftp_server_accept (char *ip, uint16_t port, tfpt_server_cb_f_t cb)
 starts the tftp server on this machine on a given port More...
 
errval_t tftp_server_terminate (void)
 terminates the tftp server connection More...
 
errval_t tftp_client_write_file (char *name, void *buf, size_t buflen)
 writes a file over tftp on the established connection More...
 
errval_t tftp_client_read_file (char *path, void *buf, size_t buflen, size_t *ret_size)
 reads a file over tftp on the established connection More...
 
errval_t tftp_client_connect (char *ip, uint16_t port)
 attempts to initialize a new TFTP connection to a server More...
 
errval_t tftp_client_disconnect (void)
 terminates the connection to the tftp server More...
 

Detailed Description

TFTP library.

Function Documentation

errval_t tftp_client_connect ( char *  ip,
uint16_t  port 
)

attempts to initialize a new TFTP connection to a server

Returns
SYS_ERR_OK on success TFTP_ERR_* on failure
errval_t tftp_client_disconnect ( void  )

terminates the connection to the tftp server

Returns
SYS_ERR_OK on success TFTP_ERR_* on failure
errval_t tftp_client_read_file ( char *  path,
void *  buf,
size_t  buflen,
size_t *  ret_size 
)

reads a file over tftp on the established connection

Parameters
pathpath of the file to readf rom
bufbuffer where to store the contents
buflenmaximum length of the buffer
ret_sizereturns the number of bytes received
Returns
SYS_ERR_OK on success TFTP_ERR_* on failure
errval_t tftp_client_write_file ( char *  name,
void *  buf,
size_t  buflen 
)

writes a file over tftp on the established connection

Parameters
namename of the remote file to write
bufbuffer containing the data
buflenlength of the file to write
Returns
SYS_ERR_OK on success TFTP_ERR_* on failure
errval_t tftp_server_accept ( char *  ip,
uint16_t  port,
tfpt_server_cb_f_t  cb 
)

starts the tftp server on this machine on a given port

Parameters
ipip address to be used
portport to be used
cbcallback function called when clients connect
Returns
SYS_ERR_OK on success TFTP_ERR_* on failure
errval_t tftp_server_terminate ( void  )

terminates the tftp server connection

Returns
SYS_ERR_OK on success TFTP_ERR_* on failure