summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2016-11-29 09:56:02 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-12-06 18:37:50 +0800
commit445d200762cfea40d8123e9eda436dab96789f4f (patch)
tree2c729e03abdec97840b648cdb449827ba4e478f4 /ShellPkg
parentaa63a8660100f026dab94fd975e4256bbde1467d (diff)
downloadedk2-445d200762cfea40d8123e9eda436dab96789f4f.tar.gz
edk2-445d200762cfea40d8123e9eda436dab96789f4f.tar.bz2
edk2-445d200762cfea40d8123e9eda436dab96789f4f.zip
ShellPkg: Add error prompt message in Ifconfig6 command.
v2: update the prompt message more readable. It should display error prompt message when Ifconfig6 can not configure correctly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed by : Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni2
-rw-r--r--ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c15
-rw-r--r--ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni9
3 files changed, 25 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
index 76b61882b1..4566cd110e 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
@@ -61,7 +61,7 @@
#string STR_PING_RTT #language en-US "\nRtt(round trip time) min=%d~%dms max=%d~%dms avg=%d~%dms\r\n"
#string STR_IFCONFIG_UNSUPPORTED_OPTION #language en-US "The option '%H%s%N' is unsupported now.\n"
-#string STR_IFCONFIG_LACK_OPTION #language en-US "Flags lack.\n"
+#string STR_IFCONFIG_LACK_OPTION #language en-US "Flags lack. Please type 'ifConfig -?' for help info.\n"
#string STR_IFCONFIG_LACK_INTERFACE #language en-US "Lack interface name.\n"
#string STR_IFCONFIG_LACK_COMMAND #language en-US "Lack interface config option.\n"
#string STR_IFCONFIG_INVALID_INTERFACE #language en-US "Invalid interface name.\n"
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c
index 32dd2845fc..fb308cc3b6 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c
@@ -1317,6 +1317,20 @@ IfConfig6SetInterfaceInfo (
VarArg= VarArg->Next;
+ if (StrCmp (VarArg->Arg, L"host") == 0) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INVALID_IP_CONFIG), gShellNetwork2HiiHandle, Status);
+ ShellStatus = EFI_INVALID_PARAMETER;
+ goto ON_EXIT;
+ } else if (StrCmp (VarArg->Arg, L"gw") == 0) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INVALID_GW_CONFIG), gShellNetwork2HiiHandle, Status);
+ ShellStatus = EFI_INVALID_PARAMETER;
+ goto ON_EXIT;
+ } else if (StrCmp (VarArg->Arg, L"dns") == 0) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INVALID_DNS_CONFIG), gShellNetwork2HiiHandle, Status);
+ ShellStatus = EFI_INVALID_PARAMETER;
+ goto ON_EXIT;
+ }
+
} else if (StrCmp (VarArg->Arg, L"man") == 0) {
//
// Set manual config policy.
@@ -1511,6 +1525,7 @@ IfConfig6SetInterfaceInfo (
if (EFI_ERROR (Status)) {
ShellStatus = SHELL_ACCESS_DENIED;
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_MAN_GW), gShellNetwork2HiiHandle, Status);
goto ON_EXIT;
}
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
index c3445bbf1c..5c0fef0ff7 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
@@ -77,6 +77,15 @@
#string STR_IFCONFIG6_ERR_LACK_OPTION #language en-US "Lack options.\r\n"
"Hint: Please type 'IfConfig6 -?' for help info.\r\n"
#string STR_IFCONFIG6_ERR_MAN_HOST #language en-US "Manual address configuration failed. Please retry.\r\n"
+
+#string STR_IFCONFIG6_ERR_MAN_GW #language en-US "Gateway address configuration failed. Please check the argument.\r\n"
+
+#string STR_IFCONFIG6_ERR_INVALID_IP_CONFIG #language en-US "The IP address is not configurable when the policy is Ip6ConfigPolicyAutomatic.\r\n"
+
+#string STR_IFCONFIG6_ERR_INVALID_GW_CONFIG #language en-US "The gateway address is not configurable when the policy is Ip6ConfigPolicyAutomatic.\r\n"
+
+#string STR_IFCONFIG6_ERR_INVALID_DNS_CONFIG #language en-US "The DNS server address is not configurable when the policy is Ip6ConfigPolicyAutomatic.\r\n"
+
#string STR_IFCONFIG6_ERR_DUPLICATE_COMMAND #language en-US "Duplicate commands. Bad command %H%s%N is skipped.\r\n"
"Hint: Please type 'IfConfig6 -?' for help info.\r\n"
#string STR_IFCONFIG6_ERR_CONFLICT_COMMAND #language en-US "Conflict commands. Bad command %H%s%N is skipped.\r\n"