+++ /dev/null
-/** @file\r
- Translate the host name into an IP address\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 <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
-struct hostent * _gethostbydnsname (const char *, int);\r
-\r
-char mBuffer[65536];\r
-\r
-\r
-/** Translate the host name into an IP address\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
- UINT8 * pIpAddress;\r
- struct hostent * pHost;\r
-\r
- DEBUG (( DEBUG_INFO,\r
- "%a starting\r\n",\r
- Argv[0]));\r
-\r
- // Determine if the host name is specified\r
- if ( 1 == Argc ) {\r
- Print ( L"%a <host name>\r\n", Argv[0]);\r
- }\r
- else {\r
- // Translate the host name\r
- pHost = _gethostbydnsname ( Argv[1], AF_INET );\r
- if ( NULL == pHost ) {\r
- Print ( L"ERROR - host not found, h_errno: %d\r\n", h_errno );\r
- }\r
- else {\r
- pIpAddress = (UINT8 *)pHost->h_addr;\r
- Print ( L"%a: Type %d, %d.%d.%d.%d\r\n",\r
- pHost->h_name,\r
- pHost->h_addrtype,\r
- pIpAddress[0],\r
- pIpAddress[1],\r
- pIpAddress[2],\r
- pIpAddress[3]);\r
- }\r
- }\r
- // All done\r
- return errno;\r
-}\r