Barrelfish
Macros | Functions
client.c File Reference

TFTP library. More...

Macros

#define TFTP_ERR_FILE_EXISTS   1
 the TFTP client
 

Functions

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