NetworkPkg: Add dns support for pxe boot based on IPv6.

The BootFileURL option (59) in dhcpv6 is used to deliver
the next server address with bootfile name, as an example
"tftp://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]/BOOTFILE_NAME;
mode=octet", it can also be “tftp://domain_name/BOOTFILE_NAME;
mode=octet”, this patch is to support this case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
Zhang Lubo
2016-10-14 15:12:09 +08:00
committed by Jiaxin Wu
parent 581a7aca04
commit 6692d51954
5 changed files with 261 additions and 38 deletions

View File

@@ -33,7 +33,8 @@
#define PXEBC_DHCP6_IDX_BOOT_FILE_URL 1
#define PXEBC_DHCP6_IDX_BOOT_FILE_PARAM 2
#define PXEBC_DHCP6_IDX_VENDOR_CLASS 3
#define PXEBC_DHCP6_IDX_MAX 4
#define PXEBC_DHCP6_IDX_DNS_SERVER 4
#define PXEBC_DHCP6_IDX_MAX 5
#define PXEBC_DHCP6_BOOT_FILE_URL_PREFIX "tftp://"
#define PXEBC_TFTP_URL_SEPARATOR '/'
@@ -128,6 +129,7 @@ PxeBcFreeBootFileOption (
/**
Parse the Boot File URL option.
@param[in] Private Pointer to PxeBc private data.
@param[out] FileName The pointer to the boot file name.
@param[in, out] SrvAddr The pointer to the boot server address.
@param[in] BootFile The pointer to the boot file URL option data.
@@ -140,6 +142,7 @@ PxeBcFreeBootFileOption (
**/
EFI_STATUS
PxeBcExtractBootFileUrl (
IN PXEBC_PRIVATE_DATA *Private,
OUT UINT8 **FileName,
IN OUT EFI_IPv6_ADDRESS *SrvAddr,
IN CHAR8 *BootFile,