2 Produce "http" shell dynamic command.
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
11 #include <Protocol/ShellDynamicCommand.h>
15 This is the shell command handler function pointer callback type. This
16 function handles the command when it is invoked in the shell.
18 @param[in] This The instance of the
19 EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
20 @param[in] SystemTable The pointer to the system table.
21 @param[in] ShellParameters The parameters associated with the command.
22 @param[in] Shell The instance of the shell protocol used in
23 the context of processing this command.
25 @return EFI_SUCCESS the operation was sucessful
26 @return other the operation failed.
31 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
*This
,
32 IN EFI_SYSTEM_TABLE
*SystemTable
,
33 IN EFI_SHELL_PARAMETERS_PROTOCOL
*ShellParameters
,
34 IN EFI_SHELL_PROTOCOL
*Shell
37 gEfiShellParametersProtocol
= ShellParameters
;
38 gEfiShellProtocol
= Shell
;
40 return RunHttp (gImageHandle
, SystemTable
);
44 This is the command help handler function pointer callback type. This
45 function is responsible for displaying help information for the associated
48 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
49 @param[in] Language The pointer to the language string to use.
51 @return string Pool allocated help string, must be freed by caller
56 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
*This
,
57 IN CONST CHAR8
*Language
62 STRING_TOKEN (STR_GET_HELP_HTTP
),
67 EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mHttpDynamicCommand
= {
74 Entry point of Http Dynamic Command.
76 Produce the DynamicCommand protocol to handle "http" command.
78 @param ImageHandle The image handle of the process.
79 @param SystemTable The EFI System Table pointer.
81 @retval EFI_SUCCESS Http command is executed sucessfully.
82 @retval EFI_ABORTED HII package was failed to initialize.
83 @retval others Other errors when executing http command.
87 HttpCommandInitialize (
88 IN EFI_HANDLE ImageHandle
,
89 IN EFI_SYSTEM_TABLE
*SystemTable
94 mHttpHiiHandle
= InitializeHiiPackage (ImageHandle
);
95 if (mHttpHiiHandle
== NULL
) {
99 Status
= gBS
->InstallProtocolInterface (
101 &gEfiShellDynamicCommandProtocolGuid
,
102 EFI_NATIVE_INTERFACE
,
105 ASSERT_EFI_ERROR (Status
);
110 Http driver unload handler.
112 @param ImageHandle The image handle of the process.
114 @retval EFI_SUCCESS The image is unloaded.
115 @retval Others Failed to unload the image.
120 IN EFI_HANDLE ImageHandle
125 Status
= gBS
->UninstallProtocolInterface (
127 &gEfiShellDynamicCommandProtocolGuid
,
130 if (EFI_ERROR (Status
)) {
134 HiiRemovePackages (mHttpHiiHandle
);