TianoCore EDK2 master
|
Go to the source code of this file.
Support functions declaration for UEFI HTTP boot driver.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2020 Hewlett-Packard Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HttpBootSupport.h.
EFI_STATUS HttpBootCheckImageType | ( | IN CHAR8 * | Uri, |
IN VOID * | UriParser, | ||
IN UINTN | HeaderCount, | ||
IN EFI_HTTP_HEADER * | Headers, | ||
OUT HTTP_BOOT_IMAGE_TYPE * | ImageType | ||
) |
This function returns the image type according to server replied HTTP message and also the image's URI info.
[in] | Uri | The pointer to the image's URI string. |
[in] | UriParser | URI Parse result returned by NetHttpParseUrl(). |
[in] | HeaderCount | Number of HTTP header structures in Headers list. |
[in] | Headers | Array containing list of HTTP headers. |
[out] | ImageType | The image type of the downloaded file. |
EFI_SUCCESS | The image type is returned in ImageType. |
EFI_INVALID_PARAMETER | ImageType, Uri or UriParser is NULL. |
EFI_INVALID_PARAMETER | HeaderCount is not zero, and Headers is NULL. |
EFI_NOT_FOUND | Failed to identify the image type. |
Others | Unexpected error happened. |
Definition at line 639 of file HttpBootSupport.c.
EFI_STATUS HttpBootCheckUriScheme | ( | IN CHAR8 * | Uri | ) |
This function checks the HTTP(S) URI scheme.
[in] | Uri | The pointer to the URI string. |
EFI_SUCCESS | The URI scheme is valid. |
EFI_INVALID_PARAMETER | The URI scheme is not HTTP or HTTPS. |
EFI_ACCESS_DENIED | HTTP is disabled and the URI is HTTP. |
Definition at line 513 of file HttpBootSupport.c.
Notify the callback function when an event is triggered.
[in] | Event | The triggered event. |
[in] | Context | The opaque parameter to the function. |
Definition at line 300 of file HttpBootSupport.c.
EFI_STATUS HttpBootDns | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private, |
IN CHAR16 * | HostName, | ||
OUT EFI_IPv6_ADDRESS * | IpAddress | ||
) |
Retrieve the host address using the EFI_DNS6_PROTOCOL.
[in] | Private | The pointer to the driver's private data. |
[in] | HostName | Pointer to buffer containing hostname. |
[out] | IpAddress | On output, pointer to buffer containing IPv6 address. |
EFI_SUCCESS | Operation succeeded. |
EFI_DEVICE_ERROR | An unexpected network error occurred. |
Others | Other errors as indicated. |
Definition at line 320 of file HttpBootSupport.c.
EFI_HANDLE HttpBootGetNicByIp4Children | ( | IN EFI_HANDLE | ControllerHandle | ) |
Get the Nic handle using any child handle in the IPv4 stack.
[in] | ControllerHandle | Pointer to child handle over IPv4. |
Definition at line 22 of file HttpBootSupport.c.
EFI_HANDLE HttpBootGetNicByIp6Children | ( | IN EFI_HANDLE | ControllerHandle | ) |
Get the Nic handle using any child handle in the IPv6 stack.
[in] | ControllerHandle | Pointer to child handle over IPv6. |
Definition at line 49 of file HttpBootSupport.c.
BOOLEAN HttpBootIsHttpRedirectStatusCode | ( | IN EFI_HTTP_STATUS_CODE | StatusCode | ) |
Indicate if the HTTP status code indicates a redirection.
[in] | StatusCode | HTTP status code from server. |
Definition at line 779 of file HttpBootSupport.c.
EFI_STATUS HttpBootParseFilePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, |
OUT CHAR8 ** | UriAddress | ||
) |
Get the URI address string from the input device path.
Caller need to free the buffer in the UriAddress pointer.
[in] | FilePath | Pointer to the device path which contains a URI device path node. |
[out] | UriAddress | The URI address string extract from the device path. |
EFI_SUCCESS | The URI string is returned. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
Definition at line 567 of file HttpBootSupport.c.
VOID HttpBootPrintErrorMessage | ( | EFI_HTTP_STATUS_CODE | StatusCode | ) |
This function is to display the HTTP error status.
[in] | StatusCode | The status code value in HTTP message. |
Definition at line 152 of file HttpBootSupport.c.
EFI_STATUS HttpBootRegisterRamDisk | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private, |
IN UINTN | BufferSize, | ||
IN VOID * | Buffer, | ||
IN HTTP_BOOT_IMAGE_TYPE | ImageType | ||
) |
This function register the RAM disk info to the system.
[in] | Private | The pointer to the driver's private data. |
[in] | BufferSize | The size of Buffer in bytes. |
[in] | Buffer | The base address of the RAM disk. |
[in] | ImageType | The image type of the file in Buffer. |
EFI_SUCCESS | The RAM disk has been registered. |
EFI_NOT_FOUND | No RAM disk protocol instances were found. |
EFI_UNSUPPORTED | The ImageType is not supported. |
Others | Unexpected error happened. |
Definition at line 726 of file HttpBootSupport.c.
VOID HttpBootShowIp4Addr | ( | IN EFI_IPv4_ADDRESS * | Ip | ) |
This function is to display the IPv4 address.
[in] | Ip | The pointer to the IPv4 address. |
Definition at line 97 of file HttpBootSupport.c.
VOID HttpBootShowIp6Addr | ( | IN EFI_IPv6_ADDRESS * | Ip | ) |
This function is to display the IPv6 address.
[in] | Ip | The pointer to the IPv6 address. |
Definition at line 118 of file HttpBootSupport.c.
This function is to convert UINTN to ASCII string with the required formatting.
[in] | Number | Numeric value to be converted. |
[in] | Buffer | The pointer to the buffer for ASCII string. |
[in] | Length | The length of the required format. |
Definition at line 75 of file HttpBootSupport.c.