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
;
18 STATIC CONST EFI_GUID gShellNetwork1HiiGuid
= \
20 0xf3d301bb, 0xf4a5, 0x45a8, { 0xb0, 0xb7, 0xfa, 0x99, 0x9c, 0x62, 0x37, 0xae } \
24 return the file name of the help text file if not using HII.
26 @return The string pointer to the file name.
30 ShellCommandGetManFileNameNetwork1 (
34 return (gShellNetwork1FileName
);
38 Constructor for the Shell Network1 Commands library.
40 Install the handlers for Network1 UEFI Shell 2.0 profile commands.
42 @param ImageHandle The image handle of the process.
43 @param SystemTable The EFI System Table pointer.
45 @retval EFI_SUCCESS The shell command handlers were installed sucessfully.
46 @retval EFI_UNSUPPORTED The shell level required was not found.
50 ShellNetwork1CommandsLibConstructor (
51 IN EFI_HANDLE ImageHandle
,
52 IN EFI_SYSTEM_TABLE
*SystemTable
55 gShellNetwork1HiiHandle
= NULL
;
58 // check our bit of the profiles mask
60 if ((PcdGet8(PcdShellProfileMask
) & BIT3
) == 0) {
64 gShellNetwork1HiiHandle
= HiiAddPackages (&gShellNetwork1HiiGuid
, gImageHandle
, UefiShellNetwork1CommandsLibStrings
, NULL
);
65 if (gShellNetwork1HiiHandle
== NULL
) {
66 return (EFI_DEVICE_ERROR
);
69 // install our shell command handlers
71 ShellCommandRegisterCommandName(L
"ping", ShellCommandRunPing
, ShellCommandGetManFileNameNetwork1
, 0, L
"network1", TRUE
, gShellNetwork1HiiHandle
, STRING_TOKEN(STR_GET_HELP_PING
));
72 ShellCommandRegisterCommandName(L
"ifconfig",ShellCommandRunIfconfig
, ShellCommandGetManFileNameNetwork1
, 0, L
"network1", TRUE
, gShellNetwork1HiiHandle
, STRING_TOKEN(STR_GET_HELP_IFCONFIG
));
78 Destructor for the library. free any resources.
80 @param ImageHandle The image handle of the process.
81 @param SystemTable The EFI System Table pointer.
85 ShellNetwork1CommandsLibDestructor (
86 IN EFI_HANDLE ImageHandle
,
87 IN EFI_SYSTEM_TABLE
*SystemTable
90 if (gShellNetwork1HiiHandle
!= NULL
) {
91 HiiRemovePackages(gShellNetwork1HiiHandle
);