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