TianoCore EDK2 master
|
#include <IndustryStandard/Http11.h>
#include <Library/DpcLib.h>
#include <Library/HttpLib.h>
#include <Library/NetLib.h>
Go to the source code of this file.
Data Structures | |
struct | HTTP_IO_RESPONSE_DATA |
struct | HTTP4_IO_CONFIG_DATA |
struct | HTTP6_IO_CONFIG_DATA |
union | HTTP_IO_CONFIG_DATA |
struct | HTTP_IO |
struct | HTTP_IO_CHUNKS |
Macros | |
#define | HTTP_IO_MAX_SEND_PAYLOAD 1024 |
#define | HTTP_IO_CHUNK_SIZE_STRING_LEN 50 |
#define | HTTP_IO_CHUNKED_TRANSFER_CODING_DATA_LENGTH 256 |
Typedefs | |
typedef EFI_STATUS(EFIAPI * | HTTP_IO_CALLBACK) (IN HTTP_IO_CALLBACK_EVENT EventType, IN EFI_HTTP_MESSAGE *Message, IN VOID *Context) |
Enumerations | |
enum | HTTP_IO_CALLBACK_EVENT { HttpIoRequest , HttpIoResponse } |
enum | HTTP_IO_SEND_CHUNK_PROCESS { HttpIoSendChunkNone = 0 , HttpIoSendChunkHeaderZeroContent , HttpIoSendChunkContent , HttpIoSendChunkEndChunk , HttpIoSendChunkFinish } |
enum | HTTP_IO_SEND_NON_CHUNK_PROCESS { HttpIoSendNonChunkNone = 0 , HttpIoSendNonChunkHeaderZeroContent , HttpIoSendNonChunkContent , HttpIoSendNonChunkFinish } |
(C) Copyright 2020 Hewlett-Packard Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HttpIoLib.h.
#define HTTP_IO_CHUNK_SIZE_STRING_LEN 50 |
Definition at line 19 of file HttpIoLib.h.
#define HTTP_IO_CHUNKED_TRANSFER_CODING_DATA_LENGTH 256 |
Definition at line 20 of file HttpIoLib.h.
#define HTTP_IO_MAX_SEND_PAYLOAD 1024 |
Definition at line 18 of file HttpIoLib.h.
typedef EFI_STATUS(EFIAPI * HTTP_IO_CALLBACK) (IN HTTP_IO_CALLBACK_EVENT EventType, IN EFI_HTTP_MESSAGE *Message, IN VOID *Context) |
HttpIo Callback function which will be invoked when specified HTTP_IO_CALLBACK_EVENT happened.
[in] | EventType | Indicate the Event type that occurs in the current callback. |
[in] | Message | HTTP message which will be send to, or just received from HTTP server. |
[in] | Context | The Callback Context pointer. |
EFI_SUCCESS | Tells the HttpIo to continue the HTTP process. |
Others | Tells the HttpIo to abort the current HTTP process. |
Definition at line 41 of file HttpIoLib.h.
HTTP_IO_CALLBACK_EVENT
Definition at line 25 of file HttpIoLib.h.
Process code of HTTP chunk transfer.
Definition at line 121 of file HttpIoLib.h.
Process code of HTTP non chunk transfer.
Definition at line 132 of file HttpIoLib.h.
EFI_STATUS HttpIoCreateIo | ( | IN EFI_HANDLE | Image, |
IN EFI_HANDLE | Controller, | ||
IN UINT8 | IpVersion, | ||
IN HTTP_IO_CONFIG_DATA * | ConfigData, | ||
IN HTTP_IO_CALLBACK | Callback, | ||
IN VOID * | Context, | ||
OUT HTTP_IO * | HttpIo | ||
) |
Create a HTTP_IO to access the HTTP service. It will create and configure a HTTP child handle.
[in] | Image | The handle of the driver image. |
[in] | Controller | The handle of the controller. |
[in] | IpVersion | IP_VERSION_4 or IP_VERSION_6. |
[in] | ConfigData | The HTTP_IO configuration data. |
[in] | Callback | Callback function which will be invoked when specified HTTP_IO_CALLBACK_EVENT happened. |
[in] | Context | The Context data which will be passed to the Callback function. |
[out] | HttpIo | The HTTP_IO. |
EFI_SUCCESS | The HTTP_IO is created and configured. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_UNSUPPORTED | One or more of the control options are not supported in the implementation. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
Others | Failed to create the HTTP_IO or configure it. |
Destroy the HTTP_IO and release the resources.
[in] | HttpIo | The HTTP_IO which wraps the HTTP service to be destroyed. |
Definition at line 62 of file DxeHttpIoLib.c.
EFI_STATUS HttpIoGetChunkedTransferContent | ( | IN HTTP_IO * | HttpIo, |
IN UINTN | HeaderCount, | ||
IN EFI_HTTP_HEADER * | Headers, | ||
OUT LIST_ENTRY ** | ChunkListHead, | ||
OUT UINTN * | ContentLength | ||
) |
Synchronously receive a HTTP RESPONSE message from the server.
[in] | HttpIo | The HttpIo wrapping the HTTP service. |
[in] | HeaderCount | Number of headers in Headers. |
[in] | Headers | Array containing list of HTTP headers. |
[out] | ChunkListHead | A pointer to receivce list head of chunked data. Caller has to release memory of ChunkListHead and all list entries. |
[out] | ContentLength | Total content length |
EFI_SUCCESS | The HTTP chunked transfer is received. |
EFI_NOT_FOUND | No chunked transfer coding header found. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
EFI_INVALID_PARAMETER | Improper parameters. |
Others | Other errors as indicated. |
Synchronously receive a HTTP RESPONSE message from the server.
[in] | HttpIo | The HttpIo wrapping the HTTP service. |
[in] | HeaderCount | Number of headers in Headers. |
[in] | Headers | Array containing list of HTTP headers. |
[out] | ChunkListHead | A pointer to receive list head of chunked data. Caller has to release memory of ChunkListHead and all list entries. |
[out] | ContentLength | Total content length |
EFI_SUCCESS | The HTTP chunked transfer is received. |
EFI_NOT_FOUND | No chunked transfer coding header found. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
EFI_INVALID_PARAMETER | Improper parameters. |
Others | Other errors as indicated. |
Definition at line 678 of file DxeHttpIoLib.c.
EFI_STATUS HttpIoGetContentLength | ( | IN UINTN | HeaderCount, |
IN EFI_HTTP_HEADER * | Headers, | ||
OUT UINTN * | ContentLength | ||
) |
Get the value of the content length if there is a "Content-Length" header.
[in] | HeaderCount | Number of HTTP header structures in Headers. |
[in] | Headers | Array containing list of HTTP headers. |
[out] | ContentLength | Pointer to save the value of the content length. |
EFI_SUCCESS | Successfully get the content length. |
EFI_NOT_FOUND | No "Content-Length" header in the Headers. |
Definition at line 479 of file DxeHttpIoLib.c.
Request HttpIoNotifyDpc as a DPC at TPL_CALLBACK.
[in] | Event | The event signaled. |
[in] | Context | The opaque parameter to the function. |
Definition at line 44 of file DxeHttpIoLib.c.
VOID EFIAPI HttpIoNotifyDpc | ( | IN VOID * | Context | ) |
Notify the callback function when an event is triggered.
[in] | Context | The opaque parameter to the function. |
Definition at line 28 of file DxeHttpIoLib.c.
EFI_STATUS HttpIoRecvResponse | ( | IN HTTP_IO * | HttpIo, |
IN BOOLEAN | RecvMsgHeader, | ||
OUT HTTP_IO_RESPONSE_DATA * | ResponseData | ||
) |
Synchronously receive a HTTP RESPONSE message from the server.
[in] | HttpIo | The HttpIo wrapping the HTTP service. |
[in] | RecvMsgHeader | TRUE to receive a new HTTP response (from message header). FALSE to continue receive the previous response message. |
[out] | ResponseData | Point to a wrapper of the received response data. |
EFI_SUCCESS | The HTTP response is received. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
EFI_DEVICE_ERROR | An unexpected network or system error occurred. |
Others | Other errors as indicated. |
Definition at line 366 of file DxeHttpIoLib.c.
EFI_STATUS HttpIoSendChunkedTransfer | ( | IN HTTP_IO * | HttpIo, |
IN HTTP_IO_SEND_CHUNK_PROCESS * | SendChunkProcess, | ||
IN EFI_HTTP_MESSAGE * | RequestMessage | ||
) |
Send HTTP request in chunks.
[in] | HttpIo | The HttpIo wrapping the HTTP service. |
[in] | SendChunkProcess | Pointer to current chunk process status. |
[out] | RequestMessage | Request to send. |
EFI_SUCCESS | Successfully to send chunk data according to SendChunkProcess. |
Other | Other errors. |
Send HTTP request in chunks.
[in] | HttpIo | The HttpIo wrapping the HTTP service. |
[in] | SendChunkProcess | Pointer to current chunk process status. |
[in] | RequestMessage | Request to send. |
EFI_SUCCESS | Successfully to send chunk data according to SendChunkProcess. |
Other | Other errors. |
Definition at line 507 of file DxeHttpIoLib.c.
EFI_STATUS HttpIoSendRequest | ( | IN HTTP_IO * | HttpIo, |
IN EFI_HTTP_REQUEST_DATA *Request | OPTIONAL, | ||
IN UINTN | HeaderCount, | ||
IN EFI_HTTP_HEADER *Headers | OPTIONAL, | ||
IN UINTN | BodyLength, | ||
IN VOID *Body | OPTIONAL | ||
) |
Synchronously send a HTTP REQUEST message to the server.
[in] | HttpIo | The HttpIo wrapping the HTTP service. |
[in] | Request | A pointer to storage such data as URL and HTTP method. |
[in] | HeaderCount | Number of HTTP header structures in Headers list. |
[in] | Headers | Array containing list of HTTP headers. |
[in] | BodyLength | Length in bytes of the HTTP body. |
[in] | Body | Body associated with the HTTP request. |
EFI_SUCCESS | The HTTP request is transmitted. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
EFI_DEVICE_ERROR | An unexpected network or system error occurred. |
Others | Other errors as indicated. |