NetworkPkg: Refine codes related to Dhcpv4 and Dhcpv6 configuration.
v2: *Since we have redefined the name of arch types in Dhcp.h for http boot, it need to change corresponding codes. Add a new head file Dhcp.h in Mde/Include/IndustryStandard, normalize the universal option numbers and other network number tags. Cc: Sriram Subramanian <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
@@ -18,13 +18,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
// This is a map from the interested DHCP4 option tags' index to the tag value.
|
||||
//
|
||||
UINT8 mInterestedDhcp4Tags[HTTP_BOOT_DHCP4_TAG_INDEX_MAX] = {
|
||||
HTTP_BOOT_DHCP4_TAG_BOOTFILE_LEN,
|
||||
HTTP_BOOT_DHCP4_TAG_OVERLOAD,
|
||||
HTTP_BOOT_DHCP4_TAG_MSG_TYPE,
|
||||
HTTP_BOOT_DHCP4_TAG_SERVER_ID,
|
||||
HTTP_BOOT_DHCP4_TAG_CLASS_ID,
|
||||
HTTP_BOOT_DHCP4_TAG_BOOTFILE,
|
||||
HTTP_BOOT_DHCP4_TAG_DNS_SERVER
|
||||
DHCP4_TAG_BOOTFILE_LEN,
|
||||
DHCP4_TAG_OVERLOAD,
|
||||
DHCP4_TAG_MSG_TYPE,
|
||||
DHCP4_TAG_SERVER_ID,
|
||||
DHCP4_TAG_VENDOR_CLASS_ID,
|
||||
DHCP4_TAG_BOOTFILE,
|
||||
DHCP4_TAG_DNS_SERVER
|
||||
};
|
||||
|
||||
//
|
||||
@@ -59,42 +59,42 @@ HttpBootBuildDhcp4Options (
|
||||
//
|
||||
// Append parameter request list option.
|
||||
//
|
||||
OptList[Index]->OpCode = HTTP_BOOT_DHCP4_TAG_PARA_LIST;
|
||||
OptList[Index]->OpCode = DHCP4_TAG_PARA_LIST;
|
||||
OptList[Index]->Length = 27;
|
||||
OptEnt.Para = (HTTP_BOOT_DHCP4_OPTION_PARA *) OptList[Index]->Data;
|
||||
OptEnt.Para->ParaList[0] = HTTP_BOOT_DHCP4_TAG_NETMASK;
|
||||
OptEnt.Para->ParaList[1] = HTTP_BOOT_DHCP4_TAG_TIME_OFFSET;
|
||||
OptEnt.Para->ParaList[2] = HTTP_BOOT_DHCP4_TAG_ROUTER;
|
||||
OptEnt.Para->ParaList[3] = HTTP_BOOT_DHCP4_TAG_TIME_SERVER;
|
||||
OptEnt.Para->ParaList[4] = HTTP_BOOT_DHCP4_TAG_NAME_SERVER;
|
||||
OptEnt.Para->ParaList[5] = HTTP_BOOT_DHCP4_TAG_DNS_SERVER;
|
||||
OptEnt.Para->ParaList[6] = HTTP_BOOT_DHCP4_TAG_HOSTNAME;
|
||||
OptEnt.Para->ParaList[7] = HTTP_BOOT_DHCP4_TAG_BOOTFILE_LEN;
|
||||
OptEnt.Para->ParaList[8] = HTTP_BOOT_DHCP4_TAG_DOMAINNAME;
|
||||
OptEnt.Para->ParaList[9] = HTTP_BOOT_DHCP4_TAG_ROOTPATH;
|
||||
OptEnt.Para->ParaList[10] = HTTP_BOOT_DHCP4_TAG_EXTEND_PATH;
|
||||
OptEnt.Para->ParaList[11] = HTTP_BOOT_DHCP4_TAG_EMTU;
|
||||
OptEnt.Para->ParaList[12] = HTTP_BOOT_DHCP4_TAG_TTL;
|
||||
OptEnt.Para->ParaList[13] = HTTP_BOOT_DHCP4_TAG_BROADCAST;
|
||||
OptEnt.Para->ParaList[14] = HTTP_BOOT_DHCP4_TAG_NIS_DOMAIN;
|
||||
OptEnt.Para->ParaList[15] = HTTP_BOOT_DHCP4_TAG_NIS_SERVER;
|
||||
OptEnt.Para->ParaList[16] = HTTP_BOOT_DHCP4_TAG_NTP_SERVER;
|
||||
OptEnt.Para->ParaList[17] = HTTP_BOOT_DHCP4_TAG_VENDOR;
|
||||
OptEnt.Para->ParaList[18] = HTTP_BOOT_DHCP4_TAG_REQUEST_IP;
|
||||
OptEnt.Para->ParaList[19] = HTTP_BOOT_DHCP4_TAG_LEASE;
|
||||
OptEnt.Para->ParaList[20] = HTTP_BOOT_DHCP4_TAG_SERVER_ID;
|
||||
OptEnt.Para->ParaList[21] = HTTP_BOOT_DHCP4_TAG_T1;
|
||||
OptEnt.Para->ParaList[22] = HTTP_BOOT_DHCP4_TAG_T2;
|
||||
OptEnt.Para->ParaList[23] = HTTP_BOOT_DHCP4_TAG_CLASS_ID;
|
||||
OptEnt.Para->ParaList[25] = HTTP_BOOT_DHCP4_TAG_BOOTFILE;
|
||||
OptEnt.Para->ParaList[26] = HTTP_BOOT_DHCP4_TAG_UUID;
|
||||
OptEnt.Para->ParaList[0] = DHCP4_TAG_NETMASK;
|
||||
OptEnt.Para->ParaList[1] = DHCP4_TAG_TIME_OFFSET;
|
||||
OptEnt.Para->ParaList[2] = DHCP4_TAG_ROUTER;
|
||||
OptEnt.Para->ParaList[3] = DHCP4_TAG_TIME_SERVER;
|
||||
OptEnt.Para->ParaList[4] = DHCP4_TAG_NAME_SERVER;
|
||||
OptEnt.Para->ParaList[5] = DHCP4_TAG_DNS_SERVER;
|
||||
OptEnt.Para->ParaList[6] = DHCP4_TAG_HOSTNAME;
|
||||
OptEnt.Para->ParaList[7] = DHCP4_TAG_BOOTFILE_LEN;
|
||||
OptEnt.Para->ParaList[8] = DHCP4_TAG_DOMAINNAME;
|
||||
OptEnt.Para->ParaList[9] = DHCP4_TAG_ROOTPATH;
|
||||
OptEnt.Para->ParaList[10] = DHCP4_TAG_EXTEND_PATH;
|
||||
OptEnt.Para->ParaList[11] = DHCP4_TAG_EMTU;
|
||||
OptEnt.Para->ParaList[12] = DHCP4_TAG_TTL;
|
||||
OptEnt.Para->ParaList[13] = DHCP4_TAG_BROADCAST;
|
||||
OptEnt.Para->ParaList[14] = DHCP4_TAG_NIS_DOMAIN;
|
||||
OptEnt.Para->ParaList[15] = DHCP4_TAG_NIS_SERVER;
|
||||
OptEnt.Para->ParaList[16] = DHCP4_TAG_NTP_SERVER;
|
||||
OptEnt.Para->ParaList[17] = DHCP4_TAG_VENDOR;
|
||||
OptEnt.Para->ParaList[18] = DHCP4_TAG_REQUEST_IP;
|
||||
OptEnt.Para->ParaList[19] = DHCP4_TAG_LEASE;
|
||||
OptEnt.Para->ParaList[20] = DHCP4_TAG_SERVER_ID;
|
||||
OptEnt.Para->ParaList[21] = DHCP4_TAG_T1;
|
||||
OptEnt.Para->ParaList[22] = DHCP4_TAG_T2;
|
||||
OptEnt.Para->ParaList[23] = DHCP4_TAG_VENDOR_CLASS_ID;
|
||||
OptEnt.Para->ParaList[25] = DHCP4_TAG_BOOTFILE;
|
||||
OptEnt.Para->ParaList[26] = DHCP4_TAG_UUID;
|
||||
Index++;
|
||||
OptList[Index] = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);
|
||||
|
||||
//
|
||||
// Append UUID/Guid-based client identifier option
|
||||
//
|
||||
OptList[Index]->OpCode = HTTP_BOOT_DHCP4_TAG_UUID;
|
||||
OptList[Index]->OpCode = DHCP4_TAG_UUID;
|
||||
OptList[Index]->Length = (UINT8) sizeof (HTTP_BOOT_DHCP4_OPTION_UUID);
|
||||
OptEnt.Uuid = (HTTP_BOOT_DHCP4_OPTION_UUID *) OptList[Index]->Data;
|
||||
OptEnt.Uuid->Type = 0;
|
||||
@@ -110,7 +110,7 @@ HttpBootBuildDhcp4Options (
|
||||
//
|
||||
// Append client network device interface option
|
||||
//
|
||||
OptList[Index]->OpCode = HTTP_BOOT_DHCP4_TAG_UNDI;
|
||||
OptList[Index]->OpCode = DHCP4_TAG_UNDI;
|
||||
OptList[Index]->Length = (UINT8) sizeof (HTTP_BOOT_DHCP4_OPTION_UNDI);
|
||||
OptEnt.Undi = (HTTP_BOOT_DHCP4_OPTION_UNDI *) OptList[Index]->Data;
|
||||
|
||||
@@ -130,7 +130,7 @@ HttpBootBuildDhcp4Options (
|
||||
//
|
||||
// Append client system architecture option
|
||||
//
|
||||
OptList[Index]->OpCode = HTTP_BOOT_DHCP4_TAG_ARCH;
|
||||
OptList[Index]->OpCode = DHCP4_TAG_ARCH;
|
||||
OptList[Index]->Length = (UINT8) sizeof (HTTP_BOOT_DHCP4_OPTION_ARCH);
|
||||
OptEnt.Arch = (HTTP_BOOT_DHCP4_OPTION_ARCH *) OptList[Index]->Data;
|
||||
Value = HTONS (EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE);
|
||||
@@ -141,7 +141,7 @@ HttpBootBuildDhcp4Options (
|
||||
//
|
||||
// Append vendor class identify option
|
||||
//
|
||||
OptList[Index]->OpCode = HTTP_BOOT_DHCP4_TAG_CLASS_ID;
|
||||
OptList[Index]->OpCode = DHCP4_TAG_VENDOR_CLASS_ID;
|
||||
OptList[Index]->Length = (UINT8) sizeof (HTTP_BOOT_DHCP4_OPTION_CLID);
|
||||
OptEnt.Clid = (HTTP_BOOT_DHCP4_OPTION_CLID *) OptList[Index]->Data;
|
||||
CopyMem (
|
||||
@@ -190,7 +190,7 @@ HttpBootParseDhcp4Options (
|
||||
Option = (EFI_DHCP4_PACKET_OPTION *) Buffer;
|
||||
Offset = 0;
|
||||
|
||||
while (Offset < Length && Option->OpCode != HTTP_BOOT_DHCP4_TAG_EOP) {
|
||||
while (Offset < Length && Option->OpCode != DHCP4_TAG_EOP) {
|
||||
|
||||
if (Option->OpCode == OptTag) {
|
||||
//
|
||||
@@ -202,7 +202,7 @@ HttpBootParseDhcp4Options (
|
||||
//
|
||||
// Skip the current option to the next.
|
||||
//
|
||||
if (Option->OpCode == HTTP_BOOT_DHCP4_TAG_PAD) {
|
||||
if (Option->OpCode == DHCP4_TAG_PAD) {
|
||||
Offset++;
|
||||
} else {
|
||||
Offset += Option->Length + 2;
|
||||
@@ -607,7 +607,7 @@ HttpBootDhcp4CallBack (
|
||||
MaxMsgSize = HttpBootParseDhcp4Options (
|
||||
Packet->Dhcp4.Option,
|
||||
GET_OPTION_BUFFER_LEN (Packet),
|
||||
HTTP_BOOT_DHCP4_TAG_MAXMSG
|
||||
DHCP4_TAG_MAXMSG
|
||||
);
|
||||
if (MaxMsgSize != NULL) {
|
||||
Value = HTONS (HTTP_BOOT_DHCP4_PACKET_MAX_SIZE);
|
||||
|
@@ -24,47 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#define HTTP_BOOT_DHCP4_MSG_TYPE_REQUEST 3
|
||||
#define HTTP_BOOT_DHCP4_MAGIC 0x63538263 // network byte order
|
||||
|
||||
//
|
||||
// Dhcp Options
|
||||
//
|
||||
#define HTTP_BOOT_DHCP4_TAG_PAD 0 // Pad Option
|
||||
#define HTTP_BOOT_DHCP4_TAG_EOP 255 // End Option
|
||||
#define HTTP_BOOT_DHCP4_TAG_NETMASK 1 // Subnet Mask
|
||||
#define HTTP_BOOT_DHCP4_TAG_TIME_OFFSET 2 // Time Offset from UTC
|
||||
#define HTTP_BOOT_DHCP4_TAG_ROUTER 3 // Router option,
|
||||
#define HTTP_BOOT_DHCP4_TAG_TIME_SERVER 4 // Time Server
|
||||
#define HTTP_BOOT_DHCP4_TAG_NAME_SERVER 5 // Name Server
|
||||
#define HTTP_BOOT_DHCP4_TAG_DNS_SERVER 6 // Domain Name Server
|
||||
#define HTTP_BOOT_DHCP4_TAG_HOSTNAME 12 // Host Name
|
||||
#define HTTP_BOOT_DHCP4_TAG_BOOTFILE_LEN 13 // Boot File Size
|
||||
#define HTTP_BOOT_DHCP4_TAG_DUMP 14 // Merit Dump File
|
||||
#define HTTP_BOOT_DHCP4_TAG_DOMAINNAME 15 // Domain Name
|
||||
#define HTTP_BOOT_DHCP4_TAG_ROOTPATH 17 // Root path
|
||||
#define HTTP_BOOT_DHCP4_TAG_EXTEND_PATH 18 // Extensions Path
|
||||
#define HTTP_BOOT_DHCP4_TAG_EMTU 22 // Maximum Datagram Reassembly Size
|
||||
#define HTTP_BOOT_DHCP4_TAG_TTL 23 // Default IP Time-to-live
|
||||
#define HTTP_BOOT_DHCP4_TAG_BROADCAST 28 // Broadcast Address
|
||||
#define HTTP_BOOT_DHCP4_TAG_NIS_DOMAIN 40 // Network Information Service Domain
|
||||
#define HTTP_BOOT_DHCP4_TAG_NIS_SERVER 41 // Network Information Servers
|
||||
#define HTTP_BOOT_DHCP4_TAG_NTP_SERVER 42 // Network Time Protocol Servers
|
||||
#define HTTP_BOOT_DHCP4_TAG_VENDOR 43 // Vendor Specific Information
|
||||
#define HTTP_BOOT_DHCP4_TAG_REQUEST_IP 50 // Requested IP Address
|
||||
#define HTTP_BOOT_DHCP4_TAG_LEASE 51 // IP Address Lease Time
|
||||
#define HTTP_BOOT_DHCP4_TAG_OVERLOAD 52 // Option Overload
|
||||
#define HTTP_BOOT_DHCP4_TAG_MSG_TYPE 53 // DHCP Message Type
|
||||
#define HTTP_BOOT_DHCP4_TAG_SERVER_ID 54 // Server Identifier
|
||||
#define HTTP_BOOT_DHCP4_TAG_PARA_LIST 55 // Parameter Request List
|
||||
#define HTTP_BOOT_DHCP4_TAG_MAXMSG 57 // Maximum DHCP Message Size
|
||||
#define HTTP_BOOT_DHCP4_TAG_T1 58 // Renewal (T1) Time Value
|
||||
#define HTTP_BOOT_DHCP4_TAG_T2 59 // Rebinding (T2) Time Value
|
||||
#define HTTP_BOOT_DHCP4_TAG_CLASS_ID 60 // Vendor class identifier
|
||||
#define HTTP_BOOT_DHCP4_TAG_CLIENT_ID 61 // Client-identifier
|
||||
#define HTTP_BOOT_DHCP4_TAG_TFTP 66 // TFTP server name
|
||||
#define HTTP_BOOT_DHCP4_TAG_BOOTFILE 67 // Bootfile name
|
||||
#define HTTP_BOOT_DHCP4_TAG_ARCH 93
|
||||
#define HTTP_BOOT_DHCP4_TAG_UNDI 94
|
||||
#define HTTP_BOOT_DHCP4_TAG_UUID 97
|
||||
|
||||
#define HTTP_BOOT_DHCP4_OVERLOAD_FILE 1
|
||||
#define HTTP_BOOT_DHCP4_OVERLOAD_SERVER_NAME 2
|
||||
|
||||
@@ -75,15 +34,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
/// http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml
|
||||
///
|
||||
#if defined (MDE_CPU_IA32)
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE 0x000F
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE HTTP_CLIENT_ARCH_IA32
|
||||
#elif defined (MDE_CPU_X64)
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE 0x0010
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE HTTP_CLIENT_ARCH_X64
|
||||
#elif defined (MDE_CPU_ARM)
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE 0x0012
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE HTTP_CLIENT_ARCH_ARM
|
||||
#elif defined (MDE_CPU_AARCH64)
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE 0x0013
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE HTTP_CLIENT_ARCH_AARCH64
|
||||
#elif defined (MDE_CPU_EBC)
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE 0x0011
|
||||
#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE HTTP_CLIENT_ARCH_EBC
|
||||
#endif
|
||||
|
||||
/// DHCP offer types among HTTP boot.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Functions implementation related with DHCPv6 for HTTP boot driver.
|
||||
|
||||
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
@@ -41,20 +41,20 @@ HttpBootBuildDhcp6Options (
|
||||
//
|
||||
// Append client option request option
|
||||
//
|
||||
OptList[Index]->OpCode = HTONS (HTTP_BOOT_DHCP6_OPT_ORO);
|
||||
OptList[Index]->OpCode = HTONS (DHCP6_OPT_ORO);
|
||||
OptList[Index]->OpLen = HTONS (8);
|
||||
OptEnt.Oro = (HTTP_BOOT_DHCP6_OPTION_ORO *) OptList[Index]->Data;
|
||||
OptEnt.Oro->OpCode[0] = HTONS(HTTP_BOOT_DHCP6_OPT_BOOT_FILE_URL);
|
||||
OptEnt.Oro->OpCode[1] = HTONS(HTTP_BOOT_DHCP6_OPT_BOOT_FILE_PARAM);
|
||||
OptEnt.Oro->OpCode[2] = HTONS(HTTP_BOOT_DHCP6_OPT_DNS_SERVERS);
|
||||
OptEnt.Oro->OpCode[3] = HTONS(HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS);
|
||||
OptEnt.Oro->OpCode[0] = HTONS(DHCP6_OPT_BOOT_FILE_URL);
|
||||
OptEnt.Oro->OpCode[1] = HTONS(DHCP6_OPT_BOOT_FILE_PARAM);
|
||||
OptEnt.Oro->OpCode[2] = HTONS(DHCP6_OPT_DNS_SERVERS);
|
||||
OptEnt.Oro->OpCode[3] = HTONS(DHCP6_OPT_VENDOR_CLASS);
|
||||
Index++;
|
||||
OptList[Index] = GET_NEXT_DHCP6_OPTION (OptList[Index - 1]);
|
||||
|
||||
//
|
||||
// Append client network device interface option
|
||||
//
|
||||
OptList[Index]->OpCode = HTONS (HTTP_BOOT_DHCP6_OPT_UNDI);
|
||||
OptList[Index]->OpCode = HTONS (DHCP6_OPT_UNDI);
|
||||
OptList[Index]->OpLen = HTONS ((UINT16)3);
|
||||
OptEnt.Undi = (HTTP_BOOT_DHCP6_OPTION_UNDI *) OptList[Index]->Data;
|
||||
|
||||
@@ -74,7 +74,7 @@ HttpBootBuildDhcp6Options (
|
||||
//
|
||||
// Append client system architecture option
|
||||
//
|
||||
OptList[Index]->OpCode = HTONS (HTTP_BOOT_DHCP6_OPT_ARCH);
|
||||
OptList[Index]->OpCode = HTONS (DHCP6_OPT_ARCH);
|
||||
OptList[Index]->OpLen = HTONS ((UINT16) sizeof (HTTP_BOOT_DHCP6_OPTION_ARCH));
|
||||
OptEnt.Arch = (HTTP_BOOT_DHCP6_OPTION_ARCH *) OptList[Index]->Data;
|
||||
Value = HTONS (EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE);
|
||||
@@ -85,7 +85,7 @@ HttpBootBuildDhcp6Options (
|
||||
//
|
||||
// Append vendor class identify option.
|
||||
//
|
||||
OptList[Index]->OpCode = HTONS (HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS);
|
||||
OptList[Index]->OpCode = HTONS (DHCP6_OPT_VENDOR_CLASS);
|
||||
OptList[Index]->OpLen = HTONS ((UINT16) sizeof (HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS));
|
||||
OptEnt.VendorClass = (HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS *) OptList[Index]->Data;
|
||||
OptEnt.VendorClass->Vendor = HTONL (HTTP_BOOT_DHCP6_ENTERPRISE_NUM);
|
||||
@@ -211,18 +211,18 @@ HttpBootParseDhcp6Packet (
|
||||
//
|
||||
while (Offset < Length) {
|
||||
|
||||
if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_IA_NA) {
|
||||
if (NTOHS (Option->OpCode) == DHCP6_OPT_IA_NA) {
|
||||
Options[HTTP_BOOT_DHCP6_IDX_IA_NA] = Option;
|
||||
} else if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_BOOT_FILE_URL) {
|
||||
} else if (NTOHS (Option->OpCode) == DHCP6_OPT_BOOT_FILE_URL) {
|
||||
//
|
||||
// The server sends this option to inform the client about an URL to a boot file.
|
||||
//
|
||||
Options[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL] = Option;
|
||||
} else if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_BOOT_FILE_PARAM) {
|
||||
} else if (NTOHS (Option->OpCode) == DHCP6_OPT_BOOT_FILE_PARAM) {
|
||||
Options[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_PARAM] = Option;
|
||||
} else if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS) {
|
||||
} else if (NTOHS (Option->OpCode) == DHCP6_OPT_VENDOR_CLASS) {
|
||||
Options[HTTP_BOOT_DHCP6_IDX_VENDOR_CLASS] = Option;
|
||||
} else if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_DNS_SERVERS) {
|
||||
} else if (NTOHS (Option->OpCode) == DHCP6_OPT_DNS_SERVERS) {
|
||||
Options[HTTP_BOOT_DHCP6_IDX_DNS_SERVER] = Option;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ HttpBootParseDhcp6Packet (
|
||||
Option = HttpBootParseDhcp6Options (
|
||||
Option->Data + 12,
|
||||
NTOHS (Option->OpLen),
|
||||
HTTP_BOOT_DHCP6_OPT_STATUS_CODE
|
||||
DHCP6_OPT_STATUS_CODE
|
||||
);
|
||||
if ((Option != NULL && Option->Data[0] == 0) || (Option == NULL)) {
|
||||
IsProxyOffer = FALSE;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Functions declaration related with DHCPv6 for HTTP boot driver.
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
@@ -24,31 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#define HTTP_BOOT_DEFAULT_HOPLIMIT 64
|
||||
#define HTTP_BOOT_DEFAULT_LIFETIME 50000
|
||||
|
||||
|
||||
#define HTTP_BOOT_DHCP6_OPT_CLIENT_ID 1
|
||||
#define HTTP_BOOT_DHCP6_OPT_SERVER_ID 2
|
||||
#define HTTP_BOOT_DHCP6_OPT_IA_NA 3
|
||||
#define HTTP_BOOT_DHCP6_OPT_IA_TA 4
|
||||
#define HTTP_BOOT_DHCP6_OPT_IAADDR 5
|
||||
#define HTTP_BOOT_DHCP6_OPT_ORO 6
|
||||
#define HTTP_BOOT_DHCP6_OPT_PREFERENCE 7
|
||||
#define HTTP_BOOT_DHCP6_OPT_ELAPSED_TIME 8
|
||||
#define HTTP_BOOT_DHCP6_OPT_REPLAY_MSG 9
|
||||
#define HTTP_BOOT_DHCP6_OPT_AUTH 11
|
||||
#define HTTP_BOOT_DHCP6_OPT_UNICAST 12
|
||||
#define HTTP_BOOT_DHCP6_OPT_STATUS_CODE 13
|
||||
#define HTTP_BOOT_DHCP6_OPT_RAPID_COMMIT 14
|
||||
#define HTTP_BOOT_DHCP6_OPT_USER_CLASS 15
|
||||
#define HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS 16
|
||||
#define HTTP_BOOT_DHCP6_OPT_VENDOR_OPTS 17
|
||||
#define HTTP_BOOT_DHCP6_OPT_INTERFACE_ID 18
|
||||
#define HTTP_BOOT_DHCP6_OPT_RECONFIG_MSG 19
|
||||
#define HTTP_BOOT_DHCP6_OPT_RECONFIG_ACCEPT 20
|
||||
#define HTTP_BOOT_DHCP6_OPT_DNS_SERVERS 23
|
||||
#define HTTP_BOOT_DHCP6_OPT_BOOT_FILE_URL 59 // Assigned by IANA, RFC 5970
|
||||
#define HTTP_BOOT_DHCP6_OPT_BOOT_FILE_PARAM 60 // Assigned by IANA, RFC 5970
|
||||
#define HTTP_BOOT_DHCP6_OPT_ARCH 61 // Assigned by IANA, RFC 5970
|
||||
#define HTTP_BOOT_DHCP6_OPT_UNDI 62 // Assigned by IANA, RFC 5970
|
||||
#define HTTP_BOOT_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
|
||||
#define HTTP_BOOT_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
|
||||
|
||||
|
@@ -19,6 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <IndustryStandard/Http11.h>
|
||||
#include <IndustryStandard/Dhcp.h>
|
||||
|
||||
//
|
||||
// Libraries
|
||||
|
Reference in New Issue
Block a user