2 Main file for NULL named library for 'tftp' Shell command functions.
4 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved. <BR>
5 Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "UefiShellTftpCommandLib.h"
18 CONST CHAR16 gShellTftpFileName
[] = L
"ShellCommand";
19 EFI_HANDLE gShellTftpHiiHandle
= NULL
;
22 Return the file name of the help text file if not using HII.
24 @return The string pointer to the file name.
28 ShellCommandGetManFileNameTftp (
32 return gShellTftpFileName
;
36 Constructor for the Shell Tftp Command library.
38 Install the handlers for Tftp UEFI Shell command.
40 @param ImageHandle The image handle of the process.
41 @param SystemTable The EFI System Table pointer.
43 @retval EFI_SUCCESS The Shell command handlers were installed sucessfully.
44 @retval EFI_UNSUPPORTED The Shell level required was not found.
48 ShellTftpCommandLibConstructor (
49 IN EFI_HANDLE ImageHandle
,
50 IN EFI_SYSTEM_TABLE
*SystemTable
53 gShellTftpHiiHandle
= NULL
;
56 // check our bit of the profiles mask
58 if ((PcdGet8 (PcdShellProfileMask
) & BIT3
) == 0) {
62 gShellTftpHiiHandle
= HiiAddPackages (
63 &gShellTftpHiiGuid
, gImageHandle
,
64 UefiShellTftpCommandLibStrings
, NULL
66 if (gShellTftpHiiHandle
== NULL
) {
67 return EFI_DEVICE_ERROR
;
70 // Install our Shell command handler
72 ShellCommandRegisterCommandName (
73 L
"tftp", ShellCommandRunTftp
, ShellCommandGetManFileNameTftp
, 0,
74 L
"tftp", TRUE
, gShellTftpHiiHandle
, STRING_TOKEN (STR_GET_HELP_TFTP
)
81 Destructor for the library. free any resources.
83 @param ImageHandle The image handle of the process.
84 @param SystemTable The EFI System Table pointer.
88 ShellTftpCommandLibDestructor (
89 IN EFI_HANDLE ImageHandle
,
90 IN EFI_SYSTEM_TABLE
*SystemTable
93 if (gShellTftpHiiHandle
!= NULL
) {
94 HiiRemovePackages (gShellTftpHiiHandle
);