IkeCommon.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Common operation of the IKE.
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _IKE_COMMON_H_
#define _IKE_COMMON_H_
#include <Protocol/Ip4Config.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DebugLib.h>
#include <Library/UdpIoLib.h>
#include <Library/BaseCryptLib.h>
#include "IpSecImpl.h"
#include "IkePacket.h"
#include "IpSecCryptIo.h"
#define IKE_DEFAULT_PORT 500
#define IKE_NONCE_SIZE 16
#define IKE_MAX_RETRY 4
#define IKE_SPI_BASE 0x10000
do { \
} while (0)
do { \
} while (0)
} \
/**
Call Crypto Lib to generate a random value with eight-octet length.
@return the 64 byte vaule.
**/
);
/**
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.
**/
UINT8 *
);
/**
Convert the IKE Header from Network order to Host order.
@param[in, out] Header The pointer of the IKE_HEADER.
**/
);
/**
Convert the IKE Header from Host order to Network order.
@param[in, out] Header The pointer of the IKE_HEADER.
**/
);
/**
Allocate a buffer of IKE_PAYLOAD and set its Signature.
@return A buffer of IKE_PAYLOAD.
**/
);
/**
Free a specified IKE_PAYLOAD buffer.
@param[in] IkePayload Pointer of IKE_PAYLOAD to be freed.
**/
);
/**
Generate an unused SPI
@return a SPI in 4 bytes.
**/
);
/**
Generate a random data for IV
@param[in] IvBuffer The pointer of the IV buffer.
@param[in] IvSize The IV size.
@retval EFI_SUCCESS Create a random data for IV.
@retval otherwise Failed.
**/
);
/**
Get the IKE Version from the IKE_SA_SESSION.
@param[in] Session Pointer of the IKE_SA_SESSION.
**/
);
/**
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.
**/
);
extern MODP_GROUP OakleyModpGroup[];
extern IKE_ALG_GUID_INFO mIPsecEncrAlgInfo[];
extern IKE_ALG_GUID_INFO mIPsecAuthAlgInfo[];
#endif