2 Main file for NULL named library for network2 shell command functions.
4 Copyright (c) 2016, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
8 #include "UefiShellNetwork2CommandsLib.h"
10 CONST CHAR16 gShellNetwork2FileName
[] = L
"ShellCommands";
11 EFI_HII_HANDLE gShellNetwork2HiiHandle
= NULL
;
14 return the file name of the help text file if not using HII.
16 @return The string pointer to the file name.
20 ShellCommandGetManFileNameNetwork2 (
24 return (gShellNetwork2FileName
);
28 Constructor for the Shell Network2 Commands library.
30 Install the handlers for Network2 UEFI Shell 2.0 profile commands.
32 @param ImageHandle The image handle of the process.
33 @param SystemTable The EFI System Table pointer.
35 @retval EFI_SUCCESS The shell command handlers were installed sucessfully.
36 @retval EFI_UNSUPPORTED The shell level required was not found.
40 ShellNetwork2CommandsLibConstructor (
41 IN EFI_HANDLE ImageHandle
,
42 IN EFI_SYSTEM_TABLE
*SystemTable
45 gShellNetwork2HiiHandle
= NULL
;
48 // check our bit of the profiles mask
50 if ((PcdGet8 (PcdShellProfileMask
) & BIT4
) == 0) {
54 gShellNetwork2HiiHandle
= HiiAddPackages (&gShellNetwork2HiiGuid
, gImageHandle
, UefiShellNetwork2CommandsLibStrings
, NULL
);
55 if (gShellNetwork2HiiHandle
== NULL
) {
56 return (EFI_DEVICE_ERROR
);
60 // install our shell command handlers
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
));
69 Destructor for the library. free any resources.
71 @param ImageHandle The image handle of the process.
72 @param SystemTable The EFI System Table pointer.
76 ShellNetwork2CommandsLibDestructor (
77 IN EFI_HANDLE ImageHandle
,
78 IN EFI_SYSTEM_TABLE
*SystemTable
81 if (gShellNetwork2HiiHandle
!= NULL
) {
82 HiiRemovePackages (gShellNetwork2HiiHandle
);