Functions | |
VOID | FreeHeaderFields (IN EFI_HTTP_HEADER *HeaderFields, IN UINTN FieldCount) |
EFI_HTTP_HEADER * | FindHttpHeader (IN EFI_HTTP_HEADER *HeaderFields, IN UINTN FieldCount, IN CHAR8 *FieldName) |
BOOLEAN | IsValidHttpHeader (IN CHAR8 *DeleteList[], IN UINTN DeleteCount, IN CHAR8 *FieldName) |
EFI_STATUS | SetFieldNameAndValue (IN EFI_HTTP_HEADER *HttpHeader, IN CHAR8 *FieldName, IN CHAR8 *FieldValue) |
CHAR8 * | GetFieldNameAndValue (IN CHAR8 *String, OUT CHAR8 **FieldName, OUT CHAR8 **FieldValue) |
EFI_STATUS EFIAPI | HttpUtilitiesBuild (IN EFI_HTTP_UTILITIES_PROTOCOL *This, IN UINTN SeedMessageSize, IN VOID *SeedMessage, IN UINTN DeleteCount, IN CHAR8 *DeleteList[], IN UINTN AppendCount, IN EFI_HTTP_HEADER *AppendList[], OUT UINTN *NewMessageSize, OUT VOID **NewMessage) |
EFI_STATUS EFIAPI | HttpUtilitiesParse (IN EFI_HTTP_UTILITIES_PROTOCOL *This, IN CHAR8 *HttpMessage, IN UINTN HttpMessageSize, OUT EFI_HTTP_HEADER **HeaderFields, OUT UINTN *FieldCount) |
Variables | |
EFI_HTTP_UTILITIES_PROTOCOL | mHttpUtilitiesProtocol |
Copyright (c) 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
EFI_HTTP_HEADER* FindHttpHeader | ( | IN EFI_HTTP_HEADER * | HeaderFields, | |
IN UINTN | FieldCount, | |||
IN CHAR8 * | FieldName | |||
) |
Find required header field in HeaderFields.
[in] | HeaderFields | Pointer to array of key/value header pairs. |
[in] | FieldCount | The number of header pairs. |
[in] | FieldName | Pointer to header field's name. |
NULL if not find this required header field.
Referenced by HttpUtilitiesBuild().
VOID FreeHeaderFields | ( | IN EFI_HTTP_HEADER * | HeaderFields, | |
IN UINTN | FieldCount | |||
) |
Free existing HeaderFields.
[in] | HeaderFields | Pointer to array of key/value header pairs waitting for free. |
[in] | FieldCount | The number of header pairs in HeaderFields. |
Referenced by HttpUtilitiesBuild(), and HttpUtilitiesParse().
CHAR8* GetFieldNameAndValue | ( | IN CHAR8 * | String, | |
OUT CHAR8 ** | FieldName, | |||
OUT CHAR8 ** | FieldValue | |||
) |
Get one key/value header pair from the raw string.
[in] | String | Pointer to the raw string. |
[out] | FieldName | Pointer to header field's name. |
[out] | FieldValue | Pointer to header field's value. |
NULL if no key/value header pair from this raw string.
References AsciiStrGetNextToken().
Referenced by HttpUtilitiesParse().
EFI_STATUS EFIAPI HttpUtilitiesBuild | ( | IN EFI_HTTP_UTILITIES_PROTOCOL * | This, | |
IN UINTN | SeedMessageSize, | |||
IN VOID * | SeedMessage, | |||
IN UINTN | DeleteCount, | |||
IN CHAR8 * | DeleteList[], | |||
IN UINTN | AppendCount, | |||
IN EFI_HTTP_HEADER * | AppendList[], | |||
OUT UINTN * | NewMessageSize, | |||
OUT VOID ** | NewMessage | |||
) |
Create HTTP header based on a combination of seed header, fields to delete, and fields to append.
The Build() function is used to manage the headers portion of an HTTP message by providing the ability to add, remove, or replace HTTP headers.
[in] | This | Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance. |
[in] | SeedMessageSize | Size of the initial HTTP header. This can be zero. |
[in] | SeedMessage | Initial HTTP header to be used as a base for building a new HTTP header. If NULL, SeedMessageSize is ignored. |
[in] | DeleteCount | Number of null-terminated HTTP header field names in DeleteList. |
[in] | DeleteList | List of null-terminated HTTP header field names to remove from SeedMessage. Only the field names are in this list because the field values are irrelevant to this operation. |
[in] | AppendCount | Number of header fields in AppendList. |
[in] | AppendList | List of HTTP headers to populate NewMessage with. If SeedMessage is not NULL, AppendList will be appended to the existing list from SeedMessage in NewMessage. |
[out] | NewMessageSize | Pointer to number of header fields in NewMessage. |
[out] | NewMessage | Pointer to a new list of HTTP headers based on. |
EFI_SUCCESS | Add, remove, and replace operations succeeded. | |
EFI_OUT_OF_RESOURCES | Could not allocate memory for NewMessage. | |
EFI_INVALID_PARAMETER | One or more of the following conditions is TRUE: This is NULL. |
References FindHttpHeader(), FreeHeaderFields(), IsValidHttpHeader(), and SetFieldNameAndValue().
EFI_STATUS EFIAPI HttpUtilitiesParse | ( | IN EFI_HTTP_UTILITIES_PROTOCOL * | This, | |
IN CHAR8 * | HttpMessage, | |||
IN UINTN | HttpMessageSize, | |||
OUT EFI_HTTP_HEADER ** | HeaderFields, | |||
OUT UINTN * | FieldCount | |||
) |
Parses HTTP header and produces an array of key/value pairs.
The Parse() function is used to transform data stored in HttpHeader into a list of fields paired with their corresponding values.
[in] | This | Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance. |
[in] | HttpMessage | Contains raw unformatted HTTP header string. |
[in] | HttpMessageSize | Size of HTTP header. |
[out] | HeaderFields | Array of key/value header pairs. |
[out] | FieldCount | Number of headers in HeaderFields. |
EFI_SUCCESS | Allocation succeeded. | |
EFI_NOT_STARTED | This EFI HTTP Protocol instance has not been initialized. | |
EFI_INVALID_PARAMETER | One or more of the following conditions is TRUE: This is NULL. HttpMessage is NULL. HeaderFields is NULL. FieldCount is NULL. |
References FreeHeaderFields(), GetFieldNameAndValue(), and SetFieldNameAndValue().
BOOLEAN IsValidHttpHeader | ( | IN CHAR8 * | DeleteList[], | |
IN UINTN | DeleteCount, | |||
IN CHAR8 * | FieldName | |||
) |
Check whether header field called FieldName is in DeleteList.
[in] | DeleteList | Pointer to array of key/value header pairs. |
[in] | DeleteCount | The number of header pairs. |
[in] | FieldName | Pointer to header field's name. |
FALSE if FieldName is in DeleteList, that means this header field is invalid.
Referenced by HttpUtilitiesBuild().
EFI_STATUS SetFieldNameAndValue | ( | IN EFI_HTTP_HEADER * | HttpHeader, | |
IN CHAR8 * | FieldName, | |||
IN CHAR8 * | FieldValue | |||
) |
Set FieldName and FieldValue into specified HttpHeader.
[in] | HttpHeader | Specified HttpHeader. |
[in] | FieldName | FieldName of this HttpHeader. |
[in] | FieldValue | FieldValue of this HttpHeader. |
EFI_SUCCESS | The FieldName and FieldValue are set into HttpHeader successfully. | |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
Referenced by HttpUtilitiesBuild(), and HttpUtilitiesParse().
EFI_HTTP_UTILITIES_PROTOCOL mHttpUtilitiesProtocol |
Referenced by HttpUtilitiesDxeDriverEntryPoint().