NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.h File Reference


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

Detailed Description

The header files of Http Utilities functions for HttpUtilities driver.

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.


Function Documentation

EFI_HTTP_HEADER* FindHttpHeader ( IN EFI_HTTP_HEADER *  HeaderFields,
IN UINTN  FieldCount,
IN CHAR8 *  FieldName 
)

Find required header field in HeaderFields.

Parameters:
[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.
Returns:
Pointer to the queried header field.

NULL if not find this required header field.

Referenced by HttpUtilitiesBuild().

VOID FreeHeaderFields ( IN EFI_HTTP_HEADER *  HeaderFields,
IN UINTN  FieldCount 
)

Free existing HeaderFields.

Parameters:
[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.

Parameters:
[in] String Pointer to the raw string.
[out] FieldName Pointer to header field's name.
[out] FieldValue Pointer to header field's value.
Returns:
Pointer to the next raw string.

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.

Parameters:
[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.
Return values:
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.

Parameters:
[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.
Return values:
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.

Parameters:
[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.
Returns:
TRUE if FieldName is not in DeleteList, that means this header field is valid.

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.

Parameters:
[in] HttpHeader Specified HttpHeader.
[in] FieldName FieldName of this HttpHeader.
[in] FieldValue FieldValue of this HttpHeader.
Return values:
EFI_SUCCESS The FieldName and FieldValue are set into HttpHeader successfully.
EFI_OUT_OF_RESOURCES Failed to allocate resources.

Referenced by HttpUtilitiesBuild(), and HttpUtilitiesParse().


Variable Documentation

EFI_HTTP_UTILITIES_PROTOCOL mHttpUtilitiesProtocol


Generated on Mon Sep 28 08:49:05 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1