On 04/13/16 05:16, Jiaxin Wu wrote:
> This patch is used to update ping command options to sync
> with shell2.2 Spec.
> Considering the backward compatible issue, the patch keeps
> ā€˜-_sā€™ command option unchanged, only add the new option '-s'
> and make the old option '-_s' function same as new one.
> 
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Jaben Carsey <jaben.car...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> ---
>  .../Library/UefiShellNetwork1CommandsLib/Ping.c    | 12 ++++++++++--
>  .../UefiShellNetwork1CommandsLib.uni               | 22 
> +++++++++-------------
>  2 files changed, 19 insertions(+), 15 deletions(-)

Bhupesh, can you apply this patch locally, and report back to Jiaxin
with your test results?

Because, I think this patch was motivated by the discussion in
<http://thread.gmane.org/gmane.comp.bios.edk2.devel/10046>.

Jiaxin, in such cases, it is best practice to:
- add a "Reported-by:" tag to the patch, such as:

  Reported-by: Bhupesh Sharma <bhupesh.sha...@nxp.com>

- please consider also Cc:-ing the reporter (so he's aware of the patch
and can respond with test results).

Just suggestions, of course.

Thanks!
Laszlo

> diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c 
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> index dbee764..13bcdde 100644
> --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> @@ -1,10 +1,10 @@
>  /** @file
>    The implementation for Ping shell command.
>  
>    (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
> -  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2009 - 2016, 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
>    http://opensource.org/licenses/bsd-license.php.
> @@ -196,10 +196,14 @@ STATIC CONST SHELL_PARAM_ITEM    PingParamList[] = {
>    {
>      L"-n",
>      TypeValue
>    },
>    {
> +    L"-s",
> +    TypeValue
> +  },
> +  {
>      L"-_s",
>      TypeValue
>    },
>    {
>      L"-_ip6",
> @@ -1510,11 +1514,15 @@ ShellCommandRunPing (
>    ZeroMem (&DstAddress, sizeof (EFI_IPv6_ADDRESS));
>  
>    //
>    // Parse the paramter of source ip address.
>    //
> -  ValueStr = ShellCommandLineGetValue (ParamPackage, L"-_s");
> +  ValueStr = ShellCommandLineGetValue (ParamPackage, L"-s");
> +  if (ValueStr == NULL) {
> +    ValueStr = ShellCommandLineGetValue (ParamPackage, L"-_s");
> +  }
> +  
>    if (ValueStr != NULL) {
>      mSrcString = ValueStr;
>      if (IpChoice == PING_IP_CHOICE_IP6) {
>        Status = NetLibStrToIp6 (ValueStr, &SrcAddress);
>      } else {
> diff --git 
> a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
>  
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
> index bc6acac..7d6f2da 100644
> --- 
> a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
> +++ 
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
> @@ -1,9 +1,9 @@
>  // /**
>  //
>  // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
> -// Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR>
> +// Copyright (c) 2010 - 2016, 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
>  // http://opensource.org/licenses/bsd-license.php
>  //
> @@ -86,28 +86,27 @@
>  #string STR_IFCONFIG_INFO_GATEWAY_HEAD        #language en-US    
> "\n%Hdefault gateway: %N"
>  #string STR_IFCONFIG_INFO_DNS_ADDR_HEAD       #language en-US    "\n%HDNS 
> server   : %N\n"
>  #string STR_IFCONFIG_INFO_IP_ADDR_BODY        #language en-US    
> "%d.%d.%d.%d\n"
>  
>  #string STR_GET_HELP_PING         #language en-US ""
> -".TH ping 0 "Pings the target host with an IPv4 or IPv6 stack."\r\n"
> +".TH ping 0 "Ping the target host with an IPv4 stack."\r\n"
>  ".SH NAME\r\n"
> -"Pings the target host with an IPv4 or IPv6 stack.\r\n"
> +"Ping the target host with an IPv4 stack.\r\n"
>  ".SH SYNOPSIS\r\n"
>  " \r\n"
> -"PING [-_ip6] [-_s SourceIp] [-n count] [-l size] TargetIp\r\n"
> +"PING [-n count] [-l size] [-s SourceIp] TargetIp\r\n"
>  ".SH OPTIONS\r\n"
>  " \r\n"
>  "  -n       - Specifies the number of echo request datagrams to be sent.\r\n"
>  "  -l       - Specifies the size of the data buffer in the echo request 
> datagram.\r\n"
> -"  -_ip6    - Specifies the IPv6 stack usage mode (Default is IPv4 
> stack).\r\n"
> -"  -_s      - Specifies the source adapter as IPv4 or IPv6 address.\r\n"
> -"  SourceIp - Specifies the IPv4 or IPv6 address of the source machine.\r\n"
> -"  TargetIp - Specifies the IPv4 or IPv6 address of the target machine.\r\n"
> +"  -s       - Specifies the source adapter as IPv4 address.\r\n"
> +"  SourceIp - Specifies the IPv4 address of the source machine.\r\n"
> +"  TargetIp - Specifies the IPv4 address of the target machine.\r\n"
>  ".SH DESCRIPTION\r\n"
>  " \r\n"
>  "NOTES:\r\n"
> -"  1. This command uses the ICMPv4 or ICMPv6 ECHO_REQUEST datagram to elicit 
> an\r\n"
> +"  1. This command uses the ICMPv4 ECHO_REQUEST datagram to elicit an\r\n"
>  "     ECHO_REPLY from a host.\r\n"
>  ".SH EXAMPLES\r\n"
>  " \r\n"
>  "EXAMPLES:\r\n"
>  "  * To ping the target host with 64 bytes data:\r\n"
> @@ -115,14 +114,11 @@
>  " \r\n"
>  "  * To ping the target host by sending 20 echo request datagrams:\r\n"
>  "    fs0:\> ping -n 20 202.120.100.1\r\n"
>  " \r\n"
>  "  * To ping the target host by specifying the source adapter as IPv4 
> address:\r\n"
> -"    fs0:\> ping -_s 202.120.100.12 202.120.100.1\r\n"
> -" \r\n"
> -"  * To ping the target host by specifying the IPv6 stack usage mode:\r\n"
> -"    fs0:\> ping -_ip6 2000:bbbb::8\r\n"
> +"    fs0:\> ping -s 202.120.100.12 202.120.100.1\r\n"
>  ".SH RETURNVALUES\r\n"
>  " \r\n"
>  "RETURN VALUES:\r\n"
>  "  SHELL_SUCCESS             The action was completed as requested.\r\n"
>  "  SHELL_INVALID_PARAMETER   One of the passed-in parameters was 
> incorrectly\r\n"
> 

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

Reply via email to