\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
@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
\r
TmpIpDevicePath = NULL;\r
TmpDnsDevicePath = NULL;\r
- \r
+\r
//\r
// Update the IP node with DHCP assigned information.\r
//\r
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
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
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
FreePool (Private->Ip4Nic->DevicePath);\r
Private->Ip4Nic->DevicePath = NewDevicePath;\r
} else {\r
FreePool (Private->Ip6Nic->DevicePath);\r
Private->Ip6Nic->DevicePath = NewDevicePath;\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
ASSERT (SelectIndex < HTTP_BOOT_OFFER_MAX_NUM);\r
\r
DnsServerIndex = 0;\r
- \r
+\r
Status = EFI_SUCCESS;\r
\r
//\r
//\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
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
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
if (EFI_ERROR (Status) || Private->Port == 0) {\r
Private->Port = 80;\r
}\r
- \r
+\r
//\r
// All boot informations are valid here.\r
//\r
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
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
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
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
if (EFI_ERROR (Status) || Private->Port == 0) {\r
Private->Port = 80;\r
}\r
- \r
+\r
//\r
// All boot informations are valid here.\r
//\r
if (EFI_ERROR (Status)) {\r
goto Error;\r
}\r
- \r
+\r
return Status;\r
\r
Error:\r
FreePool (Private->DnsServerIp);\r
Private->DnsServerIp = NULL;\r
}\r
- \r
+\r
return Status;\r
}\r
\r
)\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
@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
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
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
\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
\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
CHAR16 *Url;\r
BOOLEAN IdentityMode;\r
UINTN ReceivedSize;\r
- \r
+\r
ASSERT (Private != NULL);\r
ASSERT (Private->HttpCreated);\r
\r
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
}\r
\r
return Status;\r
- \r
+\r
ERROR_6:\r
if (Parser != NULL) {\r
HttpFreeMsgParser (Parser);\r
FreePool (Context.Block);\r
}\r
HttpBootFreeCache (Cache);\r
- \r
+\r
ERROR_5:\r
if (ResponseData != NULL) {\r
FreePool (ResponseData);\r