]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | This file defines the EFI HTTP Protocol interface. It is split into\r | |
3 | the following two main sections:\r | |
4 | HTTP Service Binding Protocol (HTTPSB)\r | |
5 | HTTP Protocol (HTTP)\r | |
6 | \r | |
7 | Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r | |
8 | (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r | |
9 | This program and the accompanying materials\r | |
10 | are licensed and made available under the terms and conditions of the BSD License\r | |
11 | which accompanies this distribution. The full text of the license may be found at\r | |
12 | http://opensource.org/licenses/bsd-license.php\r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
16 | \r | |
17 | @par Revision Reference:\r | |
18 | This Protocol is introduced in UEFI Specification 2.5\r | |
19 | \r | |
20 | **/\r | |
21 | \r | |
22 | #ifndef __EFI_HTTP_PROTOCOL_H__\r | |
23 | #define __EFI_HTTP_PROTOCOL_H__\r | |
24 | \r | |
25 | #define EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID \\r | |
26 | { \\r | |
27 | 0xbdc8e6af, 0xd9bc, 0x4379, {0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 0x1c } \\r | |
28 | }\r | |
29 | \r | |
30 | #define EFI_HTTP_PROTOCOL_GUID \\r | |
31 | { \\r | |
32 | 0x7a59b29b, 0x910b, 0x4171, {0x82, 0x42, 0xa8, 0x5a, 0x0d, 0xf2, 0x5b, 0x5b } \\r | |
33 | }\r | |
34 | \r | |
35 | typedef struct _EFI_HTTP_PROTOCOL EFI_HTTP_PROTOCOL;\r | |
36 | \r | |
37 | ///\r | |
38 | /// EFI_HTTP_VERSION\r | |
39 | ///\r | |
40 | typedef enum {\r | |
41 | HttpVersion10,\r | |
42 | HttpVersion11,\r | |
43 | HttpVersionUnsupported\r | |
44 | } EFI_HTTP_VERSION;\r | |
45 | \r | |
46 | ///\r | |
47 | /// EFI_HTTP_METHOD\r | |
48 | ///\r | |
49 | typedef enum {\r | |
50 | HttpMethodGet,\r | |
51 | HttpMethodPost,\r | |
52 | HttpMethodPatch,\r | |
53 | HttpMethodOptions,\r | |
54 | HttpMethodConnect,\r | |
55 | HttpMethodHead,\r | |
56 | HttpMethodPut,\r | |
57 | HttpMethodDelete,\r | |
58 | HttpMethodTrace,\r | |
59 | HttpMethodMax\r | |
60 | } EFI_HTTP_METHOD;\r | |
61 | \r | |
62 | ///\r | |
63 | /// EFI_HTTP_STATUS_CODE\r | |
64 | ///\r | |
65 | typedef enum {\r | |
66 | HTTP_STATUS_UNSUPPORTED_STATUS = 0,\r | |
67 | HTTP_STATUS_100_CONTINUE,\r | |
68 | HTTP_STATUS_101_SWITCHING_PROTOCOLS,\r | |
69 | HTTP_STATUS_200_OK,\r | |
70 | HTTP_STATUS_201_CREATED,\r | |
71 | HTTP_STATUS_202_ACCEPTED,\r | |
72 | HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION,\r | |
73 | HTTP_STATUS_204_NO_CONTENT,\r | |
74 | HTTP_STATUS_205_RESET_CONTENT,\r | |
75 | HTTP_STATUS_206_PARTIAL_CONTENT,\r | |
76 | HTTP_STATUS_300_MULTIPLE_CHIOCES,\r | |
77 | HTTP_STATUS_301_MOVED_PERMANENTLY,\r | |
78 | HTTP_STATUS_302_FOUND,\r | |
79 | HTTP_STATUS_303_SEE_OTHER,\r | |
80 | HTTP_STATUS_304_NOT_MODIFIED,\r | |
81 | HTTP_STATUS_305_USE_PROXY,\r | |
82 | HTTP_STATUS_307_TEMPORARY_REDIRECT,\r | |
83 | HTTP_STATUS_400_BAD_REQUEST,\r | |
84 | HTTP_STATUS_401_UNAUTHORIZED,\r | |
85 | HTTP_STATUS_402_PAYMENT_REQUIRED,\r | |
86 | HTTP_STATUS_403_FORBIDDEN,\r | |
87 | HTTP_STATUS_404_NOT_FOUND,\r | |
88 | HTTP_STATUS_405_METHOD_NOT_ALLOWED,\r | |
89 | HTTP_STATUS_406_NOT_ACCEPTABLE,\r | |
90 | HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED,\r | |
91 | HTTP_STATUS_408_REQUEST_TIME_OUT,\r | |
92 | HTTP_STATUS_409_CONFLICT,\r | |
93 | HTTP_STATUS_410_GONE,\r | |
94 | HTTP_STATUS_411_LENGTH_REQUIRED,\r | |
95 | HTTP_STATUS_412_PRECONDITION_FAILED,\r | |
96 | HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE,\r | |
97 | HTTP_STATUS_414_REQUEST_URI_TOO_LARGE,\r | |
98 | HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE,\r | |
99 | HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED,\r | |
100 | HTTP_STATUS_417_EXPECTATION_FAILED,\r | |
101 | HTTP_STATUS_500_INTERNAL_SERVER_ERROR,\r | |
102 | HTTP_STATUS_501_NOT_IMPLEMENTED,\r | |
103 | HTTP_STATUS_502_BAD_GATEWAY,\r | |
104 | HTTP_STATUS_503_SERVICE_UNAVAILABLE,\r | |
105 | HTTP_STATUS_504_GATEWAY_TIME_OUT,\r | |
106 | HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED\r | |
107 | } EFI_HTTP_STATUS_CODE;\r | |
108 | \r | |
109 | ///\r | |
110 | /// EFI_HTTPv4_ACCESS_POINT\r | |
111 | ///\r | |
112 | typedef struct {\r | |
113 | ///\r | |
114 | /// Set to TRUE to instruct the EFI HTTP instance to use the default address\r | |
115 | /// information in every TCP connection made by this instance. In addition, when set\r | |
116 | /// to TRUE, LocalAddress and LocalSubnet are ignored.\r | |
117 | ///\r | |
118 | BOOLEAN UseDefaultAddress;\r | |
119 | ///\r | |
120 | /// If UseDefaultAddress is set to FALSE, this defines the local IP address to be\r | |
121 | /// used in every TCP connection opened by this instance.\r | |
122 | ///\r | |
123 | EFI_IPv4_ADDRESS LocalAddress;\r | |
124 | ///\r | |
125 | /// If UseDefaultAddress is set to FALSE, this defines the local subnet to be used\r | |
126 | /// in every TCP connection opened by this instance.\r | |
127 | ///\r | |
128 | EFI_IPv4_ADDRESS LocalSubnet;\r | |
129 | ///\r | |
130 | /// This defines the local port to be used in\r | |
131 | /// every TCP connection opened by this instance.\r | |
132 | ///\r | |
133 | UINT16 LocalPort;\r | |
134 | } EFI_HTTPv4_ACCESS_POINT;\r | |
135 | \r | |
136 | ///\r | |
137 | /// EFI_HTTPv6_ACCESS_POINT\r | |
138 | ///\r | |
139 | typedef struct {\r | |
140 | ///\r | |
141 | /// Local IP address to be used in every TCP connection opened by this instance.\r | |
142 | ///\r | |
143 | EFI_IPv6_ADDRESS LocalAddress;\r | |
144 | ///\r | |
145 | /// Local port to be used in every TCP connection opened by this instance.\r | |
146 | ///\r | |
147 | UINT16 LocalPort;\r | |
148 | } EFI_HTTPv6_ACCESS_POINT;\r | |
149 | \r | |
150 | ///\r | |
151 | /// EFI_HTTP_CONFIG_DATA_ACCESS_POINT\r | |
152 | ///\r | |
153 | \r | |
154 | \r | |
155 | typedef struct {\r | |
156 | ///\r | |
157 | /// HTTP version that this instance will support.\r | |
158 | ///\r | |
159 | EFI_HTTP_VERSION HttpVersion;\r | |
160 | ///\r | |
161 | /// Time out (in milliseconds) when blocking for requests.\r | |
162 | ///\r | |
163 | UINT32 TimeOutMillisec;\r | |
164 | ///\r | |
165 | /// Defines behavior of EFI DNS and TCP protocols consumed by this instance. If\r | |
166 | /// FALSE, this instance will use EFI_DNS4_PROTOCOL and EFI_TCP4_PROTOCOL. If TRUE,\r | |
167 | /// this instance will use EFI_DNS6_PROTOCOL and EFI_TCP6_PROTOCOL.\r | |
168 | ///\r | |
169 | BOOLEAN LocalAddressIsIPv6;\r | |
170 | \r | |
171 | union {\r | |
172 | ///\r | |
173 | /// When LocalAddressIsIPv6 is FALSE, this points to the local address, subnet, and\r | |
174 | /// port used by the underlying TCP protocol.\r | |
175 | ///\r | |
176 | EFI_HTTPv4_ACCESS_POINT *IPv4Node;\r | |
177 | ///\r | |
178 | /// When LocalAddressIsIPv6 is TRUE, this points to the local IPv6 address and port\r | |
179 | /// used by the underlying TCP protocol.\r | |
180 | ///\r | |
181 | EFI_HTTPv6_ACCESS_POINT *IPv6Node;\r | |
182 | } AccessPoint;\r | |
183 | } EFI_HTTP_CONFIG_DATA;\r | |
184 | \r | |
185 | ///\r | |
186 | /// EFI_HTTP_REQUEST_DATA\r | |
187 | ///\r | |
188 | typedef struct {\r | |
189 | ///\r | |
190 | /// The HTTP method (e.g. GET, POST) for this HTTP Request.\r | |
191 | ///\r | |
192 | EFI_HTTP_METHOD Method;\r | |
193 | ///\r | |
194 | /// The URI of a remote host. From the information in this field, the HTTP instance\r | |
195 | /// will be able to determine whether to use HTTP or HTTPS and will also be able to\r | |
196 | /// determine the port number to use. If no port number is specified, port 80 (HTTP)\r | |
197 | /// is assumed. See RFC 3986 for more details on URI syntax.\r | |
198 | ///\r | |
199 | CHAR16 *Url;\r | |
200 | } EFI_HTTP_REQUEST_DATA;\r | |
201 | \r | |
202 | ///\r | |
203 | /// EFI_HTTP_RESPONSE_DATA\r | |
204 | ///\r | |
205 | typedef struct {\r | |
206 | ///\r | |
207 | /// Response status code returned by the remote host.\r | |
208 | ///\r | |
209 | EFI_HTTP_STATUS_CODE StatusCode;\r | |
210 | } EFI_HTTP_RESPONSE_DATA;\r | |
211 | \r | |
212 | ///\r | |
213 | /// EFI_HTTP_HEADER\r | |
214 | ///\r | |
215 | typedef struct {\r | |
216 | ///\r | |
217 | /// Null terminated string which describes a field name. See RFC 2616 Section 14 for\r | |
218 | /// detailed information about field names.\r | |
219 | ///\r | |
220 | CHAR8 *FieldName;\r | |
221 | ///\r | |
222 | /// Null terminated string which describes the corresponding field value. See RFC 2616\r | |
223 | /// Section 14 for detailed information about field values.\r | |
224 | ///\r | |
225 | CHAR8 *FieldValue;\r | |
226 | } EFI_HTTP_HEADER;\r | |
227 | \r | |
228 | ///\r | |
229 | /// EFI_HTTP_MESSAGE\r | |
230 | ///\r | |
231 | typedef struct {\r | |
232 | ///\r | |
233 | /// HTTP message data.\r | |
234 | ///\r | |
235 | union {\r | |
236 | ///\r | |
237 | /// When the token is used to send a HTTP request, Request is a pointer to storage that\r | |
238 | /// contains such data as URL and HTTP method.\r | |
239 | ///\r | |
240 | EFI_HTTP_REQUEST_DATA *Request;\r | |
241 | ///\r | |
242 | /// When used to await a response, Response points to storage containing HTTP response\r | |
243 | /// status code.\r | |
244 | ///\r | |
245 | EFI_HTTP_RESPONSE_DATA *Response;\r | |
246 | } Data;\r | |
247 | ///\r | |
248 | /// Number of HTTP header structures in Headers list. On request, this count is\r | |
249 | /// provided by the caller. On response, this count is provided by the HTTP driver.\r | |
250 | ///\r | |
251 | UINTN HeaderCount;\r | |
252 | ///\r | |
253 | /// Array containing list of HTTP headers. On request, this array is populated by the\r | |
254 | /// caller. On response, this array is allocated and populated by the HTTP driver. It\r | |
255 | /// is the responsibility of the caller to free this memory on both request and\r | |
256 | /// response.\r | |
257 | ///\r | |
258 | EFI_HTTP_HEADER *Headers;\r | |
259 | ///\r | |
260 | /// Length in bytes of the HTTP body. This can be zero depending on the HttpMethod type.\r | |
261 | ///\r | |
262 | UINTN BodyLength;\r | |
263 | ///\r | |
264 | /// Body associated with the HTTP request or response. This can be NULL depending on\r | |
265 | /// the HttpMethod type.\r | |
266 | ///\r | |
267 | VOID *Body;\r | |
268 | } EFI_HTTP_MESSAGE;\r | |
269 | \r | |
270 | \r | |
271 | ///\r | |
272 | /// EFI_HTTP_TOKEN\r | |
273 | ///\r | |
274 | typedef struct {\r | |
275 | ///\r | |
276 | /// This Event will be signaled after the Status field is updated by the EFI HTTP\r | |
277 | /// Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL. The Task Priority\r | |
278 | /// Level (TPL) of Event must be lower than or equal to TPL_CALLBACK.\r | |
279 | ///\r | |
280 | EFI_EVENT Event;\r | |
281 | ///\r | |
282 | /// Status will be set to one of the following value if the HTTP request is\r | |
283 | /// successfully sent or if an unexpected error occurs:\r | |
284 | /// EFI_SUCCESS: The HTTP request was successfully sent to the remote host.\r | |
285 | /// EFI_HTTP_ERROR: The response message was successfully received but contains a\r | |
286 | /// HTTP error. The response status code is returned in token.\r | |
287 | /// EFI_ABORTED: The HTTP request was cancelled by the caller and removed from\r | |
288 | /// the transmit queue.\r | |
289 | /// EFI_TIMEOUT: The HTTP request timed out before reaching the remote host.\r | |
290 | /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r | |
291 | ///\r | |
292 | EFI_STATUS Status;\r | |
293 | ///\r | |
294 | /// Pointer to storage containing HTTP message data.\r | |
295 | ///\r | |
296 | EFI_HTTP_MESSAGE *Message;\r | |
297 | } EFI_HTTP_TOKEN;\r | |
298 | \r | |
299 | /**\r | |
300 | Returns the operational parameters for the current HTTP child instance.\r | |
301 | \r | |
302 | The GetModeData() function is used to read the current mode data (operational\r | |
303 | parameters) for this HTTP protocol instance.\r | |
304 | \r | |
305 | @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r | |
306 | @param[out] HttpConfigData Point to buffer for operational parameters of this\r | |
307 | HTTP instance.\r | |
308 | \r | |
309 | @retval EFI_SUCCESS Operation succeeded.\r | |
310 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
311 | HttpConfigData is NULL.\r | |
312 | HttpInstance->LocalAddressIsIPv6 is FALSE and\r | |
313 | HttpConfigData->IPv4Node is NULL.\r | |
314 | HttpInstance->LocalAddressIsIPv6 is TRUE and\r | |
315 | HttpConfigData->IPv6Node is NULL.\r | |
316 | @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.\r | |
317 | **/\r | |
318 | typedef\r | |
319 | EFI_STATUS\r | |
320 | (EFIAPI * EFI_HTTP_GET_MODE_DATA)(\r | |
321 | IN EFI_HTTP_PROTOCOL *This,\r | |
322 | OUT EFI_HTTP_CONFIG_DATA *HttpConfigData\r | |
323 | );\r | |
324 | \r | |
325 | /**\r | |
326 | Initialize or brutally reset the operational parameters for this EFI HTTP instance.\r | |
327 | \r | |
328 | The Configure() function does the following:\r | |
329 | When HttpConfigData is not NULL Initialize this EFI HTTP instance by configuring\r | |
330 | timeout, local address, port, etc.\r | |
331 | When HttpConfigData is NULL, reset this EFI HTTP instance by closing all active\r | |
332 | connections with remote hosts, canceling all asynchronous tokens, and flush request\r | |
333 | and response buffers without informing the appropriate hosts.\r | |
334 | \r | |
335 | No other EFI HTTP function can be executed by this instance until the Configure()\r | |
336 | function is executed and returns successfully.\r | |
337 | \r | |
338 | @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r | |
339 | @param[in] HttpConfigData Pointer to the configure data to configure the instance.\r | |
340 | \r | |
341 | @retval EFI_SUCCESS Operation succeeded.\r | |
342 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
343 | This is NULL.\r | |
344 | HttpConfigData is NULL.\r | |
345 | HttpConfigData->LocalAddressIsIPv6 is FALSE and\r | |
346 | HttpConfigData->IPv4Node is NULL.\r | |
347 | HttpConfigData->LocalAddressIsIPv6 is TRUE and\r | |
348 | HttpConfigData->IPv6Node is NULL.\r | |
349 | @retval EFI_ALREADY_STARTED Reinitialize this HTTP instance without calling\r | |
350 | Configure() with NULL to reset it.\r | |
351 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
352 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when\r | |
353 | executing Configure().\r | |
354 | @retval EFI_UNSUPPORTED One or more options in ConfigData are not supported\r | |
355 | in the implementation.\r | |
356 | **/\r | |
357 | typedef\r | |
358 | EFI_STATUS\r | |
359 | (EFIAPI * EFI_HTTP_CONFIGURE)(\r | |
360 | IN EFI_HTTP_PROTOCOL *This,\r | |
361 | IN EFI_HTTP_CONFIG_DATA *HttpConfigData\r | |
362 | );\r | |
363 | \r | |
364 | /**\r | |
365 | The Request() function queues an HTTP request to this HTTP instance, \r | |
366 | similar to Transmit() function in the EFI TCP driver. When the HTTP request is sent\r | |
367 | successfully, or if there is an error, Status in token will be updated and Event will\r | |
368 | be signaled.\r | |
369 | \r | |
370 | @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r | |
371 | @param[in] Token Pointer to storage containing HTTP request token.\r | |
372 | \r | |
373 | @retval EFI_SUCCESS Outgoing data was processed.\r | |
374 | @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.\r | |
375 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
376 | @retval EFI_TIMEOUT Data was dropped out of the transmit or receive queue.\r | |
377 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
378 | This is NULL.\r | |
379 | Token is NULL.\r | |
380 | Token->Message is NULL.\r | |
381 | Token->Message->Body is not NULL,\r | |
382 | Token->Message->BodyLength is non-zero, and\r | |
383 | Token->Message->Data is NULL, but a previous call to\r | |
384 | Request()has not been completed successfully.\r | |
385 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources.\r | |
386 | @retval EFI_UNSUPPORTED The HTTP method is not supported in current implementation.\r | |
387 | **/\r | |
388 | typedef\r | |
389 | EFI_STATUS\r | |
390 | (EFIAPI *EFI_HTTP_REQUEST) (\r | |
391 | IN EFI_HTTP_PROTOCOL *This,\r | |
392 | IN EFI_HTTP_TOKEN *Token\r | |
393 | );\r | |
394 | \r | |
395 | /**\r | |
396 | Abort an asynchronous HTTP request or response token.\r | |
397 | \r | |
398 | The Cancel() function aborts a pending HTTP request or response transaction. If\r | |
399 | Token is not NULL and the token is in transmit or receive queues when it is being\r | |
400 | cancelled, its Token->Status will be set to EFI_ABORTED and then Token->Event will\r | |
401 | be signaled. If the token is not in one of the queues, which usually means that the\r | |
402 | asynchronous operation has completed, EFI_NOT_FOUND is returned. If Token is NULL,\r | |
403 | all asynchronous tokens issued by Request() or Response() will be aborted.\r | |
404 | \r | |
405 | @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r | |
406 | @param[in] Token Point to storage containing HTTP request or response\r | |
407 | token.\r | |
408 | \r | |
409 | @retval EFI_SUCCESS Request and Response queues are successfully flushed.\r | |
410 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
411 | @retval EFI_NOT_STARTED This instance hasn't been configured.\r | |
412 | @retval EFI_NOT_FOUND The asynchronous request or response token is not\r | |
413 | found.\r | |
414 | @retval EFI_UNSUPPORTED The implementation does not support this function.\r | |
415 | **/\r | |
416 | typedef\r | |
417 | EFI_STATUS\r | |
418 | (EFIAPI *EFI_HTTP_CANCEL)(\r | |
419 | IN EFI_HTTP_PROTOCOL *This,\r | |
420 | IN EFI_HTTP_TOKEN *Token\r | |
421 | );\r | |
422 | \r | |
423 | /**\r | |
424 | The Response() function queues an HTTP response to this HTTP instance, similar to\r | |
425 | Receive() function in the EFI TCP driver. When the HTTP Response is received successfully,\r | |
426 | or if there is an error, Status in token will be updated and Event will be signaled.\r | |
427 | \r | |
428 | The HTTP driver will queue a receive token to the underlying TCP instance. When data\r | |
429 | is received in the underlying TCP instance, the data will be parsed and Token will\r | |
430 | be populated with the response data. If the data received from the remote host\r | |
431 | contains an incomplete or invalid HTTP header, the HTTP driver will continue waiting\r | |
432 | (asynchronously) for more data to be sent from the remote host before signaling\r | |
433 | Event in Token.\r | |
434 | \r | |
435 | It is the responsibility of the caller to allocate a buffer for Body and specify the\r | |
436 | size in BodyLength. If the remote host provides a response that contains a content\r | |
437 | body, up to BodyLength bytes will be copied from the receive buffer into Body and\r | |
438 | BodyLength will be updated with the amount of bytes received and copied to Body. This\r | |
439 | allows the client to download a large file in chunks instead of into one contiguous\r | |
440 | block of memory. Similar to HTTP request, if Body is not NULL and BodyLength is\r | |
441 | non-zero and all other fields are NULL or 0, the HTTP driver will queue a receive\r | |
442 | token to underlying TCP instance. If data arrives in the receive buffer, up to\r | |
443 | BodyLength bytes of data will be copied to Body. The HTTP driver will then update\r | |
444 | BodyLength with the amount of bytes received and copied to Body.\r | |
445 | \r | |
446 | If the HTTP driver does not have an open underlying TCP connection with the host\r | |
447 | specified in the response URL, Request() will return EFI_ACCESS_DENIED. This is\r | |
448 | consistent with RFC 2616 recommendation that HTTP clients should attempt to maintain\r | |
449 | an open TCP connection between client and host.\r | |
450 | \r | |
451 | @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r | |
452 | @param[in] Token Pointer to storage containing HTTP response token.\r | |
453 | \r | |
454 | @retval EFI_SUCCESS Allocation succeeded.\r | |
455 | @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been\r | |
456 | initialized.\r | |
457 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
458 | This is NULL.\r | |
459 | Token is NULL.\r | |
460 | Token->Message->Headers is NULL.\r | |
461 | Token->Message is NULL.\r | |
462 | Token->Message->Body is not NULL,\r | |
463 | Token->Message->BodyLength is non-zero, and\r | |
464 | Token->Message->Data is NULL, but a previous call to\r | |
465 | Response() has not been completed successfully.\r | |
466 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources.\r | |
467 | @retval EFI_ACCESS_DENIED An open TCP connection is not present with the host\r | |
468 | specified by response URL.\r | |
469 | **/\r | |
470 | typedef\r | |
471 | EFI_STATUS\r | |
472 | (EFIAPI *EFI_HTTP_RESPONSE) (\r | |
473 | IN EFI_HTTP_PROTOCOL *This,\r | |
474 | IN EFI_HTTP_TOKEN *Token\r | |
475 | );\r | |
476 | \r | |
477 | /**\r | |
478 | The Poll() function can be used by network drivers and applications to increase the\r | |
479 | rate that data packets are moved between the communication devices and the transmit\r | |
480 | and receive queues.\r | |
481 | \r | |
482 | In some systems, the periodic timer event in the managed network driver may not poll\r | |
483 | the underlying communications device fast enough to transmit and/or receive all data\r | |
484 | packets without missing incoming packets or dropping outgoing packets. Drivers and\r | |
485 | applications that are experiencing packet loss should try calling the Poll() function\r | |
486 | more often.\r | |
487 | \r | |
488 | @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r | |
489 | \r | |
490 | @retval EFI_SUCCESS Incoming or outgoing data was processed..\r | |
491 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred\r | |
492 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
493 | @retval EFI_NOT_READY No incoming or outgoing data is processed.\r | |
494 | @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.\r | |
495 | **/\r | |
496 | typedef\r | |
497 | EFI_STATUS\r | |
498 | (EFIAPI *EFI_HTTP_POLL) (\r | |
499 | IN EFI_HTTP_PROTOCOL *This\r | |
500 | );\r | |
501 | \r | |
502 | ///\r | |
503 | /// The EFI HTTP protocol is designed to be used by EFI drivers and applications to\r | |
504 | /// create and transmit HTTP Requests, as well as handle HTTP responses that are\r | |
505 | /// returned by a remote host. This EFI protocol uses and relies on an underlying EFI\r | |
506 | /// TCP protocol.\r | |
507 | ///\r | |
508 | struct _EFI_HTTP_PROTOCOL {\r | |
509 | EFI_HTTP_GET_MODE_DATA GetModeData;\r | |
510 | EFI_HTTP_CONFIGURE Configure;\r | |
511 | EFI_HTTP_REQUEST Request;\r | |
512 | EFI_HTTP_CANCEL Cancel;\r | |
513 | EFI_HTTP_RESPONSE Response;\r | |
514 | EFI_HTTP_POLL Poll;\r | |
515 | };\r | |
516 | \r | |
517 | extern EFI_GUID gEfiHttpServiceBindingProtocolGuid;\r | |
518 | extern EFI_GUID gEfiHttpProtocolGuid;\r | |
519 | \r | |
520 | #endif\r |