]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/DynamicCommand/HttpDynamicCommand/Http.h
ShellPkg: Apply uncrustify changes
[mirror_edk2.git] / ShellPkg / DynamicCommand / HttpDynamicCommand / Http.h
CommitLineData
d8ab884f
VO
1/** @file\r
2 Header file for 'http' command functions.\r
3\r
4 Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>\r
5 Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>\r
6 Copyright (c) 2020, Broadcom. All rights reserved.<BR>\r
7\r
8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
9\r
10**/\r
11\r
12#ifndef _HTTP_H_\r
13#define _HTTP_H_\r
14\r
15#include <Uefi.h>\r
16\r
17#include <Library/BaseLib.h>\r
18#include <Library/BaseMemoryLib.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/HiiLib.h>\r
21#include <Library/HttpLib.h>\r
22#include <Library/MemoryAllocationLib.h>\r
23#include <Library/NetLib.h>\r
24#include <Library/PrintLib.h>\r
25#include <Library/ShellLib.h>\r
26#include <Library/UefiBootServicesTableLib.h>\r
27#include <Library/UefiHiiServicesLib.h>\r
28#include <Library/UefiLib.h>\r
29#include <Library/UefiRuntimeServicesTableLib.h>\r
30\r
31#include <Protocol/HiiPackageList.h>\r
32#include <Protocol/HttpUtilities.h>\r
33#include <Protocol/ServiceBinding.h>\r
34\r
47d20b54 35#define HTTP_APP_NAME L"http"\r
d8ab884f
VO
36\r
37#define REQ_OK 0\r
38#define REQ_NEED_REPEAT 1\r
39\r
40//\r
41// Download Flags.\r
42//\r
47d20b54
MK
43#define DL_FLAG_TIME BIT0 // Show elapsed time.\r
44#define DL_FLAG_KEEP_BAD BIT1 // Keep files even if download failed.\r
d8ab884f 45\r
47d20b54 46extern EFI_HII_HANDLE mHttpHiiHandle;\r
d8ab884f
VO
47\r
48typedef struct {\r
47d20b54
MK
49 UINTN ContentDownloaded;\r
50 UINTN ContentLength;\r
51 UINTN LastReportedNbOfBytes;\r
52 UINTN BufferSize;\r
53 UINTN Status;\r
54 UINTN Flags;\r
55 UINT8 *Buffer;\r
56 CHAR16 *ServerAddrAndProto;\r
57 CHAR16 *Uri;\r
58 EFI_HTTP_TOKEN ResponseToken;\r
59 EFI_HTTP_TOKEN RequestToken;\r
60 EFI_HTTP_PROTOCOL *Http;\r
61 EFI_HTTP_CONFIG_DATA HttpConfigData;\r
d8ab884f
VO
62} HTTP_DOWNLOAD_CONTEXT;\r
63\r
64/**\r
65 Function for 'http' command.\r
66\r
67 @param[in] ImageHandle The image handle.\r
68 @param[in] SystemTable The system table.\r
69\r
70 @retval SHELL_SUCCESS Command completed successfully.\r
71 @retval SHELL_INVALID_PARAMETER Command usage error.\r
72 @retval SHELL_ABORTED The user aborts the operation.\r
73 @retval value Unknown error.\r
74**/\r
75SHELL_STATUS\r
76RunHttp (\r
77 IN EFI_HANDLE ImageHandle,\r
78 IN EFI_SYSTEM_TABLE *SystemTable\r
79 );\r
80\r
81/**\r
82 Retrieve HII package list from ImageHandle and publish to HII database.\r
83\r
84 @param[in] ImageHandle The image handle of the process.\r
85\r
86 @retval HII handle.\r
87**/\r
88EFI_HII_HANDLE\r
89InitializeHiiPackage (\r
47d20b54 90 IN EFI_HANDLE ImageHandle\r
d8ab884f 91 );\r
47d20b54 92\r
d8ab884f 93#endif // _HTTP_H_\r