summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellNetwork2CommandsLib
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/Library/UefiShellNetwork2CommandsLib
parentaa63a8660100f026dab94fd975e4256bbde1467d (diff)
downloadedk2-445d200762cfea40d8123e9eda436dab96789f4f.zip
edk2-445d200762cfea40d8123e9eda436dab96789f4f.tar.gz
edk2-445d200762cfea40d8123e9eda436dab96789f4f.tar.bz2
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/Library/UefiShellNetwork2CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c15
-rw-r--r--ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni9
2 files changed, 24 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c
index 32dd284..fb308cc 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 c3445bb..5c0fef0 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"