TianoCore EDK2 master
Loading...
Searching...
No Matches
HttpUtilitiesProtocol.c File Reference
#include "HttpUtilitiesDxe.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI HttpUtilitiesBuild (IN EFI_HTTP_UTILITIES_PROTOCOL *This, IN UINTN SeedMessageSize, IN VOID *SeedMessage OPTIONAL, IN UINTN DeleteCount, IN CHAR8 *DeleteList[] OPTIONAL, IN UINTN AppendCount, IN EFI_HTTP_HEADER *AppendList[] OPTIONAL, 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

Implementation of EFI_HTTP_PROTOCOL protocol interfaces.

Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HttpUtilitiesProtocol.c.

Function Documentation

◆ HttpUtilitiesBuild()

EFI_STATUS EFIAPI HttpUtilitiesBuild ( IN EFI_HTTP_UTILITIES_PROTOCOL This,
IN UINTN  SeedMessageSize,
IN VOID *SeedMessage  OPTIONAL,
IN UINTN  DeleteCount,
IN CHAR8 *DeleteList[]  OPTIONAL,
IN UINTN  AppendCount,
IN EFI_HTTP_HEADER *AppendList[]  OPTIONAL,
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]ThisPointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
[in]SeedMessageSizeSize of the initial HTTP header. This can be zero.
[in]SeedMessageInitial HTTP header to be used as a base for building a new HTTP header. If NULL, SeedMessageSize is ignored.
[in]DeleteCountNumber of null-terminated HTTP header field names in DeleteList.
[in]DeleteListList 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]AppendCountNumber of header fields in AppendList.
[in]AppendListList 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]NewMessageSizePointer to number of header fields in NewMessage.
[out]NewMessagePointer to a new list of HTTP headers based on.
Return values
EFI_SUCCESSAdd, remove, and replace operations succeeded.
EFI_OUT_OF_RESOURCESCould not allocate memory for NewMessage.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: This is NULL.

Definition at line 51 of file HttpUtilitiesProtocol.c.

◆ HttpUtilitiesParse()

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]ThisPointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
[in]HttpMessageContains raw unformatted HTTP header string.
[in]HttpMessageSizeSize of HTTP header.
[out]HeaderFieldsArray of key/value header pairs.
[out]FieldCountNumber of headers in HeaderFields.
Return values
EFI_SUCCESSAllocation succeeded.
EFI_NOT_STARTEDThis EFI HTTP Protocol instance has not been initialized.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: This is NULL. HttpMessage is NULL. HeaderFields is NULL. FieldCount is NULL.

Definition at line 282 of file HttpUtilitiesProtocol.c.

Variable Documentation

◆ mHttpUtilitiesProtocol

EFI_HTTP_UTILITIES_PROTOCOL mHttpUtilitiesProtocol
Initial value:
= {
}
EFI_STATUS EFIAPI HttpUtilitiesParse(IN EFI_HTTP_UTILITIES_PROTOCOL *This, IN CHAR8 *HttpMessage, IN UINTN HttpMessageSize, OUT EFI_HTTP_HEADER **HeaderFields, OUT UINTN *FieldCount)
EFI_STATUS EFIAPI HttpUtilitiesBuild(IN EFI_HTTP_UTILITIES_PROTOCOL *This, IN UINTN SeedMessageSize, IN VOID *SeedMessage OPTIONAL, IN UINTN DeleteCount, IN CHAR8 *DeleteList[] OPTIONAL, IN UINTN AppendCount, IN EFI_HTTP_HEADER *AppendList[] OPTIONAL, OUT UINTN *NewMessageSize, OUT VOID **NewMessage)

Definition at line 12 of file HttpUtilitiesProtocol.c.