summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/IScsiDxe/IScsiDhcp6.c
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2016-12-08 19:26:24 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-01-19 11:31:57 +0800
commiteabc6e59b9a718a44ab292f7e5c447c4c06d21c4 (patch)
treedd251ceaad80c4836db9110eacab6388844b15d3 /NetworkPkg/IScsiDxe/IScsiDhcp6.c
parenta409875592d984fdc412675e93884556eb6635d0 (diff)
downloadedk2-eabc6e59b9a718a44ab292f7e5c447c4c06d21c4.tar.gz
edk2-eabc6e59b9a718a44ab292f7e5c447c4c06d21c4.tar.bz2
edk2-eabc6e59b9a718a44ab292f7e5c447c4c06d21c4.zip
NetworkPkg: Add dns support for target URL configuration in ISCSI.
v2: *1. Add IScsiDnsIsConfigured function in IScsiSupported to check attempt using DNS protocol or not.2. Fix wrongs typos in IScsiDns.c and .uni file.3. define a macro for the length of target URL.4. update the Copyright to 2017. Add DNS support for target URL directly configuration in UI. Besides, When we enable the option (Get target info via DHCP) , the dhcp server will return target info include the rootpath, like the format "iscsi:"<servername>":"<protocol>":"<port>":"<LUN>":"<targetname> According to the RFC 4173,the server name region is expressed as IPv4(192.168.10.20 )or IPv6 ([2000:bbbb::3]) or domain name, but currently we only support the IP address format. To enable this feature, we can support both. Another enhancement is that we can deal with the data received from the iSCSI login response with an target redirection status, in which contains the Target Address in the format domainname[:port][,portal-group-tag] required by RFC 3720. 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: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Diffstat (limited to 'NetworkPkg/IScsiDxe/IScsiDhcp6.c')
-rw-r--r--NetworkPkg/IScsiDxe/IScsiDhcp6.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c b/NetworkPkg/IScsiDxe/IScsiDhcp6.c
index 0cd0bd8803..d3535d57cb 100644
--- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c
+++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c
@@ -1,7 +1,7 @@
/** @file
iSCSI DHCP6 related configuration routines.
-Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2017, 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
@@ -150,13 +150,26 @@ IScsiDhcp6ExtractRootPath (
IpMode = ConfigData->AutoConfigureMode;
}
- Status = IScsiAsciiStrToIp (Field->Str, IpMode, &Ip);
- CopyMem (&ConfigNvData->TargetIp, &Ip, sizeof (EFI_IP_ADDRESS));
-
+ //
+ // Server name is expressed as domain name, just save it.
+ //
+ if ((!NET_IS_DIGIT (*(Field->Str))) && (*(Field->Str) != '[')) {
+ ConfigNvData->DnsMode = TRUE;
+ if (Field->Len > sizeof (ConfigNvData->TargetUrl)) {
+ return EFI_INVALID_PARAMETER;
+ }
+ CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len);
+ ConfigNvData->TargetUrl[Field->Len + 1] = '\0';
+ } else {
+ ZeroMem(&ConfigNvData->TargetUrl, sizeof (ConfigNvData->TargetUrl));
+ Status = IScsiAsciiStrToIp (Field->Str, IpMode, &Ip);
+ CopyMem (&ConfigNvData->TargetIp, &Ip, sizeof (EFI_IP_ADDRESS));
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
}
+
//
// Check the protocol type.
//