1 | /** @file
|
---|
2 | Entrypoint of "http" shell standalone application.
|
---|
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 | #include "Http.h"
|
---|
12 |
|
---|
13 | /*
|
---|
14 | * String token ID of help message text.
|
---|
15 | * Shell supports to find help message in the resource section of an
|
---|
16 | * application image if * .MAN file is not found.
|
---|
17 | * This global variable is added to make build tool recognizes
|
---|
18 | * that the help string is consumed by user and then build tool will
|
---|
19 | * add the string into the resource section.
|
---|
20 | * Thus the application can use '-?' option to show help message in Shell.
|
---|
21 | */
|
---|
22 | GLOBAL_REMOVE_IF_UNREFERENCED
|
---|
23 | EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_HTTP);
|
---|
24 |
|
---|
25 | /**
|
---|
26 | Entry point of Http standalone application.
|
---|
27 |
|
---|
28 | @param ImageHandle The image handle of the process.
|
---|
29 | @param SystemTable The EFI System Table pointer.
|
---|
30 |
|
---|
31 | @retval EFI_SUCCESS Http command is executed successfully.
|
---|
32 | @retval EFI_ABORTED HII package was failed to initialize.
|
---|
33 | @retval others Other errors when executing http command.
|
---|
34 | **/
|
---|
35 | EFI_STATUS
|
---|
36 | EFIAPI
|
---|
37 | HttpAppInitialize (
|
---|
38 | IN EFI_HANDLE ImageHandle,
|
---|
39 | IN EFI_SYSTEM_TABLE *SystemTable
|
---|
40 | )
|
---|
41 | {
|
---|
42 | EFI_STATUS Status;
|
---|
43 | SHELL_STATUS ShellStatus;
|
---|
44 |
|
---|
45 | mHttpHiiHandle = InitializeHiiPackage (ImageHandle);
|
---|
46 | if (mHttpHiiHandle == NULL) {
|
---|
47 | return EFI_ABORTED;
|
---|
48 | }
|
---|
49 |
|
---|
50 | Status = EFI_SUCCESS;
|
---|
51 |
|
---|
52 | ShellStatus = RunHttp (ImageHandle, SystemTable);
|
---|
53 |
|
---|
54 | HiiRemovePackages (mHttpHiiHandle);
|
---|
55 |
|
---|
56 | if (Status != SHELL_SUCCESS) {
|
---|
57 | Status = ENCODE_ERROR (ShellStatus);
|
---|
58 | }
|
---|
59 |
|
---|
60 | return Status;
|
---|
61 | }
|
---|