]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Remove IpSecDxe and Ip4Config Protocol dependency.
authorjiaxinwu <jiaxin.wu@intel.com>
Wed, 8 Jul 2015 03:09:28 +0000 (03:09 +0000)
committerjiaxinwu <jiaxinwu@Edk2>
Wed, 8 Jul 2015 03:09:28 +0000 (03:09 +0000)
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

NetworkPkg/IpSecDxe/IkeCommon.h
NetworkPkg/IpSecDxe/IkeService.c
NetworkPkg/IpSecDxe/IpSecDxe.inf

index b88331cd86c00d6e2ea328fbc2ca7b41a87ff926..714ecaa8e30b32ff96b958b09db24e06ba925cd4 100644 (file)
@@ -18,7 +18,7 @@
 \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
index 8e2c794dc3da9be2aea5677d594c681935b96837..6594963f5dfba2c731c29954bce3c9234ea4c16a 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
@@ -212,15 +212,15 @@ IkeOpenOutputUdp (
   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
-  Ip4CfgData  = NULL;\r
+  IfInfo      = NULL;\r
   BufSize     = 0;\r
 \r
   //\r
   BufSize     = 0;\r
 \r
   //\r
@@ -236,35 +236,52 @@ IkeOpenOutputUdp (
     //\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
 \r
 \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
@@ -331,8 +348,8 @@ IkeOpenOutputUdp (
   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
   }\r
 \r
   return Status;\r
   }\r
 \r
   return Status;\r
index c587c8ca8d91a4ba4b7a5c972d88f6a51903196a..583305b4f8a3b869314c7d40557f47264156b92b 100644 (file)
@@ -6,7 +6,7 @@
 #  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
@@ -89,7 +89,7 @@
   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