TianoCore EDK2 master
Loading...
Searching...
No Matches
UefiShellNetwork1CommandsLib.c
Go to the documentation of this file.
1
9
10CONST CHAR16 gShellNetwork1FileName[] = L"ShellCommands";
11EFI_HII_HANDLE gShellNetwork1HiiHandle = NULL;
12
18CONST CHAR16 *
19EFIAPI
21 VOID
22 )
23{
24 return (gShellNetwork1FileName);
25}
26
39EFIAPI
41 IN EFI_HANDLE ImageHandle,
42 IN EFI_SYSTEM_TABLE *SystemTable
43 )
44{
45 gShellNetwork1HiiHandle = NULL;
46
47 //
48 // check our bit of the profiles mask
49 //
50 if ((PcdGet8 (PcdShellProfileMask) & BIT3) == 0) {
51 return (EFI_SUCCESS);
52 }
53
54 gShellNetwork1HiiHandle = HiiAddPackages (&gShellNetwork1HiiGuid, gImageHandle, UefiShellNetwork1CommandsLibStrings, NULL);
55 if (gShellNetwork1HiiHandle == NULL) {
56 return (EFI_DEVICE_ERROR);
57 }
58
59 //
60 // install our shell command handlers
61 //
62 ShellCommandRegisterCommandName (L"ping", ShellCommandRunPing, ShellCommandGetManFileNameNetwork1, 0, L"network1", TRUE, gShellNetwork1HiiHandle, STRING_TOKEN (STR_GET_HELP_PING));
63 ShellCommandRegisterCommandName (L"ifconfig", ShellCommandRunIfconfig, ShellCommandGetManFileNameNetwork1, 0, L"network1", TRUE, gShellNetwork1HiiHandle, STRING_TOKEN (STR_GET_HELP_IFCONFIG));
64
65 return (EFI_SUCCESS);
66}
67
75EFIAPI
77 IN EFI_HANDLE ImageHandle,
78 IN EFI_SYSTEM_TABLE *SystemTable
79 )
80{
81 if (gShellNetwork1HiiHandle != NULL) {
82 HiiRemovePackages (gShellNetwork1HiiHandle);
83 }
84
85 return (EFI_SUCCESS);
86}
EFI_HII_HANDLE EFIAPI HiiAddPackages(IN CONST EFI_GUID *PackageListGuid, IN EFI_HANDLE DeviceHandle OPTIONAL,...)
Definition: HiiLib.c:141
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
Definition: HiiLib.c:253
SHELL_STATUS EFIAPI ShellCommandRunIfconfig(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Ifconfig.c:1293
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define IN
Definition: Base.h:279
#define PcdGet8(TokenName)
Definition: PcdLib.h:336
SHELL_STATUS EFIAPI ShellCommandRunPing(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Ping.c:1581
RETURN_STATUS EFIAPI ShellCommandRegisterCommandName(IN CONST CHAR16 *CommandString, IN SHELL_RUN_COMMAND CommandHandler, IN SHELL_GET_MAN_FILENAME GetManFileName, IN UINT32 ShellMinSupportLevel, IN CONST CHAR16 *ProfileName, IN CONST BOOLEAN CanAffectLE, IN CONST EFI_HII_HANDLE HiiHandle, IN CONST EFI_STRING_ID ManFormatHelp)
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
#define STRING_TOKEN(t)
VOID * EFI_HII_HANDLE
CONST CHAR16 *EFIAPI ShellCommandGetManFileNameNetwork1(VOID)
EFI_STATUS EFIAPI ShellNetwork1CommandsLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI ShellNetwork1CommandsLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)