summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6c5c70d)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: jiaxinwu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17874
6f19259b-4bc3-4df7-8a09-
765794883524
\r
#include <Protocol/Udp4.h>\r
#include <Protocol/Udp6.h>\r
\r
#include <Protocol/Udp4.h>\r
#include <Protocol/Udp6.h>\r
-#include <Protocol/Ip4Config.h>\r
+#include <Protocol/Ip4Config2.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
/** @file\r
Provide IPsec Key Exchange (IKE) service general interfaces.\r
\r
/** @file\r
Provide IPsec Key Exchange (IKE) service general interfaces.\r
\r
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
IN EFI_IP_ADDRESS *RemoteIp\r
)\r
{\r
IN EFI_IP_ADDRESS *RemoteIp\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_IP4_CONFIG_PROTOCOL *Ip4Cfg;\r
- EFI_IP4_IPCONFIG_DATA *Ip4CfgData;\r
- UINTN BufSize;\r
- EFI_IP6_MODE_DATA Ip6ModeData;\r
- EFI_UDP6_PROTOCOL *Udp6;\r
+ EFI_STATUS Status;\r
+ EFI_IP4_CONFIG2_PROTOCOL *Ip4Cfg2;\r
+ EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo;\r
+ UINTN BufSize;\r
+ EFI_IP6_MODE_DATA Ip6ModeData;\r
+ EFI_UDP6_PROTOCOL *Udp6;\r
\r
Status = EFI_SUCCESS;\r
\r
Status = EFI_SUCCESS;\r
//\r
Status = gBS->HandleProtocol (\r
UdpService->NicHandle,\r
//\r
Status = gBS->HandleProtocol (\r
UdpService->NicHandle,\r
- &gEfiIp4ConfigProtocolGuid,\r
- (VOID **) &Ip4Cfg\r
+ &gEfiIp4Config2ProtocolGuid,\r
+ (VOID **) &Ip4Cfg2\r
);\r
\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
\r
);\r
\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
\r
- Status = Ip4Cfg->GetData (Ip4Cfg, &BufSize, NULL);\r
+ //\r
+ // Get the interface information size.\r
+ //\r
+ Status = Ip4Cfg2->GetData (\r
+ Ip4Cfg2,\r
+ Ip4Config2DataTypeInterfaceInfo,\r
+ &BufSize,\r
+ NULL\r
+ );\r
\r
if (EFI_ERROR (Status) && Status != EFI_BUFFER_TOO_SMALL) {\r
goto ON_EXIT;\r
}\r
\r
\r
if (EFI_ERROR (Status) && Status != EFI_BUFFER_TOO_SMALL) {\r
goto ON_EXIT;\r
}\r
\r
- Ip4CfgData = AllocateZeroPool (BufSize);\r
+ IfInfo = AllocateZeroPool (BufSize);\r
- if (Ip4CfgData == NULL) {\r
+ if (IfInfo == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
\r
- Status = Ip4Cfg->GetData (Ip4Cfg, &BufSize, Ip4CfgData);\r
+ //\r
+ // Get the interface info.\r
+ //\r
+ Status = Ip4Cfg2->GetData (\r
+ Ip4Cfg2,\r
+ Ip4Config2DataTypeInterfaceInfo,\r
+ &BufSize,\r
+ IfInfo\r
+ );\r
+ \r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
\r
CopyMem (\r
&UdpService->DefaultAddress.v4,\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
\r
CopyMem (\r
&UdpService->DefaultAddress.v4,\r
- &Ip4CfgData->StationAddress,\r
+ &IfInfo->StationAddress,\r
sizeof (EFI_IPv4_ADDRESS)\r
);\r
\r
sizeof (EFI_IPv4_ADDRESS)\r
);\r
\r
UdpService->IsConfigured = TRUE;\r
\r
ON_EXIT:\r
UdpService->IsConfigured = TRUE;\r
\r
ON_EXIT:\r
- if (Ip4CfgData != NULL) {\r
- FreePool (Ip4CfgData);\r
+ if (IfInfo != NULL) {\r
+ FreePool (IfInfo);\r
# packet-level security for IP datagram. It provides the IP packet protection via\r
# ESP and it supports IKEv2 for key negotiation.\r
#\r
# packet-level security for IP datagram. It provides the IP packet protection via\r
# ESP and it supports IKEv2 for key negotiation.\r
#\r
-# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
PcdLib\r
\r
[Protocols]\r
PcdLib\r
\r
[Protocols]\r
- gEfiIp4ConfigProtocolGuid ## SOMETIMES_CONSUMES\r
+ gEfiIp4Config2ProtocolGuid ## SOMETIMES_CONSUMES\r
gEfiUdp4ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES \r
gEfiUdp4ProtocolGuid ## SOMETIMES_CONSUMES\r
gEfiUdp6ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES \r
gEfiUdp4ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES \r
gEfiUdp4ProtocolGuid ## SOMETIMES_CONSUMES\r
gEfiUdp6ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES \r