A read-only TFTP server for PXE: UEFI firmware fetches the shim over TFTP, the shim its GRUB, and GRUB its menu, kernel and initrd, all from the same server. Each read is answered by the same function as HTTP's, so PXE and HTTP boot get the same files. Each transfer runs on its own socket (the client's transfer id), one block in flight, retransmitting on a timeout; a write request is refused.
type TftpOptions = {
readonly port: number;
readonly hostname?: string;
/** The bytes of a file of the served tree…(617 characters)
typeTftpOptions= {
readonlyport:number;
readonlyhostname?:string;
/** The bytes of a file of the served tree (a path with a leading slash), or nothing where there is none. */readonlyread: (path:string, from:string) =>Promise<Uint8Array|undefined>;
/** Told of each transfer: its file, who asked and how it ended. */readonlyonTransfer?: (e: { readonlyfile:string; readonlyfrom:string; readonlyoutcome:"sent"|"refused"|"not-found"|"timed-out" }) =>void;
/** How many times a block is sent again before the transfer is given up (5 by default). */readonlyretries?:number;
};
type TftpOptions = {
readonly port: number;
readonly hostname?: string;
/** The bytes of a file of the served tree…(617 characters)
typeTftpOptions= {
readonlyport:number;
readonlyhostname?:string;
/** The bytes of a file of the served tree (a path with a leading slash), or nothing where there is none. */readonlyread: (path:string, from:string) =>Promise<Uint8Array|undefined>;
/** Told of each transfer: its file, who asked and how it ended. */readonlyonTransfer?: (e: { readonlyfile:string; readonlyfrom:string; readonlyoutcome:"sent"|"refused"|"not-found"|"timed-out" }) =>void;
/** How many times a block is sent again before the transfer is given up (5 by default). */readonlyretries?:number;
};