public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command.
@ 2016-11-29  2:58 Zhang Lubo
  2016-11-29  3:59 ` Hegde, Nagaraj P
  2016-11-30  5:54 ` Wu, Jiaxin
  0 siblings, 2 replies; 5+ messages in thread
From: Zhang Lubo @ 2016-11-29  2:58 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

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>
---
 ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c | 15 +++++++++++++++
 .../UefiShellNetwork2CommandsLib.uni                      |  9 +++++++++
 2 files changed, 24 insertions(+)

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
@@ -1315,10 +1315,24 @@ IfConfig6SetInterfaceInfo (
         goto ON_EXIT;
       }
 
       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.
       //
       Policy = Ip6ConfigPolicyManual;
@@ -1509,10 +1523,11 @@ IfConfig6SetInterfaceInfo (
                               CfgAddr
                               );
 
       if (EFI_ERROR (Status)) {
         ShellStatus = SHELL_ACCESS_DENIED;
+        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_MAN_GW), gShellNetwork2HiiHandle, Status);
         goto ON_EXIT;
       }
 
     } else if (StrCmp (VarArg->Arg, L"dns") == 0) {
       //
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
index c3445bb..79af7f9 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
@@ -75,10 +75,19 @@
 #string STR_IFCONFIG6_ERR_LACK_ARGUMENTS       #language en-US    "Lack arguments. Bad command %H%s%N is skipped.\r\n"
                                                                   "Hint: Please type 'IfConfig6 -?' for help info.\r\n"
 #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    "Getway 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"
                                                                   "Hint: Please type 'IfConfig6 -?' for help info.\r\n"
 #string STR_IFCONFIG6_ERR_UNKNOWN_COMMAND      #language en-US    "Unknown commands. Bad command %H%s%N is skipped.\r\n"
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command.
  2016-11-29  2:58 [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command Zhang Lubo
@ 2016-11-29  3:59 ` Hegde, Nagaraj P
  2016-11-29  4:02   ` Zhang, Lubo
  2016-11-30  5:54 ` Wu, Jiaxin
  1 sibling, 1 reply; 5+ messages in thread
From: Hegde, Nagaraj P @ 2016-11-29  3:59 UTC (permalink / raw)
  To: Zhang Lubo, edk2-devel@lists.01.org; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

Spelling correction in the uni file for STR_IFCONFIG6_ERR_MAN_GW. Should be "Gateway" instead of "Getway".
Reviewed-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhang Lubo
Sent: Tuesday, November 29, 2016 8:28 AM
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting.ye@intel.com>; Fu Siyuan <siyuan.fu@intel.com>; Wu Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [PATCH v2] 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>
---
 ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c | 15 +++++++++++++++
 .../UefiShellNetwork2CommandsLib.uni                      |  9 +++++++++
 2 files changed, 24 insertions(+)

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
@@ -1315,10 +1315,24 @@ IfConfig6SetInterfaceInfo (
         goto ON_EXIT;
       }
 
       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.
       //
       Policy = Ip6ConfigPolicyManual;
@@ -1509,10 +1523,11 @@ IfConfig6SetInterfaceInfo (
                               CfgAddr
                               );
 
       if (EFI_ERROR (Status)) {
         ShellStatus = SHELL_ACCESS_DENIED;
+        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
+ (STR_IFCONFIG6_ERR_MAN_GW), gShellNetwork2HiiHandle, Status);
         goto ON_EXIT;
       }
 
     } else if (StrCmp (VarArg->Arg, L"dns") == 0) {
       //
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
index c3445bb..79af7f9 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
+++ mandsLib.uni
@@ -75,10 +75,19 @@
 #string STR_IFCONFIG6_ERR_LACK_ARGUMENTS       #language en-US    "Lack arguments. Bad command %H%s%N is skipped.\r\n"
                                                                   "Hint: Please type 'IfConfig6 -?' for help info.\r\n"
 #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    "Getway 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"
                                                                   "Hint: Please type 'IfConfig6 -?' for help info.\r\n"
 #string STR_IFCONFIG6_ERR_UNKNOWN_COMMAND      #language en-US    "Unknown commands. Bad command %H%s%N is skipped.\r\n"
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command.
  2016-11-29  3:59 ` Hegde, Nagaraj P
@ 2016-11-29  4:02   ` Zhang, Lubo
  2016-11-30  3:01     ` Ye, Ting
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang, Lubo @ 2016-11-29  4:02 UTC (permalink / raw)
  To: Hegde, Nagaraj P, edk2-devel@lists.01.org
  Cc: Ye, Ting, Fu, Siyuan, Wu, Jiaxin

Thank you for reminding.

Lubo

-----Original Message-----
From: Hegde, Nagaraj P [mailto:nagaraj-p.hegde@hpe.com] 
Sent: Tuesday, November 29, 2016 11:59 AM
To: Zhang, Lubo <lubo.zhang@intel.com>; edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: RE: [edk2] [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command.

Spelling correction in the uni file for STR_IFCONFIG6_ERR_MAN_GW. Should be "Gateway" instead of "Getway".
Reviewed-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhang Lubo
Sent: Tuesday, November 29, 2016 8:28 AM
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting.ye@intel.com>; Fu Siyuan <siyuan.fu@intel.com>; Wu Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [PATCH v2] 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>
---
 ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c | 15 +++++++++++++++
 .../UefiShellNetwork2CommandsLib.uni                      |  9 +++++++++
 2 files changed, 24 insertions(+)

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
@@ -1315,10 +1315,24 @@ IfConfig6SetInterfaceInfo (
         goto ON_EXIT;
       }
 
       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.
       //
       Policy = Ip6ConfigPolicyManual;
@@ -1509,10 +1523,11 @@ IfConfig6SetInterfaceInfo (
                               CfgAddr
                               );
 
       if (EFI_ERROR (Status)) {
         ShellStatus = SHELL_ACCESS_DENIED;
+        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
+ (STR_IFCONFIG6_ERR_MAN_GW), gShellNetwork2HiiHandle, Status);
         goto ON_EXIT;
       }
 
     } else if (StrCmp (VarArg->Arg, L"dns") == 0) {
       //
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
index c3445bb..79af7f9 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
+++ mandsLib.uni
@@ -75,10 +75,19 @@
 #string STR_IFCONFIG6_ERR_LACK_ARGUMENTS       #language en-US    "Lack arguments. Bad command %H%s%N is skipped.\r\n"
                                                                   "Hint: Please type 'IfConfig6 -?' for help info.\r\n"
 #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    "Getway 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"
                                                                   "Hint: Please type 'IfConfig6 -?' for help info.\r\n"
 #string STR_IFCONFIG6_ERR_UNKNOWN_COMMAND      #language en-US    "Unknown commands. Bad command %H%s%N is skipped.\r\n"
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command.
  2016-11-29  4:02   ` Zhang, Lubo
@ 2016-11-30  3:01     ` Ye, Ting
  0 siblings, 0 replies; 5+ messages in thread
From: Ye, Ting @ 2016-11-30  3:01 UTC (permalink / raw)
  To: Zhang, Lubo, Hegde, Nagaraj P, edk2-devel@lists.01.org
  Cc: Fu, Siyuan, Wu, Jiaxin

Looks good to me with the typo fixed.

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Zhang, Lubo 
Sent: Tuesday, November 29, 2016 12:03 PM
To: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>; edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: RE: [edk2] [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command.

Thank you for reminding.

Lubo

-----Original Message-----
From: Hegde, Nagaraj P [mailto:nagaraj-p.hegde@hpe.com]
Sent: Tuesday, November 29, 2016 11:59 AM
To: Zhang, Lubo <lubo.zhang@intel.com>; edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: RE: [edk2] [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command.

Spelling correction in the uni file for STR_IFCONFIG6_ERR_MAN_GW. Should be "Gateway" instead of "Getway".
Reviewed-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhang Lubo
Sent: Tuesday, November 29, 2016 8:28 AM
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting.ye@intel.com>; Fu Siyuan <siyuan.fu@intel.com>; Wu Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [PATCH v2] 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>
---
 ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c | 15 +++++++++++++++
 .../UefiShellNetwork2CommandsLib.uni                      |  9 +++++++++
 2 files changed, 24 insertions(+)

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
@@ -1315,10 +1315,24 @@ IfConfig6SetInterfaceInfo (
         goto ON_EXIT;
       }
 
       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.
       //
       Policy = Ip6ConfigPolicyManual;
@@ -1509,10 +1523,11 @@ IfConfig6SetInterfaceInfo (
                               CfgAddr
                               );
 
       if (EFI_ERROR (Status)) {
         ShellStatus = SHELL_ACCESS_DENIED;
+        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
+ (STR_IFCONFIG6_ERR_MAN_GW), gShellNetwork2HiiHandle, Status);
         goto ON_EXIT;
       }
 
     } else if (StrCmp (VarArg->Arg, L"dns") == 0) {
       //
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
index c3445bb..79af7f9 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
+++ mandsLib.uni
@@ -75,10 +75,19 @@
 #string STR_IFCONFIG6_ERR_LACK_ARGUMENTS       #language en-US    "Lack arguments. Bad command %H%s%N is skipped.\r\n"
                                                                   "Hint: Please type 'IfConfig6 -?' for help info.\r\n"
 #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    "Getway 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"
                                                                   "Hint: Please type 'IfConfig6 -?' for help info.\r\n"
 #string STR_IFCONFIG6_ERR_UNKNOWN_COMMAND      #language en-US    "Unknown commands. Bad command %H%s%N is skipped.\r\n"
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command.
  2016-11-29  2:58 [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command Zhang Lubo
  2016-11-29  3:59 ` Hegde, Nagaraj P
@ 2016-11-30  5:54 ` Wu, Jiaxin
  1 sibling, 0 replies; 5+ messages in thread
From: Wu, Jiaxin @ 2016-11-30  5:54 UTC (permalink / raw)
  To: Zhang, Lubo, edk2-devel@lists.01.org; +Cc: Ye, Ting, Fu, Siyuan

Reviewed by : Wu Jiaxin <jiaxin.wu@intel.com>


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Zhang Lubo
> Sent: Tuesday, November 29, 2016 10:58 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu,
> Jiaxin <jiaxin.wu@intel.com>
> Subject: [edk2] [PATCH v2] 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>
> ---
>  ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c | 15
> +++++++++++++++
>  .../UefiShellNetwork2CommandsLib.uni                      |  9 +++++++++
>  2 files changed, 24 insertions(+)
> 
> 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
> @@ -1315,10 +1315,24 @@ IfConfig6SetInterfaceInfo (
>          goto ON_EXIT;
>        }
> 
>        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.
>        //
>        Policy = Ip6ConfigPolicyManual;
> @@ -1509,10 +1523,11 @@ IfConfig6SetInterfaceInfo (
>                                CfgAddr
>                                );
> 
>        if (EFI_ERROR (Status)) {
>          ShellStatus = SHELL_ACCESS_DENIED;
> +        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> + (STR_IFCONFIG6_ERR_MAN_GW), gShellNetwork2HiiHandle, Status);
>          goto ON_EXIT;
>        }
> 
>      } else if (StrCmp (VarArg->Arg, L"dns") == 0) {
>        //
> diff --git
> a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
> mandsLib.uni
> b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
> mandsLib.uni
> index c3445bb..79af7f9 100644
> ---
> a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
> mandsLib.uni
> +++
> b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
> +++ mandsLib.uni
> @@ -75,10 +75,19 @@
>  #string STR_IFCONFIG6_ERR_LACK_ARGUMENTS       #language en-US
> "Lack arguments. Bad command %H%s%N is skipped.\r\n"
>                                                                    "Hint: Please type 'IfConfig6 -?' for help
> info.\r\n"
>  #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    "Getway
> 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"
>                                                                    "Hint: Please type 'IfConfig6 -?' for help
> info.\r\n"
>  #string STR_IFCONFIG6_ERR_UNKNOWN_COMMAND      #language en-US
> "Unknown commands. Bad command %H%s%N is skipped.\r\n"
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-30  5:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29  2:58 [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command Zhang Lubo
2016-11-29  3:59 ` Hegde, Nagaraj P
2016-11-29  4:02   ` Zhang, Lubo
2016-11-30  3:01     ` Ye, Ting
2016-11-30  5:54 ` Wu, Jiaxin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox