TianoCore EDK2 master
Loading...
Searching...
No Matches
UefiShellNetwork2CommandsLib.c
Go to the documentation of this file.
1
9
10CONST CHAR16 gShellNetwork2FileName[] = L"ShellCommands";
11EFI_HII_HANDLE gShellNetwork2HiiHandle = NULL;
12
18CONST CHAR16 *
19EFIAPI
21 VOID
22 )
23{
24 return (gShellNetwork2FileName);
25}
26
39EFIAPI
41 IN EFI_HANDLE ImageHandle,
42 IN EFI_SYSTEM_TABLE *SystemTable
43 )
44{
45 gShellNetwork2HiiHandle = NULL;
46
47 //
48 // check our bit of the profiles mask
49 //
50 if ((PcdGet8 (PcdShellProfileMask) & BIT4) == 0) {
51 return (EFI_SUCCESS);
52 }
53
54 gShellNetwork2HiiHandle = HiiAddPackages (&gShellNetwork2HiiGuid, gImageHandle, UefiShellNetwork2CommandsLibStrings, NULL);
55 if (gShellNetwork2HiiHandle == NULL) {
56 return (EFI_DEVICE_ERROR);
57 }
58
59 //
60 // install our shell command handlers
61 //
62 ShellCommandRegisterCommandName (L"ping6", ShellCommandRunPing6, ShellCommandGetManFileNameNetwork2, 0, L"network2", TRUE, gShellNetwork2HiiHandle, STRING_TOKEN (STR_GET_HELP_PING6));
63 ShellCommandRegisterCommandName (L"ifconfig6", ShellCommandRunIfconfig6, ShellCommandGetManFileNameNetwork2, 0, L"network2", TRUE, gShellNetwork2HiiHandle, STRING_TOKEN (STR_GET_HELP_IFCONFIG6));
64
65 return EFI_SUCCESS;
66}
67
75EFIAPI
77 IN EFI_HANDLE ImageHandle,
78 IN EFI_SYSTEM_TABLE *SystemTable
79 )
80{
81 if (gShellNetwork2HiiHandle != NULL) {
82 HiiRemovePackages (gShellNetwork2HiiHandle);
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 ShellCommandRunIfconfig6(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Ifconfig6.c:1774
#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 ShellCommandRunPing6(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Ping6.c:1257
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 ShellCommandGetManFileNameNetwork2(VOID)
EFI_STATUS EFIAPI ShellNetwork2CommandsLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI ShellNetwork2CommandsLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)