Implementation of the boot file download function.\r
\r
Copyright (c) 2015 - 2016, 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
The full text of the license may be found at\r
}\r
Status = HttpBootSetHeader (\r
HttpIoHeader,\r
- HTTP_FIELD_NAME_HOST,\r
+ HTTP_HEADER_HOST,\r
HostName\r
);\r
FreePool (HostName);\r
//\r
Status = HttpBootSetHeader (\r
HttpIoHeader,\r
- HTTP_FIELD_NAME_ACCEPT,\r
+ HTTP_HEADER_ACCEPT,\r
"*/*"\r
);\r
if (EFI_ERROR (Status)) {\r
//\r
Status = HttpBootSetHeader (\r
HttpIoHeader,\r
- HTTP_FIELD_NAME_USER_AGENT,\r
+ HTTP_HEADER_USER_AGENT,\r
HTTP_USER_AGENT_EFI_HTTP_BOOT\r
);\r
if (EFI_ERROR (Status)) {\r
Declaration of the boot file download function.\r
\r
Copyright (c) 2015, 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
The full text of the license may be found at\r
#define HTTP_BOOT_REQUEST_TIMEOUT 5000 // 5 seconds in uints of millisecond.\r
#define HTTP_BOOT_BLOCK_SIZE 1500\r
\r
-#define HTTP_FIELD_NAME_USER_AGENT "User-Agent"\r
-#define HTTP_FIELD_NAME_HOST "Host"\r
-#define HTTP_FIELD_NAME_ACCEPT "Accept"\r
\r
\r
#define HTTP_USER_AGENT_EFI_HTTP_BOOT "UefiHttpBoot/1.0"\r
UEFI HTTP boot driver's private data structure and interfaces declaration.\r
\r
Copyright (c) 2015, 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
The full text of the license may be found at\r
\r
#include <Uefi.h>\r
\r
+#include <IndustryStandard/Http11.h>\r
+\r
//\r
// Libraries\r
//\r
The header files of the driver binding and service binding protocol for HttpDxe driver.\r
\r
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
#define __EFI_HTTP_DRIVER_H__\r
\r
#include <Uefi.h>\r
+#include <IndustryStandard/Http11.h>\r
\r
//\r
// Libraries\r
The header files of implementation of EFI_HTTP_PROTOCOL protocol interfaces.\r
\r
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> \r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
#define HTTP_DEFAULT_PORT 80\r
#define HTTP_END_OF_HDR_STR "\r\n\r\n"\r
#define HTTP_CRLF_STR "\r\n"\r
-#define HTTP_VERSION_STR "HTTP/1.1"\r
+#define HTTP_VERSION_STR HTTP_VERSION\r
#define HTTP_VERSION_CRLF_STR " HTTP/1.1\r\n"\r
-#define HTTP_GET_STR "GET "\r
-#define HTTP_HEAD_STR "HEAD "\r
#define HTTP_ERROR_OR_NOT_SUPPORT_STATUS_CODE 300\r
\r
-//\r
-// Connect method has maximum length according to EFI_HTTP_METHOD defined in\r
-// UEFI2.5 spec so use this.\r
-//\r
-#define HTTP_MAXIMUM_METHOD_LEN sizeof ("CONNECT")\r
\r
/**\r
Returns the operational parameters for the current HTTP child instance.\r
Miscellaneous routines for HttpDxe driver.\r
\r
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
//\r
// Calculate HTTP message length.\r
//\r
- MsgSize = Message->BodyLength + HTTP_MAXIMUM_METHOD_LEN + AsciiStrLen (Url) + \r
+ MsgSize = Message->BodyLength + HTTP_METHOD_MAXIMUM_LEN + AsciiStrLen (Url) +\r
AsciiStrLen (HTTP_VERSION_CRLF_STR) + HttpHdrSize;\r
Request = AllocateZeroPool (MsgSize);\r
if (Request == NULL) {\r
//\r
switch (Message->Data.Request->Method) {\r
case HttpMethodGet:\r
- StrLength = sizeof (HTTP_GET_STR) - 1;\r
- CopyMem (RequestPtr, HTTP_GET_STR, StrLength);\r
+ StrLength = sizeof (HTTP_METHOD_GET) - 1;\r
+ CopyMem (RequestPtr, HTTP_METHOD_GET, StrLength);\r
RequestPtr += StrLength;\r
break;\r
case HttpMethodHead:\r
- StrLength = sizeof (HTTP_HEAD_STR) - 1;\r
- CopyMem (RequestPtr, HTTP_HEAD_STR, StrLength);\r
+ StrLength = sizeof (HTTP_METHOD_HEAD) - 1;\r
+ CopyMem (RequestPtr, HTTP_METHOD_HEAD, StrLength);\r
RequestPtr += StrLength;\r
break;\r
default:\r
goto Exit;\r
}\r
\r
+ StrLength = AsciiStrLen(" ");\r
+ CopyMem (RequestPtr, " ", StrLength);\r
+ RequestPtr += StrLength;\r
+\r
StrLength = AsciiStrLen (Url);\r
CopyMem (RequestPtr, Url, StrLength);\r
RequestPtr += StrLength;\r