summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/UefiPxeBcDxe
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2016-06-22 10:25:21 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-06-23 09:39:38 +0800
commit142c00c3d659a6d5d66416385b4c93fd9a9f10e6 (patch)
tree6df6f04a6c91d797994fbd0b7e306d69fb09b000 /NetworkPkg/UefiPxeBcDxe
parentac6c3d90edebf1499dac8f4d3c99e94d197ad45e (diff)
downloadedk2-142c00c3d659a6d5d66416385b4c93fd9a9f10e6.tar.gz
edk2-142c00c3d659a6d5d66416385b4c93fd9a9f10e6.tar.bz2
edk2-142c00c3d659a6d5d66416385b4c93fd9a9f10e6.zip
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>
Diffstat (limited to 'NetworkPkg/UefiPxeBcDxe')
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c98
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h42
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c28
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.h25
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h3
5 files changed, 67 insertions, 129 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
index 818586f955..6566afd6af 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
@@ -19,13 +19,13 @@
// This is a map from the interested DHCP4 option tags' index to the tag value.
//
UINT8 mInterestedDhcp4Tags[PXEBC_DHCP4_TAG_INDEX_MAX] = {
- PXEBC_DHCP4_TAG_BOOTFILE_LEN,
- PXEBC_DHCP4_TAG_VENDOR,
- PXEBC_DHCP4_TAG_OVERLOAD,
- PXEBC_DHCP4_TAG_MSG_TYPE,
- PXEBC_DHCP4_TAG_SERVER_ID,
- PXEBC_DHCP4_TAG_CLASS_ID,
- PXEBC_DHCP4_TAG_BOOTFILE
+ DHCP4_TAG_BOOTFILE_LEN,
+ DHCP4_TAG_VENDOR,
+ DHCP4_TAG_OVERLOAD,
+ DHCP4_TAG_MSG_TYPE,
+ DHCP4_TAG_SERVER_ID,
+ DHCP4_TAG_VENDOR_CLASS_ID,
+ DHCP4_TAG_BOOTFILE
};
//
@@ -58,7 +58,7 @@ PxeBcParseDhcp4Options (
Option = (EFI_DHCP4_PACKET_OPTION *) Buffer;
Offset = 0;
- while (Offset < Length && Option->OpCode != PXEBC_DHCP4_TAG_EOP) {
+ while (Offset < Length && Option->OpCode != DHCP4_TAG_EOP) {
if (Option->OpCode == OptTag) {
//
@@ -70,7 +70,7 @@ PxeBcParseDhcp4Options (
//
// Skip the current option to the next.
//
- if (Option->OpCode == PXEBC_DHCP4_TAG_PAD) {
+ if (Option->OpCode == DHCP4_TAG_PAD) {
Offset++;
} else {
Offset += Option->Length + 2;
@@ -108,7 +108,7 @@ PxeBcParseVendorOptions (
ASSERT (PxeOption != NULL);
- while ((Offset < VendorOptionLen) && (PxeOption->OpCode != PXEBC_DHCP4_TAG_EOP)) {
+ while ((Offset < VendorOptionLen) && (PxeOption->OpCode != DHCP4_TAG_EOP)) {
//
// Parse all the interesting PXE vendor options one by one.
//
@@ -201,7 +201,7 @@ PxeBcParseVendorOptions (
//
// Continue to the next option.
//
- if (PxeOption->OpCode == PXEBC_DHCP4_TAG_PAD) {
+ if (PxeOption->OpCode == DHCP4_TAG_PAD) {
Offset++;
} else {
Offset = (UINT8) (Offset + PxeOption->Length + 2);
@@ -243,7 +243,7 @@ PxeBcBuildDhcp4Options (
//
// Append message type.
//
- OptList[Index]->OpCode = PXEBC_DHCP4_TAG_MSG_TYPE;
+ OptList[Index]->OpCode = DHCP4_TAG_MSG_TYPE;
OptList[Index]->Length = 1;
OptEnt.Mesg = (PXEBC_DHCP4_OPTION_MESG *) OptList[Index]->Data;
OptEnt.Mesg->Type = PXEBC_DHCP4_MSG_TYPE_REQUEST;
@@ -253,7 +253,7 @@ PxeBcBuildDhcp4Options (
//
// Append max message size.
//
- OptList[Index]->OpCode = PXEBC_DHCP4_TAG_MAXMSG;
+ OptList[Index]->OpCode = DHCP4_TAG_MAXMSG;
OptList[Index]->Length = (UINT8) sizeof (PXEBC_DHCP4_OPTION_MAX_MESG_SIZE);
OptEnt.MaxMesgSize = (PXEBC_DHCP4_OPTION_MAX_MESG_SIZE *) OptList[Index]->Data;
Value = NTOHS (PXEBC_DHCP4_PACKET_MAX_SIZE - 8);
@@ -265,36 +265,36 @@ PxeBcBuildDhcp4Options (
//
// Append parameter request list option.
//
- OptList[Index]->OpCode = PXEBC_DHCP4_TAG_PARA_LIST;
+ OptList[Index]->OpCode = DHCP4_TAG_PARA_LIST;
OptList[Index]->Length = 35;
OptEnt.Para = (PXEBC_DHCP4_OPTION_PARA *) OptList[Index]->Data;
- OptEnt.Para->ParaList[0] = PXEBC_DHCP4_TAG_NETMASK;
- OptEnt.Para->ParaList[1] = PXEBC_DHCP4_TAG_TIME_OFFSET;
- OptEnt.Para->ParaList[2] = PXEBC_DHCP4_TAG_ROUTER;
- OptEnt.Para->ParaList[3] = PXEBC_DHCP4_TAG_TIME_SERVER;
- OptEnt.Para->ParaList[4] = PXEBC_DHCP4_TAG_NAME_SERVER;
- OptEnt.Para->ParaList[5] = PXEBC_DHCP4_TAG_DNS_SERVER;
- OptEnt.Para->ParaList[6] = PXEBC_DHCP4_TAG_HOSTNAME;
- OptEnt.Para->ParaList[7] = PXEBC_DHCP4_TAG_BOOTFILE_LEN;
- OptEnt.Para->ParaList[8] = PXEBC_DHCP4_TAG_DOMAINNAME;
- OptEnt.Para->ParaList[9] = PXEBC_DHCP4_TAG_ROOTPATH;
- OptEnt.Para->ParaList[10] = PXEBC_DHCP4_TAG_EXTEND_PATH;
- OptEnt.Para->ParaList[11] = PXEBC_DHCP4_TAG_EMTU;
- OptEnt.Para->ParaList[12] = PXEBC_DHCP4_TAG_TTL;
- OptEnt.Para->ParaList[13] = PXEBC_DHCP4_TAG_BROADCAST;
- OptEnt.Para->ParaList[14] = PXEBC_DHCP4_TAG_NIS_DOMAIN;
- OptEnt.Para->ParaList[15] = PXEBC_DHCP4_TAG_NIS_SERVER;
- OptEnt.Para->ParaList[16] = PXEBC_DHCP4_TAG_NTP_SERVER;
- OptEnt.Para->ParaList[17] = PXEBC_DHCP4_TAG_VENDOR;
- OptEnt.Para->ParaList[18] = PXEBC_DHCP4_TAG_REQUEST_IP;
- OptEnt.Para->ParaList[19] = PXEBC_DHCP4_TAG_LEASE;
- OptEnt.Para->ParaList[20] = PXEBC_DHCP4_TAG_SERVER_ID;
- OptEnt.Para->ParaList[21] = PXEBC_DHCP4_TAG_T1;
- OptEnt.Para->ParaList[22] = PXEBC_DHCP4_TAG_T2;
- OptEnt.Para->ParaList[23] = PXEBC_DHCP4_TAG_CLASS_ID;
- OptEnt.Para->ParaList[24] = PXEBC_DHCP4_TAG_TFTP;
- OptEnt.Para->ParaList[25] = PXEBC_DHCP4_TAG_BOOTFILE;
- OptEnt.Para->ParaList[26] = PXEBC_PXE_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[24] = DHCP4_TAG_TFTP;
+ OptEnt.Para->ParaList[25] = DHCP4_TAG_BOOTFILE;
+ OptEnt.Para->ParaList[26] = DHCP4_TAG_UUID;
OptEnt.Para->ParaList[27] = 0x80;
OptEnt.Para->ParaList[28] = 0x81;
OptEnt.Para->ParaList[29] = 0x82;
@@ -309,7 +309,7 @@ PxeBcBuildDhcp4Options (
//
// Append UUID/Guid-based client identifier option
//
- OptList[Index]->OpCode = PXEBC_PXE_DHCP4_TAG_UUID;
+ OptList[Index]->OpCode = DHCP4_TAG_UUID;
OptList[Index]->Length = (UINT8) sizeof (PXEBC_DHCP4_OPTION_UUID);
OptEnt.Uuid = (PXEBC_DHCP4_OPTION_UUID *) OptList[Index]->Data;
OptEnt.Uuid->Type = 0;
@@ -326,7 +326,7 @@ PxeBcBuildDhcp4Options (
//
// Append client network device interface option
//
- OptList[Index]->OpCode = PXEBC_PXE_DHCP4_TAG_UNDI;
+ OptList[Index]->OpCode = DHCP4_TAG_UNDI;
OptList[Index]->Length = (UINT8) sizeof (PXEBC_DHCP4_OPTION_UNDI);
OptEnt.Undi = (PXEBC_DHCP4_OPTION_UNDI *) OptList[Index]->Data;
@@ -346,7 +346,7 @@ PxeBcBuildDhcp4Options (
//
// Append client system architecture option
//
- OptList[Index]->OpCode = PXEBC_PXE_DHCP4_TAG_ARCH;
+ OptList[Index]->OpCode = DHCP4_TAG_ARCH;
OptList[Index]->Length = (UINT8) sizeof (PXEBC_DHCP4_OPTION_ARCH);
OptEnt.Arch = (PXEBC_DHCP4_OPTION_ARCH *) OptList[Index]->Data;
Value = HTONS (EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE);
@@ -357,7 +357,7 @@ PxeBcBuildDhcp4Options (
//
// Append vendor class identify option
//
- OptList[Index]->OpCode = PXEBC_DHCP4_TAG_CLASS_ID;
+ OptList[Index]->OpCode = DHCP4_TAG_VENDOR_CLASS_ID;
OptList[Index]->Length = (UINT8) sizeof (PXEBC_DHCP4_OPTION_CLID);
OptEnt.Clid = (PXEBC_DHCP4_OPTION_CLID *) OptList[Index]->Data;
CopyMem (
@@ -414,7 +414,7 @@ PxeBcSeedDhcp4Packet (
CopyMem (Header->ClientHwAddr, &Mode.CurrentAddress, Header->HwAddrLen);
Seed->Dhcp4.Magik = PXEBC_DHCP4_MAGIC;
- Seed->Dhcp4.Option[0] = PXEBC_DHCP4_TAG_EOP;
+ Seed->Dhcp4.Option[0] = DHCP4_TAG_EOP;
}
@@ -1180,7 +1180,7 @@ PxeBcDhcp4CallBack (
MaxMsgSize = PxeBcParseDhcp4Options (
Packet->Dhcp4.Option,
GET_OPTION_BUFFER_LEN (Packet),
- PXEBC_DHCP4_TAG_MAXMSG
+ DHCP4_TAG_MAXMSG
);
if (MaxMsgSize != NULL) {
Value = HTONS (PXEBC_DHCP4_PACKET_MAX_SIZE - 8);
@@ -1356,14 +1356,14 @@ PxeBcDhcp4Discover (
return EFI_OUT_OF_RESOURCES;
}
- OptList[OptCount]->OpCode = PXEBC_DHCP4_TAG_VENDOR;
+ OptList[OptCount]->OpCode = DHCP4_TAG_VENDOR;
OptList[OptCount]->Length = (UINT8) (VendorOptLen - 2);
PxeOpt = (EFI_DHCP4_PACKET_OPTION *) OptList[OptCount]->Data;
PxeOpt->OpCode = PXEBC_VENDOR_TAG_BOOT_ITEM;
PxeOpt->Length = (UINT8) sizeof (PXEBC_OPTION_BOOT_ITEM);
PxeBootItem = (PXEBC_OPTION_BOOT_ITEM *) PxeOpt->Data;
PxeBootItem->Type = HTONS (Type);
- PxeOpt->Data[PxeOpt->Length] = PXEBC_DHCP4_TAG_EOP;
+ PxeOpt->Data[PxeOpt->Length] = DHCP4_TAG_EOP;
if (Layer != NULL) {
PxeBootItem->Layer = HTONS (*Layer);
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h
index 248dc60d2c..3aabaed088 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h
@@ -1,7 +1,7 @@
/** @file
Functions declaration related with DHCPv4 for UefiPxeBc Driver.
- Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 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
@@ -29,46 +29,6 @@
#define PXEBC_DHCP4_MAGIC 0x63538263 // network byte order
//
-// Dhcp Options
-//
-#define PXEBC_DHCP4_TAG_PAD 0 // Pad Option
-#define PXEBC_DHCP4_TAG_EOP 255 // End Option
-#define PXEBC_DHCP4_TAG_NETMASK 1 // Subnet Mask
-#define PXEBC_DHCP4_TAG_TIME_OFFSET 2 // Time Offset from UTC
-#define PXEBC_DHCP4_TAG_ROUTER 3 // Router option,
-#define PXEBC_DHCP4_TAG_TIME_SERVER 4 // Time Server
-#define PXEBC_DHCP4_TAG_NAME_SERVER 5 // Name Server
-#define PXEBC_DHCP4_TAG_DNS_SERVER 6 // Domain Name Server
-#define PXEBC_DHCP4_TAG_HOSTNAME 12 // Host Name
-#define PXEBC_DHCP4_TAG_BOOTFILE_LEN 13 // Boot File Size
-#define PXEBC_DHCP4_TAG_DUMP 14 // Merit Dump File
-#define PXEBC_DHCP4_TAG_DOMAINNAME 15 // Domain Name
-#define PXEBC_DHCP4_TAG_ROOTPATH 17 // Root path
-#define PXEBC_DHCP4_TAG_EXTEND_PATH 18 // Extensions Path
-#define PXEBC_DHCP4_TAG_EMTU 22 // Maximum Datagram Reassembly Size
-#define PXEBC_DHCP4_TAG_TTL 23 // Default IP Time-to-live
-#define PXEBC_DHCP4_TAG_BROADCAST 28 // Broadcast Address
-#define PXEBC_DHCP4_TAG_NIS_DOMAIN 40 // Network Information Service Domain
-#define PXEBC_DHCP4_TAG_NIS_SERVER 41 // Network Information Servers
-#define PXEBC_DHCP4_TAG_NTP_SERVER 42 // Network Time Protocol Servers
-#define PXEBC_DHCP4_TAG_VENDOR 43 // Vendor Specific Information
-#define PXEBC_DHCP4_TAG_REQUEST_IP 50 // Requested IP Address
-#define PXEBC_DHCP4_TAG_LEASE 51 // IP Address Lease Time
-#define PXEBC_DHCP4_TAG_OVERLOAD 52 // Option Overload
-#define PXEBC_DHCP4_TAG_MSG_TYPE 53 // DHCP Message Type
-#define PXEBC_DHCP4_TAG_SERVER_ID 54 // Server Identifier
-#define PXEBC_DHCP4_TAG_PARA_LIST 55 // Parameter Request List
-#define PXEBC_DHCP4_TAG_MAXMSG 57 // Maximum DHCP Message Size
-#define PXEBC_DHCP4_TAG_T1 58 // Renewal (T1) Time Value
-#define PXEBC_DHCP4_TAG_T2 59 // Rebinding (T2) Time Value
-#define PXEBC_DHCP4_TAG_CLASS_ID 60 // Vendor class identifier
-#define PXEBC_DHCP4_TAG_CLIENT_ID 61 // Client-identifier
-#define PXEBC_DHCP4_TAG_TFTP 66 // TFTP server name
-#define PXEBC_DHCP4_TAG_BOOTFILE 67 // Bootfile name
-#define PXEBC_PXE_DHCP4_TAG_ARCH 93
-#define PXEBC_PXE_DHCP4_TAG_UNDI 94
-#define PXEBC_PXE_DHCP4_TAG_UUID 97
-//
// Sub-Options in Dhcp Vendor Option
//
#define PXEBC_VENDOR_TAG_MTFTP_IP 1
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
index 8003f31491..41d3d30a12 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
@@ -92,18 +92,18 @@ PxeBcBuildDhcp6Options (
//
// Append client option request option
//
- OptList[Index]->OpCode = HTONS (PXEBC_DHCP6_OPT_ORO);
+ OptList[Index]->OpCode = HTONS (DHCP6_OPT_ORO);
OptList[Index]->OpLen = HTONS (4);
OptEnt.Oro = (PXEBC_DHCP6_OPTION_ORO *) OptList[Index]->Data;
- OptEnt.Oro->OpCode[0] = HTONS(PXEBC_DHCP6_OPT_BOOT_FILE_URL);
- OptEnt.Oro->OpCode[1] = HTONS(PXEBC_DHCP6_OPT_BOOT_FILE_PARAM);
+ OptEnt.Oro->OpCode[0] = HTONS(DHCP6_OPT_BOOT_FILE_URL);
+ OptEnt.Oro->OpCode[1] = HTONS(DHCP6_OPT_BOOT_FILE_PARAM);
Index++;
OptList[Index] = GET_NEXT_DHCP6_OPTION (OptList[Index - 1]);
//
// Append client network device interface option
//
- OptList[Index]->OpCode = HTONS (PXEBC_DHCP6_OPT_UNDI);
+ OptList[Index]->OpCode = HTONS (DHCP6_OPT_UNDI);
OptList[Index]->OpLen = HTONS ((UINT16)3);
OptEnt.Undi = (PXEBC_DHCP6_OPTION_UNDI *) OptList[Index]->Data;
@@ -123,7 +123,7 @@ PxeBcBuildDhcp6Options (
//
// Append client system architecture option
//
- OptList[Index]->OpCode = HTONS (PXEBC_DHCP6_OPT_ARCH);
+ OptList[Index]->OpCode = HTONS (DHCP6_OPT_ARCH);
OptList[Index]->OpLen = HTONS ((UINT16) sizeof (PXEBC_DHCP6_OPTION_ARCH));
OptEnt.Arch = (PXEBC_DHCP6_OPTION_ARCH *) OptList[Index]->Data;
Value = HTONS (EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE);
@@ -134,7 +134,7 @@ PxeBcBuildDhcp6Options (
//
// Append vendor class option to store the PXE class identifier.
//
- OptList[Index]->OpCode = HTONS (PXEBC_DHCP6_OPT_VENDOR_CLASS);
+ OptList[Index]->OpCode = HTONS (DHCP6_OPT_VENDOR_CLASS);
OptList[Index]->OpLen = HTONS ((UINT16) sizeof (PXEBC_DHCP6_OPTION_VENDOR_CLASS));
OptEnt.VendorClass = (PXEBC_DHCP6_OPTION_VENDOR_CLASS *) OptList[Index]->Data;
OptEnt.VendorClass->Vendor = HTONL (PXEBC_DHCP6_ENTERPRISE_NUM);
@@ -471,16 +471,16 @@ PxeBcParseDhcp6Packet (
//
while (Offset < Length) {
- if (NTOHS (Option->OpCode) == PXEBC_DHCP6_OPT_IA_NA) {
+ if (NTOHS (Option->OpCode) == DHCP6_OPT_IA_NA) {
Options[PXEBC_DHCP6_IDX_IA_NA] = Option;
- } else if (NTOHS (Option->OpCode) == PXEBC_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[PXEBC_DHCP6_IDX_BOOT_FILE_URL] = Option;
- } else if (NTOHS (Option->OpCode) == PXEBC_DHCP6_OPT_BOOT_FILE_PARAM) {
+ } else if (NTOHS (Option->OpCode) == DHCP6_OPT_BOOT_FILE_PARAM) {
Options[PXEBC_DHCP6_IDX_BOOT_FILE_PARAM] = Option;
- } else if (NTOHS (Option->OpCode) == PXEBC_DHCP6_OPT_VENDOR_CLASS) {
+ } else if (NTOHS (Option->OpCode) == DHCP6_OPT_VENDOR_CLASS) {
Options[PXEBC_DHCP6_IDX_VENDOR_CLASS] = Option;
}
@@ -497,7 +497,7 @@ PxeBcParseDhcp6Packet (
Option = PxeBcParseDhcp6Options (
Option->Data + 12,
NTOHS (Option->OpLen),
- PXEBC_DHCP6_OPT_STATUS_CODE
+ DHCP6_OPT_STATUS_CODE
);
if ((Option != NULL && Option->Data[0] == 0) || (Option == NULL)) {
IsProxyOffer = FALSE;
@@ -713,7 +713,7 @@ PxeBcRequestBootService (
Option = PxeBcDhcp6SeekOption (
ProxyOffer->Dhcp6.Option,
ProxyOffer->Length - 4,
- PXEBC_DHCP6_OPT_SERVER_ID
+ DHCP6_OPT_SERVER_ID
);
if (Option == NULL) {
return EFI_NOT_FOUND;
@@ -732,7 +732,7 @@ PxeBcRequestBootService (
OpLen = NTOHS (((EFI_DHCP6_PACKET_OPTION *) RequestOpt)->OpLen);
if (OpCode != EFI_DHCP6_IA_TYPE_NA &&
OpCode != EFI_DHCP6_IA_TYPE_TA &&
- OpCode != PXEBC_DHCP6_OPT_SERVER_ID
+ OpCode != DHCP6_OPT_SERVER_ID
) {
//
// Copy all the options except IA option and Server ID
@@ -751,7 +751,7 @@ PxeBcRequestBootService (
Option = PxeBcDhcp6SeekOption (
Discover->DhcpOptions,
(UINT32)(RequestLen - 4),
- PXEBC_DHCP6_OPT_ELAPSED_TIME
+ DHCP6_OPT_ELAPSED_TIME
);
if (Option != NULL) {
CalcElapsedTime (Private);
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.h b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.h
index 38bf26564d..a6d52f972c 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.h
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.h
@@ -1,7 +1,7 @@
/** @file
Functions declaration related with DHCPv6 for UefiPxeBc Driver.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 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
@@ -25,29 +25,6 @@
#define PXEBC_DHCP6_S_PORT 547
#define PXEBC_DHCP6_C_PORT 546
-#define PXEBC_DHCP6_OPT_CLIENT_ID 1
-#define PXEBC_DHCP6_OPT_SERVER_ID 2
-#define PXEBC_DHCP6_OPT_IA_NA 3
-#define PXEBC_DHCP6_OPT_IA_TA 4
-#define PXEBC_DHCP6_OPT_IAADDR 5
-#define PXEBC_DHCP6_OPT_ORO 6
-#define PXEBC_DHCP6_OPT_PREFERENCE 7
-#define PXEBC_DHCP6_OPT_ELAPSED_TIME 8
-#define PXEBC_DHCP6_OPT_REPLAY_MSG 9
-#define PXEBC_DHCP6_OPT_AUTH 11
-#define PXEBC_DHCP6_OPT_UNICAST 12
-#define PXEBC_DHCP6_OPT_STATUS_CODE 13
-#define PXEBC_DHCP6_OPT_RAPID_COMMIT 14
-#define PXEBC_DHCP6_OPT_USER_CLASS 15
-#define PXEBC_DHCP6_OPT_VENDOR_CLASS 16
-#define PXEBC_DHCP6_OPT_VENDOR_OPTS 17
-#define PXEBC_DHCP6_OPT_INTERFACE_ID 18
-#define PXEBC_DHCP6_OPT_RECONFIG_MSG 19
-#define PXEBC_DHCP6_OPT_RECONFIG_ACCEPT 20
-#define PXEBC_DHCP6_OPT_BOOT_FILE_URL 59 // Assigned by IANA, RFC 5970
-#define PXEBC_DHCP6_OPT_BOOT_FILE_PARAM 60 // Assigned by IANA, RFC 5970
-#define PXEBC_DHCP6_OPT_ARCH 61 // Assigned by IANA, RFC 5970
-#define PXEBC_DHCP6_OPT_UNDI 62 // Assigned by IANA, RFC 5970
#define PXEBC_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
#define PXEBC_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h
index ac7dc8781a..d0f5e5b5f2 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h
@@ -2,7 +2,7 @@
This EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.
interfaces declaration.
- Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 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
@@ -21,6 +21,7 @@
#include <Guid/SmBios.h>
#include <IndustryStandard/SmBios.h>
+#include <IndustryStandard/Dhcp.h>
#include <Protocol/NetworkInterfaceIdentifier.h>
#include <Protocol/Arp.h>
#include <Protocol/Ip4.h>