]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IpSecDxe/IkeCommon.h
NetworkPkg/IpSecDxe: Generate SPI randomly and correct IKE_SPI_BASE value
[mirror_edk2.git] / NetworkPkg / IpSecDxe / IkeCommon.h
index 714ecaa8e30b32ff96b958b09db24e06ba925cd4..7f7fd4d5b09b0631bfaf8059ab8fc8062ec33c1d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Common operation of the IKE.\r
 \r
-  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2016, 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
@@ -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_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
@@ -130,14 +130,20 @@ IkePayloadFree (
   );\r
 \r
 /**\r
-  Generate an unused SPI\r
-\r
-  @return a SPI in 4 bytes.\r
+  Generate an new SPI.\r
+  \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
-UINT32\r
+EFI_STATUS\r
 IkeGenerateSpi (\r
-  VOID\r
+  IN  IKEV2_SA_SESSION         *IkeSaSession,\r
+  OUT UINT32                   *SpiValue\r
   );\r
 \r
 /**\r