2010-12-31 11:43:54 +01:00
|
|
|
/** @file
|
|
|
|
IKE Packet related definitions and function declarations.
|
|
|
|
|
2018-06-27 15:12:32 +02:00
|
|
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
2010-12-31 11:43:54 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
http://opensource.org/licenses/bsd-license.php.
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2018-06-27 15:12:32 +02:00
|
|
|
|
2010-12-31 11:43:54 +01:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _IKE_V1_PACKET_H_
|
|
|
|
#define _IKE_V1_PACKET_H_
|
|
|
|
|
|
|
|
#include "Ike.h"
|
|
|
|
|
|
|
|
#define IKE_PACKET_REF(p) ((p)->RefCount++)
|
|
|
|
|
|
|
|
/**
|
|
|
|
Allocate a buffer for the IKE_PACKET and intitalize its Header and payloadlist.
|
|
|
|
|
|
|
|
@return The pointer of the IKE_PACKET.
|
|
|
|
|
|
|
|
**/
|
|
|
|
IKE_PACKET *
|
|
|
|
IkePacketAlloc (
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Free the IkePacket by the specified IKE_PACKET pointer.
|
|
|
|
|
|
|
|
@param[in] IkePacket The pointer of the IKE_PACKET to be freed.
|
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
IkePacketFree (
|
|
|
|
IN IKE_PACKET *IkePacket
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Copy the NetBuf into a IKE_PACKET sturcture.
|
2018-06-27 15:12:32 +02:00
|
|
|
|
|
|
|
Create a IKE_PACKET and fill the received IKE header into the header of IKE_PACKET
|
2010-12-31 11:43:54 +01:00
|
|
|
and copy the recieved packet without IKE HEADER to the PayloadBuf of IKE_PACKET.
|
|
|
|
|
2018-06-27 15:12:32 +02:00
|
|
|
@param[in] Netbuf The pointer of the Netbuf which contains the whole received
|
2010-12-31 11:43:54 +01:00
|
|
|
IKE packet.
|
|
|
|
|
|
|
|
@return The pointer of the IKE_PACKET which contains the received packet.
|
|
|
|
|
|
|
|
**/
|
|
|
|
IKE_PACKET *
|
|
|
|
IkePacketFromNetbuf (
|
|
|
|
IN NET_BUF *Netbuf
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Convert the format from IKE_PACKET to NetBuf.
|
|
|
|
|
|
|
|
@param[in] SessionCommon Pointer of related IKE_COMMON_SESSION
|
|
|
|
@param[in] IkePacket Pointer of IKE_PACKET to be copy to NetBuf
|
2018-06-27 15:12:32 +02:00
|
|
|
@param[in] IkeType The IKE type to pointer the packet is for which IKE
|
|
|
|
phase. Now it supports IKE_SA_TYPE, IKE_CHILDSA_TYPE,
|
2010-12-31 11:43:54 +01:00
|
|
|
IKE_INFO_TYPE.
|
|
|
|
|
|
|
|
@return A pointer of Netbuff which contains the contents of the IKE_PACKE in network order.
|
|
|
|
**/
|
|
|
|
NET_BUF *
|
|
|
|
IkeNetbufFromPacket (
|
|
|
|
IN UINT8 *SessionCommon,
|
|
|
|
IN IKE_PACKET *IkePacket,
|
|
|
|
IN UINTN IkeType
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|