]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Sockets/GetNetByName/GetNetByName.c
BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / AppPkg / Applications / Sockets / GetNetByName / GetNetByName.c
index be81b3483d26612fdfb3f6ca34689fd21712f77d..7ce741c08cc564c9707c361627bef32e0f139e35 100644 (file)
@@ -1,17 +1,15 @@
 /** @file\r
   Translate the network name into an IP address\r
 \r
-  Copyright (c) 2011, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
+  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php.\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
 **/\r
-\r
 #include <errno.h>\r
 #include <netdb.h>\r
 #include <string.h>\r
 char mBuffer[65536];\r
 \r
 \r
-/**\r
-  Translate the network name into an IP address\r
+/** Translate the network name into an IP address\r
 \r
-  @param [in] Argc  The number of arguments\r
-  @param [in] Argv  The argument value array\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
@@ -41,7 +38,6 @@ main (
   IN char **Argv\r
   )\r
 {\r
-  int AppStatus;\r
   UINT8 * pIpAddress;\r
   struct netent * pNetwork;\r
 \r
@@ -49,23 +45,18 @@ main (
             "%a starting\r\n",\r
             Argv[0]));\r
 \r
-  //\r
   //  Determine if the network name is specified\r
-  //\r
-  AppStatus = 0;\r
   if ( 1 == Argc ) {\r
     Print ( L"%a  <network name>\r\n", Argv[0]);\r
   }\r
   else {\r
-    //\r
     //  Translate the net name\r
-    //\r
     pNetwork = getnetbyname ( Argv[1]);\r
     if ( NULL == pNetwork ) {\r
       Print ( L"ERROR - network not found, errno: %d\r\n", errno );\r
     }\r
     else {\r
-      pIpAddress = (UINT8 *)pNetwork->n_net;\r
+      pIpAddress = (UINT8 *)(UINTN)&pNetwork->n_net;\r
       Print ( L"%a: Type %d, %d.%d.%d.%d\r\n",\r
               pNetwork->n_name,\r
               pNetwork->n_addrtype,\r
@@ -75,9 +66,6 @@ main (
               pIpAddress[3]);\r
     }\r
   }\r
-\r
-  //\r
   //  All done\r
-  //\r
   return errno;\r
 }\r