]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpDns.c
BaseTools: Add HOST_APPLICATION module type.
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpDns.c
index 59cd7b325189b4c777812c38426a4c87d38e1a85..5f092c00e300837098393d5230b1331252bf82b4 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   Routines for HttpDxe driver to perform DNS resolution based on UEFI DNS protocols.\r
 \r
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
-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
-\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
+Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -25,13 +19,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   @retval EFI_OUT_OF_RESOURCES    Failed to allocate needed resources.\r
   @retval EFI_DEVICE_ERROR        An unexpected network error occurred.\r
   @retval Others                  Other errors as indicated.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 HttpDns4 (\r
   IN     HTTP_PROTOCOL            *HttpInstance,\r
   IN     CHAR16                   *HostName,\r
-     OUT EFI_IPv4_ADDRESS         *IpAddress                \r
+     OUT EFI_IPv4_ADDRESS         *IpAddress\r
   )\r
 {\r
   EFI_STATUS                      Status;\r
@@ -45,7 +39,7 @@ HttpDns4 (
   UINTN                           DnsServerListCount;\r
   EFI_IPv4_ADDRESS                *DnsServerList;\r
   UINTN                           DataSize;\r
-  \r
+\r
 \r
   Service = HttpInstance->Service;\r
   ASSERT (Service != NULL);\r
@@ -82,7 +76,7 @@ HttpDns4 (
 \r
   Dns4Handle = NULL;\r
   Dns4       = NULL;\r
-  \r
+\r
   //\r
   // Create a DNS child instance and get the protocol.\r
   //\r
@@ -94,7 +88,7 @@ HttpDns4 (
              );\r
   if (EFI_ERROR (Status)) {\r
     goto Exit;\r
-  }  \r
+  }\r
 \r
   Status = gBS->OpenProtocol (\r
                   Dns4Handle,\r
@@ -128,7 +122,7 @@ HttpDns4 (
   if (EFI_ERROR (Status)) {\r
     goto Exit;\r
   }\r
-  \r
+\r
   //\r
   // Create event to set the is done flag when name resolution is finished.\r
   //\r
@@ -161,7 +155,7 @@ HttpDns4 (
   //\r
   // Name resolution is done, check result.\r
   //\r
-  Status = Token.Status;  \r
+  Status = Token.Status;\r
   if (!EFI_ERROR (Status)) {\r
     if (Token.RspData.H2AData == NULL) {\r
       Status = EFI_DEVICE_ERROR;\r
@@ -179,7 +173,7 @@ HttpDns4 (
   }\r
 \r
 Exit:\r
-  \r
+\r
   if (Token.Event != NULL) {\r
     gBS->CloseEvent (Token.Event);\r
   }\r
@@ -192,7 +186,7 @@ Exit:
 \r
   if (Dns4 != NULL) {\r
     Dns4->Configure (Dns4, NULL);\r
-    \r
+\r
     gBS->CloseProtocol (\r
            Dns4Handle,\r
            &gEfiDns4ProtocolGuid,\r
@@ -213,7 +207,7 @@ Exit:
   if (DnsServerList != NULL) {\r
     FreePool (DnsServerList);\r
   }\r
-  \r
+\r
   return Status;\r
 }\r
 \r
@@ -228,13 +222,13 @@ Exit:
   @retval EFI_OUT_OF_RESOURCES    Failed to allocate needed resources.\r
   @retval EFI_DEVICE_ERROR        An unexpected network error occurred.\r
   @retval Others                  Other errors as indicated.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 HttpDns6 (\r
   IN     HTTP_PROTOCOL            *HttpInstance,\r
   IN     CHAR16                   *HostName,\r
-     OUT EFI_IPv6_ADDRESS         *IpAddress                \r
+     OUT EFI_IPv6_ADDRESS         *IpAddress\r
   )\r
 {\r
   EFI_STATUS                      Status;\r
@@ -248,7 +242,7 @@ HttpDns6 (
   UINTN                           DnsServerListCount;\r
   UINTN                           DataSize;\r
   BOOLEAN                         IsDone;\r
-  \r
+\r
 \r
   Service = HttpInstance->Service;\r
   ASSERT (Service != NULL);\r
@@ -258,7 +252,7 @@ HttpDns6 (
   Dns6                = NULL;\r
   Dns6Handle          = NULL;\r
   ZeroMem (&Token, sizeof (EFI_DNS6_COMPLETION_TOKEN));\r
-  \r
+\r
   //\r
   // Get DNS server list from EFI IPv6 Configuration protocol.\r
   //\r
@@ -273,7 +267,7 @@ HttpDns6 (
       DnsServerList = AllocatePool (DataSize);\r
       if (DnsServerList == NULL) {\r
         return EFI_OUT_OF_RESOURCES;\r
-      }  \r
+      }\r
 \r
       Status = Ip6Config->GetData (Ip6Config, Ip6ConfigDataTypeDnsServer, &DataSize, DnsServerList);\r
       if (EFI_ERROR (Status)) {\r
@@ -296,8 +290,8 @@ HttpDns6 (
              );\r
   if (EFI_ERROR (Status)) {\r
     goto Exit;\r
-  } \r
-  \r
+  }\r
+\r
   Status = gBS->OpenProtocol (\r
                   Dns6Handle,\r
                   &gEfiDns6ProtocolGuid,\r
@@ -358,7 +352,7 @@ HttpDns6 (
   //\r
   // Name resolution is done, check result.\r
   //\r
-  Status = Token.Status;  \r
+  Status = Token.Status;\r
   if (!EFI_ERROR (Status)) {\r
     if (Token.RspData.H2AData == NULL) {\r
       Status = EFI_DEVICE_ERROR;\r
@@ -374,7 +368,7 @@ HttpDns6 (
     IP6_COPY_ADDRESS (IpAddress, Token.RspData.H2AData->IpList);\r
     Status = EFI_SUCCESS;\r
   }\r
-  \r
+\r
 Exit:\r
 \r
   if (Token.Event != NULL) {\r
@@ -389,7 +383,7 @@ Exit:
 \r
   if (Dns6 != NULL) {\r
     Dns6->Configure (Dns6, NULL);\r
-    \r
+\r
     gBS->CloseProtocol (\r
            Dns6Handle,\r
            &gEfiDns6ProtocolGuid,\r
@@ -410,6 +404,6 @@ Exit:
   if (DnsServerList != NULL) {\r
     FreePool (DnsServerList);\r
   }\r
-  \r
-  return Status;  \r
+\r
+  return Status;\r
 }\r