// HttpOffer contains the boot file URL.\r
//\r
SelectOffer = &Private->OfferBuffer[SelectIndex].Dhcp4;\r
- if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) || (SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns)) {\r
- HttpOffer = SelectOffer;\r
+ if (Private->FilePathUri == NULL) {\r
+ //\r
+ // In Corporate environment, we need a HttpOffer.\r
+ //\r
+ if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) || \r
+ (SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns) ||\r
+ (SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns)) {\r
+ HttpOffer = SelectOffer;\r
+ } else {\r
+ ASSERT (Private->SelectProxyType != HttpOfferTypeMax);\r
+ ProxyIndex = Private->OfferIndex[Private->SelectProxyType][0];\r
+ HttpOffer = &Private->OfferBuffer[ProxyIndex].Dhcp4;\r
+ }\r
+ Private->BootFileUriParser = HttpOffer->UriParser;\r
+ Private->BootFileUri = (CHAR8*) HttpOffer->OptList[HTTP_BOOT_DHCP4_TAG_INDEX_BOOTFILE]->Data;\r
} else {\r
- ASSERT (Private->SelectProxyType != HttpOfferTypeMax);\r
- ProxyIndex = Private->OfferIndex[Private->SelectProxyType][0];\r
- HttpOffer = &Private->OfferBuffer[ProxyIndex].Dhcp4;\r
+ //\r
+ // In Home environment the BootFileUri comes from the FilePath.\r
+ //\r
+ Private->BootFileUriParser = Private->FilePathUriParser;\r
+ Private->BootFileUri = Private->FilePathUri;\r
}\r
\r
//\r
// Configure the default DNS server if server assigned.\r
//\r
- if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) || (SelectOffer->OfferType == HttpOfferTypeDhcpDns)) {\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
ASSERT (Option != NULL);\r
Status = HttpBootRegisterIp4Dns (\r
// Extract the port from URL, and use default HTTP port 80 if not provided.\r
//\r
Status = HttpUrlGetPort (\r
- (CHAR8*) HttpOffer->OptList[HTTP_BOOT_DHCP4_TAG_INDEX_BOOTFILE]->Data,\r
- HttpOffer->UriParser,\r
+ Private->BootFileUri,\r
+ Private->BootFileUriParser,\r
&Private->Port\r
);\r
if (EFI_ERROR (Status) || Private->Port == 0) {\r
Private->Port = 80;\r
}\r
\r
- //\r
- // Record the URI of boot file from the selected HTTP offer.\r
- //\r
- Private->BootFileUriParser = HttpOffer->UriParser;\r
- Private->BootFileUri = (CHAR8*) HttpOffer->OptList[HTTP_BOOT_DHCP4_TAG_INDEX_BOOTFILE]->Data;\r
-\r
- \r
//\r
// All boot informations are valid here.\r
//\r
// HttpOffer contains the boot file URL.\r
//\r
SelectOffer = &Private->OfferBuffer[SelectIndex].Dhcp6;\r
- if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) || (SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns)) {\r
- HttpOffer = SelectOffer;\r
+ if (Private->FilePathUri == NULL) {\r
+ //\r
+ // In Corporate environment, we need a HttpOffer.\r
+ //\r
+ if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) ||\r
+ (SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns) ||\r
+ (SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns)) {\r
+ HttpOffer = SelectOffer;\r
+ } else {\r
+ ASSERT (Private->SelectProxyType != HttpOfferTypeMax);\r
+ ProxyIndex = Private->OfferIndex[Private->SelectProxyType][0];\r
+ HttpOffer = &Private->OfferBuffer[ProxyIndex].Dhcp6;\r
+ }\r
+ Private->BootFileUriParser = HttpOffer->UriParser;\r
+ Private->BootFileUri = (CHAR8*) HttpOffer->OptList[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL]->Data;\r
} else {\r
- ASSERT (Private->SelectProxyType != HttpOfferTypeMax);\r
- ProxyIndex = Private->OfferIndex[Private->SelectProxyType][0];\r
- HttpOffer = &Private->OfferBuffer[ProxyIndex].Dhcp6;\r
+ //\r
+ // In Home environment the BootFileUri comes from the FilePath.\r
+ //\r
+ Private->BootFileUriParser = Private->FilePathUriParser;\r
+ Private->BootFileUri = Private->FilePathUri;\r
}\r
\r
//\r
//\r
// Configure the default DNS server if server assigned.\r
//\r
- if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) || (SelectOffer->OfferType == HttpOfferTypeDhcpDns)) {\r
+ if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) || \r
+ (SelectOffer->OfferType == HttpOfferTypeDhcpDns) ||\r
+ (SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns)) {\r
Option = SelectOffer->OptList[HTTP_BOOT_DHCP6_IDX_DNS_SERVER];\r
ASSERT (Option != NULL);\r
Status = HttpBootSetIp6Dns (\r
// whether can send message to HTTP Server Ip through the GateWay.\r
//\r
Status = HttpUrlGetIp6 (\r
- (CHAR8*) HttpOffer->OptList[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL]->Data,\r
- HttpOffer->UriParser,\r
+ Private->BootFileUri,\r
+ Private->BootFileUriParser,\r
&IpAddr\r
);\r
\r
// The Http server address is expressed by Name Ip, so perform DNS resolution\r
//\r
Status = HttpUrlGetHostName (\r
- (CHAR8*) HttpOffer->OptList[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL]->Data,\r
- HttpOffer->UriParser,\r
+ Private->BootFileUri,\r
+ Private->BootFileUriParser,\r
&HostName\r
);\r
if (EFI_ERROR (Status)) {\r
// Extract the port from URL, and use default HTTP port 80 if not provided.\r
//\r
Status = HttpUrlGetPort (\r
- (CHAR8*) HttpOffer->OptList[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL]->Data,\r
- HttpOffer->UriParser,\r
+ Private->BootFileUri,\r
+ Private->BootFileUriParser,\r
&Private->Port\r
);\r
if (EFI_ERROR (Status) || Private->Port == 0) {\r
Private->Port = 80;\r
}\r
\r
- //\r
- // Record the URI of boot file from the selected HTTP offer.\r
- //\r
- Private->BootFileUriParser = HttpOffer->UriParser;\r
- Private->BootFileUri = (CHAR8*) HttpOffer->OptList[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL]->Data;\r
-\r
- \r
//\r
// All boot informations are valid here.\r
//\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- //\r
- // Search file in the cache list, the cache entry will be released upon a successful\r
- // match.\r
- //\r
NET_LIST_FOR_EACH (Entry, &Private->CacheList) {\r
Cache = NET_LIST_USER_STRUCT (Entry, HTTP_BOOT_CACHE_CONTENT, Link);\r
//\r
}\r
}\r
*BufferSize = CopyedSize;\r
-\r
- //\r
- // On success, free the cached data to release the memory resource.\r
- //\r
- RemoveEntryList (&Cache->Link);\r
- HttpBootFreeCache (Cache);\r
return EFI_SUCCESS;\r
}\r
}\r
\r
return Status;\r
}\r
+\r