NetworkPkg/HttpBootDxe/HttpBootClient.c File Reference


Functions

EFI_STATUS HttpBootUpdateDevicePath (IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootExtractUriInfo (IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootDiscoverBootInfo (IN OUT HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootCreateHttpIo (IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootGetFileFromCache (IN HTTP_BOOT_PRIVATE_DATA *Private, IN CHAR16 *Uri, IN OUT UINTN *BufferSize, OUT UINT8 *Buffer)
VOID HttpBootFreeCache (IN HTTP_BOOT_CACHE_CONTENT *Cache)
VOID HttpBootFreeCacheList (IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS EFIAPI HttpBootGetBootFileCallback (IN HTTP_BODY_PARSE_EVENT EventType, IN CHAR8 *Data, IN UINTN Length, IN VOID *Context)
EFI_STATUS HttpBootGetBootFile (IN HTTP_BOOT_PRIVATE_DATA *Private, IN BOOLEAN HeaderOnly, IN OUT UINTN *BufferSize, OUT UINT8 *Buffer)

Detailed Description

Implementation of the boot file download function.

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

EFI_STATUS HttpBootCreateHttpIo ( IN HTTP_BOOT_PRIVATE_DATA Private  ) 

Create a HttpIo instance for the file download.

Parameters:
[in] Private The pointer to the driver's private data.
Return values:
EFI_SUCCESS Successfully created.
Others Failed to create HttpIo.

References HTTP_IO_CONFIG_DATA::Config4, HTTP_BOOT_REQUEST_TIMEOUT, HttpIoCreateIo(), HTTP4_IO_CONFIG_DATA::HttpVersion, HTTP4_IO_CONFIG_DATA::LocalIp, HTTP4_IO_CONFIG_DATA::RequestTimeOut, and HTTP4_IO_CONFIG_DATA::SubnetMask.

Referenced by HttpBootLoadFile().

EFI_STATUS HttpBootDiscoverBootInfo ( IN OUT HTTP_BOOT_PRIVATE_DATA Private  ) 

Discover all the boot information for boot file.

Parameters:
[in,out] Private The pointer to the driver's private data.
Return values:
EFI_SUCCESS Successfully obtained all the boot information .
Others Failed to retrieve the boot information.

References HttpBootDhcp(), and HttpBootExtractUriInfo().

Referenced by HttpBootLoadFile().

EFI_STATUS HttpBootExtractUriInfo ( IN HTTP_BOOT_PRIVATE_DATA Private  ) 

Parse the boot file URI information from the selected Dhcp4 offer packet.

Parameters:
[in] Private The pointer to the driver's private data.
Return values:
EFI_SUCCESS Successfully parsed out all the boot information.
Others Failed to parse out the boot information.

References HTTP_BOOT_DHCP4_TAG_INDEX_BOOTFILE, HTTP_BOOT_DHCP4_TAG_INDEX_DNS_SERVER, HTTP_BOOT_OFFER_MAX_NUM, HttpBootRegisterIp4Dns(), HttpBootUpdateDevicePath(), HttpOfferTypeDhcpDns, HttpOfferTypeDhcpIpUri, HttpOfferTypeDhcpNameUriDns, HttpOfferTypeMax, HTTP_BOOT_DHCP4_PACKET_CACHE::OfferType, HTTP_BOOT_DHCP4_PACKET_CACHE::OptList, and HTTP_BOOT_DHCP4_PACKET_CACHE::UriParser.

Referenced by HttpBootDiscoverBootInfo().

VOID HttpBootFreeCache ( IN HTTP_BOOT_CACHE_CONTENT Cache  ) 

Release all the resource of a cache item.

Parameters:
[in] Cache The pointer to the cache item.

References HTTP_BOOT_ENTITY_DATA::Block, and HTTP_BOOT_ENTITY_DATA::Link.

Referenced by HttpBootFreeCacheList(), and HttpBootGetBootFile().

VOID HttpBootFreeCacheList ( IN HTTP_BOOT_PRIVATE_DATA Private  ) 

Clean up all cached data.

Parameters:
[in] Private The pointer to the driver's private data.

References HttpBootFreeCache(), and HTTP_BOOT_CACHE_CONTENT::Link.

Referenced by HttpBootIp4DxeDriverBindingStop().

EFI_STATUS HttpBootGetBootFile ( IN HTTP_BOOT_PRIVATE_DATA Private,
IN BOOLEAN  HeaderOnly,
IN OUT UINTN *  BufferSize,
OUT UINT8 *  Buffer 
)

This function download the boot file by using UEFI HTTP protocol.

Parameters:
[in] Private The pointer to the driver's private data.
[in] HeaderOnly Only request the response header, it could save a lot of time if the caller only want to know the size of the requested file.
[in,out] BufferSize On input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file.
[out] Buffer The memory buffer to transfer the file to. IF Buffer is NULL, then the size of the requested file is returned in BufferSize.
Return values:
EFI_SUCCESS The file was loaded.
EFI_INVALID_PARAMETER BufferSize is NULL or Buffer Size is not NULL but Buffer is NULL.
EFI_OUT_OF_RESOURCES Could not allocate needed resources
EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry. BufferSize has been updated with the size needed to complete the request.
Others Unexpected error happened.

References HTTP_BOOT_CALLBACK_DATA::Block, HTTP_IO_RESOPNSE_DATA::Body, HTTP_IO_RESOPNSE_DATA::BodyLength, HTTP_BOOT_CALLBACK_DATA::Buffer, HTTP_BOOT_CALLBACK_DATA::BufferSize, HTTP_BOOT_CALLBACK_DATA::Cache, HTTP_BOOT_CALLBACK_DATA::CopyedSize, HTTP_BOOT_CACHE_CONTENT::EntityDataList, HTTP_BOOT_CACHE_CONTENT::EntityLength, HTTP_IO_RESOPNSE_DATA::HeaderCount, HTTP_IO_HEADER::HeaderCount, HTTP_IO_RESOPNSE_DATA::Headers, HTTP_IO_HEADER::Headers, HTTP_BOOT_BLOCK_SIZE, HTTP_FIELD_NAME_ACCEPT, HTTP_FIELD_NAME_HOST, HTTP_FIELD_NAME_USER_AGENT, HTTP_USER_AGENT_EFI_HTTP_BOOT, HttpBootCreateHeader(), HttpBootFreeCache(), HttpBootFreeHeader(), HttpBootGetBootFileCallback(), HttpBootGetFileFromCache(), HttpBootSetHeader(), HttpIoRecvResponse(), HttpIoSendRequest(), HTTP_BOOT_CACHE_CONTENT::Link, HTTP_BOOT_CALLBACK_DATA::NewBlock, HTTP_BOOT_CACHE_CONTENT::RequestData, HTTP_IO_RESOPNSE_DATA::Response, and HTTP_BOOT_CACHE_CONTENT::ResponseData.

Referenced by HttpBootLoadFile().

EFI_STATUS EFIAPI HttpBootGetBootFileCallback ( IN HTTP_BODY_PARSE_EVENT  EventType,
IN CHAR8 *  Data,
IN UINTN  Length,
IN VOID *  Context 
)

A callback function to intercept events during message parser.

This function will be invoked during HttpParseMessageBody() with various events type. An error return status of the callback function will cause the HttpParseMessageBody() aborted.

Parameters:
[in] EventType Event type of this callback call.
[in] Data A pointer to data buffer.
[in] Length Length in bytes of the Data.
[in] Context Callback context set by HttpInitMsgParser().
Return values:
EFI_SUCCESS Continue to parser the message body.
Others Abort the parse.

References HTTP_BOOT_CALLBACK_DATA::Block, HTTP_BOOT_ENTITY_DATA::Block, HTTP_BOOT_CALLBACK_DATA::Buffer, HTTP_BOOT_CALLBACK_DATA::BufferSize, HTTP_BOOT_CALLBACK_DATA::Cache, HTTP_BOOT_CALLBACK_DATA::CopyedSize, HTTP_BOOT_ENTITY_DATA::DataLength, HTTP_BOOT_ENTITY_DATA::DataStart, HTTP_BOOT_CACHE_CONTENT::EntityDataList, HTTP_BOOT_ENTITY_DATA::Link, and HTTP_BOOT_CALLBACK_DATA::NewBlock.

Referenced by HttpBootGetBootFile().

EFI_STATUS HttpBootGetFileFromCache ( IN HTTP_BOOT_PRIVATE_DATA Private,
IN CHAR16 *  Uri,
IN OUT UINTN *  BufferSize,
OUT UINT8 *  Buffer 
)

Get the file content from cached data.

Parameters:
[in] Private The pointer to the driver's private data.
[in] Uri Uri of the file to be retrieved from cache.
[in,out] BufferSize On input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file.
[out] Buffer The memory buffer to transfer the file to. IF Buffer is NULL, then the size of the requested file is returned in BufferSize.
Return values:
EFI_SUCCESS Successfully created.
Others Failed to create HttpIo.

References HTTP_BOOT_ENTITY_DATA::DataLength, HTTP_BOOT_ENTITY_DATA::DataStart, HTTP_BOOT_CACHE_CONTENT::EntityDataList, HTTP_BOOT_CACHE_CONTENT::EntityLength, and HTTP_BOOT_CACHE_CONTENT::RequestData.

Referenced by HttpBootGetBootFile().

EFI_STATUS HttpBootUpdateDevicePath ( IN HTTP_BOOT_PRIVATE_DATA Private  ) 

Update the IP and URL device path node to include the boot resource information.

Parameters:
[in] Private The pointer to the driver's private data.
Return values:
EFI_SUCCESS Device patch successfully updated.
EFI_OUT_OF_RESOURCES Could not allocate needed resources.
Others Unexpected error happened.

Referenced by HttpBootExtractUriInfo().


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