[manual index][section index]

NAME

tftp - Trivial File Transfer Protocol

SYNOPSIS

tftp := load Tftp Tftp->PATH;
Tftp: module
{
   init:    fn(progress: int);
   receive: fn(host: string, filename: string,
               fd: ref Sys->FD): string;
};

DESCRIPTION

Tftp fetches files from an Internet TFTP server. It is typically used only to fetch kernels or configuration files when booting. Only one transfer can be active at any given time.

Init must be called once before using any other function of the module. If progress is non-zero, receive will periodically print a character as blocks are received: `.' for every 25 blocks, `S' for a sequence error, `T' for a timeout.

Receive attempts to fetch the contents of filename from host and writes the blocks of data to fd as they are received. It returns when the file transfer has completed, returning a nil string on success or a diagnostic string otherwise. When booting, fd is typically open on the kexec file of boot(3).

SOURCE

/appl/lib/tftp.b

SEE ALSO

ip(2), bootpd(8)

TFTP(2 ) Rev:  Tue Mar 31 02:42:39 GMT 2015