sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
tftp_context Struct Reference

#include <tftp_common.h>

Public Attributes

void *(*) open (const char *fname, const char *mode, u8_t write)
void(*) close (void *handle)
int(*) read (void *handle, void *buf, int bytes)
int(*) write (void *handle, struct pbuf *p)
void(*) error (void *handle, int err, const char *msg, int size)

Detailed Description

TFTP context containing callback functions for TFTP transfers

Definition at line 56 of file tftp_common.h.

Member Data Documentation

◆ close

void(*) tftp_context::close(void *handle)

Close file handle

Parameters
handleFile handle returned by open()/tftp_put()/tftp_get()

Definition at line 69 of file tftp_common.h.

◆ error

void(*) tftp_context::error(void *handle, int err, const char *msg, int size)

Error indication from client or response from server

Parameters
handleFile handle set by open()/tftp_get()/tftp_put()
errerror code from client or server
msgerror message from client or server
sizesize of msg

Definition at line 94 of file tftp_common.h.

◆ open

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

Open file for read/write (server mode only).

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 64 of file tftp_common.h.

◆ read

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

Read from file

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

Definition at line 77 of file tftp_common.h.

◆ write

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

Write to file

Parameters
handleFile handle returned by open()/tftp_put()/tftp_get()
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 86 of file tftp_common.h.


The documentation for this struct was generated from the following file: