X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=NetworkPkg%2FIpSecDxe%2FIkeCommon.h;h=ba9f1bb2fb3c8dd6a2a37845f567447daf2a88fe;hb=f33d5d68abc02727dc828c1079e72ab65e1d63af;hp=4bcfe6c2a610ddcf49f7be61508057f92ff2f5a7;hpb=9bdc6592135aa9b687db7a679c52903f63812484;p=mirror_edk2.git diff --git a/NetworkPkg/IpSecDxe/IkeCommon.h b/NetworkPkg/IpSecDxe/IkeCommon.h index 4bcfe6c2a6..ba9f1bb2fb 100644 --- a/NetworkPkg/IpSecDxe/IkeCommon.h +++ b/NetworkPkg/IpSecDxe/IkeCommon.h @@ -1,7 +1,7 @@ /** @file Common operation of the IKE. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -18,8 +18,8 @@ #include #include -#include - +#include + #include #include #include @@ -39,7 +39,7 @@ #define IKE_DEFAULT_TIMEOUT_INTERVAL 10000 // 10s #define IKE_NONCE_SIZE 16 #define IKE_MAX_RETRY 4 -#define IKE_SPI_BASE 0x10000 +#define IKE_SPI_BASE 0x100 #define IKE_PAYLOAD_SIGNATURE SIGNATURE_32('I','K','E','P') #define IKE_PAYLOAD_BY_PACKET(a) CR(a,IKE_PAYLOAD,ByPacket,IKE_PAYLOAD_SIGNATURE) @@ -62,7 +62,7 @@ /** Call Crypto Lib to generate a random value with eight-octet length. - + @return the 64 byte vaule. **/ @@ -75,8 +75,8 @@ IkeGenerateCookie ( Generate the random data for Nonce payload. @param[in] NonceSize Size of the data in bytes. - - @return Buffer which contains the random data of the spcified size. + + @return Buffer which contains the random data of the spcified size. **/ UINT8 * @@ -130,14 +130,20 @@ IkePayloadFree ( ); /** - Generate an unused SPI + Generate an new SPI. - @return a SPI in 4 bytes. + @param[in] IkeSaSession Pointer to IKEV2_SA_SESSION related to this Child SA + Session. + @param[in, out] SpiValue Pointer to the new generated SPI value. + + @retval EFI_SUCCESS The operation performs successfully. + @retval Otherwise The operation is failed. **/ -UINT32 +EFI_STATUS IkeGenerateSpi ( - VOID + IN IKEV2_SA_SESSION *IkeSaSession, + IN OUT UINT32 *SpiValue ); /** @@ -167,21 +173,20 @@ IkeGetVersionFromSession ( IN UINT8 *Session ); -/** - Find SPD entry by a specified SPD selector. - +/** + Find SPD entry by a specified SPD selector. + @param[in] SpdSel Point to SPD Selector to be searched for. - - @retval Point to Spd Entry if the SPD entry found. - @retval NULL if not found. - -**/ -IPSEC_SPD_ENTRY * + + @retval Point to Spd Entry if the SPD entry found. + @retval NULL if not found. + +**/ +IPSEC_SPD_ENTRY * IkeSearchSpdEntry ( - IN EFI_IPSEC_SPD_SELECTOR *SpdSel + IN EFI_IPSEC_SPD_SELECTOR *SpdSel ); -extern EFI_GUID mZeroGuid; extern MODP_GROUP OakleyModpGroup[]; extern IKE_ALG_GUID_INFO mIPsecEncrAlgInfo[]; extern IKE_ALG_GUID_INFO mIPsecAuthAlgInfo[];