summaryrefslogtreecommitdiff
path: root/NetworkPkg/IScsiDxe
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/IScsiDxe
parentac6c3d90edebf1499dac8f4d3c99e94d197ad45e (diff)
downloadedk2-142c00c3d659a6d5d66416385b4c93fd9a9f10e6.zip
edk2-142c00c3d659a6d5d66416385b4c93fd9a9f10e6.tar.gz
edk2-142c00c3d659a6d5d66416385b4c93fd9a9f10e6.tar.bz2
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/IScsiDxe')
-rw-r--r--NetworkPkg/IScsiDxe/IScsiDhcp.c10
-rw-r--r--NetworkPkg/IScsiDxe/IScsiDhcp.h9
-rw-r--r--NetworkPkg/IScsiDxe/IScsiDhcp6.c8
-rw-r--r--NetworkPkg/IScsiDxe/IScsiDhcp6.h11
-rw-r--r--NetworkPkg/IScsiDxe/IScsiImpl.h4
5 files changed, 14 insertions, 28 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.c b/NetworkPkg/IScsiDxe/IScsiDhcp.c
index fa2412e..0e42805 100644
--- a/NetworkPkg/IScsiDxe/IScsiDhcp.c
+++ b/NetworkPkg/IScsiDxe/IScsiDhcp.c
@@ -1,7 +1,7 @@
/** @file
iSCSI DHCP4 related configuration routines.
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 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
which accompanies this distribution. The full text of the license may be found at
@@ -240,7 +240,7 @@ IScsiDhcpSelectOffer (
}
for (Index = 0; Index < OptionCount; Index++) {
- if (OptionList[Index]->OpCode != DHCP4_TAG_ROOT_PATH) {
+ if (OptionList[Index]->OpCode != DHCP4_TAG_ROOTPATH) {
continue;
}
@@ -326,7 +326,7 @@ IScsiParseDhcpAck (
//
// Get DNS server addresses and DHCP server address from this offer.
//
- if (OptionList[Index]->OpCode == DHCP4_TAG_DNS) {
+ if (OptionList[Index]->OpCode == DHCP4_TAG_DNS_SERVER) {
if (((OptionList[Index]->Length & 0x3) != 0) || (OptionList[Index]->Length == 0)) {
Status = EFI_INVALID_PARAMETER;
@@ -440,8 +440,8 @@ IScsiDoDhcp (
ParaList->Length = (UINT8) (NvData->TargetInfoFromDhcp ? 4 : 3);
ParaList->Data[0] = DHCP4_TAG_NETMASK;
ParaList->Data[1] = DHCP4_TAG_ROUTER;
- ParaList->Data[2] = DHCP4_TAG_DNS;
- ParaList->Data[3] = DHCP4_TAG_ROOT_PATH;
+ ParaList->Data[2] = DHCP4_TAG_DNS_SERVER;
+ ParaList->Data[3] = DHCP4_TAG_ROOTPATH;
ZeroMem (&Dhcp4ConfigData, sizeof (EFI_DHCP4_CONFIG_DATA));
Dhcp4ConfigData.OptionCount = 1;
diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.h b/NetworkPkg/IScsiDxe/IScsiDhcp.h
index 3165100..7d55ec9 100644
--- a/NetworkPkg/IScsiDxe/IScsiDhcp.h
+++ b/NetworkPkg/IScsiDxe/IScsiDhcp.h
@@ -1,7 +1,7 @@
/** @file
The head file of iSCSI DHCP4 related configuration routines.
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 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
which accompanies this distribution. The full text of the license may be found at
@@ -15,13 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef _ISCSI_DHCP_H_
#define _ISCSI_DHCP_H_
-
-#define DHCP4_TAG_PARA_LIST 55
-#define DHCP4_TAG_NETMASK 1
-#define DHCP4_TAG_ROUTER 3
-#define DHCP4_TAG_DNS 6
-#define DHCP4_TAG_SERVER_ID 54
-#define DHCP4_TAG_ROOT_PATH 17
#define ISCSI_ROOT_PATH_ID "iscsi:"
#define ISCSI_ROOT_PATH_FIELD_DELIMITER ':'
diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c b/NetworkPkg/IScsiDxe/IScsiDhcp6.c
index 331b0f1..0cd0bd8 100644
--- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c
+++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c
@@ -1,7 +1,7 @@
/** @file
iSCSI DHCP6 related configuration routines.
-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
which accompanies this distribution. The full text of the license may be found at
@@ -303,7 +303,7 @@ IScsiDhcp6ParseReply (
// The server sends this option to inform the client about an URL to a boot file.
//
BootFileOpt = OptionList[Index];
- } else if (OptionList[Index]->OpCode == DHCP6_OPT_BOOT_FILE_PARA) {
+ } else if (OptionList[Index]->OpCode == DHCP6_OPT_BOOT_FILE_PARAM) {
//
// The server sends this option to inform the client about DHCP6 server address.
//
@@ -434,11 +434,11 @@ IScsiDoDhcp6 (
// Ask the server to reply with DNS and Boot File URL options by info request.
// All members in EFI_DHCP6_PACKET_OPTION are in network order.
//
- Oro->OpCode = HTONS (DHCP6_OPT_REQUEST_OPTION);
+ Oro->OpCode = HTONS (DHCP6_OPT_ORO);
Oro->OpLen = HTONS (2 * 3);
Oro->Data[1] = DHCP6_OPT_DNS_SERVERS;
Oro->Data[3] = DHCP6_OPT_BOOT_FILE_URL;
- Oro->Data[5] = DHCP6_OPT_BOOT_FILE_PARA;
+ Oro->Data[5] = DHCP6_OPT_BOOT_FILE_PARAM;
InfoReqReXmit.Irt = 4;
InfoReqReXmit.Mrc = 1;
diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.h b/NetworkPkg/IScsiDxe/IScsiDhcp6.h
index 4ca25bd..1d59d10 100644
--- a/NetworkPkg/IScsiDxe/IScsiDhcp6.h
+++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.h
@@ -1,7 +1,7 @@
/** @file
The header file of iSCSI DHCP6 related configuration routines.
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 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
which accompanies this distribution. The full text of the license may be found at
@@ -15,15 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef _ISCSI_DHCP6_H_
#define _ISCSI_DHCP6_H_
-#define DHCP6_OPT_REQUEST_OPTION 6
-#define DHCP6_OPT_VENDOR_INFO 17
-#define DHCP6_OPT_DNS_SERVERS 23
-///
-/// Assigned by IANA, RFC 5970
-///
-#define DHCP6_OPT_BOOT_FILE_URL 59
-#define DHCP6_OPT_BOOT_FILE_PARA 60
-
#define ISCSI_ROOT_PATH_ID "iscsi:"
#define ISCSI_ROOT_PATH_FIELD_DELIMITER ':'
#define ISCSI_ROOT_PATH_ADDR_START_DELIMITER '['
diff --git a/NetworkPkg/IScsiDxe/IScsiImpl.h b/NetworkPkg/IScsiDxe/IScsiImpl.h
index 9941b8c..af46871 100644
--- a/NetworkPkg/IScsiDxe/IScsiImpl.h
+++ b/NetworkPkg/IScsiDxe/IScsiImpl.h
@@ -1,7 +1,7 @@
/** @file
The shared head file for iSCSI driver.
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 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
which accompanies this distribution. The full text of the license may be found at
@@ -17,6 +17,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Uefi.h>
+#include <IndustryStandard/Dhcp.h>
+
#include <Protocol/ComponentName.h>
#include <Protocol/ComponentName2.h>
#include <Protocol/DriverBinding.h>