HTTP Service Binding Protocol (HTTPSB)\r
HTTP Protocol (HTTP)\r
\r
- Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2016 - 2017, 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
HttpMethodHead,\r
HttpMethodPut,\r
HttpMethodDelete,\r
- HttpMethodTrace\r
+ HttpMethodTrace,\r
+ HttpMethodMax\r
} EFI_HTTP_METHOD;\r
\r
///\r
HTTP_STATUS_204_NO_CONTENT,\r
HTTP_STATUS_205_RESET_CONTENT,\r
HTTP_STATUS_206_PARTIAL_CONTENT,\r
- HTTP_STATUS_300_MULTIPLE_CHIOCES,\r
+ HTTP_STATUS_300_MULTIPLE_CHOICES,\r
HTTP_STATUS_301_MOVED_PERMANENTLY,\r
HTTP_STATUS_302_FOUND,\r
HTTP_STATUS_303_SEE_OTHER,\r
HTTP_STATUS_412_PRECONDITION_FAILED,\r
HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE,\r
HTTP_STATUS_414_REQUEST_URI_TOO_LARGE,\r
- HTTP_STATUS_415_UNSUPPORETD_MEDIA_TYPE,\r
+ HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE,\r
HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED,\r
HTTP_STATUS_417_EXPECTATION_FAILED,\r
HTTP_STATUS_500_INTERNAL_SERVER_ERROR,\r
- HTTP_STATUS_501_NOT_IMIPLEMENTED,\r
+ HTTP_STATUS_501_NOT_IMPLEMENTED,\r
HTTP_STATUS_502_BAD_GATEWAY,\r
HTTP_STATUS_503_SERVICE_UNAVAILABLE,\r
HTTP_STATUS_504_GATEWAY_TIME_OUT,\r
- HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED\r
+ HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED,\r
+ HTTP_STATUS_308_PERMANENT_REDIRECT\r
} EFI_HTTP_STATUS_CODE;\r
\r
///\r
///\r
/// Set to TRUE to instruct the EFI HTTP instance to use the default address\r
/// information in every TCP connection made by this instance. In addition, when set\r
- /// to TRUE, LocalAddress, LocalSubnet, and LocalPort are ignored.\r
+ /// to TRUE, LocalAddress and LocalSubnet are ignored.\r
///\r
BOOLEAN UseDefaultAddress;\r
///\r
///\r
EFI_IPv4_ADDRESS LocalSubnet;\r
///\r
- /// If UseDefaultAddress is set to FALSE, this defines the local port to be used in\r
+ /// This defines the local port to be used in\r
/// every TCP connection opened by this instance.\r
///\r
UINT16 LocalPort;\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_SUCCESS: The HTTP request was successfully sent to the remote host.\r
+ /// EFI_HTTP_ERROR: The response message was successfully received but contains a\r
+ /// HTTP error. The response status code is returned in token.\r
/// EFI_ABORTED: The HTTP request was cancelled by the caller and removed from\r
/// the transmit queue.\r
/// EFI_TIMEOUT: The HTTP request timed out before reaching the remote host.\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
+ 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
EFI_STATUS\r
-(EFIAPI * EFI_HTTP_GET_MODE_DATA)(\r
+(EFIAPI *EFI_HTTP_GET_MODE_DATA)(\r
IN EFI_HTTP_PROTOCOL *This,\r
OUT EFI_HTTP_CONFIG_DATA *HttpConfigData\r
);\r
connections with remote hosts, canceling all asynchronous tokens, and flush request\r
and response buffers without informing the appropriate hosts.\r
\r
- Except for GetModeData() and Configure(), No other EFI HTTP function can be executed\r
- by this instance until the Configure() function is executed and returns successfully.\r
+ No other EFI HTTP function can be executed by this instance until the Configure()\r
+ function is executed and returns successfully.\r
\r
@param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r
@param[in] HttpConfigData Pointer to the configure data to configure the instance.\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
typedef\r
EFI_STATUS\r
-(EFIAPI * EFI_HTTP_CONFIGURE)(\r
+(EFIAPI *EFI_HTTP_CONFIGURE)(\r
IN EFI_HTTP_PROTOCOL *This,\r
- IN EFI_HTTP_CONFIG_DATA *HttpConfigData\r
+ IN EFI_HTTP_CONFIG_DATA *HttpConfigData OPTIONAL\r
);\r
\r
/**\r
@retval EFI_TIMEOUT Data was dropped out of the transmit or receive queue.\r
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
This is NULL.\r
+ Token is NULL.\r
Token->Message is NULL.\r
Token->Message->Body is not NULL,\r
Token->Message->BodyLength is non-zero, and\r
Token->Message->Data is NULL, but a previous call to\r
Request()has not been completed successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources.\r
+ @retval EFI_UNSUPPORTED The HTTP method is not supported in current implementation.\r
**/\r
typedef\r
EFI_STATUS\r
@retval EFI_SUCCESS Request and Response queues are successfully flushed.\r
@retval EFI_INVALID_PARAMETER This is NULL.\r
@retval EFI_NOT_STARTED This instance hasn't been configured.\r
- @retval EFI_NO_MAPPING When using the default address, configuration (DHCP,\r
- BOOTP, RARP, etc.) hasn't finished yet.\r
@retval EFI_NOT_FOUND The asynchronous request or response token is not\r
found.\r
@retval EFI_UNSUPPORTED The implementation does not support this function.\r
\r
/**\r
The Response() function queues an HTTP response to this HTTP instance, similar to\r
- Receive() function in the EFI TCP driver. When the HTTP request is sent successfully,\r
+ Receive() function in the EFI TCP driver. When the HTTP Response is received successfully,\r
or if there is an error, Status in token will be updated and Event will be signaled.\r
\r
The HTTP driver will queue a receive token to the underlying TCP instance. When data\r
initialized.\r
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
This is NULL.\r
+ Token is NULL.\r
Token->Message->Headers is NULL.\r
Token->Message is NULL.\r
Token->Message->Body is not NULL,\r
Token->Message->BodyLength is non-zero, and\r
Token->Message->Data is NULL, but a previous call to\r
Response() has not been completed successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources.\r
@retval EFI_ACCESS_DENIED An open TCP connection is not present with the host\r
specified by response URL.\r
**/\r
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred\r
@retval EFI_INVALID_PARAMETER This is NULL.\r
@retval EFI_NOT_READY No incoming or outgoing data is processed.\r
+ @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.\r
**/\r
typedef\r
EFI_STATUS\r