]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IpSecDxe/IkeCommon.h
BaseTools/Capsule: Do not support -o with --dump-info
[mirror_edk2.git] / NetworkPkg / IpSecDxe / IkeCommon.h
index 4bcfe6c2a610ddcf49f7be61508057f92ff2f5a7..ba9f1bb2fb3c8dd6a2a37845f567447daf2a88fe 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Common operation of the IKE.\r
 \r
 /** @file\r
   Common operation of the IKE.\r
 \r
-  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2018, 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
@@ -18,8 +18,8 @@
 \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
\r
+#include <Protocol/Ip4Config2.h>\r
+\r
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
@@ -39,7 +39,7 @@
 #define IKE_DEFAULT_TIMEOUT_INTERVAL  10000 // 10s\r
 #define IKE_NONCE_SIZE                16\r
 #define IKE_MAX_RETRY                 4\r
 #define IKE_DEFAULT_TIMEOUT_INTERVAL  10000 // 10s\r
 #define IKE_NONCE_SIZE                16\r
 #define IKE_MAX_RETRY                 4\r
-#define IKE_SPI_BASE                  0x10000\r
+#define IKE_SPI_BASE                  0x100\r
 #define IKE_PAYLOAD_SIGNATURE         SIGNATURE_32('I','K','E','P')\r
 #define IKE_PAYLOAD_BY_PACKET(a)      CR(a,IKE_PAYLOAD,ByPacket,IKE_PAYLOAD_SIGNATURE)\r
 \r
 #define IKE_PAYLOAD_SIGNATURE         SIGNATURE_32('I','K','E','P')\r
 #define IKE_PAYLOAD_BY_PACKET(a)      CR(a,IKE_PAYLOAD,ByPacket,IKE_PAYLOAD_SIGNATURE)\r
 \r
@@ -62,7 +62,7 @@
 \r
 /**\r
   Call Crypto Lib to generate a random value with eight-octet length.\r
 \r
 /**\r
   Call Crypto Lib to generate a random value with eight-octet length.\r
-  \r
+\r
   @return the 64 byte vaule.\r
 \r
 **/\r
   @return the 64 byte vaule.\r
 \r
 **/\r
@@ -75,8 +75,8 @@ IkeGenerateCookie (
   Generate the random data for Nonce payload.\r
 \r
   @param[in]  NonceSize      Size of the data in bytes.\r
   Generate the random data for Nonce payload.\r
 \r
   @param[in]  NonceSize      Size of the data in bytes.\r
-  \r
-  @return Buffer which contains the random data of the spcified size. \r
+\r
+  @return Buffer which contains the random data of the spcified size.\r
 \r
 **/\r
 UINT8 *\r
 \r
 **/\r
 UINT8 *\r
@@ -130,14 +130,20 @@ IkePayloadFree (
   );\r
 \r
 /**\r
   );\r
 \r
 /**\r
-  Generate an unused SPI\r
+  Generate an new SPI.\r
 \r
 \r
-  @return a SPI in 4 bytes.\r
+  @param[in]       IkeSaSession   Pointer to IKEV2_SA_SESSION related to this Child SA\r
+                                  Session.\r
+  @param[in, out]  SpiValue       Pointer to the new generated SPI value.\r
+\r
+  @retval EFI_SUCCESS         The operation performs successfully.\r
+  @retval Otherwise           The operation is failed.\r
 \r
 **/\r
 \r
 **/\r
-UINT32\r
+EFI_STATUS\r
 IkeGenerateSpi (\r
 IkeGenerateSpi (\r
-  VOID\r
+  IN     IKEV2_SA_SESSION         *IkeSaSession,\r
+  IN OUT UINT32                   *SpiValue\r
   );\r
 \r
 /**\r
   );\r
 \r
 /**\r
@@ -167,21 +173,20 @@ IkeGetVersionFromSession (
   IN UINT8                    *Session\r
   );\r
 \r
   IN UINT8                    *Session\r
   );\r
 \r
-/**
-  Find SPD entry by a specified SPD selector.
-
+/**\r
+  Find SPD entry by a specified SPD selector.\r
+\r
   @param[in] SpdSel       Point to SPD Selector to be searched for.\r
   @param[in] SpdSel       Point to SPD Selector to be searched for.\r
-
-  @retval Point to Spd Entry if the SPD entry found.
-  @retval NULL if not found.
-
-**/
-IPSEC_SPD_ENTRY *
+\r
+  @retval Point to Spd Entry if the SPD entry found.\r
+  @retval NULL if not found.\r
+\r
+**/\r
+IPSEC_SPD_ENTRY *\r
 IkeSearchSpdEntry (\r
 IkeSearchSpdEntry (\r
-  IN EFI_IPSEC_SPD_SELECTOR             *SpdSel
+  IN EFI_IPSEC_SPD_SELECTOR             *SpdSel\r
   );\r
 \r
   );\r
 \r
-extern EFI_GUID               mZeroGuid;\r
 extern MODP_GROUP             OakleyModpGroup[];\r
 extern IKE_ALG_GUID_INFO      mIPsecEncrAlgInfo[];\r
 extern IKE_ALG_GUID_INFO      mIPsecAuthAlgInfo[];\r
 extern MODP_GROUP             OakleyModpGroup[];\r
 extern IKE_ALG_GUID_INFO      mIPsecEncrAlgInfo[];\r
 extern IKE_ALG_GUID_INFO      mIPsecAuthAlgInfo[];\r