2 EFI HTTP Utilities protocol provides a platform independent abstraction for HTTP
5 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 @par Revision Reference:
15 This Protocol is introduced in UEFI Specification 2.5
19 #ifndef __EFI_HTTP_UTILITIES_PROTOCOL_H__
20 #define __EFI_HTTP_UTILITIES_PROTOCOL_H__
22 #include <Protocol/Http.h>
24 #define EFI_HTTP_UTILITIES_PROTOCOL_GUID \
26 0x3e35c163, 0x4074, 0x45dd, {0x43, 0x1e, 0x23, 0x98, 0x9d, 0xd8, 0x6b, 0x32 } \
29 typedef struct _EFI_HTTP_UTILITIES_PROTOCOL EFI_HTTP_UTILITIES_PROTOCOL
;
33 Create HTTP header based on a combination of seed header, fields
34 to delete, and fields to append.
36 The Build() function is used to manage the headers portion of an
37 HTTP message by providing the ability to add, remove, or replace
40 @param[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
41 @param[in] SeedMessageSize Size of the initial HTTP header. This can be zero.
42 @param[in] SeedMessage Initial HTTP header to be used as a base for
43 building a new HTTP header. If NULL,
44 SeedMessageSize is ignored.
45 @param[in] DeleteCount Number of null-terminated HTTP header field names
47 @param[in] DeleteList List of null-terminated HTTP header field names to
48 remove from SeedMessage. Only the field names are
49 in this list because the field values are irrelevant
51 @param[in] AppendCount Number of header fields in AppendList.
52 @param[in] AppendList List of HTTP headers to populate NewMessage with.
53 If SeedMessage is not NULL, AppendList will be
54 appended to the existing list from SeedMessage in
56 @param[out] NewMessageSize Pointer to number of header fields in NewMessage.
57 @param[out] NewMessage Pointer to a new list of HTTP headers based on.
59 @retval EFI_SUCCESS Add, remove, and replace operations succeeded.
60 @retval EFI_OUT_OF_RESOURCES Could not allocate memory for NewMessage.
61 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
66 (EFIAPI
*EFI_HTTP_UTILS_BUILD
) (
67 IN EFI_HTTP_UTILITIES_PROTOCOL
*This
,
68 IN UINTN SeedMessageSize
,
69 IN VOID
*SeedMessage
, OPTIONAL
71 IN CHAR8
*DeleteList
[], OPTIONAL
73 IN EFI_HTTP_HEADER
*AppendList
[], OPTIONAL
74 OUT UINTN
*NewMessageSize
,
79 Parses HTTP header and produces an array of key/value pairs.
81 The Parse() function is used to transform data stored in HttpHeader
82 into a list of fields paired with their corresponding values.
84 @param[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
85 @param[in] HttpMessage Contains raw unformatted HTTP header string.
86 @param[in] HttpMessageSize Size of HTTP header.
87 @param[out] HeaderFields Array of key/value header pairs.
88 @param[out] FieldCount Number of headers in HeaderFields.
90 @retval EFI_SUCCESS Allocation succeeded.
91 @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been
93 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
101 (EFIAPI
*EFI_HTTP_UTILS_PARSE
) (
102 IN EFI_HTTP_UTILITIES_PROTOCOL
*This
,
103 IN CHAR8
*HttpMessage
,
104 IN UINTN HttpMessageSize
,
105 OUT EFI_HTTP_HEADER
**HeaderFields
,
106 OUT UINTN
*FieldCount
111 /// EFI_HTTP_UTILITIES_PROTOCOL
112 /// designed to be used by EFI drivers and applications to parse HTTP
113 /// headers from a byte stream. This driver is neither dependent on
114 /// network connectivity, nor the existence of an underlying network
117 struct _EFI_HTTP_UTILITIES_PROTOCOL
{
118 EFI_HTTP_UTILS_BUILD Build
;
119 EFI_HTTP_UTILS_PARSE Parse
;
122 extern EFI_GUID gEfiHttpUtilitiesProtocolGuid
;