TianoCore EDK2 master
Loading...
Searching...
No Matches
HttpDynamicCommand.c
Go to the documentation of this file.
1
12#include "Http.h"
13
29EFIAPI
32 IN EFI_SYSTEM_TABLE *SystemTable,
33 IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
35 )
36{
37 gEfiShellParametersProtocol = ShellParameters;
38 gEfiShellProtocol = Shell;
39
40 return RunHttp (gImageHandle, SystemTable);
41}
42
53CHAR16 *
54EFIAPI
57 IN CONST CHAR8 *Language
58 )
59{
60 return HiiGetString (
61 mHttpHiiHandle,
62 STRING_TOKEN (STR_GET_HELP_HTTP),
63 Language
64 );
65}
66
67EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mHttpDynamicCommand = {
68 HTTP_APP_NAME,
71};
72
86EFIAPI
88 IN EFI_HANDLE ImageHandle,
89 IN EFI_SYSTEM_TABLE *SystemTable
90 )
91{
92 EFI_STATUS Status;
93
94 mHttpHiiHandle = InitializeHiiPackage (ImageHandle);
95 if (mHttpHiiHandle == NULL) {
96 return EFI_ABORTED;
97 }
98
99 Status = gBS->InstallProtocolInterface (
100 &ImageHandle,
101 &gEfiShellDynamicCommandProtocolGuid,
103 &mHttpDynamicCommand
104 );
105 ASSERT_EFI_ERROR (Status);
106 return Status;
107}
108
118EFIAPI
120 IN EFI_HANDLE ImageHandle
121 )
122{
123 EFI_STATUS Status;
124
125 Status = gBS->UninstallProtocolInterface (
126 ImageHandle,
127 &gEfiShellDynamicCommandProtocolGuid,
128 &mHttpDynamicCommand
129 );
130 if (EFI_ERROR (Status)) {
131 return Status;
132 }
133
134 HiiRemovePackages (mHttpHiiHandle);
135
136 return EFI_SUCCESS;
137}
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
Definition: HiiString.c:211
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
Definition: HiiLib.c:253
SHELL_STATUS RunHttp(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Http.c:469
EFI_STATUS EFIAPI HttpCommandInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI HttpUnload(IN EFI_HANDLE ImageHandle)
SHELL_STATUS EFIAPI HttpCommandHandler(IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This, IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN EFI_SHELL_PROTOCOL *Shell)
CHAR16 *EFIAPI HttpCommandGetHelp(IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This, IN CONST CHAR8 *Language)
STATIC EFI_HII_HANDLE InitializeHiiPackage(EFI_HANDLE ImageHandle)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
SHELL_STATUS
Definition: Shell.h:21
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_HANDLE gImageHandle
EFI_BOOT_SERVICES * gBS
#define STRING_TOKEN(t)
@ EFI_NATIVE_INTERFACE
Definition: UefiSpec.h:1193
EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.