ShellPkg: Update ping/ifconfig library source code to consume Ip4Config2 protocol.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: jiaxinwu <jiaxin.wu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hp.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17869 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jiaxinwu 2015-07-08 02:53:41 +00:00 committed by jiaxinwu
parent cceb4ebd08
commit 7c25b7ea5b
5 changed files with 1115 additions and 1607 deletions

File diff suppressed because it is too large Load Diff

View File

@ -955,7 +955,7 @@ PingCreateIpInstance (
// //
Status = gBS->HandleProtocol ( Status = gBS->HandleProtocol (
HandleBuffer[HandleIndex], HandleBuffer[HandleIndex],
Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ConfigProtocolGuid:&gEfiIp4ConfigProtocolGuid, Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ConfigProtocolGuid:&gEfiIp4Config2ProtocolGuid,
(VOID **) &IpXCfg (VOID **) &IpXCfg
); );
@ -973,8 +973,9 @@ PingCreateIpInstance (
NULL NULL
); );
} else { } else {
Status = ((EFI_IP4_CONFIG_PROTOCOL*)IpXCfg)->GetData ( Status = ((EFI_IP4_CONFIG2_PROTOCOL*)IpXCfg)->GetData (
IpXCfg, IpXCfg,
Ip4Config2DataTypeInterfaceInfo,
&IfInfoSize, &IfInfoSize,
NULL NULL
); );
@ -1009,8 +1010,9 @@ PingCreateIpInstance (
IpXInterfaceInfo IpXInterfaceInfo
); );
} else { } else {
Status = ((EFI_IP4_CONFIG_PROTOCOL*)IpXCfg)->GetData ( Status = ((EFI_IP4_CONFIG2_PROTOCOL*)IpXCfg)->GetData (
IpXCfg, IpXCfg,
Ip4Config2DataTypeInterfaceInfo,
&IfInfoSize, &IfInfoSize,
IpXInterfaceInfo IpXInterfaceInfo
); );
@ -1045,7 +1047,7 @@ PingCreateIpInstance (
// //
// IP4 address check // IP4 address check
// //
if (EFI_IP4_EQUAL (&Private->SrcAddress, &((EFI_IP4_IPCONFIG_DATA*)IpXInterfaceInfo)->StationAddress)) { if (EFI_IP4_EQUAL (&Private->SrcAddress, &((EFI_IP4_CONFIG2_INTERFACE_INFO*)IpXInterfaceInfo)->StationAddress)) {
// //
// Match a certain interface address. // Match a certain interface address.
// //
@ -1137,11 +1139,6 @@ PingCreateIpInstance (
// //
// Configure the ip4 instance for icmp4 packet exchange. // Configure the ip4 instance for icmp4 packet exchange.
// //
// PING_IP4_COPY_ADDRESS (&Ip4Config.StationAddress, &Private->SrcAddress);
// Ip4Config.SubnetMask.Addr[0] = 0xFF;
// Ip4Config.SubnetMask.Addr[1] = 0xFF;
// Ip4Config.SubnetMask.Addr[2] = 0xFF;
// Ip4Config.SubnetMask.Addr[3] = 0x00;
Ip4Config.DefaultProtocol = 1; Ip4Config.DefaultProtocol = 1;
Ip4Config.AcceptAnyProtocol = FALSE; Ip4Config.AcceptAnyProtocol = FALSE;
Ip4Config.AcceptBroadcast = FALSE; Ip4Config.AcceptBroadcast = FALSE;
@ -1429,6 +1426,10 @@ ON_EXIT:
@param[in] ImageHandle Handle to the Image (NULL if Internal). @param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal). @param[in] SystemTable Pointer to the System Table (NULL if Internal).
@retval SHELL_SUCCESS The ping processed successfullly.
@retval others The ping processed unsuccessfully.
**/ **/
SHELL_STATUS SHELL_STATUS
EFIAPI EFIAPI

View File

@ -1,7 +1,7 @@
/** @file /** @file
header file for NULL named library for network1 shell command functions. header file for NULL named library for network1 shell command functions.
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -26,9 +26,7 @@
#include <Protocol/Ip6.h> #include <Protocol/Ip6.h>
#include <Protocol/Ip6Config.h> #include <Protocol/Ip6Config.h>
#include <Protocol/Ip4.h> #include <Protocol/Ip4.h>
#include <Protocol/Ip4Config.h> #include <Protocol/Ip4Config2.h>
#include <Protocol/HiiConfigAccess.h>
#include <Protocol/HiiConfigRouting.h>
#include <Protocol/Arp.h> #include <Protocol/Arp.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
@ -47,8 +45,6 @@
#include <Library/DevicePathLib.h> #include <Library/DevicePathLib.h>
#include <Library/PrintLib.h> #include <Library/PrintLib.h>
#include <Guid/NicIp4ConfigNvData.h>
extern EFI_HANDLE gShellNetwork1HiiHandle; extern EFI_HANDLE gShellNetwork1HiiHandle;
/** /**

View File

@ -59,9 +59,9 @@
gEfiIp6ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES gEfiIp6ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES
gEfiIp6ConfigProtocolGuid ## SOMETIMES_CONSUMES gEfiIp6ConfigProtocolGuid ## SOMETIMES_CONSUMES
gEfiIp6ProtocolGuid ## SOMETIMES_CONSUMES gEfiIp4ProtocolGuid ## SOMETIMES_CONSUMES
gEfiIp6ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES gEfiIp4ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES
gEfiIp6ConfigProtocolGuid ## SOMETIMES_CONSUMES gEfiIp4Config2ProtocolGuid ## SOMETIMES_CONSUMES
[Guids] [Guids]
gShellNetwork1HiiGuid ## SOMETIMES_CONSUMES ## HII gShellNetwork1HiiGuid ## SOMETIMES_CONSUMES ## HII