TianoCore EDK2 master
|
#include "HttpBootDxe.h"
Go to the source code of this file.
Implementation of the boot file download function.
Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HttpBootClient.c.
EFI_STATUS HttpBootCreateHttpIo | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Create a HttpIo instance for the file download.
[in] | Private | The pointer to the driver's private data. |
EFI_SUCCESS | Successfully created. |
Others | Failed to create HttpIo. |
Definition at line 609 of file HttpBootClient.c.
EFI_STATUS HttpBootDhcp4ExtractUriInfo | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Parse the boot file URI information from the selected Dhcp4 offer packet.
[in] | Private | The pointer to the driver's private data. |
EFI_SUCCESS | Successfully parsed out all the boot information. |
Others | Failed to parse out the boot information. |
Definition at line 188 of file HttpBootClient.c.
EFI_STATUS HttpBootDhcp6ExtractUriInfo | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Parse the boot file URI information from the selected Dhcp6 offer packet.
[in] | Private | The pointer to the driver's private data. |
EFI_SUCCESS | Successfully parsed out all the boot information. |
Others | Failed to parse out the boot information. |
Definition at line 328 of file HttpBootClient.c.
EFI_STATUS HttpBootDiscoverBootInfo | ( | IN OUT HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Discover all the boot information for boot file.
[in,out] | Private | The pointer to the driver's private data. |
EFI_SUCCESS | Successfully obtained all the boot information . |
Others | Failed to retrieve the boot information. |
Definition at line 539 of file HttpBootClient.c.
VOID HttpBootFreeCache | ( | IN HTTP_BOOT_CACHE_CONTENT * | Cache | ) |
Release all the resource of a cache item.
[in] | Cache | The pointer to the cache item. |
Definition at line 663 of file HttpBootClient.c.
VOID HttpBootFreeCacheList | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Clean up all cached data.
[in] | Private | The pointer to the driver's private data. |
Definition at line 722 of file HttpBootClient.c.
EFI_STATUS HttpBootGetBootFile | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private, |
IN BOOLEAN | HeaderOnly, | ||
IN OUT UINTN * | BufferSize, | ||
OUT UINT8 * | Buffer, | ||
OUT HTTP_BOOT_IMAGE_TYPE * | ImageType | ||
) |
This function download the boot file by using UEFI HTTP protocol.
[in] | Private | The pointer to the driver's private data. |
[in] | HeaderOnly | Only request the response header, it could save a lot of time if the caller only want to know the size of the requested file. |
[in,out] | BufferSize | On input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file. |
[out] | Buffer | The memory buffer to transfer the file to. IF Buffer is NULL, then the size of the requested file is returned in BufferSize. |
[out] | ImageType | The image type of the downloaded file. |
EFI_SUCCESS | The file was loaded. |
EFI_INVALID_PARAMETER | BufferSize is NULL or Buffer Size is not NULL but Buffer is NULL. |
EFI_OUT_OF_RESOURCES | Could not allocate needed resources |
EFI_BUFFER_TOO_SMALL | The BufferSize is too small to read the current directory entry. BufferSize has been updated with the size needed to complete the request. |
EFI_ACCESS_DENIED | The server needs to authenticate the client. |
EFI_NOT_READY | Data transfer has timed-out, call HttpBootGetBootFile again to resume the download operation using HTTP Range headers. |
EFI_UNSUPPORTED | Some HTTP response header is not supported. |
Others | Unexpected error happened. |
Definition at line 933 of file HttpBootClient.c.
EFI_STATUS EFIAPI HttpBootGetBootFileCallback | ( | IN HTTP_BODY_PARSE_EVENT | EventType, |
IN CHAR8 * | Data, | ||
IN UINTN | Length, | ||
IN VOID * | Context | ||
) |
A callback function to intercept events during message parser.
This function will be invoked during HttpParseMessageBody() with various events type. An error return status of the callback function will cause the HttpParseMessageBody() aborted.
[in] | EventType | Event type of this callback call. |
[in] | Data | A pointer to data buffer. |
[in] | Length | Length in bytes of the Data. |
[in] | Context | Callback context set by HttpInitMsgParser(). |
EFI_SUCCESS | Continue to parser the message body. |
Others | Abort the parse. |
Definition at line 836 of file HttpBootClient.c.
EFI_STATUS HttpBootGetFileFromCache | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private, |
IN CHAR16 * | Uri, | ||
IN OUT UINTN * | BufferSize, | ||
OUT UINT8 * | Buffer, | ||
OUT HTTP_BOOT_IMAGE_TYPE * | ImageType | ||
) |
Get the file content from cached data.
[in] | Private | The pointer to the driver's private data. |
[in] | Uri | Uri of the file to be retrieved from cache. |
[in,out] | BufferSize | On input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file. |
[out] | Buffer | The memory buffer to transfer the file to. IF Buffer is NULL, then the size of the requested file is returned in BufferSize. |
[out] | ImageType | The image type of the downloaded file. |
EFI_SUCCESS | Successfully created. |
Others | Failed to create HttpIo. |
Definition at line 756 of file HttpBootClient.c.
EFI_STATUS EFIAPI HttpBootHttpIoCallback | ( | IN HTTP_IO_CALLBACK_EVENT | EventType, |
IN EFI_HTTP_MESSAGE * | Message, | ||
IN VOID * | Context | ||
) |
HttpIo Callback function which will be invoked when specified HTTP_IO_CALLBACK_EVENT happened.
[in] | EventType | Indicate the Event type that occurs in the current callback. |
[in] | Message | HTTP message which will be send to, or just received from HTTP server. |
[in] | Context | The Callback Context pointer. |
EFI_SUCCESS | Tells the HttpIo to continue the HTTP process. |
Others | Tells the HttpIo to abort the current HTTP process. |
Definition at line 575 of file HttpBootClient.c.
EFI_STATUS HttpBootUpdateDevicePath | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Update the device path node to include the boot resource information.
[in] | Private | The pointer to the driver's private data. |
EFI_SUCCESS | Device patch successfully updated. |
EFI_OUT_OF_RESOURCES | Could not allocate needed resources. |
Others | Unexpected error happened. |
Definition at line 23 of file HttpBootClient.c.