TftpApp.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /** @file
  2. Entrypoint of "tftp" shell standalone application.
  3. Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>
  4. Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #include "Tftp.h"
  8. //
  9. // String token ID of help message text.
  10. // Shell supports to find help message in the resource section of an application image if
  11. // .MAN file is not found. This global variable is added to make build tool recognizes
  12. // that the help string is consumed by user and then build tool will add the string into
  13. // the resource section. Thus the application can use '-?' option to show help message in
  14. // Shell.
  15. //
  16. GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_TFTP);
  17. /**
  18. Entry point of Tftp standalone application.
  19. @param ImageHandle The image handle of the process.
  20. @param SystemTable The EFI System Table pointer.
  21. @retval EFI_SUCCESS Tftp command is executed successfully.
  22. @retval EFI_ABORTED HII package was failed to initialize.
  23. @retval others Other errors when executing tftp command.
  24. **/
  25. EFI_STATUS
  26. EFIAPI
  27. TftpAppInitialize (
  28. IN EFI_HANDLE ImageHandle,
  29. IN EFI_SYSTEM_TABLE *SystemTable
  30. )
  31. {
  32. EFI_STATUS Status;
  33. mTftpHiiHandle = InitializeHiiPackage (ImageHandle);
  34. if (mTftpHiiHandle == NULL) {
  35. return EFI_ABORTED;
  36. }
  37. Status = (EFI_STATUS)RunTftp (ImageHandle, SystemTable);
  38. HiiRemovePackages (mTftpHiiHandle);
  39. return Status;
  40. }