2 Main file for NULL named library for network1 shell command functions.
4 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved. <BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 #include "UefiShellNetwork1CommandsLib.h"
16 CONST CHAR16 gShellNetwork1FileName
[] = L
"ShellCommands";
17 EFI_HANDLE gShellNetwork1HiiHandle
= NULL
;
20 return the file name of the help text file if not using HII.
22 @return The string pointer to the file name.
26 ShellCommandGetManFileNameNetwork1 (
30 return (gShellNetwork1FileName
);
34 Constructor for the Shell Network1 Commands library.
36 Install the handlers for Network1 UEFI Shell 2.0 profile commands.
38 @param ImageHandle The image handle of the process.
39 @param SystemTable The EFI System Table pointer.
41 @retval EFI_SUCCESS The shell command handlers were installed sucessfully.
42 @retval EFI_UNSUPPORTED The shell level required was not found.
46 ShellNetwork1CommandsLibConstructor (
47 IN EFI_HANDLE ImageHandle
,
48 IN EFI_SYSTEM_TABLE
*SystemTable
51 gShellNetwork1HiiHandle
= NULL
;
54 // check our bit of the profiles mask
56 if ((PcdGet8(PcdShellProfileMask
) & BIT3
) == 0) {
60 gShellNetwork1HiiHandle
= HiiAddPackages (&gShellNetwork1HiiGuid
, gImageHandle
, UefiShellNetwork1CommandsLibStrings
, NULL
);
61 if (gShellNetwork1HiiHandle
== NULL
) {
62 return (EFI_DEVICE_ERROR
);
65 // install our shell command handlers
67 ShellCommandRegisterCommandName(L
"ping", ShellCommandRunPing
, ShellCommandGetManFileNameNetwork1
, 0, L
"network1", TRUE
, gShellNetwork1HiiHandle
, STRING_TOKEN(STR_GET_HELP_PING
));
68 ShellCommandRegisterCommandName(L
"ifconfig",ShellCommandRunIfconfig
, ShellCommandGetManFileNameNetwork1
, 0, L
"network1", TRUE
, gShellNetwork1HiiHandle
, STRING_TOKEN(STR_GET_HELP_IFCONFIG
));
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 ShellNetwork1CommandsLibDestructor (
82 IN EFI_HANDLE ImageHandle
,
83 IN EFI_SYSTEM_TABLE
*SystemTable
86 if (gShellNetwork1HiiHandle
!= NULL
) {
87 HiiRemovePackages(gShellNetwork1HiiHandle
);