2 Main file for NULL named library for network2 shell command functions.
4 Copyright (c) 2016, Intel Corporation. All rights reserved. <BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License which accompanies this distribution.
7 The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #include "UefiShellNetwork2CommandsLib.h"
15 CONST CHAR16 gShellNetwork2FileName
[] = L
"ShellCommands";
16 EFI_HANDLE gShellNetwork2HiiHandle
= NULL
;
19 return the file name of the help text file if not using HII.
21 @return The string pointer to the file name.
25 ShellCommandGetManFileNameNetwork2 (
29 return (gShellNetwork2FileName
);
33 Constructor for the Shell Network2 Commands library.
35 Install the handlers for Network2 UEFI Shell 2.0 profile commands.
37 @param ImageHandle The image handle of the process.
38 @param SystemTable The EFI System Table pointer.
40 @retval EFI_SUCCESS The shell command handlers were installed sucessfully.
41 @retval EFI_UNSUPPORTED The shell level required was not found.
45 ShellNetwork2CommandsLibConstructor (
46 IN EFI_HANDLE ImageHandle
,
47 IN EFI_SYSTEM_TABLE
*SystemTable
50 gShellNetwork2HiiHandle
= NULL
;
53 // check our bit of the profiles mask
55 if ((PcdGet8(PcdShellProfileMask
) & BIT4
) == 0) {
59 gShellNetwork2HiiHandle
= HiiAddPackages (&gShellNetwork2HiiGuid
, gImageHandle
, UefiShellNetwork2CommandsLibStrings
, NULL
);
60 if (gShellNetwork2HiiHandle
== NULL
) {
61 return (EFI_DEVICE_ERROR
);
64 // install our shell command handlers
66 ShellCommandRegisterCommandName(L
"ping6", ShellCommandRunPing6
, ShellCommandGetManFileNameNetwork2
, 0, L
"network2", TRUE
, gShellNetwork2HiiHandle
, STRING_TOKEN(STR_GET_HELP_PING6
));
67 ShellCommandRegisterCommandName(L
"ifconfig6",ShellCommandRunIfconfig6
, ShellCommandGetManFileNameNetwork2
, 0, L
"network2", TRUE
, gShellNetwork2HiiHandle
, STRING_TOKEN(STR_GET_HELP_IFCONFIG6
));
74 Destructor for the library. free any resources.
76 @param ImageHandle The image handle of the process.
77 @param SystemTable The EFI System Table pointer.
81 ShellNetwork2CommandsLibDestructor (
82 IN EFI_HANDLE ImageHandle
,
83 IN EFI_SYSTEM_TABLE
*SystemTable
86 if (gShellNetwork2HiiHandle
!= NULL
) {
87 HiiRemovePackages(gShellNetwork2HiiHandle
);