* [Patch] ShellPkg: Add error message if failed to place receive token in ping command.
@ 2017-11-15 4:09 Fu Siyuan
2017-11-15 6:05 ` Wu, Jiaxin
2017-11-15 7:18 ` Ye, Ting
0 siblings, 2 replies; 3+ messages in thread
From: Fu Siyuan @ 2017-11-15 4:09 UTC (permalink / raw)
To: edk2-devel; +Cc: Wu Jiaxin, Ye Ting, Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
---
ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 9 +++++++--
.../UefiShellNetwork1CommandsLib.uni | 1 +
ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c | 9 +++++++--
.../UefiShellNetwork2CommandsLib.uni | 1 +
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
index ca5c22a..10d291c 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
@@ -2,7 +2,7 @@
The implementation for Ping shell command.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
@@ -629,6 +629,7 @@ ON_EXIT:
Status = Private->ProtocolPointers.Receive (Private->IpProtocol, &Private->RxToken);
if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_RECEIVE), gShellNetwork1HiiHandle, Status);
Private->Status = EFI_ABORTED;
}
} else {
@@ -828,7 +829,11 @@ Ping6ReceiveEchoReply (
Private->RxToken.Status = EFI_NOT_READY;
- return (Private->ProtocolPointers.Receive (Private->IpProtocol, &Private->RxToken));
+ Status = Private->ProtocolPointers.Receive (Private->IpProtocol, &Private->RxToken);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_RECEIVE), gShellNetwork1HiiHandle, Status);
+ }
+ return Status;
}
/**
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
index 70c3465..7a43ad5 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
@@ -50,6 +50,7 @@
#string STR_PING_CONFIG #language en-US "Config %r\r\n"
#string STR_PING_GETMODE #language en-US "GetModeData %r\r\n"
#string STR_PING_GETDATA #language en-US "GetData %r\r\n"
+#string STR_PING_RECEIVE #language en-US "Receive %r\r\n"
#string STR_PING_SEND_REQUEST #language en-US "Echo request sequence %d did not complete successfully.\r\n"
#string STR_PING_NOSOURCE_INDO #language en-US "There are no sources in %s's multicast domain.\r\n"
#string STR_PING_NETWORK_ERROR #language en-US "%H%s%N: Network function failed with %r\r\n"
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
index 2961fd7..b784696 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
@@ -1,7 +1,7 @@
/** @file
The implementation for Ping6 application.
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, 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
@@ -474,6 +474,7 @@ ON_EXIT:
Status = Private->Ip6->Receive (Private->Ip6, RxToken);
if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6_RECEIVE), gShellNetwork2HiiHandle, Status);
Private->Status = EFI_ABORTED;
}
} else {
@@ -658,7 +659,11 @@ Ping6OnReceiveEchoReply (
Private->RxToken.Status = EFI_NOT_READY;
- return Private->Ip6->Receive (Private->Ip6, &Private->RxToken);
+ Status = Private->Ip6->Receive (Private->Ip6, &Private->RxToken);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6_RECEIVE), gShellNetwork2HiiHandle, Status);
+ }
+ return Status;
}
/**
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
index 2b2327b..9a535ad 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
@@ -33,6 +33,7 @@
#string STR_PING6_INVALID_BUFFER_SIZE #language en-US "%Ping6: Invalid buffer size, %s\r\n"
#string STR_PING6_INVALID_SOURCE #language en-US "%Ping6: Require source interface option\r\n"
#string STR_PING6_IP6_CONFIG #language en-US "%Ping6: The process of Ip6 Configure %r\r\n"
+#string STR_PING6_IP6_RECEIVE #language en-US "%Ping6: Place the receive token %r\r\n"
#string STR_PING6_IP6CFG_GETDATA #language en-US "%Ping6: Get data of the interface information %r\r\n"
#string STR_PING6_SEND_REQUEST #language en-US "Echo request sequence %d fails.\r\n"
#string STR_PING6_CONFIGD_NIC_NF #language en-US "%Ping6: No configured interfaces were found.\r\n"
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch] ShellPkg: Add error message if failed to place receive token in ping command.
2017-11-15 4:09 [Patch] ShellPkg: Add error message if failed to place receive token in ping command Fu Siyuan
@ 2017-11-15 6:05 ` Wu, Jiaxin
2017-11-15 7:18 ` Ye, Ting
1 sibling, 0 replies; 3+ messages in thread
From: Wu, Jiaxin @ 2017-11-15 6:05 UTC (permalink / raw)
To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Ye, Ting, Ni, Ruiyu
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
> -----Original Message-----
> From: Fu, Siyuan
> Sent: Wednesday, November 15, 2017 12:10 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>; Ni,
> Ruiyu <ruiyu.ni@intel.com>
> Subject: [Patch] ShellPkg: Add error message if failed to place receive token
> in ping command.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> ---
> ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 9
> +++++++--
> .../UefiShellNetwork1CommandsLib.uni | 1 +
> ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c | 9
> +++++++--
> .../UefiShellNetwork2CommandsLib.uni | 1 +
> 4 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> index ca5c22a..10d291c 100644
> --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> @@ -2,7 +2,7 @@
> The implementation for Ping shell command.
>
> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
> - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
>
> This program and the accompanying materials
> @@ -629,6 +629,7 @@ ON_EXIT:
> Status = Private->ProtocolPointers.Receive (Private->IpProtocol, &Private-
> >RxToken);
>
> if (EFI_ERROR (Status)) {
> + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_RECEIVE),
> gShellNetwork1HiiHandle, Status);
> Private->Status = EFI_ABORTED;
> }
> } else {
> @@ -828,7 +829,11 @@ Ping6ReceiveEchoReply (
>
> Private->RxToken.Status = EFI_NOT_READY;
>
> - return (Private->ProtocolPointers.Receive (Private->IpProtocol, &Private-
> >RxToken));
> + Status = Private->ProtocolPointers.Receive (Private->IpProtocol, &Private-
> >RxToken);
> + if (EFI_ERROR (Status)) {
> + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_RECEIVE),
> gShellNetwork1HiiHandle, Status);
> + }
> + return Status;
> }
>
> /**
> diff --git
> a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1Com
> mandsLib.uni
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1Com
> mandsLib.uni
> index 70c3465..7a43ad5 100644
> ---
> a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1Com
> mandsLib.uni
> +++
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1Com
> mandsLib.uni
> @@ -50,6 +50,7 @@
> #string STR_PING_CONFIG #language en-US "Config %r\r\n"
> #string STR_PING_GETMODE #language en-US
> "GetModeData %r\r\n"
> #string STR_PING_GETDATA #language en-US "GetData %r\r\n"
> +#string STR_PING_RECEIVE #language en-US "Receive %r\r\n"
> #string STR_PING_SEND_REQUEST #language en-US "Echo request
> sequence %d did not complete successfully.\r\n"
> #string STR_PING_NOSOURCE_INDO #language en-US "There are no
> sources in %s's multicast domain.\r\n"
> #string STR_PING_NETWORK_ERROR #language en-US "%H%s%N:
> Network function failed with %r\r\n"
> diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
> b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
> index 2961fd7..b784696 100644
> --- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
> +++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
> @@ -1,7 +1,7 @@
> /** @file
> The implementation for Ping6 application.
>
> - Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2016 - 2017, 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
> @@ -474,6 +474,7 @@ ON_EXIT:
> Status = Private->Ip6->Receive (Private->Ip6, RxToken);
>
> if (EFI_ERROR (Status)) {
> + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6_RECEIVE),
> gShellNetwork2HiiHandle, Status);
> Private->Status = EFI_ABORTED;
> }
> } else {
> @@ -658,7 +659,11 @@ Ping6OnReceiveEchoReply (
>
> Private->RxToken.Status = EFI_NOT_READY;
>
> - return Private->Ip6->Receive (Private->Ip6, &Private->RxToken);
> + Status = Private->Ip6->Receive (Private->Ip6, &Private->RxToken);
> + if (EFI_ERROR (Status)) {
> + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6_RECEIVE),
> gShellNetwork2HiiHandle, Status);
> + }
> + return Status;
> }
>
> /**
> diff --git
> a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
> mandsLib.uni
> b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
> mandsLib.uni
> index 2b2327b..9a535ad 100644
> ---
> a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
> mandsLib.uni
> +++
> b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
> mandsLib.uni
> @@ -33,6 +33,7 @@
> #string STR_PING6_INVALID_BUFFER_SIZE #language en-US "%Ping6:
> Invalid buffer size, %s\r\n"
> #string STR_PING6_INVALID_SOURCE #language en-US "%Ping6:
> Require source interface option\r\n"
> #string STR_PING6_IP6_CONFIG #language en-US "%Ping6: The
> process of Ip6 Configure %r\r\n"
> +#string STR_PING6_IP6_RECEIVE #language en-US "%Ping6: Place
> the receive token %r\r\n"
> #string STR_PING6_IP6CFG_GETDATA #language en-US "%Ping6: Get
> data of the interface information %r\r\n"
> #string STR_PING6_SEND_REQUEST #language en-US "Echo request
> sequence %d fails.\r\n"
> #string STR_PING6_CONFIGD_NIC_NF #language en-US "%Ping6: No
> configured interfaces were found.\r\n"
> --
> 1.9.5.msysgit.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch] ShellPkg: Add error message if failed to place receive token in ping command.
2017-11-15 4:09 [Patch] ShellPkg: Add error message if failed to place receive token in ping command Fu Siyuan
2017-11-15 6:05 ` Wu, Jiaxin
@ 2017-11-15 7:18 ` Ye, Ting
1 sibling, 0 replies; 3+ messages in thread
From: Ye, Ting @ 2017-11-15 7:18 UTC (permalink / raw)
To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Wu, Jiaxin, Ni, Ruiyu
Reviewed-by: Ye Ting <ting.ye@intel.com>
-----Original Message-----
From: Fu, Siyuan
Sent: Wednesday, November 15, 2017 12:10 PM
To: edk2-devel@lists.01.org
Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
Subject: [Patch] ShellPkg: Add error message if failed to place receive token in ping command.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
---
ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 9 +++++++--
.../UefiShellNetwork1CommandsLib.uni | 1 +
ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c | 9 +++++++--
.../UefiShellNetwork2CommandsLib.uni | 1 +
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
index ca5c22a..10d291c 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
@@ -2,7 +2,7 @@
The implementation for Ping shell command.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights
+ reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials @@ -629,6 +629,7 @@ ON_EXIT:
Status = Private->ProtocolPointers.Receive (Private->IpProtocol, &Private->RxToken);
if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_RECEIVE),
+ gShellNetwork1HiiHandle, Status);
Private->Status = EFI_ABORTED;
}
} else {
@@ -828,7 +829,11 @@ Ping6ReceiveEchoReply (
Private->RxToken.Status = EFI_NOT_READY;
- return (Private->ProtocolPointers.Receive (Private->IpProtocol, &Private->RxToken));
+ Status = Private->ProtocolPointers.Receive (Private->IpProtocol,
+ &Private->RxToken); if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_RECEIVE),
+ gShellNetwork1HiiHandle, Status); } return Status;
}
/**
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
index 70c3465..7a43ad5 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1Com
+++ mandsLib.uni
@@ -50,6 +50,7 @@
#string STR_PING_CONFIG #language en-US "Config %r\r\n"
#string STR_PING_GETMODE #language en-US "GetModeData %r\r\n"
#string STR_PING_GETDATA #language en-US "GetData %r\r\n"
+#string STR_PING_RECEIVE #language en-US "Receive %r\r\n"
#string STR_PING_SEND_REQUEST #language en-US "Echo request sequence %d did not complete successfully.\r\n"
#string STR_PING_NOSOURCE_INDO #language en-US "There are no sources in %s's multicast domain.\r\n"
#string STR_PING_NETWORK_ERROR #language en-US "%H%s%N: Network function failed with %r\r\n"
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
index 2961fd7..b784696 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
@@ -1,7 +1,7 @@
/** @file
The implementation for Ping6 application.
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, 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 @@ -474,6 +474,7 @@ ON_EXIT:
Status = Private->Ip6->Receive (Private->Ip6, RxToken);
if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
+ (STR_PING6_IP6_RECEIVE), gShellNetwork2HiiHandle, Status);
Private->Status = EFI_ABORTED;
}
} else {
@@ -658,7 +659,11 @@ Ping6OnReceiveEchoReply (
Private->RxToken.Status = EFI_NOT_READY;
- return Private->Ip6->Receive (Private->Ip6, &Private->RxToken);
+ Status = Private->Ip6->Receive (Private->Ip6, &Private->RxToken); if
+ (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
+ (STR_PING6_IP6_RECEIVE), gShellNetwork2HiiHandle, Status); } return
+ Status;
}
/**
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
index 2b2327b..9a535ad 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2Com
+++ mandsLib.uni
@@ -33,6 +33,7 @@
#string STR_PING6_INVALID_BUFFER_SIZE #language en-US "%Ping6: Invalid buffer size, %s\r\n"
#string STR_PING6_INVALID_SOURCE #language en-US "%Ping6: Require source interface option\r\n"
#string STR_PING6_IP6_CONFIG #language en-US "%Ping6: The process of Ip6 Configure %r\r\n"
+#string STR_PING6_IP6_RECEIVE #language en-US "%Ping6: Place the receive token %r\r\n"
#string STR_PING6_IP6CFG_GETDATA #language en-US "%Ping6: Get data of the interface information %r\r\n"
#string STR_PING6_SEND_REQUEST #language en-US "Echo request sequence %d fails.\r\n"
#string STR_PING6_CONFIGD_NIC_NF #language en-US "%Ping6: No configured interfaces were found.\r\n"
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-11-15 7:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-15 4:09 [Patch] ShellPkg: Add error message if failed to place receive token in ping command Fu Siyuan
2017-11-15 6:05 ` Wu, Jiaxin
2017-11-15 7:18 ` Ye, Ting
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox