]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Sockets/GetServByPort/GetServByPort.c
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Sockets / GetServByPort / GetServByPort.c
diff --git a/AppPkg/Applications/Sockets/GetServByPort/GetServByPort.c b/AppPkg/Applications/Sockets/GetServByPort/GetServByPort.c
deleted file mode 100644 (file)
index 0923ac0..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file\r
-  Translate the port number into a service name\r
-\r
-  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-**/\r
-#include <errno.h>\r
-#include <netdb.h>\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <Uefi.h>\r
-#include <unistd.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiLib.h>\r
-\r
-#include <sys/socket.h>\r
-\r
-char mBuffer[65536];\r
-\r
-\r
-/** Translate the port number into a service name\r
-\r
-  @param[in]  Argc  The number of arguments\r
-  @param[in]  Argv  The argument value array\r
-\r
-  @retval  0        The application exited normally.\r
-  @retval  Other    An error occurred.\r
-**/\r
-int\r
-main (\r
-  IN int Argc,\r
-  IN char **Argv\r
-  )\r
-{\r
-  int PortNumber;\r
-  struct servent * pService;\r
-\r
-  //  Determine if the service name is specified\r
-  if (( 2 != Argc )\r
-    || ( 1 != sscanf ( Argv[1], "%d", &PortNumber ))) {\r
-    Print ( L"%a  <port number>\r\n", Argv[0]);\r
-  }\r
-  else {\r
-    //  Translate the port number\r
-    pService = getservbyport ( htons ( PortNumber ), NULL );\r
-    if ( NULL == pService ) {\r
-      Print ( L"ERROR - service not found, errno: %d\r\n", errno );\r
-    }\r
-    else {\r
-      Print ( L"%a: %d, %a\r\n",\r
-              pService->s_name,\r
-              PortNumber,\r
-              pService->s_proto );\r
-    }\r
-  }\r
-  //  All done\r
-  return errno;\r
-}\r