From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 01AE481C9A for ; Mon, 28 Nov 2016 20:02:57 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 28 Nov 2016 20:02:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,714,1473145200"; d="scan'208";a="906571686" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 28 Nov 2016 20:02:57 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 28 Nov 2016 20:02:56 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.138]) with mapi id 14.03.0248.002; Tue, 29 Nov 2016 12:02:40 +0800 From: "Zhang, Lubo" To: "Hegde, Nagaraj P" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" , "Wu, Jiaxin" Thread-Topic: [edk2] [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command. Thread-Index: AQHSSex9SzL7HvjxlEmdIYXUhYGQsqDvVYswgAAA/5A= Date: Tue, 29 Nov 2016 04:02:40 +0000 Message-ID: <7619447B08B8F74DA4FF2A813B79803B378FDAD9@shsmsx102.ccr.corp.intel.com> References: <1480388290-13564-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2] ShellPkg: Add error prompt message in Ifconfig6 command. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 04:02:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thank you for reminding. Lubo -----Original Message----- From: Hegde, Nagaraj P [mailto:nagaraj-p.hegde@hpe.com]=20 Sent: Tuesday, November 29, 2016 11:59 AM To: Zhang, Lubo ; edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jia= xin Subject: RE: [edk2] [PATCH v2] ShellPkg: Add error prompt message in Ifconf= ig6 command. Spelling correction in the uni file for STR_IFCONFIG6_ERR_MAN_GW. Should be= "Gateway" instead of "Getway". Reviewed-by: Hegde, Nagaraj P -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhan= g Lubo Sent: Tuesday, November 29, 2016 8:28 AM To: edk2-devel@lists.01.org Cc: Ye Ting ; Fu Siyuan ; Wu Jiaxin= 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 cor= rectly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Ye Ting Cc: Fu Siyuan Cc: Wu Jiaxin --- ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c | 15 +++++++++++= ++++ .../UefiShellNetwork2CommandsLib.uni | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ifconfig6.c b/Sh= ellPkg/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; } =20 VarArg=3D VarArg->Next; =20 + if (StrCmp (VarArg->Arg, L"host") =3D=3D 0) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INV= ALID_IP_CONFIG), gShellNetwork2HiiHandle, Status); + ShellStatus =3D EFI_INVALID_PARAMETER; + goto ON_EXIT; + } else if (StrCmp (VarArg->Arg, L"gw") =3D=3D 0) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INV= ALID_GW_CONFIG), gShellNetwork2HiiHandle, Status); + ShellStatus =3D EFI_INVALID_PARAMETER; + goto ON_EXIT; + } else if (StrCmp (VarArg->Arg, L"dns") =3D=3D 0) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INV= ALID_DNS_CONFIG), gShellNetwork2HiiHandle, Status); + ShellStatus =3D EFI_INVALID_PARAMETER; + goto ON_EXIT; + } + } else if (StrCmp (VarArg->Arg, L"man") =3D=3D 0) { // // Set manual config policy. // Policy =3D Ip6ConfigPolicyManual; @@ -1509,10 +1523,11 @@ IfConfig6SetInterfaceInfo ( CfgAddr ); =20 if (EFI_ERROR (Status)) { ShellStatus =3D SHELL_ACCESS_DENIED; + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN=20 + (STR_IFCONFIG6_ERR_MAN_GW), gShellNetwork2HiiHandle, Status); goto ON_EXIT; } =20 } else if (StrCmp (VarArg->Arg, L"dns") =3D=3D 0) { // diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork= 2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellN= etwork2CommandsLib.uni index c3445bb..79af7f9 100644 --- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Comman= dsLib.uni +++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com +++ mandsLib.uni @@ -75,10 +75,19 @@ #string STR_IFCONFIG6_ERR_LACK_ARGUMENTS #language en-US "Lack ar= guments. Bad command %H%s%N is skipped.\r\n" "Hint: P= lease type 'IfConfig6 -?' for help info.\r\n" #string STR_IFCONFIG6_ERR_LACK_OPTION #language en-US "Lack op= tions.\r\n" "Hint: P= lease 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 gat= eway address is not configurable when the policy is Ip6ConfigPolicyAutomati= c.\r\n" + +#string STR_IFCONFIG6_ERR_INVALID_DNS_CONFIG #language en-US "The DNS= server address is not configurable when the policy is Ip6ConfigPolicyAutom= atic.\r\n" + #string STR_IFCONFIG6_ERR_DUPLICATE_COMMAND #language en-US "Duplica= te commands. Bad command %H%s%N is skipped.\r\n" "Hint: P= lease type 'IfConfig6 -?' for help info.\r\n" #string STR_IFCONFIG6_ERR_CONFLICT_COMMAND #language en-US "Conflic= t commands. Bad command %H%s%N is skipped.\r\n" "Hint: P= lease 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