HTTP Service Binding Protocol (HTTPSB)\r
HTTP Protocol (HTTP)\r
\r
- Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2015-2017 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
- 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
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
@par Revision Reference:\r
This Protocol is introduced in UEFI Specification 2.5\r
/// information in every TCP connection made by this instance. In addition, when set\r
/// to TRUE, LocalAddress and LocalSubnet are ignored.\r
///\r
- BOOLEAN UseDefaultAddress;\r
+ BOOLEAN UseDefaultAddress;\r
///\r
/// If UseDefaultAddress is set to FALSE, this defines the local IP address to be\r
/// used in every TCP connection opened by this instance.\r
///\r
- EFI_IPv4_ADDRESS LocalAddress;\r
+ EFI_IPv4_ADDRESS LocalAddress;\r
///\r
/// If UseDefaultAddress is set to FALSE, this defines the local subnet to be used\r
/// in every TCP connection opened by this instance.\r
///\r
- EFI_IPv4_ADDRESS LocalSubnet;\r
+ EFI_IPv4_ADDRESS LocalSubnet;\r
///\r
/// This defines the local port to be used in\r
/// every TCP connection opened by this instance.\r
///\r
- UINT16 LocalPort;\r
+ UINT16 LocalPort;\r
} EFI_HTTPv4_ACCESS_POINT;\r
\r
///\r
///\r
/// Local IP address to be used in every TCP connection opened by this instance.\r
///\r
- EFI_IPv6_ADDRESS LocalAddress;\r
+ EFI_IPv6_ADDRESS LocalAddress;\r
///\r
/// Local port to be used in every TCP connection opened by this instance.\r
///\r
- UINT16 LocalPort;\r
+ UINT16 LocalPort;\r
} EFI_HTTPv6_ACCESS_POINT;\r
\r
///\r
/// EFI_HTTP_CONFIG_DATA_ACCESS_POINT\r
///\r
\r
-\r
typedef struct {\r
///\r
/// HTTP version that this instance will support.\r
///\r
- EFI_HTTP_VERSION HttpVersion;\r
+ EFI_HTTP_VERSION HttpVersion;\r
///\r
/// Time out (in milliseconds) when blocking for requests.\r
///\r
- UINT32 TimeOutMillisec;\r
+ UINT32 TimeOutMillisec;\r
///\r
/// Defines behavior of EFI DNS and TCP protocols consumed by this instance. If\r
/// FALSE, this instance will use EFI_DNS4_PROTOCOL and EFI_TCP4_PROTOCOL. If TRUE,\r
/// this instance will use EFI_DNS6_PROTOCOL and EFI_TCP6_PROTOCOL.\r
///\r
- BOOLEAN LocalAddressIsIPv6;\r
+ BOOLEAN LocalAddressIsIPv6;\r
\r
union {\r
///\r
/// When LocalAddressIsIPv6 is FALSE, this points to the local address, subnet, and\r
/// port used by the underlying TCP protocol.\r
///\r
- EFI_HTTPv4_ACCESS_POINT *IPv4Node;\r
+ EFI_HTTPv4_ACCESS_POINT *IPv4Node;\r
///\r
/// When LocalAddressIsIPv6 is TRUE, this points to the local IPv6 address and port\r
/// used by the underlying TCP protocol.\r
///\r
- EFI_HTTPv6_ACCESS_POINT *IPv6Node;\r
+ EFI_HTTPv6_ACCESS_POINT *IPv6Node;\r
} AccessPoint;\r
} EFI_HTTP_CONFIG_DATA;\r
\r
///\r
/// The HTTP method (e.g. GET, POST) for this HTTP Request.\r
///\r
- EFI_HTTP_METHOD Method;\r
+ EFI_HTTP_METHOD Method;\r
///\r
/// The URI of a remote host. From the information in this field, the HTTP instance\r
/// will be able to determine whether to use HTTP or HTTPS and will also be able to\r
/// determine the port number to use. If no port number is specified, port 80 (HTTP)\r
/// is assumed. See RFC 3986 for more details on URI syntax.\r
///\r
- CHAR16 *Url;\r
+ CHAR16 *Url;\r
} EFI_HTTP_REQUEST_DATA;\r
\r
///\r
///\r
/// Response status code returned by the remote host.\r
///\r
- EFI_HTTP_STATUS_CODE StatusCode;\r
+ EFI_HTTP_STATUS_CODE StatusCode;\r
} EFI_HTTP_RESPONSE_DATA;\r
\r
///\r
/// Null terminated string which describes a field name. See RFC 2616 Section 14 for\r
/// detailed information about field names.\r
///\r
- CHAR8 *FieldName;\r
+ CHAR8 *FieldName;\r
///\r
/// Null terminated string which describes the corresponding field value. See RFC 2616\r
/// Section 14 for detailed information about field values.\r
///\r
- CHAR8 *FieldValue;\r
+ CHAR8 *FieldValue;\r
} EFI_HTTP_HEADER;\r
\r
///\r
/// When the token is used to send a HTTP request, Request is a pointer to storage that\r
/// contains such data as URL and HTTP method.\r
///\r
- EFI_HTTP_REQUEST_DATA *Request;\r
+ EFI_HTTP_REQUEST_DATA *Request;\r
///\r
/// When used to await a response, Response points to storage containing HTTP response\r
/// status code.\r
///\r
- EFI_HTTP_RESPONSE_DATA *Response;\r
+ EFI_HTTP_RESPONSE_DATA *Response;\r
} Data;\r
///\r
/// Number of HTTP header structures in Headers list. On request, this count is\r
/// provided by the caller. On response, this count is provided by the HTTP driver.\r
///\r
- UINTN HeaderCount;\r
+ UINTN HeaderCount;\r
///\r
/// Array containing list of HTTP headers. On request, this array is populated by the\r
/// caller. On response, this array is allocated and populated by the HTTP driver. It\r
/// is the responsibility of the caller to free this memory on both request and\r
/// response.\r
///\r
- EFI_HTTP_HEADER *Headers;\r
+ EFI_HTTP_HEADER *Headers;\r
///\r
/// Length in bytes of the HTTP body. This can be zero depending on the HttpMethod type.\r
///\r
- UINTN BodyLength;\r
+ UINTN BodyLength;\r
///\r
/// Body associated with the HTTP request or response. This can be NULL depending on\r
/// the HttpMethod type.\r
///\r
- VOID *Body;\r
+ VOID *Body;\r
} EFI_HTTP_MESSAGE;\r
\r
-\r
///\r
/// EFI_HTTP_TOKEN\r
///\r
/// Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL. The Task Priority\r
/// Level (TPL) of Event must be lower than or equal to TPL_CALLBACK.\r
///\r
- EFI_EVENT Event;\r
+ EFI_EVENT Event;\r
///\r
/// Status will be set to one of the following value if the HTTP request is\r
/// successfully sent or if an unexpected error occurs:\r
/// EFI_TIMEOUT: The HTTP request timed out before reaching the remote host.\r
/// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r
///\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
///\r
/// Pointer to storage containing HTTP message data.\r
///\r
- EFI_HTTP_MESSAGE *Message;\r
+ EFI_HTTP_MESSAGE *Message;\r
} EFI_HTTP_TOKEN;\r
\r
/**\r
\r
@param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r
@param[out] HttpConfigData Point to buffer for operational parameters of this\r
- HTTP instance.\r
+ HTTP instance. It is the responsibility of the caller\r
+ to allocate the memory for HttpConfigData and\r
+ HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact,\r
+ it is recommended to allocate sufficient memory to record\r
+ IPv6Node since it is big enough for all possibilities.\r
\r
@retval EFI_SUCCESS Operation succeeded.\r
@retval EFI_INVALID_PARAMETER This is NULL.\r
HttpConfigData is NULL.\r
- HttpInstance->LocalAddressIsIPv6 is FALSE and\r
- HttpConfigData->IPv4Node is NULL.\r
- HttpInstance->LocalAddressIsIPv6 is TRUE and\r
- HttpConfigData->IPv6Node is NULL.\r
+ HttpConfigData->AccessPoint.IPv4Node or\r
+ HttpConfigData->AccessPoint.IPv6Node is NULL.\r
@retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.\r
**/\r
typedef\r
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
This is NULL.\r
HttpConfigData->LocalAddressIsIPv6 is FALSE and\r
- HttpConfigData->IPv4Node is NULL.\r
+ HttpConfigData->AccessPoint.IPv4Node is NULL.\r
HttpConfigData->LocalAddressIsIPv6 is TRUE and\r
- HttpConfigData->IPv6Node is NULL.\r
+ HttpConfigData->AccessPoint.IPv6Node is NULL.\r
@retval EFI_ALREADY_STARTED Reinitialize this HTTP instance without calling\r
Configure() with NULL to reset it.\r
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
);\r
\r
/**\r
- The Request() function queues an HTTP request to this HTTP instance, \r
+ The Request() function queues an HTTP request to this HTTP instance,\r
similar to Transmit() function in the EFI TCP driver. When the HTTP request is sent\r
successfully, or if there is an error, Status in token will be updated and Event will\r
be signaled.\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_HTTP_REQUEST) (\r
+(EFIAPI *EFI_HTTP_REQUEST)(\r
IN EFI_HTTP_PROTOCOL *This,\r
IN EFI_HTTP_TOKEN *Token\r
);\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_HTTP_RESPONSE) (\r
+(EFIAPI *EFI_HTTP_RESPONSE)(\r
IN EFI_HTTP_PROTOCOL *This,\r
IN EFI_HTTP_TOKEN *Token\r
);\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_HTTP_POLL) (\r
+(EFIAPI *EFI_HTTP_POLL)(\r
IN EFI_HTTP_PROTOCOL *This\r
);\r
\r
/// TCP protocol.\r
///\r
struct _EFI_HTTP_PROTOCOL {\r
- EFI_HTTP_GET_MODE_DATA GetModeData;\r
- EFI_HTTP_CONFIGURE Configure;\r
- EFI_HTTP_REQUEST Request;\r
- EFI_HTTP_CANCEL Cancel;\r
- EFI_HTTP_RESPONSE Response;\r
- EFI_HTTP_POLL Poll;\r
+ EFI_HTTP_GET_MODE_DATA GetModeData;\r
+ EFI_HTTP_CONFIGURE Configure;\r
+ EFI_HTTP_REQUEST Request;\r
+ EFI_HTTP_CANCEL Cancel;\r
+ EFI_HTTP_RESPONSE Response;\r
+ EFI_HTTP_POLL Poll;\r
};\r
\r
-extern EFI_GUID gEfiHttpServiceBindingProtocolGuid;\r
-extern EFI_GUID gEfiHttpProtocolGuid;\r
+extern EFI_GUID gEfiHttpServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiHttpProtocolGuid;\r
\r
#endif\r