TianoCore EDK2 master
|
#include <Uefi.h>
#include <Protocol/Http.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/HttpIoLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
Go to the source code of this file.
Http IO Helper Library.
(C) Copyright 2020 Hewlett-Packard Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DxeHttpIoLib.c.
EFI_STATUS HttpIoCreateIo | ( | IN EFI_HANDLE | Image, |
IN EFI_HANDLE | Controller, | ||
IN UINT8 | IpVersion, | ||
IN HTTP_IO_CONFIG_DATA *ConfigData | OPTIONAL, | ||
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 , NULL means not to configure the HTTP child. |
[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. |
Definition at line 130 of file DxeHttpIoLib.c.
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 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. |
[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, | ||
IN UINTN | HeaderCount, | ||
IN EFI_HTTP_HEADER * | Headers, | ||
IN UINTN | BodyLength, | ||
IN VOID * | Body | ||
) |
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 trasmitted. |
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 293 of file DxeHttpIoLib.c.