]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Refine codes related to Dhcpv4 and Dhcpv6 configuration.
authorZhang Lubo <lubo.zhang@intel.com>
Wed, 22 Jun 2016 02:25:21 +0000 (10:25 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Thu, 23 Jun 2016 01:39:38 +0000 (09:39 +0800)
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>
20 files changed:
NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h
NetworkPkg/HttpBootDxe/HttpBootDhcp4.c
NetworkPkg/HttpBootDxe/HttpBootDhcp4.h
NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
NetworkPkg/HttpBootDxe/HttpBootDhcp6.h
NetworkPkg/HttpBootDxe/HttpBootDxe.h
NetworkPkg/IScsiDxe/IScsiDhcp.c
NetworkPkg/IScsiDxe/IScsiDhcp.h
NetworkPkg/IScsiDxe/IScsiDhcp6.c
NetworkPkg/IScsiDxe/IScsiDhcp6.h
NetworkPkg/IScsiDxe/IScsiImpl.h
NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h
NetworkPkg/Ip6Dxe/Ip6Impl.h
NetworkPkg/Ip6Dxe/Ip6Nd.c
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.h
NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h

index e3e755316318f747a0399c2ad055f643542920a3..86ef8afb292263428ae7510875354015013d2fb8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Dhcp6 internal data structure and definition declaration.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -19,6 +19,8 @@
 \r
 #include <Uefi.h>\r
 \r
+#include <IndustryStandard/Dhcp.h>\r
+\r
 #include <Protocol/Dhcp6.h>\r
 #include <Protocol/Udp6.h>\r
 #include <Protocol/Ip6Config.h>\r
@@ -50,66 +52,6 @@ typedef struct _DHCP6_INSTANCE DHCP6_INSTANCE;
 #define DHCP6_SERVICE_SIGNATURE   SIGNATURE_32 ('D', 'H', '6', 'S')\r
 #define DHCP6_INSTANCE_SIGNATURE  SIGNATURE_32 ('D', 'H', '6', 'I')\r
 \r
-//\r
-// Transmit parameters of solicit message, refers to section-5.5 of rfc-3315.\r
-//\r
-#define DHCP6_SOL_MAX_DELAY       1\r
-#define DHCP6_SOL_IRT             1\r
-#define DHCP6_SOL_MRC             0\r
-#define DHCP6_SOL_MRT             120\r
-#define DHCP6_SOL_MRD             0\r
-//\r
-// Transmit parameters of request message, refers to section-5.5 of rfc-3315.\r
-//\r
-#define DHCP6_REQ_IRT             1\r
-#define DHCP6_REQ_MRC             10\r
-#define DHCP6_REQ_MRT             30\r
-#define DHCP6_REQ_MRD             0\r
-//\r
-// Transmit parameters of confirm message, refers to section-5.5 of rfc-3315.\r
-//\r
-#define DHCP6_CNF_MAX_DELAY       1\r
-#define DHCP6_CNF_IRT             1\r
-#define DHCP6_CNF_MRC             0\r
-#define DHCP6_CNF_MRT             4\r
-#define DHCP6_CNF_MRD             10\r
-//\r
-// Transmit parameters of renew message, refers to section-5.5 of rfc-3315.\r
-//\r
-#define DHCP6_REN_IRT             10\r
-#define DHCP6_REN_MRC             0\r
-#define DHCP6_REN_MRT             600\r
-#define DHCP6_REN_MRD             0\r
-//\r
-// Transmit parameters of rebind message, refers to section-5.5 of rfc-3315.\r
-//\r
-#define DHCP6_REB_IRT             10\r
-#define DHCP6_REB_MRC             0\r
-#define DHCP6_REB_MRT             600\r
-#define DHCP6_REB_MRD             0\r
-//\r
-// Transmit parameters of information request message, refers to section-5.5 of rfc-3315.\r
-//\r
-#define DHCP6_INF_MAX_DELAY       1\r
-#define DHCP6_INF_IRT             1\r
-#define DHCP6_INF_MRC             0\r
-#define DHCP6_INF_MRT             120\r
-#define DHCP6_INF_MRD             0\r
-//\r
-// Transmit parameters of release message, refers to section-5.5 of rfc-3315.\r
-//\r
-#define DHCP6_REL_IRT             1\r
-#define DHCP6_REL_MRC             5\r
-#define DHCP6_REL_MRT             0\r
-#define DHCP6_REL_MRD             0\r
-//\r
-// Transmit parameters of decline message, refers to section-5.5 of rfc-3315.\r
-//\r
-#define DHCP6_DEC_IRT             1\r
-#define DHCP6_DEC_MRC             5\r
-#define DHCP6_DEC_MRT             0\r
-#define DHCP6_DEC_MRD             0\r
-\r
 #define DHCP6_PACKET_ALL          0\r
 #define DHCP6_PACKET_STATEFUL     1\r
 #define DHCP6_PACKET_STATELESS    2\r
@@ -126,70 +68,6 @@ extern EFI_IPv6_ADDRESS           mAllDhcpRelayAndServersAddress;
 extern EFI_IPv6_ADDRESS           mAllDhcpServersAddress;\r
 extern EFI_DHCP6_PROTOCOL         gDhcp6ProtocolTemplate;\r
 \r
-//\r
-// Enumeration of Dhcp6 message type, refers to section-5.3 of rfc-3315.\r
-//\r
-typedef enum {\r
-  Dhcp6MsgSolicit               = 1,\r
-  Dhcp6MsgAdvertise             = 2,\r
-  Dhcp6MsgRequest               = 3,\r
-  Dhcp6MsgConfirm               = 4,\r
-  Dhcp6MsgRenew                 = 5,\r
-  Dhcp6MsgRebind                = 6,\r
-  Dhcp6MsgReply                 = 7,\r
-  Dhcp6MsgRelease               = 8,\r
-  Dhcp6MsgDecline               = 9,\r
-  Dhcp6MsgReconfigure           = 10,\r
-  Dhcp6MsgInfoRequest           = 11\r
-} DHCP6_MSG_TYPE;\r
-\r
-//\r
-// Enumeration of option code in Dhcp6 packet, refers to section-24.3 of rfc-3315.\r
-//\r
-typedef enum {\r
-  Dhcp6OptClientId              = 1,\r
-  Dhcp6OptServerId              = 2,\r
-  Dhcp6OptIana                  = 3,\r
-  Dhcp6OptIata                  = 4,\r
-  Dhcp6OptIaAddr                = 5,\r
-  Dhcp6OptRequestOption         = 6,\r
-  Dhcp6OptPreference            = 7,\r
-  Dhcp6OptElapsedTime           = 8,\r
-  Dhcp6OptReplayMessage         = 9,\r
-  Dhcp6OptAuthentication        = 11,\r
-  Dhcp6OptServerUnicast         = 12,\r
-  Dhcp6OptStatusCode            = 13,\r
-  Dhcp6OptRapidCommit           = 14,\r
-  Dhcp6OptUserClass             = 15,\r
-  Dhcp6OptVendorClass           = 16,\r
-  Dhcp6OptVendorInfo            = 17,\r
-  Dhcp6OptInterfaceId           = 18,\r
-  Dhcp6OptReconfigMessage       = 19,\r
-  Dhcp6OptReconfigureAccept     = 20\r
-} DHCP6_OPT_CODE;\r
-\r
-//\r
-// Enumeration of status code recorded by IANA, refers to section-24.4 of rfc-3315.\r
-//\r
-typedef enum {\r
-  Dhcp6StsSuccess               = 0,\r
-  Dhcp6StsUnspecFail            = 1,\r
-  Dhcp6StsNoAddrsAvail          = 2,\r
-  Dhcp6StsNoBinding             = 3,\r
-  Dhcp6StsNotOnLink             = 4,\r
-  Dhcp6StsUseMulticast          = 5\r
-} DHCP6_STS_CODE;\r
-\r
-//\r
-// Enumeration of Duid type recorded by IANA, refers to section-24.5 of rfc-3315.\r
-//\r
-typedef enum {\r
-  Dhcp6DuidTypeLlt              = 1,\r
-  Dhcp6DuidTypeEn               = 2,\r
-  Dhcp6DuidTypeLl               = 3,\r
-  Dhcp6DuidTypeUuid             = 4\r
-} DHCP6_DUID_TYPE;\r
-\r
 //\r
 // Control block for each IA.\r
 //\r
index 5a226d7f7600b320ece641b859e1e4ee26bfafb7..a47a8f494f9ec1cf8c4f0678dddfb429a49a2a07 100644 (file)
@@ -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.\r
 //\r
 UINT8 mInterestedDhcp4Tags[HTTP_BOOT_DHCP4_TAG_INDEX_MAX] = {\r
-  HTTP_BOOT_DHCP4_TAG_BOOTFILE_LEN,\r
-  HTTP_BOOT_DHCP4_TAG_OVERLOAD,\r
-  HTTP_BOOT_DHCP4_TAG_MSG_TYPE,\r
-  HTTP_BOOT_DHCP4_TAG_SERVER_ID,\r
-  HTTP_BOOT_DHCP4_TAG_CLASS_ID,\r
-  HTTP_BOOT_DHCP4_TAG_BOOTFILE,\r
-  HTTP_BOOT_DHCP4_TAG_DNS_SERVER\r
+  DHCP4_TAG_BOOTFILE_LEN,\r
+  DHCP4_TAG_OVERLOAD,\r
+  DHCP4_TAG_MSG_TYPE,\r
+  DHCP4_TAG_SERVER_ID,\r
+  DHCP4_TAG_VENDOR_CLASS_ID,\r
+  DHCP4_TAG_BOOTFILE,\r
+  DHCP4_TAG_DNS_SERVER\r
 };\r
 \r
 //\r
@@ -59,42 +59,42 @@ HttpBootBuildDhcp4Options (
   //\r
   // Append parameter request list option.\r
   //\r
-  OptList[Index]->OpCode    = HTTP_BOOT_DHCP4_TAG_PARA_LIST;\r
+  OptList[Index]->OpCode    = DHCP4_TAG_PARA_LIST;\r
   OptList[Index]->Length    = 27;\r
   OptEnt.Para               = (HTTP_BOOT_DHCP4_OPTION_PARA *) OptList[Index]->Data;\r
-  OptEnt.Para->ParaList[0]  = HTTP_BOOT_DHCP4_TAG_NETMASK;\r
-  OptEnt.Para->ParaList[1]  = HTTP_BOOT_DHCP4_TAG_TIME_OFFSET;\r
-  OptEnt.Para->ParaList[2]  = HTTP_BOOT_DHCP4_TAG_ROUTER;\r
-  OptEnt.Para->ParaList[3]  = HTTP_BOOT_DHCP4_TAG_TIME_SERVER;\r
-  OptEnt.Para->ParaList[4]  = HTTP_BOOT_DHCP4_TAG_NAME_SERVER;\r
-  OptEnt.Para->ParaList[5]  = HTTP_BOOT_DHCP4_TAG_DNS_SERVER;\r
-  OptEnt.Para->ParaList[6]  = HTTP_BOOT_DHCP4_TAG_HOSTNAME;\r
-  OptEnt.Para->ParaList[7]  = HTTP_BOOT_DHCP4_TAG_BOOTFILE_LEN;\r
-  OptEnt.Para->ParaList[8]  = HTTP_BOOT_DHCP4_TAG_DOMAINNAME;\r
-  OptEnt.Para->ParaList[9]  = HTTP_BOOT_DHCP4_TAG_ROOTPATH;\r
-  OptEnt.Para->ParaList[10] = HTTP_BOOT_DHCP4_TAG_EXTEND_PATH;\r
-  OptEnt.Para->ParaList[11] = HTTP_BOOT_DHCP4_TAG_EMTU;\r
-  OptEnt.Para->ParaList[12] = HTTP_BOOT_DHCP4_TAG_TTL;\r
-  OptEnt.Para->ParaList[13] = HTTP_BOOT_DHCP4_TAG_BROADCAST;\r
-  OptEnt.Para->ParaList[14] = HTTP_BOOT_DHCP4_TAG_NIS_DOMAIN;\r
-  OptEnt.Para->ParaList[15] = HTTP_BOOT_DHCP4_TAG_NIS_SERVER;\r
-  OptEnt.Para->ParaList[16] = HTTP_BOOT_DHCP4_TAG_NTP_SERVER;\r
-  OptEnt.Para->ParaList[17] = HTTP_BOOT_DHCP4_TAG_VENDOR;\r
-  OptEnt.Para->ParaList[18] = HTTP_BOOT_DHCP4_TAG_REQUEST_IP;\r
-  OptEnt.Para->ParaList[19] = HTTP_BOOT_DHCP4_TAG_LEASE;\r
-  OptEnt.Para->ParaList[20] = HTTP_BOOT_DHCP4_TAG_SERVER_ID;\r
-  OptEnt.Para->ParaList[21] = HTTP_BOOT_DHCP4_TAG_T1;\r
-  OptEnt.Para->ParaList[22] = HTTP_BOOT_DHCP4_TAG_T2;\r
-  OptEnt.Para->ParaList[23] = HTTP_BOOT_DHCP4_TAG_CLASS_ID;\r
-  OptEnt.Para->ParaList[25] = HTTP_BOOT_DHCP4_TAG_BOOTFILE;\r
-  OptEnt.Para->ParaList[26] = HTTP_BOOT_DHCP4_TAG_UUID;\r
+  OptEnt.Para->ParaList[0]  = DHCP4_TAG_NETMASK;\r
+  OptEnt.Para->ParaList[1]  = DHCP4_TAG_TIME_OFFSET;\r
+  OptEnt.Para->ParaList[2]  = DHCP4_TAG_ROUTER;\r
+  OptEnt.Para->ParaList[3]  = DHCP4_TAG_TIME_SERVER;\r
+  OptEnt.Para->ParaList[4]  = DHCP4_TAG_NAME_SERVER;\r
+  OptEnt.Para->ParaList[5]  = DHCP4_TAG_DNS_SERVER;\r
+  OptEnt.Para->ParaList[6]  = DHCP4_TAG_HOSTNAME;\r
+  OptEnt.Para->ParaList[7]  = DHCP4_TAG_BOOTFILE_LEN;\r
+  OptEnt.Para->ParaList[8]  = DHCP4_TAG_DOMAINNAME;\r
+  OptEnt.Para->ParaList[9]  = DHCP4_TAG_ROOTPATH;\r
+  OptEnt.Para->ParaList[10] = DHCP4_TAG_EXTEND_PATH;\r
+  OptEnt.Para->ParaList[11] = DHCP4_TAG_EMTU;\r
+  OptEnt.Para->ParaList[12] = DHCP4_TAG_TTL;\r
+  OptEnt.Para->ParaList[13] = DHCP4_TAG_BROADCAST;\r
+  OptEnt.Para->ParaList[14] = DHCP4_TAG_NIS_DOMAIN;\r
+  OptEnt.Para->ParaList[15] = DHCP4_TAG_NIS_SERVER;\r
+  OptEnt.Para->ParaList[16] = DHCP4_TAG_NTP_SERVER;\r
+  OptEnt.Para->ParaList[17] = DHCP4_TAG_VENDOR;\r
+  OptEnt.Para->ParaList[18] = DHCP4_TAG_REQUEST_IP;\r
+  OptEnt.Para->ParaList[19] = DHCP4_TAG_LEASE;\r
+  OptEnt.Para->ParaList[20] = DHCP4_TAG_SERVER_ID;\r
+  OptEnt.Para->ParaList[21] = DHCP4_TAG_T1;\r
+  OptEnt.Para->ParaList[22] = DHCP4_TAG_T2;\r
+  OptEnt.Para->ParaList[23] = DHCP4_TAG_VENDOR_CLASS_ID;\r
+  OptEnt.Para->ParaList[25] = DHCP4_TAG_BOOTFILE;\r
+  OptEnt.Para->ParaList[26] = DHCP4_TAG_UUID;\r
   Index++;\r
   OptList[Index]            = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);\r
 \r
   //\r
   // Append UUID/Guid-based client identifier option\r
   //\r
-  OptList[Index]->OpCode  = HTTP_BOOT_DHCP4_TAG_UUID;\r
+  OptList[Index]->OpCode  = DHCP4_TAG_UUID;\r
   OptList[Index]->Length  = (UINT8) sizeof (HTTP_BOOT_DHCP4_OPTION_UUID);\r
   OptEnt.Uuid             = (HTTP_BOOT_DHCP4_OPTION_UUID *) OptList[Index]->Data;\r
   OptEnt.Uuid->Type       = 0;\r
@@ -110,7 +110,7 @@ HttpBootBuildDhcp4Options (
   //\r
   // Append client network device interface option\r
   //\r
-  OptList[Index]->OpCode  = HTTP_BOOT_DHCP4_TAG_UNDI;\r
+  OptList[Index]->OpCode  = DHCP4_TAG_UNDI;\r
   OptList[Index]->Length  = (UINT8) sizeof (HTTP_BOOT_DHCP4_OPTION_UNDI);\r
   OptEnt.Undi             = (HTTP_BOOT_DHCP4_OPTION_UNDI *) OptList[Index]->Data;\r
 \r
@@ -130,7 +130,7 @@ HttpBootBuildDhcp4Options (
   //\r
   // Append client system architecture option\r
   //\r
-  OptList[Index]->OpCode  = HTTP_BOOT_DHCP4_TAG_ARCH;\r
+  OptList[Index]->OpCode  = DHCP4_TAG_ARCH;\r
   OptList[Index]->Length  = (UINT8) sizeof (HTTP_BOOT_DHCP4_OPTION_ARCH);\r
   OptEnt.Arch             = (HTTP_BOOT_DHCP4_OPTION_ARCH *) OptList[Index]->Data;\r
   Value                   = HTONS (EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE);\r
@@ -141,7 +141,7 @@ HttpBootBuildDhcp4Options (
   //\r
   // Append vendor class identify option\r
   //\r
-  OptList[Index]->OpCode  = HTTP_BOOT_DHCP4_TAG_CLASS_ID;\r
+  OptList[Index]->OpCode  = DHCP4_TAG_VENDOR_CLASS_ID;\r
   OptList[Index]->Length  = (UINT8) sizeof (HTTP_BOOT_DHCP4_OPTION_CLID);\r
   OptEnt.Clid             = (HTTP_BOOT_DHCP4_OPTION_CLID *) OptList[Index]->Data;\r
   CopyMem (\r
@@ -190,7 +190,7 @@ HttpBootParseDhcp4Options (
   Option  = (EFI_DHCP4_PACKET_OPTION *) Buffer;\r
   Offset  = 0;\r
 \r
-  while (Offset < Length && Option->OpCode != HTTP_BOOT_DHCP4_TAG_EOP) {\r
+  while (Offset < Length && Option->OpCode != DHCP4_TAG_EOP) {\r
 \r
     if (Option->OpCode == OptTag) {\r
       //\r
@@ -202,7 +202,7 @@ HttpBootParseDhcp4Options (
     //\r
     // Skip the current option to the next.\r
     //\r
-    if (Option->OpCode == HTTP_BOOT_DHCP4_TAG_PAD) {\r
+    if (Option->OpCode == DHCP4_TAG_PAD) {\r
       Offset++;\r
     } else {\r
       Offset += Option->Length + 2;\r
@@ -607,7 +607,7 @@ HttpBootDhcp4CallBack (
   MaxMsgSize = HttpBootParseDhcp4Options (\r
                  Packet->Dhcp4.Option,\r
                  GET_OPTION_BUFFER_LEN (Packet),\r
-                 HTTP_BOOT_DHCP4_TAG_MAXMSG\r
+                 DHCP4_TAG_MAXMSG\r
                  );\r
   if (MaxMsgSize != NULL) {\r
     Value = HTONS (HTTP_BOOT_DHCP4_PACKET_MAX_SIZE);\r
index 5ac7f7116536bc9a2770d4adb4cf966467a4cdce..27d949850ab3b1efb3117f97740ef31fde7ac97a 100644 (file)
@@ -24,47 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define HTTP_BOOT_DHCP4_MSG_TYPE_REQUEST       3\r
 #define HTTP_BOOT_DHCP4_MAGIC                  0x63538263 // network byte order\r
 \r
-//\r
-// Dhcp Options\r
-//\r
-#define HTTP_BOOT_DHCP4_TAG_PAD                0    // Pad Option\r
-#define HTTP_BOOT_DHCP4_TAG_EOP                255  // End Option\r
-#define HTTP_BOOT_DHCP4_TAG_NETMASK            1    // Subnet Mask\r
-#define HTTP_BOOT_DHCP4_TAG_TIME_OFFSET        2    // Time Offset from UTC\r
-#define HTTP_BOOT_DHCP4_TAG_ROUTER             3    // Router option,\r
-#define HTTP_BOOT_DHCP4_TAG_TIME_SERVER        4    // Time Server\r
-#define HTTP_BOOT_DHCP4_TAG_NAME_SERVER        5    // Name Server\r
-#define HTTP_BOOT_DHCP4_TAG_DNS_SERVER         6    // Domain Name Server\r
-#define HTTP_BOOT_DHCP4_TAG_HOSTNAME           12   // Host Name\r
-#define HTTP_BOOT_DHCP4_TAG_BOOTFILE_LEN       13   // Boot File Size\r
-#define HTTP_BOOT_DHCP4_TAG_DUMP               14   // Merit Dump File\r
-#define HTTP_BOOT_DHCP4_TAG_DOMAINNAME         15   // Domain Name\r
-#define HTTP_BOOT_DHCP4_TAG_ROOTPATH           17   // Root path\r
-#define HTTP_BOOT_DHCP4_TAG_EXTEND_PATH        18   // Extensions Path\r
-#define HTTP_BOOT_DHCP4_TAG_EMTU               22   // Maximum Datagram Reassembly Size\r
-#define HTTP_BOOT_DHCP4_TAG_TTL                23   // Default IP Time-to-live\r
-#define HTTP_BOOT_DHCP4_TAG_BROADCAST          28   // Broadcast Address\r
-#define HTTP_BOOT_DHCP4_TAG_NIS_DOMAIN         40   // Network Information Service Domain\r
-#define HTTP_BOOT_DHCP4_TAG_NIS_SERVER         41   // Network Information Servers\r
-#define HTTP_BOOT_DHCP4_TAG_NTP_SERVER         42   // Network Time Protocol Servers\r
-#define HTTP_BOOT_DHCP4_TAG_VENDOR             43   // Vendor Specific Information\r
-#define HTTP_BOOT_DHCP4_TAG_REQUEST_IP         50   // Requested IP Address\r
-#define HTTP_BOOT_DHCP4_TAG_LEASE              51   // IP Address Lease Time\r
-#define HTTP_BOOT_DHCP4_TAG_OVERLOAD           52   // Option Overload\r
-#define HTTP_BOOT_DHCP4_TAG_MSG_TYPE           53   // DHCP Message Type\r
-#define HTTP_BOOT_DHCP4_TAG_SERVER_ID          54   // Server Identifier\r
-#define HTTP_BOOT_DHCP4_TAG_PARA_LIST          55   // Parameter Request List\r
-#define HTTP_BOOT_DHCP4_TAG_MAXMSG             57   // Maximum DHCP Message Size\r
-#define HTTP_BOOT_DHCP4_TAG_T1                 58   // Renewal (T1) Time Value\r
-#define HTTP_BOOT_DHCP4_TAG_T2                 59   // Rebinding (T2) Time Value\r
-#define HTTP_BOOT_DHCP4_TAG_CLASS_ID           60   // Vendor class identifier\r
-#define HTTP_BOOT_DHCP4_TAG_CLIENT_ID          61   // Client-identifier\r
-#define HTTP_BOOT_DHCP4_TAG_TFTP               66   // TFTP server name\r
-#define HTTP_BOOT_DHCP4_TAG_BOOTFILE           67   // Bootfile name\r
-#define HTTP_BOOT_DHCP4_TAG_ARCH               93\r
-#define HTTP_BOOT_DHCP4_TAG_UNDI               94\r
-#define HTTP_BOOT_DHCP4_TAG_UUID               97\r
-\r
 #define HTTP_BOOT_DHCP4_OVERLOAD_FILE          1\r
 #define HTTP_BOOT_DHCP4_OVERLOAD_SERVER_NAME   2\r
 \r
@@ -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\r
 ///\r
 #if defined (MDE_CPU_IA32)\r
-#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    0x000F\r
+#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    HTTP_CLIENT_ARCH_IA32\r
 #elif defined (MDE_CPU_X64)\r
-#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    0x0010\r
+#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    HTTP_CLIENT_ARCH_X64\r
 #elif defined (MDE_CPU_ARM)\r
-#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    0x0012\r
+#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    HTTP_CLIENT_ARCH_ARM\r
 #elif defined (MDE_CPU_AARCH64)\r
-#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    0x0013\r
+#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    HTTP_CLIENT_ARCH_AARCH64\r
 #elif defined (MDE_CPU_EBC)\r
-#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    0x0011\r
+#define EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE    HTTP_CLIENT_ARCH_EBC\r
 #endif\r
 \r
 /// DHCP offer types among HTTP boot.\r
index 9ea421d758ecbe974b9ced885cab355302820d09..809accc29bc3ea3a99e0ab5e913d8d89767d6a50 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Functions implementation related with DHCPv6 for HTTP boot driver.\r
 \r
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -41,20 +41,20 @@ HttpBootBuildDhcp6Options (
   //\r
   // Append client option request option\r
   //\r
-  OptList[Index]->OpCode     = HTONS (HTTP_BOOT_DHCP6_OPT_ORO);\r
+  OptList[Index]->OpCode     = HTONS (DHCP6_OPT_ORO);\r
   OptList[Index]->OpLen      = HTONS (8);\r
   OptEnt.Oro                 = (HTTP_BOOT_DHCP6_OPTION_ORO *) OptList[Index]->Data;\r
-  OptEnt.Oro->OpCode[0]      = HTONS(HTTP_BOOT_DHCP6_OPT_BOOT_FILE_URL);\r
-  OptEnt.Oro->OpCode[1]      = HTONS(HTTP_BOOT_DHCP6_OPT_BOOT_FILE_PARAM);\r
-  OptEnt.Oro->OpCode[2]      = HTONS(HTTP_BOOT_DHCP6_OPT_DNS_SERVERS);\r
-  OptEnt.Oro->OpCode[3]      = HTONS(HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS);\r
+  OptEnt.Oro->OpCode[0]      = HTONS(DHCP6_OPT_BOOT_FILE_URL);\r
+  OptEnt.Oro->OpCode[1]      = HTONS(DHCP6_OPT_BOOT_FILE_PARAM);\r
+  OptEnt.Oro->OpCode[2]      = HTONS(DHCP6_OPT_DNS_SERVERS);\r
+  OptEnt.Oro->OpCode[3]      = HTONS(DHCP6_OPT_VENDOR_CLASS);\r
   Index++;\r
   OptList[Index]             = GET_NEXT_DHCP6_OPTION (OptList[Index - 1]);\r
 \r
   //\r
   // Append client network device interface option\r
   //\r
-  OptList[Index]->OpCode     = HTONS (HTTP_BOOT_DHCP6_OPT_UNDI);\r
+  OptList[Index]->OpCode     = HTONS (DHCP6_OPT_UNDI);\r
   OptList[Index]->OpLen      = HTONS ((UINT16)3);\r
   OptEnt.Undi                = (HTTP_BOOT_DHCP6_OPTION_UNDI *) OptList[Index]->Data;\r
 \r
@@ -74,7 +74,7 @@ HttpBootBuildDhcp6Options (
   //\r
   // Append client system architecture option\r
   //\r
-  OptList[Index]->OpCode     = HTONS (HTTP_BOOT_DHCP6_OPT_ARCH);\r
+  OptList[Index]->OpCode     = HTONS (DHCP6_OPT_ARCH);\r
   OptList[Index]->OpLen      = HTONS ((UINT16) sizeof (HTTP_BOOT_DHCP6_OPTION_ARCH));\r
   OptEnt.Arch                = (HTTP_BOOT_DHCP6_OPTION_ARCH *) OptList[Index]->Data;\r
   Value                      = HTONS (EFI_HTTP_BOOT_CLIENT_SYSTEM_ARCHITECTURE);\r
@@ -85,7 +85,7 @@ HttpBootBuildDhcp6Options (
   //\r
   // Append vendor class identify option.\r
   //\r
-  OptList[Index]->OpCode       = HTONS (HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS);\r
+  OptList[Index]->OpCode       = HTONS (DHCP6_OPT_VENDOR_CLASS);\r
   OptList[Index]->OpLen        = HTONS ((UINT16) sizeof (HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS));\r
   OptEnt.VendorClass           = (HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS *) OptList[Index]->Data;\r
   OptEnt.VendorClass->Vendor   = HTONL (HTTP_BOOT_DHCP6_ENTERPRISE_NUM);\r
@@ -211,18 +211,18 @@ HttpBootParseDhcp6Packet (
   //\r
   while (Offset < Length) {\r
 \r
-    if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_IA_NA) {\r
+    if (NTOHS (Option->OpCode) == DHCP6_OPT_IA_NA) {\r
       Options[HTTP_BOOT_DHCP6_IDX_IA_NA] = Option;\r
-    } else if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_BOOT_FILE_URL) {\r
+    } else if (NTOHS (Option->OpCode) == DHCP6_OPT_BOOT_FILE_URL) {\r
       //\r
       // The server sends this option to inform the client about an URL to a boot file.\r
       //\r
       Options[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL] = Option;\r
-    } else if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_BOOT_FILE_PARAM) {\r
+    } else if (NTOHS (Option->OpCode) == DHCP6_OPT_BOOT_FILE_PARAM) {\r
       Options[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_PARAM] = Option;\r
-    } else if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS) {\r
+    } else if (NTOHS (Option->OpCode) == DHCP6_OPT_VENDOR_CLASS) {\r
       Options[HTTP_BOOT_DHCP6_IDX_VENDOR_CLASS] = Option;\r
-    } else if (NTOHS (Option->OpCode) == HTTP_BOOT_DHCP6_OPT_DNS_SERVERS) {\r
+    } else if (NTOHS (Option->OpCode) == DHCP6_OPT_DNS_SERVERS) {\r
       Options[HTTP_BOOT_DHCP6_IDX_DNS_SERVER] = Option;\r
     }\r
 \r
@@ -238,7 +238,7 @@ HttpBootParseDhcp6Packet (
     Option = HttpBootParseDhcp6Options (\r
                Option->Data + 12,\r
                NTOHS (Option->OpLen),\r
-               HTTP_BOOT_DHCP6_OPT_STATUS_CODE\r
+               DHCP6_OPT_STATUS_CODE\r
                );\r
     if ((Option != NULL && Option->Data[0] == 0) || (Option == NULL)) {\r
       IsProxyOffer = FALSE;\r
index 59ca19e464ff406d6119f406f5658a668e877939..f9eec9d7d35929a1a9373d3e46dc43a912b4707a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Functions declaration related with DHCPv6 for HTTP boot driver.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -24,31 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define HTTP_BOOT_DEFAULT_HOPLIMIT             64\r
 #define HTTP_BOOT_DEFAULT_LIFETIME             50000\r
 \r
-\r
-#define HTTP_BOOT_DHCP6_OPT_CLIENT_ID         1\r
-#define HTTP_BOOT_DHCP6_OPT_SERVER_ID         2\r
-#define HTTP_BOOT_DHCP6_OPT_IA_NA             3\r
-#define HTTP_BOOT_DHCP6_OPT_IA_TA             4\r
-#define HTTP_BOOT_DHCP6_OPT_IAADDR            5\r
-#define HTTP_BOOT_DHCP6_OPT_ORO               6\r
-#define HTTP_BOOT_DHCP6_OPT_PREFERENCE        7\r
-#define HTTP_BOOT_DHCP6_OPT_ELAPSED_TIME      8\r
-#define HTTP_BOOT_DHCP6_OPT_REPLAY_MSG        9\r
-#define HTTP_BOOT_DHCP6_OPT_AUTH              11\r
-#define HTTP_BOOT_DHCP6_OPT_UNICAST           12\r
-#define HTTP_BOOT_DHCP6_OPT_STATUS_CODE       13\r
-#define HTTP_BOOT_DHCP6_OPT_RAPID_COMMIT      14\r
-#define HTTP_BOOT_DHCP6_OPT_USER_CLASS        15\r
-#define HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS      16\r
-#define HTTP_BOOT_DHCP6_OPT_VENDOR_OPTS       17\r
-#define HTTP_BOOT_DHCP6_OPT_INTERFACE_ID      18\r
-#define HTTP_BOOT_DHCP6_OPT_RECONFIG_MSG      19\r
-#define HTTP_BOOT_DHCP6_OPT_RECONFIG_ACCEPT   20\r
-#define HTTP_BOOT_DHCP6_OPT_DNS_SERVERS       23\r
-#define HTTP_BOOT_DHCP6_OPT_BOOT_FILE_URL     59    // Assigned by IANA, RFC 5970\r
-#define HTTP_BOOT_DHCP6_OPT_BOOT_FILE_PARAM   60    // Assigned by IANA, RFC 5970\r
-#define HTTP_BOOT_DHCP6_OPT_ARCH              61    // Assigned by IANA, RFC 5970\r
-#define HTTP_BOOT_DHCP6_OPT_UNDI              62    // Assigned by IANA, RFC 5970\r
 #define HTTP_BOOT_DHCP6_ENTERPRISE_NUM        343   // TODO: IANA TBD: temporarily using Intel's\r
 #define HTTP_BOOT_DHCP6_MAX_BOOT_FILE_SIZE    65535 //   It's a limitation of bit length, 65535*512 bytes.\r
 \r
index 806429cad1b268b11c66cbdcbab40b604a808b21..7e8cd9d4f3d0d839424b5330d8eba3be01b4f100 100644 (file)
@@ -19,6 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Uefi.h>\r
 \r
 #include <IndustryStandard/Http11.h>\r
+#include <IndustryStandard/Dhcp.h>\r
 \r
 //\r
 // Libraries\r
index fa2412ebd8628d5b49d8eef0824edf55ec09dcc4..0e42805c03d52cedb9a531a2446809368e417144 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   iSCSI DHCP4 related configuration routines.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -240,7 +240,7 @@ IScsiDhcpSelectOffer (
   }\r
 \r
   for (Index = 0; Index < OptionCount; Index++) {\r
-    if (OptionList[Index]->OpCode != DHCP4_TAG_ROOT_PATH) {\r
+    if (OptionList[Index]->OpCode != DHCP4_TAG_ROOTPATH) {\r
       continue;\r
     }\r
 \r
@@ -326,7 +326,7 @@ IScsiParseDhcpAck (
     //\r
     // Get DNS server addresses and DHCP server address from this offer.\r
     //\r
-    if (OptionList[Index]->OpCode == DHCP4_TAG_DNS) {\r
+    if (OptionList[Index]->OpCode == DHCP4_TAG_DNS_SERVER) {\r
 \r
       if (((OptionList[Index]->Length & 0x3) != 0) || (OptionList[Index]->Length == 0)) {\r
         Status = EFI_INVALID_PARAMETER;\r
@@ -440,8 +440,8 @@ IScsiDoDhcp (
   ParaList->Length  = (UINT8) (NvData->TargetInfoFromDhcp ? 4 : 3);\r
   ParaList->Data[0] = DHCP4_TAG_NETMASK;\r
   ParaList->Data[1] = DHCP4_TAG_ROUTER;\r
-  ParaList->Data[2] = DHCP4_TAG_DNS;\r
-  ParaList->Data[3] = DHCP4_TAG_ROOT_PATH;\r
+  ParaList->Data[2] = DHCP4_TAG_DNS_SERVER;\r
+  ParaList->Data[3] = DHCP4_TAG_ROOTPATH;\r
 \r
   ZeroMem (&Dhcp4ConfigData, sizeof (EFI_DHCP4_CONFIG_DATA));\r
   Dhcp4ConfigData.OptionCount = 1;\r
index 31651000991e1b26a479b5c24297850aaf5231d5..7d55ec99ec68f3cb8d34c44ed7fb2e39166c25da 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The head file of iSCSI DHCP4 related configuration routines.\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -15,13 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _ISCSI_DHCP_H_\r
 #define _ISCSI_DHCP_H_\r
 \r
-\r
-#define DHCP4_TAG_PARA_LIST             55\r
-#define DHCP4_TAG_NETMASK               1\r
-#define DHCP4_TAG_ROUTER                3\r
-#define DHCP4_TAG_DNS                   6\r
-#define DHCP4_TAG_SERVER_ID             54\r
-#define DHCP4_TAG_ROOT_PATH             17\r
 #define ISCSI_ROOT_PATH_ID              "iscsi:"\r
 #define ISCSI_ROOT_PATH_FIELD_DELIMITER ':'\r
 \r
index 331b0f161b25bdac6a395190717a0078881eb257..0cd0bd88032fa01f7da81f570a6e8889c6b6370a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   iSCSI DHCP6 related configuration routines.\r
 \r
-Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -303,7 +303,7 @@ IScsiDhcp6ParseReply (
       // The server sends this option to inform the client about an URL to a boot file.\r
       //\r
       BootFileOpt = OptionList[Index];\r
-    } else if (OptionList[Index]->OpCode == DHCP6_OPT_BOOT_FILE_PARA) {\r
+    } else if (OptionList[Index]->OpCode == DHCP6_OPT_BOOT_FILE_PARAM) {\r
       //\r
       // The server sends this option to inform the client about DHCP6 server address.\r
       //\r
@@ -434,11 +434,11 @@ IScsiDoDhcp6 (
   // Ask the server to reply with DNS and Boot File URL options by info request.\r
   // All members in EFI_DHCP6_PACKET_OPTION are in network order.\r
   //\r
-  Oro->OpCode  = HTONS (DHCP6_OPT_REQUEST_OPTION);\r
+  Oro->OpCode  = HTONS (DHCP6_OPT_ORO);\r
   Oro->OpLen   = HTONS (2 * 3);\r
   Oro->Data[1] = DHCP6_OPT_DNS_SERVERS;\r
   Oro->Data[3] = DHCP6_OPT_BOOT_FILE_URL;\r
-  Oro->Data[5] = DHCP6_OPT_BOOT_FILE_PARA;\r
+  Oro->Data[5] = DHCP6_OPT_BOOT_FILE_PARAM;\r
 \r
   InfoReqReXmit.Irt = 4;\r
   InfoReqReXmit.Mrc = 1;\r
index 4ca25bd4945bc8aa62e4a90dd58d16802430d106..1d59d106266254deeffe440a2c961a3f51b2a73a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The header file of iSCSI DHCP6 related configuration routines.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -15,15 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _ISCSI_DHCP6_H_\r
 #define _ISCSI_DHCP6_H_\r
 \r
-#define DHCP6_OPT_REQUEST_OPTION 6\r
-#define DHCP6_OPT_VENDOR_INFO    17\r
-#define DHCP6_OPT_DNS_SERVERS    23\r
-///\r
-/// Assigned by IANA, RFC 5970\r
-///\r
-#define DHCP6_OPT_BOOT_FILE_URL  59\r
-#define DHCP6_OPT_BOOT_FILE_PARA 60\r
-\r
 #define ISCSI_ROOT_PATH_ID                   "iscsi:"\r
 #define ISCSI_ROOT_PATH_FIELD_DELIMITER      ':'\r
 #define ISCSI_ROOT_PATH_ADDR_START_DELIMITER '['\r
index 9941b8c3ea11eeb88f014f9e259d5f6d02098582..af468719c53d6cab29b9cb81985519fd438b79c8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The shared head file for iSCSI driver.\r
 \r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -17,6 +17,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Uefi.h>\r
 \r
+#include <IndustryStandard/Dhcp.h>\r
+\r
 #include <Protocol/ComponentName.h>\r
 #include <Protocol/ComponentName2.h>\r
 #include <Protocol/DriverBinding.h>\r
index 62a8ae298ca13ce1c29a7b0a10bc0db89273be6c..54522f9a730f8f1e334d4852f5b150721b65e0a1 100644 (file)
@@ -219,9 +219,9 @@ Ip6ConfigStartStatefulAutoConfig (
   // with DNS SERVERS.\r
   //\r
   Oro                         = (EFI_DHCP6_PACKET_OPTION *) OptBuf;\r
-  Oro->OpCode                 = HTONS (IP6_CONFIG_DHCP6_OPTION_ORO);\r
+  Oro->OpCode                 = HTONS (DHCP6_OPT_ORO);\r
   Oro->OpLen                  = HTONS (2);\r
-  *((UINT16 *) &Oro->Data[0]) = HTONS (IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS);\r
+  *((UINT16 *) &Oro->Data[0]) = HTONS (DHCP6_OPT_DNS_SERVERS);\r
   OptList[0]                  = Oro;\r
 \r
   Status                      = EFI_SUCCESS;\r
@@ -1508,7 +1508,7 @@ Ip6ConfigParseDhcpReply (
     CopyMem (&OpCode, &OptList[Index]->OpCode, sizeof (OpCode));\r
     OpCode = NTOHS (OpCode);\r
 \r
-    if (OpCode == IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS) {\r
+    if (OpCode == DHCP6_OPT_DNS_SERVERS) {\r
       CopyMem (&Length, &OptList[Index]->OpLen, sizeof (Length));\r
       Length = NTOHS (Length);\r
 \r
index 2f0e4467d1ec4dfa96489e91437466ee2786beec..3a6e8ad4d17c28e7b70180c5a0e42dba44077275 100644 (file)
@@ -21,8 +21,6 @@
 #define IP6_CONFIG_VARIABLE_ATTRIBUTE    (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)\r
 \r
 #define IP6_CONFIG_DEFAULT_DAD_XMITS        1\r
-#define IP6_CONFIG_DHCP6_OPTION_ORO         6\r
-#define IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS 23\r
 \r
 #define DATA_ATTRIB_SIZE_FIXED              0x1\r
 #define DATA_ATTRIB_VOLATILE                0x2\r
index d30246b2db3e22a14a9e0fd25fa7abe18e3216b8..9960a9a711786b2864fbfaaedc517e26fbf54339 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of EFI_IP6_PROTOCOL protocol interfaces and type definitions.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -19,6 +19,8 @@
 \r
 #include <Uefi.h>\r
 \r
+#include <IndustryStandard/Dhcp.h>\r
+\r
 #include <Protocol/ServiceBinding.h>\r
 #include <Protocol/ManagedNetwork.h>\r
 #include <Protocol/IpSec.h>\r
index be3dd911b6c5cf0b025d83f4e153eaa9709bd04c..a3f49bb2daadccf3d65a1ceb314299ccd68bbb2b 100644 (file)
@@ -853,9 +853,9 @@ Ip6OnDADFinished (
         // with DNS SERVERS.\r
         //\r
         Oro         = (EFI_DHCP6_PACKET_OPTION *) OptBuf;\r
-        Oro->OpCode = HTONS (IP6_CONFIG_DHCP6_OPTION_ORO);\r
+        Oro->OpCode = HTONS (DHCP6_OPT_ORO);\r
         Oro->OpLen  = HTONS (2);\r
-        *((UINT16 *) &Oro->Data[0]) = HTONS (IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS);\r
+        *((UINT16 *) &Oro->Data[0]) = HTONS (DHCP6_OPT_DNS_SERVERS);\r
 \r
         InfoReqReXmit.Irt = 4;\r
         InfoReqReXmit.Mrc = 64;\r
index 818586f9552ff3bbdcbbbbb3bbef0a6901049f7b..6566afd6af2dbe42a70a28ebeb69e2171485c8d1 100644 (file)
 // This is a map from the interested DHCP4 option tags' index to the tag value.\r
 //\r
 UINT8 mInterestedDhcp4Tags[PXEBC_DHCP4_TAG_INDEX_MAX] = {\r
-  PXEBC_DHCP4_TAG_BOOTFILE_LEN,\r
-  PXEBC_DHCP4_TAG_VENDOR,\r
-  PXEBC_DHCP4_TAG_OVERLOAD,\r
-  PXEBC_DHCP4_TAG_MSG_TYPE,\r
-  PXEBC_DHCP4_TAG_SERVER_ID,\r
-  PXEBC_DHCP4_TAG_CLASS_ID,\r
-  PXEBC_DHCP4_TAG_BOOTFILE\r
+  DHCP4_TAG_BOOTFILE_LEN,\r
+  DHCP4_TAG_VENDOR,\r
+  DHCP4_TAG_OVERLOAD,\r
+  DHCP4_TAG_MSG_TYPE,\r
+  DHCP4_TAG_SERVER_ID,\r
+  DHCP4_TAG_VENDOR_CLASS_ID,\r
+  DHCP4_TAG_BOOTFILE\r
 };\r
 \r
 //\r
@@ -58,7 +58,7 @@ PxeBcParseDhcp4Options (
   Option  = (EFI_DHCP4_PACKET_OPTION *) Buffer;\r
   Offset  = 0;\r
 \r
-  while (Offset < Length && Option->OpCode != PXEBC_DHCP4_TAG_EOP) {\r
+  while (Offset < Length && Option->OpCode != DHCP4_TAG_EOP) {\r
 \r
     if (Option->OpCode == OptTag) {\r
       //\r
@@ -70,7 +70,7 @@ PxeBcParseDhcp4Options (
     //\r
     // Skip the current option to the next.\r
     //\r
-    if (Option->OpCode == PXEBC_DHCP4_TAG_PAD) {\r
+    if (Option->OpCode == DHCP4_TAG_PAD) {\r
       Offset++;\r
     } else {\r
       Offset += Option->Length + 2;\r
@@ -108,7 +108,7 @@ PxeBcParseVendorOptions (
 \r
   ASSERT (PxeOption != NULL);\r
 \r
-  while ((Offset < VendorOptionLen) && (PxeOption->OpCode != PXEBC_DHCP4_TAG_EOP)) {\r
+  while ((Offset < VendorOptionLen) && (PxeOption->OpCode != DHCP4_TAG_EOP)) {\r
     //\r
     // Parse all the interesting PXE vendor options one by one.\r
     //\r
@@ -201,7 +201,7 @@ PxeBcParseVendorOptions (
     //\r
     // Continue to the next option.\r
     //\r
-    if (PxeOption->OpCode == PXEBC_DHCP4_TAG_PAD) {\r
+    if (PxeOption->OpCode == DHCP4_TAG_PAD) {\r
       Offset++;\r
     } else {\r
       Offset = (UINT8) (Offset + PxeOption->Length + 2);\r
@@ -243,7 +243,7 @@ PxeBcBuildDhcp4Options (
     //\r
     // Append message type.\r
     //\r
-    OptList[Index]->OpCode  = PXEBC_DHCP4_TAG_MSG_TYPE;\r
+    OptList[Index]->OpCode  = DHCP4_TAG_MSG_TYPE;\r
     OptList[Index]->Length  = 1;\r
     OptEnt.Mesg             = (PXEBC_DHCP4_OPTION_MESG *) OptList[Index]->Data;\r
     OptEnt.Mesg->Type       = PXEBC_DHCP4_MSG_TYPE_REQUEST;\r
@@ -253,7 +253,7 @@ PxeBcBuildDhcp4Options (
     //\r
     // Append max message size.\r
     //\r
-    OptList[Index]->OpCode  = PXEBC_DHCP4_TAG_MAXMSG;\r
+    OptList[Index]->OpCode  = DHCP4_TAG_MAXMSG;\r
     OptList[Index]->Length  = (UINT8) sizeof (PXEBC_DHCP4_OPTION_MAX_MESG_SIZE);\r
     OptEnt.MaxMesgSize      = (PXEBC_DHCP4_OPTION_MAX_MESG_SIZE *) OptList[Index]->Data;\r
     Value                   = NTOHS (PXEBC_DHCP4_PACKET_MAX_SIZE - 8);\r
@@ -265,36 +265,36 @@ PxeBcBuildDhcp4Options (
   //\r
   // Append parameter request list option.\r
   //\r
-  OptList[Index]->OpCode    = PXEBC_DHCP4_TAG_PARA_LIST;\r
+  OptList[Index]->OpCode    = DHCP4_TAG_PARA_LIST;\r
   OptList[Index]->Length    = 35;\r
   OptEnt.Para               = (PXEBC_DHCP4_OPTION_PARA *) OptList[Index]->Data;\r
-  OptEnt.Para->ParaList[0]  = PXEBC_DHCP4_TAG_NETMASK;\r
-  OptEnt.Para->ParaList[1]  = PXEBC_DHCP4_TAG_TIME_OFFSET;\r
-  OptEnt.Para->ParaList[2]  = PXEBC_DHCP4_TAG_ROUTER;\r
-  OptEnt.Para->ParaList[3]  = PXEBC_DHCP4_TAG_TIME_SERVER;\r
-  OptEnt.Para->ParaList[4]  = PXEBC_DHCP4_TAG_NAME_SERVER;\r
-  OptEnt.Para->ParaList[5]  = PXEBC_DHCP4_TAG_DNS_SERVER;\r
-  OptEnt.Para->ParaList[6]  = PXEBC_DHCP4_TAG_HOSTNAME;\r
-  OptEnt.Para->ParaList[7]  = PXEBC_DHCP4_TAG_BOOTFILE_LEN;\r
-  OptEnt.Para->ParaList[8]  = PXEBC_DHCP4_TAG_DOMAINNAME;\r
-  OptEnt.Para->ParaList[9]  = PXEBC_DHCP4_TAG_ROOTPATH;\r
-  OptEnt.Para->ParaList[10] = PXEBC_DHCP4_TAG_EXTEND_PATH;\r
-  OptEnt.Para->ParaList[11] = PXEBC_DHCP4_TAG_EMTU;\r
-  OptEnt.Para->ParaList[12] = PXEBC_DHCP4_TAG_TTL;\r
-  OptEnt.Para->ParaList[13] = PXEBC_DHCP4_TAG_BROADCAST;\r
-  OptEnt.Para->ParaList[14] = PXEBC_DHCP4_TAG_NIS_DOMAIN;\r
-  OptEnt.Para->ParaList[15] = PXEBC_DHCP4_TAG_NIS_SERVER;\r
-  OptEnt.Para->ParaList[16] = PXEBC_DHCP4_TAG_NTP_SERVER;\r
-  OptEnt.Para->ParaList[17] = PXEBC_DHCP4_TAG_VENDOR;\r
-  OptEnt.Para->ParaList[18] = PXEBC_DHCP4_TAG_REQUEST_IP;\r
-  OptEnt.Para->ParaList[19] = PXEBC_DHCP4_TAG_LEASE;\r
-  OptEnt.Para->ParaList[20] = PXEBC_DHCP4_TAG_SERVER_ID;\r
-  OptEnt.Para->ParaList[21] = PXEBC_DHCP4_TAG_T1;\r
-  OptEnt.Para->ParaList[22] = PXEBC_DHCP4_TAG_T2;\r
-  OptEnt.Para->ParaList[23] = PXEBC_DHCP4_TAG_CLASS_ID;\r
-  OptEnt.Para->ParaList[24] = PXEBC_DHCP4_TAG_TFTP;\r
-  OptEnt.Para->ParaList[25] = PXEBC_DHCP4_TAG_BOOTFILE;\r
-  OptEnt.Para->ParaList[26] = PXEBC_PXE_DHCP4_TAG_UUID;\r
+  OptEnt.Para->ParaList[0]  = DHCP4_TAG_NETMASK;\r
+  OptEnt.Para->ParaList[1]  = DHCP4_TAG_TIME_OFFSET;\r
+  OptEnt.Para->ParaList[2]  = DHCP4_TAG_ROUTER;\r
+  OptEnt.Para->ParaList[3]  = DHCP4_TAG_TIME_SERVER;\r
+  OptEnt.Para->ParaList[4]  = DHCP4_TAG_NAME_SERVER;\r
+  OptEnt.Para->ParaList[5]  = DHCP4_TAG_DNS_SERVER;\r
+  OptEnt.Para->ParaList[6]  = DHCP4_TAG_HOSTNAME;\r
+  OptEnt.Para->ParaList[7]  = DHCP4_TAG_BOOTFILE_LEN;\r
+  OptEnt.Para->ParaList[8]  = DHCP4_TAG_DOMAINNAME;\r
+  OptEnt.Para->ParaList[9]  = DHCP4_TAG_ROOTPATH;\r
+  OptEnt.Para->ParaList[10] = DHCP4_TAG_EXTEND_PATH;\r
+  OptEnt.Para->ParaList[11] = DHCP4_TAG_EMTU;\r
+  OptEnt.Para->ParaList[12] = DHCP4_TAG_TTL;\r
+  OptEnt.Para->ParaList[13] = DHCP4_TAG_BROADCAST;\r
+  OptEnt.Para->ParaList[14] = DHCP4_TAG_NIS_DOMAIN;\r
+  OptEnt.Para->ParaList[15] = DHCP4_TAG_NIS_SERVER;\r
+  OptEnt.Para->ParaList[16] = DHCP4_TAG_NTP_SERVER;\r
+  OptEnt.Para->ParaList[17] = DHCP4_TAG_VENDOR;\r
+  OptEnt.Para->ParaList[18] = DHCP4_TAG_REQUEST_IP;\r
+  OptEnt.Para->ParaList[19] = DHCP4_TAG_LEASE;\r
+  OptEnt.Para->ParaList[20] = DHCP4_TAG_SERVER_ID;\r
+  OptEnt.Para->ParaList[21] = DHCP4_TAG_T1;\r
+  OptEnt.Para->ParaList[22] = DHCP4_TAG_T2;\r
+  OptEnt.Para->ParaList[23] = DHCP4_TAG_VENDOR_CLASS_ID;\r
+  OptEnt.Para->ParaList[24] = DHCP4_TAG_TFTP;\r
+  OptEnt.Para->ParaList[25] = DHCP4_TAG_BOOTFILE;\r
+  OptEnt.Para->ParaList[26] = DHCP4_TAG_UUID;\r
   OptEnt.Para->ParaList[27] = 0x80;\r
   OptEnt.Para->ParaList[28] = 0x81;\r
   OptEnt.Para->ParaList[29] = 0x82;\r
@@ -309,7 +309,7 @@ PxeBcBuildDhcp4Options (
   //\r
   // Append UUID/Guid-based client identifier option\r
   //\r
-  OptList[Index]->OpCode  = PXEBC_PXE_DHCP4_TAG_UUID;\r
+  OptList[Index]->OpCode  = DHCP4_TAG_UUID;\r
   OptList[Index]->Length  = (UINT8) sizeof (PXEBC_DHCP4_OPTION_UUID);\r
   OptEnt.Uuid             = (PXEBC_DHCP4_OPTION_UUID *) OptList[Index]->Data;\r
   OptEnt.Uuid->Type       = 0;\r
@@ -326,7 +326,7 @@ PxeBcBuildDhcp4Options (
   //\r
   // Append client network device interface option\r
   //\r
-  OptList[Index]->OpCode  = PXEBC_PXE_DHCP4_TAG_UNDI;\r
+  OptList[Index]->OpCode  = DHCP4_TAG_UNDI;\r
   OptList[Index]->Length  = (UINT8) sizeof (PXEBC_DHCP4_OPTION_UNDI);\r
   OptEnt.Undi             = (PXEBC_DHCP4_OPTION_UNDI *) OptList[Index]->Data;\r
 \r
@@ -346,7 +346,7 @@ PxeBcBuildDhcp4Options (
   //\r
   // Append client system architecture option\r
   //\r
-  OptList[Index]->OpCode  = PXEBC_PXE_DHCP4_TAG_ARCH;\r
+  OptList[Index]->OpCode  = DHCP4_TAG_ARCH;\r
   OptList[Index]->Length  = (UINT8) sizeof (PXEBC_DHCP4_OPTION_ARCH);\r
   OptEnt.Arch             = (PXEBC_DHCP4_OPTION_ARCH *) OptList[Index]->Data;\r
   Value                   = HTONS (EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE);\r
@@ -357,7 +357,7 @@ PxeBcBuildDhcp4Options (
   //\r
   // Append vendor class identify option\r
   //\r
-  OptList[Index]->OpCode  = PXEBC_DHCP4_TAG_CLASS_ID;\r
+  OptList[Index]->OpCode  = DHCP4_TAG_VENDOR_CLASS_ID;\r
   OptList[Index]->Length  = (UINT8) sizeof (PXEBC_DHCP4_OPTION_CLID);\r
   OptEnt.Clid             = (PXEBC_DHCP4_OPTION_CLID *) OptList[Index]->Data;\r
   CopyMem (\r
@@ -414,7 +414,7 @@ PxeBcSeedDhcp4Packet (
   CopyMem (Header->ClientHwAddr, &Mode.CurrentAddress, Header->HwAddrLen);\r
 \r
   Seed->Dhcp4.Magik     = PXEBC_DHCP4_MAGIC;\r
-  Seed->Dhcp4.Option[0] = PXEBC_DHCP4_TAG_EOP;\r
+  Seed->Dhcp4.Option[0] = DHCP4_TAG_EOP;\r
 }\r
 \r
 \r
@@ -1180,7 +1180,7 @@ PxeBcDhcp4CallBack (
   MaxMsgSize = PxeBcParseDhcp4Options (\r
                  Packet->Dhcp4.Option,\r
                  GET_OPTION_BUFFER_LEN (Packet),\r
-                 PXEBC_DHCP4_TAG_MAXMSG\r
+                 DHCP4_TAG_MAXMSG\r
                  );\r
   if (MaxMsgSize != NULL) {\r
     Value = HTONS (PXEBC_DHCP4_PACKET_MAX_SIZE - 8);\r
@@ -1356,14 +1356,14 @@ PxeBcDhcp4Discover (
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
-    OptList[OptCount]->OpCode     = PXEBC_DHCP4_TAG_VENDOR;\r
+    OptList[OptCount]->OpCode     = DHCP4_TAG_VENDOR;\r
     OptList[OptCount]->Length     = (UINT8) (VendorOptLen - 2);\r
     PxeOpt                        = (EFI_DHCP4_PACKET_OPTION *) OptList[OptCount]->Data;\r
     PxeOpt->OpCode                = PXEBC_VENDOR_TAG_BOOT_ITEM;\r
     PxeOpt->Length                = (UINT8) sizeof (PXEBC_OPTION_BOOT_ITEM);\r
     PxeBootItem                   = (PXEBC_OPTION_BOOT_ITEM *) PxeOpt->Data;\r
     PxeBootItem->Type             = HTONS (Type);\r
-    PxeOpt->Data[PxeOpt->Length]  = PXEBC_DHCP4_TAG_EOP;\r
+    PxeOpt->Data[PxeOpt->Length]  = DHCP4_TAG_EOP;\r
 \r
     if (Layer != NULL) {\r
       PxeBootItem->Layer          = HTONS (*Layer);\r
index 248dc60d2c165ade18a2968e31247799f78d47fb..3aabaed088820f2b3abe0f17b6df5b53ed193988 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Functions declaration related with DHCPv4 for UefiPxeBc Driver.\r
 \r
-  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 #define PXEBC_DHCP4_MSG_TYPE_REQUEST       3\r
 #define PXEBC_DHCP4_MAGIC                  0x63538263 // network byte order\r
 \r
-//\r
-// Dhcp Options\r
-//\r
-#define PXEBC_DHCP4_TAG_PAD                0    // Pad Option\r
-#define PXEBC_DHCP4_TAG_EOP                255  // End Option\r
-#define PXEBC_DHCP4_TAG_NETMASK            1    // Subnet Mask\r
-#define PXEBC_DHCP4_TAG_TIME_OFFSET        2    // Time Offset from UTC\r
-#define PXEBC_DHCP4_TAG_ROUTER             3    // Router option,\r
-#define PXEBC_DHCP4_TAG_TIME_SERVER        4    // Time Server\r
-#define PXEBC_DHCP4_TAG_NAME_SERVER        5    // Name Server\r
-#define PXEBC_DHCP4_TAG_DNS_SERVER         6    // Domain Name Server\r
-#define PXEBC_DHCP4_TAG_HOSTNAME           12   // Host Name\r
-#define PXEBC_DHCP4_TAG_BOOTFILE_LEN       13   // Boot File Size\r
-#define PXEBC_DHCP4_TAG_DUMP               14   // Merit Dump File\r
-#define PXEBC_DHCP4_TAG_DOMAINNAME         15   // Domain Name\r
-#define PXEBC_DHCP4_TAG_ROOTPATH           17   // Root path\r
-#define PXEBC_DHCP4_TAG_EXTEND_PATH        18   // Extensions Path\r
-#define PXEBC_DHCP4_TAG_EMTU               22   // Maximum Datagram Reassembly Size\r
-#define PXEBC_DHCP4_TAG_TTL                23   // Default IP Time-to-live\r
-#define PXEBC_DHCP4_TAG_BROADCAST          28   // Broadcast Address\r
-#define PXEBC_DHCP4_TAG_NIS_DOMAIN         40   // Network Information Service Domain\r
-#define PXEBC_DHCP4_TAG_NIS_SERVER         41   // Network Information Servers\r
-#define PXEBC_DHCP4_TAG_NTP_SERVER         42   // Network Time Protocol Servers\r
-#define PXEBC_DHCP4_TAG_VENDOR             43   // Vendor Specific Information\r
-#define PXEBC_DHCP4_TAG_REQUEST_IP         50   // Requested IP Address\r
-#define PXEBC_DHCP4_TAG_LEASE              51   // IP Address Lease Time\r
-#define PXEBC_DHCP4_TAG_OVERLOAD           52   // Option Overload\r
-#define PXEBC_DHCP4_TAG_MSG_TYPE           53   // DHCP Message Type\r
-#define PXEBC_DHCP4_TAG_SERVER_ID          54   // Server Identifier\r
-#define PXEBC_DHCP4_TAG_PARA_LIST          55   // Parameter Request List\r
-#define PXEBC_DHCP4_TAG_MAXMSG             57   // Maximum DHCP Message Size\r
-#define PXEBC_DHCP4_TAG_T1                 58   // Renewal (T1) Time Value\r
-#define PXEBC_DHCP4_TAG_T2                 59   // Rebinding (T2) Time Value\r
-#define PXEBC_DHCP4_TAG_CLASS_ID           60   // Vendor class identifier\r
-#define PXEBC_DHCP4_TAG_CLIENT_ID          61   // Client-identifier\r
-#define PXEBC_DHCP4_TAG_TFTP               66   // TFTP server name\r
-#define PXEBC_DHCP4_TAG_BOOTFILE           67   // Bootfile name\r
-#define PXEBC_PXE_DHCP4_TAG_ARCH           93\r
-#define PXEBC_PXE_DHCP4_TAG_UNDI           94\r
-#define PXEBC_PXE_DHCP4_TAG_UUID           97\r
 //\r
 // Sub-Options in Dhcp Vendor Option\r
 //\r
index 8003f314910ef015dfa032dbe61a94ffadbcbdf8..41d3d30a12d50c563a3935cd68e7d8fa082bc486 100644 (file)
@@ -92,18 +92,18 @@ PxeBcBuildDhcp6Options (
   //\r
   // Append client option request option\r
   //\r
-  OptList[Index]->OpCode     = HTONS (PXEBC_DHCP6_OPT_ORO);\r
+  OptList[Index]->OpCode     = HTONS (DHCP6_OPT_ORO);\r
   OptList[Index]->OpLen      = HTONS (4);\r
   OptEnt.Oro                 = (PXEBC_DHCP6_OPTION_ORO *) OptList[Index]->Data;\r
-  OptEnt.Oro->OpCode[0]      = HTONS(PXEBC_DHCP6_OPT_BOOT_FILE_URL);\r
-  OptEnt.Oro->OpCode[1]      = HTONS(PXEBC_DHCP6_OPT_BOOT_FILE_PARAM);\r
+  OptEnt.Oro->OpCode[0]      = HTONS(DHCP6_OPT_BOOT_FILE_URL);\r
+  OptEnt.Oro->OpCode[1]      = HTONS(DHCP6_OPT_BOOT_FILE_PARAM);\r
   Index++;\r
   OptList[Index]             = GET_NEXT_DHCP6_OPTION (OptList[Index - 1]);\r
 \r
   //\r
   // Append client network device interface option\r
   //\r
-  OptList[Index]->OpCode     = HTONS (PXEBC_DHCP6_OPT_UNDI);\r
+  OptList[Index]->OpCode     = HTONS (DHCP6_OPT_UNDI);\r
   OptList[Index]->OpLen      = HTONS ((UINT16)3);\r
   OptEnt.Undi                = (PXEBC_DHCP6_OPTION_UNDI *) OptList[Index]->Data;\r
 \r
@@ -123,7 +123,7 @@ PxeBcBuildDhcp6Options (
   //\r
   // Append client system architecture option\r
   //\r
-  OptList[Index]->OpCode     = HTONS (PXEBC_DHCP6_OPT_ARCH);\r
+  OptList[Index]->OpCode     = HTONS (DHCP6_OPT_ARCH);\r
   OptList[Index]->OpLen      = HTONS ((UINT16) sizeof (PXEBC_DHCP6_OPTION_ARCH));\r
   OptEnt.Arch                = (PXEBC_DHCP6_OPTION_ARCH *) OptList[Index]->Data;\r
   Value                      = HTONS (EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE);\r
@@ -134,7 +134,7 @@ PxeBcBuildDhcp6Options (
   //\r
   // Append vendor class option to store the PXE class identifier.\r
   //\r
-  OptList[Index]->OpCode       = HTONS (PXEBC_DHCP6_OPT_VENDOR_CLASS);\r
+  OptList[Index]->OpCode       = HTONS (DHCP6_OPT_VENDOR_CLASS);\r
   OptList[Index]->OpLen        = HTONS ((UINT16) sizeof (PXEBC_DHCP6_OPTION_VENDOR_CLASS));\r
   OptEnt.VendorClass           = (PXEBC_DHCP6_OPTION_VENDOR_CLASS *) OptList[Index]->Data;\r
   OptEnt.VendorClass->Vendor   = HTONL (PXEBC_DHCP6_ENTERPRISE_NUM);\r
@@ -471,16 +471,16 @@ PxeBcParseDhcp6Packet (
   //\r
   while (Offset < Length) {\r
 \r
-    if (NTOHS (Option->OpCode) == PXEBC_DHCP6_OPT_IA_NA) {\r
+    if (NTOHS (Option->OpCode) == DHCP6_OPT_IA_NA) {\r
       Options[PXEBC_DHCP6_IDX_IA_NA] = Option;\r
-    } else if (NTOHS (Option->OpCode) == PXEBC_DHCP6_OPT_BOOT_FILE_URL) {\r
+    } else if (NTOHS (Option->OpCode) == DHCP6_OPT_BOOT_FILE_URL) {\r
       //\r
       // The server sends this option to inform the client about an URL to a boot file.\r
       //\r
       Options[PXEBC_DHCP6_IDX_BOOT_FILE_URL] = Option;\r
-    } else if (NTOHS (Option->OpCode) == PXEBC_DHCP6_OPT_BOOT_FILE_PARAM) {\r
+    } else if (NTOHS (Option->OpCode) == DHCP6_OPT_BOOT_FILE_PARAM) {\r
       Options[PXEBC_DHCP6_IDX_BOOT_FILE_PARAM] = Option;\r
-    } else if (NTOHS (Option->OpCode) == PXEBC_DHCP6_OPT_VENDOR_CLASS) {\r
+    } else if (NTOHS (Option->OpCode) == DHCP6_OPT_VENDOR_CLASS) {\r
       Options[PXEBC_DHCP6_IDX_VENDOR_CLASS] = Option;\r
     }\r
 \r
@@ -497,7 +497,7 @@ PxeBcParseDhcp6Packet (
     Option = PxeBcParseDhcp6Options (\r
                Option->Data + 12,\r
                NTOHS (Option->OpLen),\r
-               PXEBC_DHCP6_OPT_STATUS_CODE\r
+               DHCP6_OPT_STATUS_CODE\r
                );\r
     if ((Option != NULL && Option->Data[0] == 0) || (Option == NULL)) {\r
       IsProxyOffer = FALSE;\r
@@ -713,7 +713,7 @@ PxeBcRequestBootService (
   Option = PxeBcDhcp6SeekOption (\r
              ProxyOffer->Dhcp6.Option,\r
              ProxyOffer->Length - 4,\r
-             PXEBC_DHCP6_OPT_SERVER_ID\r
+             DHCP6_OPT_SERVER_ID\r
              );\r
   if (Option == NULL) {\r
     return EFI_NOT_FOUND;\r
@@ -732,7 +732,7 @@ PxeBcRequestBootService (
     OpLen  = NTOHS (((EFI_DHCP6_PACKET_OPTION *) RequestOpt)->OpLen);\r
     if (OpCode != EFI_DHCP6_IA_TYPE_NA &&\r
         OpCode != EFI_DHCP6_IA_TYPE_TA &&\r
-        OpCode != PXEBC_DHCP6_OPT_SERVER_ID\r
+        OpCode != DHCP6_OPT_SERVER_ID\r
         ) {\r
       //\r
       // Copy all the options except IA option and Server ID\r
@@ -751,7 +751,7 @@ PxeBcRequestBootService (
   Option = PxeBcDhcp6SeekOption (\r
              Discover->DhcpOptions,\r
              (UINT32)(RequestLen - 4),\r
-             PXEBC_DHCP6_OPT_ELAPSED_TIME\r
+             DHCP6_OPT_ELAPSED_TIME\r
              );\r
   if (Option != NULL) {\r
     CalcElapsedTime (Private);\r
index 38bf26564d0865f40e63bce52b9ca700a2621cdc..a6d52f972c5b16105ef9995caebf12a2a4aec9cd 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Functions declaration related with DHCPv6 for UefiPxeBc Driver.\r
 \r
-  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 #define PXEBC_DHCP6_S_PORT                547\r
 #define PXEBC_DHCP6_C_PORT                546\r
 \r
-#define PXEBC_DHCP6_OPT_CLIENT_ID         1\r
-#define PXEBC_DHCP6_OPT_SERVER_ID         2\r
-#define PXEBC_DHCP6_OPT_IA_NA             3\r
-#define PXEBC_DHCP6_OPT_IA_TA             4\r
-#define PXEBC_DHCP6_OPT_IAADDR            5\r
-#define PXEBC_DHCP6_OPT_ORO               6\r
-#define PXEBC_DHCP6_OPT_PREFERENCE        7\r
-#define PXEBC_DHCP6_OPT_ELAPSED_TIME      8\r
-#define PXEBC_DHCP6_OPT_REPLAY_MSG        9\r
-#define PXEBC_DHCP6_OPT_AUTH              11\r
-#define PXEBC_DHCP6_OPT_UNICAST           12\r
-#define PXEBC_DHCP6_OPT_STATUS_CODE       13\r
-#define PXEBC_DHCP6_OPT_RAPID_COMMIT      14\r
-#define PXEBC_DHCP6_OPT_USER_CLASS        15\r
-#define PXEBC_DHCP6_OPT_VENDOR_CLASS      16\r
-#define PXEBC_DHCP6_OPT_VENDOR_OPTS       17\r
-#define PXEBC_DHCP6_OPT_INTERFACE_ID      18\r
-#define PXEBC_DHCP6_OPT_RECONFIG_MSG      19\r
-#define PXEBC_DHCP6_OPT_RECONFIG_ACCEPT   20\r
-#define PXEBC_DHCP6_OPT_BOOT_FILE_URL     59    // Assigned by IANA, RFC 5970\r
-#define PXEBC_DHCP6_OPT_BOOT_FILE_PARAM   60    // Assigned by IANA, RFC 5970\r
-#define PXEBC_DHCP6_OPT_ARCH              61    // Assigned by IANA, RFC 5970\r
-#define PXEBC_DHCP6_OPT_UNDI              62    // Assigned by IANA, RFC 5970\r
 #define PXEBC_DHCP6_ENTERPRISE_NUM        343   // TODO: IANA TBD: temporarily using Intel's\r
 #define PXEBC_DHCP6_MAX_BOOT_FILE_SIZE    65535 //   It's a limitation of bit length, 65535*512 bytes.\r
 \r
index ac7dc8781a2f754e5145c1791f0922ac45ad6e3d..d0f5e5b5f26cd9f7a2f3cd2d8c0b97c031249a08 100644 (file)
@@ -2,7 +2,7 @@
   This EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.\r
   interfaces declaration.\r
 \r
-  Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -21,6 +21,7 @@
 \r
 #include <Guid/SmBios.h>\r
 #include <IndustryStandard/SmBios.h>\r
+#include <IndustryStandard/Dhcp.h>\r
 #include <Protocol/NetworkInterfaceIdentifier.h>\r
 #include <Protocol/Arp.h>\r
 #include <Protocol/Ip4.h>\r