NetworkPkg:Enable Http Boot over Ipv6 stack

Add new features to support Http boot over ipv6 stack.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18743 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Zhang Lubo
2015-11-09 03:30:42 +00:00
committed by luobozhang
parent d1c275c651
commit b659408b93
23 changed files with 5078 additions and 917 deletions

View File

@ -29,6 +29,20 @@ HttpBootGetNicByIp4Children (
IN EFI_HANDLE ControllerHandle
);
/**
Get the Nic handle using any child handle in the IPv6 stack.
@param[in] ControllerHandle Pointer to child handle over IPv6.
@return NicHandle The pointer to the Nic handle.
@return NULL Can't find the Nic handle.
**/
EFI_HANDLE
HttpBootGetNicByIp6Children (
IN EFI_HANDLE ControllerHandle
);
/**
This function is to convert UINTN to ASCII string with the required formatting.
@ -56,6 +70,17 @@ HttpBootShowIp4Addr (
IN EFI_IPv4_ADDRESS *Ip
);
/**
This function is to display the IPv6 address.
@param[in] Ip The pointer to the IPv6 address.
**/
VOID
HttpBootShowIp6Addr (
IN EFI_IPv6_ADDRESS *Ip
);
//
// A wrapper structure to hold the HTTP headers.
//
@ -122,11 +147,24 @@ typedef struct {
UINT16 LocalPort;
} HTTP4_IO_CONFIG_DATA;
//
// HTTP_IO configuration data for IPv6
//
typedef struct {
EFI_HTTP_VERSION HttpVersion;
UINT32 RequestTimeOut; // In milliseconds.
BOOLEAN UseDefaultAddress;
EFI_IPv6_ADDRESS LocalIp;
UINT16 LocalPort;
} HTTP6_IO_CONFIG_DATA;
//
// HTTP_IO configuration
//
typedef union {
HTTP4_IO_CONFIG_DATA Config4;
HTTP6_IO_CONFIG_DATA Config6;
} HTTP_IO_CONFIG_DATA;
//
@ -160,6 +198,38 @@ typedef struct {
CHAR8 *Body;
} HTTP_IO_RESOPNSE_DATA;
/**
Retrieve the host address using the EFI_DNS6_PROTOCOL.
@param[in] Private The pointer to the driver's private data.
@param[in] HostName Pointer to buffer containing hostname.
@param[out] IpAddress On output, pointer to buffer containing IPv6 address.
@retval EFI_SUCCESS Operation succeeded.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpBootDns (
IN HTTP_BOOT_PRIVATE_DATA *Private,
IN CHAR16 *HostName,
OUT EFI_IPv6_ADDRESS *IpAddress
);
/**
Notify the callback function when an event is triggered.
@param[in] Event The triggered event.
@param[in] Context The opaque parameter to the function.
**/
VOID
EFIAPI
HttpBootCommonNotify (
IN EFI_EVENT Event,
IN VOID *Context
);
/**
Create a HTTP_IO to access the HTTP service. It will create and configure
a HTTP child handle.