VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.h

Last change on this file was 99404, checked in by vboxsync, 2 years ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1/** @file
2 Header file for 'http' command functions.
3
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>
7
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10**/
11
12#ifndef _HTTP_H_
13#define _HTTP_H_
14
15#include <Uefi.h>
16
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>
30
31#include <Protocol/HiiPackageList.h>
32#include <Protocol/HttpUtilities.h>
33#include <Protocol/ServiceBinding.h>
34
35#define HTTP_APP_NAME L"http"
36
37#define REQ_OK 0
38#define REQ_NEED_REPEAT 1
39
40//
41// Download Flags.
42//
43#define DL_FLAG_TIME BIT0 // Show elapsed time.
44#define DL_FLAG_KEEP_BAD BIT1 // Keep files even if download failed.
45
46extern EFI_HII_HANDLE mHttpHiiHandle;
47
48typedef struct {
49 UINTN ContentDownloaded;
50 UINTN ContentLength;
51 UINTN LastReportedNbOfBytes;
52 UINTN BufferSize;
53 UINTN Status;
54 UINTN Flags;
55 UINT8 *Buffer;
56 CHAR16 *ServerAddrAndProto;
57 CHAR16 *Uri;
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;
63
64/**
65 Function for 'http' command.
66
67 @param[in] ImageHandle The image handle.
68 @param[in] SystemTable The system table.
69
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.
74**/
75SHELL_STATUS
76RunHttp (
77 IN EFI_HANDLE ImageHandle,
78 IN EFI_SYSTEM_TABLE *SystemTable
79 );
80
81/**
82 Retrieve HII package list from ImageHandle and publish to HII database.
83
84 @param[in] ImageHandle The image handle of the process.
85
86 @retval HII handle.
87**/
88EFI_HII_HANDLE
89InitializeHiiPackage (
90 IN EFI_HANDLE ImageHandle
91 );
92
93#endif // _HTTP_H_
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette