NetworkPkg/HttpBootDxe/HttpBootSupport.c File Reference


Functions

EFI_HANDLE HttpBootGetNicByIp4Children (IN EFI_HANDLE ControllerHandle)
VOID HttpBootUintnToAscDecWithFormat (IN UINTN Number, IN UINT8 *Buffer, IN INTN Length)
VOID HttpBootShowIp4Addr (IN EFI_IPv4_ADDRESS *Ip)
HTTP_IO_HEADERHttpBootCreateHeader (UINTN MaxHeaderCount)
VOID HttpBootFreeHeader (IN HTTP_IO_HEADER *HttpIoHeader)
EFI_HTTP_HEADER * HttpBootFindHeader (IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, IN CHAR8 *FieldName)
EFI_STATUS HttpBootSetHeader (IN HTTP_IO_HEADER *HttpIoHeader, IN CHAR8 *FieldName, IN CHAR8 *FieldValue)
VOID EFIAPI HttpIoCommonNotify (IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS HttpIoCreateIo (IN EFI_HANDLE Image, IN EFI_HANDLE Controller, IN UINT8 IpVersion, IN HTTP_IO_CONFIG_DATA *ConfigData, OUT HTTP_IO *HttpIo)
VOID HttpIoDestroyIo (IN 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_RESOPNSE_DATA *ResponseData)

Detailed Description

Support functions implementation for UEFI HTTP boot driver.

Copyright (c) 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

HTTP_IO_HEADER* HttpBootCreateHeader ( UINTN  MaxHeaderCount  ) 

Create a HTTP_IO_HEADER to hold the HTTP header items.

Parameters:
[in] MaxHeaderCount The maximun number of HTTP header in this holder.
Returns:
A pointer of the HTTP header holder or NULL if failed.

References HTTP_IO_HEADER::Headers, and HTTP_IO_HEADER::MaxHeaderCount.

EFI_HTTP_HEADER* HttpBootFindHeader ( IN UINTN  HeaderCount,
IN EFI_HTTP_HEADER *  Headers,
IN CHAR8 *  FieldName 
)

Find a specified header field according to the field name.

Parameters:
[in] HeaderCount Number of HTTP header structures in Headers list.
[in] Headers Array containing list of HTTP headers.
[in] FieldName Null terminated string which describes a field name.
Returns:
Pointer to the found header or NULL.

Referenced by HttpBootSetHeader().

VOID HttpBootFreeHeader ( IN HTTP_IO_HEADER HttpIoHeader  ) 

Destroy the HTTP_IO_HEADER and release the resouces.

Parameters:
[in] HttpIoHeader Point to the HTTP header holder to be destroyed.

Referenced by HttpBootGetBootFile().

EFI_HANDLE HttpBootGetNicByIp4Children ( IN EFI_HANDLE  ControllerHandle  ) 

Get the Nic handle using any child handle in the IPv4 stack.

Parameters:
[in] ControllerHandle Pointer to child handle over IPv4.
Returns:
NicHandle The pointer to the Nic handle.

NULL Can't find the Nic handle.

Referenced by HttpBootDxeComponentNameGetControllerName(), and HttpBootIp4DxeDriverBindingStop().

EFI_STATUS HttpBootSetHeader ( IN HTTP_IO_HEADER HttpIoHeader,
IN CHAR8 *  FieldName,
IN CHAR8 *  FieldValue 
)

Set or update a HTTP header with the field name and corresponding value.

Parameters:
[in] HttpIoHeader Point to the HTTP header holder.
[in] FieldName Null terminated string which describes a field name.
[in] FieldValue Null terminated string which describes the corresponding field value.
Return values:
EFI_SUCCESS The HTTP header has been set or updated.
EFI_INVALID_PARAMETER Any input parameter is invalid.
EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation.
Other Unexpected error happened.

References HttpBootFindHeader().

Referenced by HttpBootGetBootFile().

VOID HttpBootShowIp4Addr ( IN EFI_IPv4_ADDRESS *  Ip  ) 

This function is to display the IPv4 address.

Parameters:
[in] Ip The pointer to the IPv4 address.

Referenced by HttpBootDhcp4Dora().

VOID HttpBootUintnToAscDecWithFormat ( IN UINTN  Number,
IN UINT8 *  Buffer,
IN INTN  Length 
)

This function is to convert UINTN to ASCII string with the required formatting.

Parameters:
[in] Number Numeric value to be converted.
[in] Buffer The pointer to the buffer for ASCII string.
[in] Length The length of the required format.

Referenced by HttpBootBuildDhcp4Options().

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

Notify the callback function when an event is triggered.

Parameters:
[in] Event The triggered event.
[in] Context The opaque parameter to the function.

Referenced by HttpIoCreateIo().

EFI_STATUS HttpIoCreateIo ( IN EFI_HANDLE  Image,
IN EFI_HANDLE  Controller,
IN UINT8  IpVersion,
IN HTTP_IO_CONFIG_DATA ConfigData,
OUT HTTP_IO HttpIo 
)

Create a HTTP_IO to access the HTTP service. It will create and configure a HTTP child handle.

Parameters:
[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.
[out] HttpIo The HTTP_IO.
Return values:
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.

References HttpIoCommonNotify(), and HttpIoDestroyIo().

Referenced by HttpBootCreateHttpIo().

VOID HttpIoDestroyIo ( IN HTTP_IO HttpIo  ) 

Destroy the HTTP_IO and release the resouces.

Parameters:
[in] HttpIo The HTTP_IO which wraps the HTTP service to be destroyed.

Referenced by HttpBootDestroyIp4Children(), HttpBootStop(), and HttpIoCreateIo().

EFI_STATUS HttpIoRecvResponse ( IN HTTP_IO HttpIo,
IN BOOLEAN  RecvMsgHeader,
OUT HTTP_IO_RESOPNSE_DATA ResponseData 
)

Synchronously receive a HTTP RESPONSE message from the server.

Parameters:
[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.
Return values:
EFI_SUCCESS The HTTP resopnse 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.

Referenced by HttpBootGetBootFile().

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] 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.
Return values:
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.

Referenced by HttpBootGetBootFile().


Generated on Mon Sep 28 08:49:05 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1