]>
Commit | Line | Data |
---|---|---|
d933e70a JW |
1 | /** @file\r |
2 | The header files of Http Utilities functions for HttpUtilities driver.\r | |
3 | \r | |
4 | Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r | |
f58554fc | 5 | (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r |
d933e70a JW |
6 | \r |
7 | This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php.\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | **/\r | |
16 | \r | |
17 | #ifndef __EFI_HTTP_UTILITIES_DXE_H__\r | |
18 | #define __EFI_HTTP_UTILITIES_DXE_H__\r | |
19 | \r | |
20 | #include <Uefi.h>\r | |
21 | \r | |
22 | //\r | |
23 | // Libraries\r | |
24 | //\r | |
25 | #include <Library/UefiBootServicesTableLib.h>\r | |
26 | #include <Library/MemoryAllocationLib.h>\r | |
27 | #include <Library/BaseMemoryLib.h>\r | |
28 | #include <Library/BaseLib.h>\r | |
29 | #include <Library/UefiLib.h>\r | |
30 | #include <Library/DebugLib.h>\r | |
f58554fc | 31 | #include <Library/HttpLib.h>\r |
d933e70a JW |
32 | \r |
33 | //\r | |
34 | // Consumed Protocols\r | |
35 | //\r | |
36 | #include <Protocol/HttpUtilities.h>\r | |
37 | #include <Protocol/Http.h>\r | |
38 | \r | |
39 | //\r | |
40 | // Protocol instances\r | |
41 | //\r | |
42 | extern EFI_HTTP_UTILITIES_PROTOCOL mHttpUtilitiesProtocol;\r | |
43 | \r | |
d933e70a JW |
44 | /**\r |
45 | Create HTTP header based on a combination of seed header, fields\r | |
46 | to delete, and fields to append.\r | |
47 | \r | |
48 | The Build() function is used to manage the headers portion of an\r | |
49 | HTTP message by providing the ability to add, remove, or replace\r | |
50 | HTTP headers.\r | |
51 | \r | |
52 | @param[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.\r | |
53 | @param[in] SeedMessageSize Size of the initial HTTP header. This can be zero.\r | |
54 | @param[in] SeedMessage Initial HTTP header to be used as a base for\r | |
55 | building a new HTTP header. If NULL,\r | |
56 | SeedMessageSize is ignored.\r | |
57 | @param[in] DeleteCount Number of null-terminated HTTP header field names\r | |
58 | in DeleteList.\r | |
59 | @param[in] DeleteList List of null-terminated HTTP header field names to\r | |
60 | remove from SeedMessage. Only the field names are\r | |
61 | in this list because the field values are irrelevant\r | |
62 | to this operation.\r | |
63 | @param[in] AppendCount Number of header fields in AppendList.\r | |
64 | @param[in] AppendList List of HTTP headers to populate NewMessage with.\r | |
65 | If SeedMessage is not NULL, AppendList will be\r | |
66 | appended to the existing list from SeedMessage in\r | |
67 | NewMessage.\r | |
68 | @param[out] NewMessageSize Pointer to number of header fields in NewMessage.\r | |
69 | @param[out] NewMessage Pointer to a new list of HTTP headers based on.\r | |
70 | \r | |
71 | @retval EFI_SUCCESS Add, remove, and replace operations succeeded.\r | |
72 | @retval EFI_OUT_OF_RESOURCES Could not allocate memory for NewMessage.\r | |
73 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
74 | This is NULL.\r | |
75 | **/\r | |
76 | EFI_STATUS\r | |
77 | EFIAPI\r | |
78 | HttpUtilitiesBuild (\r | |
79 | IN EFI_HTTP_UTILITIES_PROTOCOL *This,\r | |
80 | IN UINTN SeedMessageSize,\r | |
81 | IN VOID *SeedMessage, OPTIONAL\r | |
82 | IN UINTN DeleteCount,\r | |
83 | IN CHAR8 *DeleteList[], OPTIONAL\r | |
84 | IN UINTN AppendCount,\r | |
85 | IN EFI_HTTP_HEADER *AppendList[], OPTIONAL\r | |
86 | OUT UINTN *NewMessageSize,\r | |
87 | OUT VOID **NewMessage\r | |
88 | );\r | |
89 | \r | |
90 | \r | |
91 | /**\r | |
92 | Parses HTTP header and produces an array of key/value pairs.\r | |
93 | \r | |
94 | The Parse() function is used to transform data stored in HttpHeader\r | |
95 | into a list of fields paired with their corresponding values.\r | |
96 | \r | |
97 | @param[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.\r | |
98 | @param[in] HttpMessage Contains raw unformatted HTTP header string.\r | |
99 | @param[in] HttpMessageSize Size of HTTP header.\r | |
100 | @param[out] HeaderFields Array of key/value header pairs.\r | |
101 | @param[out] FieldCount Number of headers in HeaderFields.\r | |
102 | \r | |
103 | @retval EFI_SUCCESS Allocation succeeded.\r | |
104 | @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been\r | |
105 | initialized.\r | |
106 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
107 | This is NULL.\r | |
108 | HttpMessage is NULL.\r | |
109 | HeaderFields is NULL.\r | |
110 | FieldCount is NULL.\r | |
111 | **/\r | |
112 | EFI_STATUS\r | |
113 | EFIAPI\r | |
114 | HttpUtilitiesParse (\r | |
115 | IN EFI_HTTP_UTILITIES_PROTOCOL *This,\r | |
116 | IN CHAR8 *HttpMessage,\r | |
117 | IN UINTN HttpMessageSize,\r | |
118 | OUT EFI_HTTP_HEADER **HeaderFields,\r | |
119 | OUT UINTN *FieldCount\r | |
120 | );\r | |
121 | \r | |
122 | #endif\r |