2 Header file for 'http' command functions.
4 Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>
5 Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>
6 Copyright (c) 2020, Broadcom. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
17 #include <Library/BaseLib.h>
18 #include <Library/BaseMemoryLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/HiiLib.h>
21 #include <Library/HttpLib.h>
22 #include <Library/MemoryAllocationLib.h>
23 #include <Library/NetLib.h>
24 #include <Library/PrintLib.h>
25 #include <Library/ShellLib.h>
26 #include <Library/UefiBootServicesTableLib.h>
27 #include <Library/UefiHiiServicesLib.h>
28 #include <Library/UefiLib.h>
29 #include <Library/UefiRuntimeServicesTableLib.h>
31 #include <Protocol/HiiPackageList.h>
32 #include <Protocol/HttpUtilities.h>
33 #include <Protocol/ServiceBinding.h>
35 #define HTTP_APP_NAME L"http"
38 #define REQ_NEED_REPEAT 1
43 #define DL_FLAG_TIME BIT0 // Show elapsed time.
44 #define DL_FLAG_KEEP_BAD BIT1 // Keep files even if download failed.
46 extern EFI_HII_HANDLE mHttpHiiHandle
;
49 UINTN ContentDownloaded
;
51 UINTN LastReportedNbOfBytes
;
56 CHAR16
*ServerAddrAndProto
;
58 EFI_HTTP_TOKEN ResponseToken
;
59 EFI_HTTP_TOKEN RequestToken
;
60 EFI_HTTP_PROTOCOL
*Http
;
61 EFI_HTTP_CONFIG_DATA HttpConfigData
;
62 } HTTP_DOWNLOAD_CONTEXT
;
65 Function for 'http' command.
67 @param[in] ImageHandle The image handle.
68 @param[in] SystemTable The system table.
70 @retval SHELL_SUCCESS Command completed successfully.
71 @retval SHELL_INVALID_PARAMETER Command usage error.
72 @retval SHELL_ABORTED The user aborts the operation.
73 @retval value Unknown error.
77 IN EFI_HANDLE ImageHandle
,
78 IN EFI_SYSTEM_TABLE
*SystemTable
82 Retrieve HII package list from ImageHandle and publish to HII database.
84 @param[in] ImageHandle The image handle of the process.
89 InitializeHiiPackage (
90 IN EFI_HANDLE ImageHandle