NetworkPkg[all]
0.98
|
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 IN EFI_HTTP_MESSAGE * | Message |
typedef IN EFI_HTTP_MESSAGE IN VOID * | Context |
Functions | |
typedef | EFI_STATUS (EFIAPI *HTTP_IO_CALLBACK)(IN HTTP_IO_CALLBACK_EVENT EventType |
VOID EFIAPI | HttpIoNotifyDpc (IN VOID *Context) |
VOID EFIAPI | HttpIoNotify (IN EFI_EVENT Event, IN VOID *Context) |
VOID | HttpIoDestroyIo (IN HTTP_IO *HttpIo) |
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) |
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) |
EFI_STATUS | HttpIoRecvResponse (IN HTTP_IO *HttpIo, IN BOOLEAN RecvMsgHeader, OUT HTTP_IO_RESPONSE_DATA *ResponseData) |
EFI_STATUS | HttpIoGetContentLength (IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, OUT UINTN *ContentLength) |
EFI_STATUS | HttpIoGetChunkedTransferContent (IN HTTP_IO *HttpIo, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, OUT LIST_ENTRY **ChunkListHead, OUT UINTN *ContentLength) |
EFI_STATUS | HttpIoSendChunkedTransfer (IN HTTP_IO *HttpIo, IN HTTP_IO_SEND_CHUNK_PROCESS *SendChunkProcess, IN EFI_HTTP_MESSAGE *RequestMessage) |
(C) Copyright 2020 Hewlett-Packard Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
#define HTTP_IO_CHUNK_SIZE_STRING_LEN 50 |
#define HTTP_IO_CHUNKED_TRANSFER_CODING_DATA_LENGTH 256 |
#define HTTP_IO_MAX_SEND_PAYLOAD 1024 |
typedef IN EFI_HTTP_MESSAGE* Message |
typedef EFI_STATUS | ( | EFIAPI * | HTTP_IO_CALLBACK | ) |
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. |
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. |
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. |
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. |
Request HttpIoNotifyDpc as a DPC at TPL_CALLBACK.
[in] | Event | The event signaled. |
[in] | Context | The opaque parameter to the function. |
Notify the callback function when an event is triggered.
[in] | Context | The opaque parameter to the function. |
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. |
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. |
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 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. |