TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeHttpIoLib.c File Reference

Go to the source code of this file.

Functions

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 OPTIONAL, 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 HttpIoSendChunkedTransfer (IN HTTP_IO *HttpIo, IN HTTP_IO_SEND_CHUNK_PROCESS *SendChunkProcess, IN EFI_HTTP_MESSAGE *RequestMessage)
 
EFI_STATUS HttpIoGetChunkedTransferContent (IN HTTP_IO *HttpIo, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, OUT LIST_ENTRY **ChunkListHead, OUT UINTN *ContentLength)
 

Detailed Description

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.

Function Documentation

◆ HttpIoCreateIo()

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.

Parameters
[in]ImageThe handle of the driver image.
[in]ControllerThe handle of the controller.
[in]IpVersionIP_VERSION_4 or IP_VERSION_6.
[in]ConfigDataThe HTTP_IO configuration data , NULL means not to configure the HTTP child.
[in]CallbackCallback function which will be invoked when specified HTTP_IO_CALLBACK_EVENT happened.
[in]ContextThe Context data which will be passed to the Callback function.
[out]HttpIoThe HTTP_IO.
Return values
EFI_SUCCESSThe HTTP_IO is created and configured.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_UNSUPPORTEDOne or more of the control options are not supported in the implementation.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
OthersFailed to create the HTTP_IO or configure it.

Definition at line 130 of file DxeHttpIoLib.c.

◆ HttpIoDestroyIo()

VOID HttpIoDestroyIo ( IN HTTP_IO HttpIo)

Destroy the HTTP_IO and release the resources.

Parameters
[in]HttpIoThe HTTP_IO which wraps the HTTP service to be destroyed.

Definition at line 62 of file DxeHttpIoLib.c.

◆ HttpIoGetChunkedTransferContent()

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.

Parameters
[in]HttpIoThe HttpIo wrapping the HTTP service.
[in]HeaderCountNumber of headers in Headers.
[in]HeadersArray containing list of HTTP headers.
[out]ChunkListHeadA pointer to receive list head of chunked data. Caller has to release memory of ChunkListHead and all list entries.
[out]ContentLengthTotal content length
Return values
EFI_SUCCESSThe HTTP chunked transfer is received.
EFI_NOT_FOUNDNo chunked transfer coding header found.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_INVALID_PARAMETERImproper parameters.
OthersOther errors as indicated.

Definition at line 678 of file DxeHttpIoLib.c.

◆ HttpIoGetContentLength()

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.

Parameters
[in]HeaderCountNumber of HTTP header structures in Headers.
[in]HeadersArray containing list of HTTP headers.
[out]ContentLengthPointer to save the value of the content length.
Return values
EFI_SUCCESSSuccessfully get the content length.
EFI_NOT_FOUNDNo "Content-Length" header in the Headers.

Definition at line 479 of file DxeHttpIoLib.c.

◆ HttpIoNotify()

VOID EFIAPI HttpIoNotify ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Request HttpIoNotifyDpc as a DPC at TPL_CALLBACK.

Parameters
[in]EventThe event signaled.
[in]ContextThe opaque parameter to the function.

Definition at line 44 of file DxeHttpIoLib.c.

◆ HttpIoNotifyDpc()

VOID EFIAPI HttpIoNotifyDpc ( IN VOID *  Context)

Notify the callback function when an event is triggered.

Parameters
[in]ContextThe opaque parameter to the function.

Definition at line 28 of file DxeHttpIoLib.c.

◆ HttpIoRecvResponse()

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.

Parameters
[in]HttpIoThe HttpIo wrapping the HTTP service.
[in]RecvMsgHeaderTRUE to receive a new HTTP response (from message header). FALSE to continue receive the previous response message.
[out]ResponseDataPoint to a wrapper of the received response data.
Return values
EFI_SUCCESSThe HTTP response is received.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_DEVICE_ERRORAn unexpected network or system error occurred.
OthersOther errors as indicated.

Definition at line 366 of file DxeHttpIoLib.c.

◆ HttpIoSendChunkedTransfer()

EFI_STATUS HttpIoSendChunkedTransfer ( IN HTTP_IO HttpIo,
IN HTTP_IO_SEND_CHUNK_PROCESS SendChunkProcess,
IN EFI_HTTP_MESSAGE RequestMessage 
)

Send HTTP request in chunks.

Parameters
[in]HttpIoThe HttpIo wrapping the HTTP service.
[in]SendChunkProcessPointer to current chunk process status.
[in]RequestMessageRequest to send.
Return values
EFI_SUCCESSSuccessfully to send chunk data according to SendChunkProcess.
OtherOther errors.

Definition at line 507 of file DxeHttpIoLib.c.

◆ HttpIoSendRequest()

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.

Parameters
[in]HttpIoThe HttpIo wrapping the HTTP service.
[in]RequestA pointer to storage such data as URL and HTTP method.
[in]HeaderCountNumber of HTTP header structures in Headers list.
[in]HeadersArray containing list of HTTP headers.
[in]BodyLengthLength in bytes of the HTTP body.
[in]BodyBody associated with the HTTP request.
Return values
EFI_SUCCESSThe HTTP request is trasmitted.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_DEVICE_ERRORAn unexpected network or system error occurred.
OthersOther errors as indicated.

Definition at line 293 of file DxeHttpIoLib.c.