]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootClient.c
NetworkPkg: Clean up source files
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootClient.c
index 1d1e47008da23ee1fb8c9ba2037c1ed3b407c9f0..90a6acb0d4ed4203e154c04289e1e9635c0d0fe8 100644 (file)
@@ -3,12 +3,12 @@
 \r
 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
+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
+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
@@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   @retval EFI_SUCCESS              Device patch successfully updated.\r
   @retval EFI_OUT_OF_RESOURCES     Could not allocate needed resources.\r
   @retval Others                   Unexpected error happened.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 HttpBootUpdateDevicePath (\r
@@ -39,7 +39,7 @@ HttpBootUpdateDevicePath (
 \r
   TmpIpDevicePath  = NULL;\r
   TmpDnsDevicePath = NULL;\r
-  \r
+\r
   //\r
   // Update the IP node with DHCP assigned information.\r
   //\r
@@ -67,13 +67,13 @@ HttpBootUpdateDevicePath (
     SetDevicePathNodeLength (Node, sizeof (IPv6_DEVICE_PATH));\r
     Node->Ipv6.PrefixLength    = IP6_PREFIX_LENGTH;\r
     Node->Ipv6.RemotePort      = Private->Port;\r
-    Node->Ipv6.Protocol        = EFI_IP_PROTO_TCP; \r
+    Node->Ipv6.Protocol        = EFI_IP_PROTO_TCP;\r
     Node->Ipv6.IpAddressOrigin = 0;\r
     CopyMem (&Node->Ipv6.LocalIpAddress, &Private->StationIp.v6, sizeof (EFI_IPv6_ADDRESS));\r
     CopyMem (&Node->Ipv6.RemoteIpAddress, &Private->ServerIp.v6, sizeof (EFI_IPv6_ADDRESS));\r
     CopyMem (&Node->Ipv6.GatewayIpAddress, &Private->GatewayIp.v6, sizeof (EFI_IPv6_ADDRESS));\r
   }\r
-  \r
+\r
   TmpIpDevicePath = AppendDevicePathNode (Private->ParentDevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);\r
   FreePool (Node);\r
   if (TmpIpDevicePath == NULL) {\r
@@ -95,7 +95,7 @@ HttpBootUpdateDevicePath (
     SetDevicePathNodeLength (Node, Length);\r
     Node->Dns.IsIPv6 = Private->UsingIpv6 ? 0x01 : 0x00;\r
     CopyMem ((UINT8*) Node + sizeof (EFI_DEVICE_PATH_PROTOCOL) + sizeof (Node->Dns.IsIPv6), Private->DnsServerIp, Private->DnsServerCount * sizeof (EFI_IP_ADDRESS));\r
-    \r
+\r
     TmpDnsDevicePath = AppendDevicePathNode (TmpIpDevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);\r
     FreePool (Node);\r
     FreePool (TmpIpDevicePath);\r
@@ -150,7 +150,7 @@ HttpBootUpdateDevicePath (
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
-    \r
+\r
     FreePool (Private->Ip4Nic->DevicePath);\r
     Private->Ip4Nic->DevicePath = NewDevicePath;\r
   } else {\r
@@ -169,7 +169,7 @@ HttpBootUpdateDevicePath (
     FreePool (Private->Ip6Nic->DevicePath);\r
     Private->Ip6Nic->DevicePath = NewDevicePath;\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -201,7 +201,7 @@ HttpBootDhcp4ExtractUriInfo (
   ASSERT (SelectIndex < HTTP_BOOT_OFFER_MAX_NUM);\r
 \r
   DnsServerIndex = 0;\r
-  \r
+\r
   Status = EFI_SUCCESS;\r
 \r
   //\r
@@ -213,7 +213,7 @@ HttpBootDhcp4ExtractUriInfo (
     //\r
     // In Corporate environment, we need a HttpOffer.\r
     //\r
-    if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) || \r
+    if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) ||\r
         (SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns) ||\r
         (SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns)) {\r
       HttpOffer = SelectOffer;\r
@@ -246,7 +246,7 @@ HttpBootDhcp4ExtractUriInfo (
     return Status;\r
   }\r
 \r
-  if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) || \r
+  if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||\r
       (SelectOffer->OfferType == HttpOfferTypeDhcpDns) ||\r
       (SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns)) {\r
     Option = SelectOffer->OptList[HTTP_BOOT_DHCP4_TAG_INDEX_DNS_SERVER];\r
@@ -265,10 +265,10 @@ HttpBootDhcp4ExtractUriInfo (
     for (DnsServerIndex = 0; DnsServerIndex < Private->DnsServerCount; DnsServerIndex++) {\r
       CopyMem (&(Private->DnsServerIp[DnsServerIndex].v4), &(((EFI_IPv4_ADDRESS *) Option->Data)[DnsServerIndex]), sizeof (EFI_IPv4_ADDRESS));\r
     }\r
-    \r
+\r
     //\r
     // Configure the default DNS server if server assigned.\r
-    //    \r
+    //\r
     Status = HttpBootRegisterIp4Dns (\r
                Private,\r
                Option->Length,\r
@@ -292,7 +292,7 @@ HttpBootDhcp4ExtractUriInfo (
   if (EFI_ERROR (Status) || Private->Port == 0) {\r
     Private->Port = 80;\r
   }\r
-  \r
+\r
   //\r
   // All boot informations are valid here.\r
   //\r
@@ -402,7 +402,7 @@ HttpBootDhcp6ExtractUriInfo (
     return Status;\r
   }\r
 \r
-  if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) || \r
+  if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||\r
       (SelectOffer->OfferType == HttpOfferTypeDhcpDns) ||\r
       (SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns)) {\r
     Option = SelectOffer->OptList[HTTP_BOOT_DHCP6_IDX_DNS_SERVER];\r
@@ -434,9 +434,9 @@ HttpBootDhcp6ExtractUriInfo (
       goto Error;\r
     }\r
   }\r
-  \r
+\r
   //\r
-  // Extract the HTTP server Ip from URL. This is used to Check route table \r
+  // Extract the HTTP server Ip from URL. This is used to Check route table\r
   // whether can send message to HTTP Server Ip through the GateWay.\r
   //\r
   Status = HttpUrlGetIp6 (\r
@@ -444,7 +444,7 @@ HttpBootDhcp6ExtractUriInfo (
              Private->BootFileUriParser,\r
              &IpAddr\r
              );\r
-  \r
+\r
   if (EFI_ERROR (Status)) {\r
     //\r
     // The Http server address is expressed by Name Ip, so perform DNS resolution\r
@@ -464,23 +464,23 @@ HttpBootDhcp6ExtractUriInfo (
       Status = EFI_OUT_OF_RESOURCES;\r
       goto Error;\r
     }\r
-    \r
+\r
     AsciiStrToUnicodeStrS (HostName, HostNameStr, HostNameSize);\r
 \r
     if (HostName != NULL) {\r
       FreePool (HostName);\r
     }\r
-    \r
+\r
     Status = HttpBootDns (Private, HostNameStr, &IpAddr);\r
     FreePool (HostNameStr);\r
     if (EFI_ERROR (Status)) {\r
       AsciiPrint ("\n  Error: Could not retrieve the host address from DNS server.\n");\r
       goto Error;\r
-    }  \r
-  } \r
-  \r
+    }\r
+  }\r
+\r
   CopyMem (&Private->ServerIp.v6, &IpAddr, sizeof (EFI_IPv6_ADDRESS));\r
-  \r
+\r
   //\r
   // Extract the port from URL, and use default HTTP port 80 if not provided.\r
   //\r
@@ -492,7 +492,7 @@ HttpBootDhcp6ExtractUriInfo (
   if (EFI_ERROR (Status) || Private->Port == 0) {\r
     Private->Port = 80;\r
   }\r
-  \r
+\r
   //\r
   // All boot informations are valid here.\r
   //\r
@@ -504,7 +504,7 @@ HttpBootDhcp6ExtractUriInfo (
   if (EFI_ERROR (Status)) {\r
     goto Error;\r
   }\r
-  \r
+\r
   return Status;\r
 \r
 Error:\r
@@ -512,7 +512,7 @@ Error:
     FreePool (Private->DnsServerIp);\r
     Private->DnsServerIp = NULL;\r
   }\r
-  \r
+\r
   return Status;\r
 }\r
 \r
@@ -532,7 +532,7 @@ HttpBootDiscoverBootInfo (
   )\r
 {\r
   EFI_STATUS              Status;\r
-  \r
+\r
   //\r
   // Start D.O.R.A/S.A.R.R exchange to acquire station ip address and\r
   // other Http boot information.\r
@@ -557,7 +557,7 @@ HttpBootDiscoverBootInfo (
   @param[in]    EventType      Indicate the Event type that occurs in the current callback.\r
   @param[in]    Message        HTTP message which will be send to, or just received from HTTP server.\r
   @param[in]    Context        The Callback Context pointer.\r
-  \r
+\r
   @retval EFI_SUCCESS          Tells the HttpIo to continue the HTTP process.\r
   @retval Others               Tells the HttpIo to abort the current HTTP process.\r
 **/\r
@@ -706,7 +706,7 @@ HttpBootFreeCacheList (
   LIST_ENTRY                  *Entry;\r
   LIST_ENTRY                  *NextEntry;\r
   HTTP_BOOT_CACHE_CONTENT     *Cache;\r
-  \r
+\r
   NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->CacheList) {\r
     Cache = NET_LIST_USER_STRUCT (Entry, HTTP_BOOT_CACHE_CONTENT, Link);\r
     RemoveEntryList (&Cache->Link);\r
@@ -746,7 +746,7 @@ HttpBootGetFileFromCache (
   HTTP_BOOT_CACHE_CONTENT     *Cache;\r
   HTTP_BOOT_ENTITY_DATA       *EntityData;\r
   UINTN                       CopyedSize;\r
-  \r
+\r
   if (Uri == NULL || BufferSize == NULL || Buffer == NULL || ImageType == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -808,7 +808,7 @@ HttpBootGetFileFromCache (
 \r
   @retval EFI_SUCCESS              Continue to parser the message body.\r
   @retval Others                   Abort the parse.\r
\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -878,7 +878,7 @@ HttpBootGetBootFileCallback (
 \r
 /**\r
   This function download the boot file by using UEFI HTTP protocol.\r
-  \r
+\r
   @param[in]       Private         The pointer to the driver's private data.\r
   @param[in]       HeaderOnly      Only request the response header, it could save a lot of time if\r
                                    the caller only want to know the size of the requested file.\r
@@ -926,7 +926,7 @@ HttpBootGetBootFile (
   CHAR16                     *Url;\r
   BOOLEAN                    IdentityMode;\r
   UINTN                      ReceivedSize;\r
-  \r
+\r
   ASSERT (Private != NULL);\r
   ASSERT (Private->HttpCreated);\r
 \r
@@ -1116,7 +1116,7 @@ HttpBootGetBootFile (
     Cache->ResponseData = ResponseData;\r
     Cache->ImageType = *ImageType;\r
   }\r
-  \r
+\r
   //\r
   // 3.3 Init a message-body parser from the header information.\r
   //\r
@@ -1278,7 +1278,7 @@ HttpBootGetBootFile (
   }\r
 \r
   return Status;\r
-  \r
+\r
 ERROR_6:\r
   if (Parser != NULL) {\r
     HttpFreeMsgParser (Parser);\r
@@ -1287,7 +1287,7 @@ ERROR_6:
     FreePool (Context.Block);\r
   }\r
   HttpBootFreeCache (Cache);\r
-  \r
+\r
 ERROR_5:\r
   if (ResponseData != NULL) {\r
     FreePool (ResponseData);\r