iPXE
|
iPXE Download Protocol More...
Go to the source code of this file.
Data Structures | |
struct | _IPXE_DOWNLOAD_PROTOCOL |
The iPXE Download Protocol. More... | |
Macros | |
#define | IPXE_DOWNLOAD_PROTOCOL_GUID |
Typedefs | |
typedef struct _IPXE_DOWNLOAD_PROTOCOL | IPXE_DOWNLOAD_PROTOCOL |
typedef VOID * | IPXE_DOWNLOAD_FILE |
Token to represent a currently downloading file. More... | |
typedef EFI_STATUS(EFIAPI * | IPXE_DOWNLOAD_DATA_CALLBACK) (IN VOID *Context, IN VOID *Buffer, IN UINTN BufferLength, IN UINTN FileOffset) |
Callback function that is invoked when data arrives for a particular file. More... | |
typedef void(EFIAPI * | IPXE_DOWNLOAD_FINISH_CALLBACK) (IN VOID *Context, IN EFI_STATUS Status) |
Callback function that is invoked when the file is finished downloading, or when a connection unexpectedly closes or times out. More... | |
typedef EFI_STATUS(EFIAPI * | IPXE_DOWNLOAD_START) (IN IPXE_DOWNLOAD_PROTOCOL *This, IN CHAR8 *Url, IN IPXE_DOWNLOAD_DATA_CALLBACK DataCallback, IN IPXE_DOWNLOAD_FINISH_CALLBACK FinishCallback, IN VOID *Context, OUT IPXE_DOWNLOAD_FILE *File) |
Start downloading a file, and register callback functions to handle the download. More... | |
typedef EFI_STATUS(EFIAPI * | IPXE_DOWNLOAD_ABORT) (IN IPXE_DOWNLOAD_PROTOCOL *This, IN IPXE_DOWNLOAD_FILE File, IN EFI_STATUS Status) |
Forcibly abort downloading a file that is currently in progress. More... | |
typedef EFI_STATUS(EFIAPI * | IPXE_DOWNLOAD_POLL) (IN IPXE_DOWNLOAD_PROTOCOL *This) |
Poll for more data from iPXE. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER) | |
int | efi_download_install (EFI_HANDLE handle) |
Install iPXE download protocol. More... | |
void | efi_download_uninstall (EFI_HANDLE handle) |
Uninstall iPXE download protocol. More... | |
iPXE Download Protocol
EFI applications started by iPXE may use this interface to download files.
Definition in file efi_download.h.
#define IPXE_DOWNLOAD_PROTOCOL_GUID |
Definition at line 149 of file efi_download.h.
typedef struct _IPXE_DOWNLOAD_PROTOCOL IPXE_DOWNLOAD_PROTOCOL |
Definition at line 31 of file efi_download.h.
typedef VOID* IPXE_DOWNLOAD_FILE |
Token to represent a currently downloading file.
Definition at line 34 of file efi_download.h.
typedef EFI_STATUS(EFIAPI * IPXE_DOWNLOAD_DATA_CALLBACK) (IN VOID *Context, IN VOID *Buffer, IN UINTN BufferLength, IN UINTN FileOffset) |
Callback function that is invoked when data arrives for a particular file.
Not all protocols will deliver data in order. Clients should not rely on the order of data delivery matching the order in the file.
Some protocols are capable of determining the file size near the beginning of data transfer. To allow the client to allocate memory more efficiently, iPXE may give a hint about the file size by calling the Data callback with a zero BufferLength and the file size in FileOffset. Clients should be prepared to deal with more or less data than the hint actually arriving.
Context | Context provided to the Start function |
Buffer | New data |
BufferLength | Length of new data in bytes |
FileOffset | Offset of new data in the file |
Status | EFI_SUCCESS to continue the download, or any error code to abort. |
Definition at line 57 of file efi_download.h.
Callback function that is invoked when the file is finished downloading, or when a connection unexpectedly closes or times out.
The finish callback is also called when a download is aborted by the Abort function (below).
Context | Context provided to the Start function |
Status | Reason for termination: EFI_SUCCESS when the entire file was transferred successfully, or an error otherwise |
Definition at line 78 of file efi_download.h.
typedef EFI_STATUS(EFIAPI * IPXE_DOWNLOAD_START) (IN IPXE_DOWNLOAD_PROTOCOL *This, IN CHAR8 *Url, IN IPXE_DOWNLOAD_DATA_CALLBACK DataCallback, IN IPXE_DOWNLOAD_FINISH_CALLBACK FinishCallback, IN VOID *Context, OUT IPXE_DOWNLOAD_FILE *File) |
Start downloading a file, and register callback functions to handle the download.
This | iPXE Download Protocol instance |
Url | URL to download from |
DataCallback | Callback that will be invoked when data arrives |
FinishCallback | Callback that will be invoked when the download ends |
Context | Context passed to the Data and Finish callbacks |
File | Token that can be used to abort the download |
Status | EFI status code |
Definition at line 97 of file efi_download.h.
typedef EFI_STATUS(EFIAPI * IPXE_DOWNLOAD_ABORT) (IN IPXE_DOWNLOAD_PROTOCOL *This, IN IPXE_DOWNLOAD_FILE File, IN EFI_STATUS Status) |
Forcibly abort downloading a file that is currently in progress.
It is not safe to call this function after the Finish callback has executed.
This | iPXE Download Protocol instance |
File | Token obtained from Start |
Status | Reason for aborting the download |
Status | EFI status code |
Definition at line 118 of file efi_download.h.
typedef EFI_STATUS(EFIAPI * IPXE_DOWNLOAD_POLL) (IN IPXE_DOWNLOAD_PROTOCOL *This) |
Poll for more data from iPXE.
This function will invoke the registered callbacks if data is available or if downloads complete.
This | iPXE Download Protocol instance |
Status | EFI status code |
Definition at line 133 of file efi_download.h.
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
int efi_download_install | ( | EFI_HANDLE | handle | ) |
Install iPXE download protocol.
handle | EFI handle |
rc | Return status code |
Definition at line 211 of file efi_download.c.
References EFI_SYSTEM_TABLE::BootServices, DBG, EEFI, efi_systab, handle, EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces, ipxe_download_protocol_guid, ipxe_download_protocol_interface, NULL, rc, and strerror().
Referenced by efi_image_exec().
void efi_download_uninstall | ( | EFI_HANDLE | handle | ) |
Uninstall iPXE download protocol.
handle | EFI handle |
Definition at line 236 of file efi_download.c.
References EFI_SYSTEM_TABLE::BootServices, efi_systab, handle, ipxe_download_protocol_guid, ipxe_download_protocol_interface, NULL, and EFI_BOOT_SERVICES::UninstallMultipleProtocolInterfaces.
Referenced by efi_image_exec().