2 EFI HTTP Utilities protocol provides a platform independent abstraction for HTTP
5 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
8 @par Revision Reference:
9 This Protocol is introduced in UEFI Specification 2.5
13 #ifndef __EFI_HTTP_UTILITIES_PROTOCOL_H__
14 #define __EFI_HTTP_UTILITIES_PROTOCOL_H__
16 #include <Protocol/Http.h>
18 #define EFI_HTTP_UTILITIES_PROTOCOL_GUID \
20 0x3e35c163, 0x4074, 0x45dd, {0x43, 0x1e, 0x23, 0x98, 0x9d, 0xd8, 0x6b, 0x32 } \
23 typedef struct _EFI_HTTP_UTILITIES_PROTOCOL EFI_HTTP_UTILITIES_PROTOCOL
;
27 Create HTTP header based on a combination of seed header, fields
28 to delete, and fields to append.
30 The Build() function is used to manage the headers portion of an
31 HTTP message by providing the ability to add, remove, or replace
34 @param[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
35 @param[in] SeedMessageSize Size of the initial HTTP header. This can be zero.
36 @param[in] SeedMessage Initial HTTP header to be used as a base for
37 building a new HTTP header. If NULL,
38 SeedMessageSize is ignored.
39 @param[in] DeleteCount Number of null-terminated HTTP header field names
41 @param[in] DeleteList List of null-terminated HTTP header field names to
42 remove from SeedMessage. Only the field names are
43 in this list because the field values are irrelevant
45 @param[in] AppendCount Number of header fields in AppendList.
46 @param[in] AppendList List of HTTP headers to populate NewMessage with.
47 If SeedMessage is not NULL, AppendList will be
48 appended to the existing list from SeedMessage in
50 @param[out] NewMessageSize Pointer to number of header fields in NewMessage.
51 @param[out] NewMessage Pointer to a new list of HTTP headers based on.
53 @retval EFI_SUCCESS Add, remove, and replace operations succeeded.
54 @retval EFI_OUT_OF_RESOURCES Could not allocate memory for NewMessage.
55 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
60 (EFIAPI
*EFI_HTTP_UTILS_BUILD
) (
61 IN EFI_HTTP_UTILITIES_PROTOCOL
*This
,
62 IN UINTN SeedMessageSize
,
63 IN VOID
*SeedMessage
, OPTIONAL
65 IN CHAR8
*DeleteList
[], OPTIONAL
67 IN EFI_HTTP_HEADER
*AppendList
[], OPTIONAL
68 OUT UINTN
*NewMessageSize
,
73 Parses HTTP header and produces an array of key/value pairs.
75 The Parse() function is used to transform data stored in HttpHeader
76 into a list of fields paired with their corresponding values.
78 @param[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
79 @param[in] HttpMessage Contains raw unformatted HTTP header string.
80 @param[in] HttpMessageSize Size of HTTP header.
81 @param[out] HeaderFields Array of key/value header pairs.
82 @param[out] FieldCount Number of headers in HeaderFields.
84 @retval EFI_SUCCESS Allocation succeeded.
85 @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been
87 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
95 (EFIAPI
*EFI_HTTP_UTILS_PARSE
) (
96 IN EFI_HTTP_UTILITIES_PROTOCOL
*This
,
97 IN CHAR8
*HttpMessage
,
98 IN UINTN HttpMessageSize
,
99 OUT EFI_HTTP_HEADER
**HeaderFields
,
100 OUT UINTN
*FieldCount
105 /// EFI_HTTP_UTILITIES_PROTOCOL
106 /// designed to be used by EFI drivers and applications to parse HTTP
107 /// headers from a byte stream. This driver is neither dependent on
108 /// network connectivity, nor the existence of an underlying network
111 struct _EFI_HTTP_UTILITIES_PROTOCOL
{
112 EFI_HTTP_UTILS_BUILD Build
;
113 EFI_HTTP_UTILS_PARSE Parse
;
116 extern EFI_GUID gEfiHttpUtilitiesProtocolGuid
;