]>
Commit | Line | Data |
---|---|---|
9166f840 | 1 | /** @file\r |
2 | IKE Packet related definitions and function declarations.\r | |
3 | \r | |
4 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r | |
5 | \r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php.\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef _IKE_V1_PACKET_H_\r | |
17 | #define _IKE_V1_PACKET_H_\r | |
18 | \r | |
19 | #include "Ike.h"\r | |
20 | \r | |
21 | #define IKE_PACKET_REF(p) ((p)->RefCount++)\r | |
22 | \r | |
23 | /**\r | |
24 | Allocate a buffer for the IKE_PACKET and intitalize its Header and payloadlist.\r | |
25 | \r | |
26 | @return The pointer of the IKE_PACKET.\r | |
27 | \r | |
28 | **/\r | |
29 | IKE_PACKET *\r | |
30 | IkePacketAlloc (\r | |
31 | VOID\r | |
32 | );\r | |
33 | \r | |
34 | \r | |
35 | /**\r | |
36 | Free the IkePacket by the specified IKE_PACKET pointer.\r | |
37 | \r | |
38 | @param[in] IkePacket The pointer of the IKE_PACKET to be freed.\r | |
39 | \r | |
40 | **/\r | |
41 | VOID\r | |
42 | IkePacketFree (\r | |
43 | IN IKE_PACKET *IkePacket\r | |
44 | );\r | |
45 | \r | |
46 | \r | |
47 | /**\r | |
48 | Copy the NetBuf into a IKE_PACKET sturcture.\r | |
49 | \r | |
50 | Create a IKE_PACKET and fill the received IKE header into the header of IKE_PACKET \r | |
51 | and copy the recieved packet without IKE HEADER to the PayloadBuf of IKE_PACKET.\r | |
52 | \r | |
53 | @param[in] Netbuf The pointer of the Netbuf which contains the whole received \r | |
54 | IKE packet.\r | |
55 | \r | |
56 | @return The pointer of the IKE_PACKET which contains the received packet.\r | |
57 | \r | |
58 | **/\r | |
59 | IKE_PACKET *\r | |
60 | IkePacketFromNetbuf (\r | |
61 | IN NET_BUF *Netbuf\r | |
62 | );\r | |
63 | \r | |
64 | /**\r | |
65 | Convert the format from IKE_PACKET to NetBuf.\r | |
66 | \r | |
67 | @param[in] SessionCommon Pointer of related IKE_COMMON_SESSION\r | |
68 | @param[in] IkePacket Pointer of IKE_PACKET to be copy to NetBuf\r | |
69 | @param[in] IkeType The IKE type to pointer the packet is for which IKE \r | |
70 | phase. Now it supports IKE_SA_TYPE, IKE_CHILDSA_TYPE, \r | |
71 | IKE_INFO_TYPE.\r | |
72 | \r | |
73 | @return A pointer of Netbuff which contains the contents of the IKE_PACKE in network order.\r | |
74 | **/\r | |
75 | NET_BUF *\r | |
76 | IkeNetbufFromPacket (\r | |
77 | IN UINT8 *SessionCommon,\r | |
78 | IN IKE_PACKET *IkePacket,\r | |
79 | IN UINTN IkeType\r | |
80 | );\r | |
81 | \r | |
82 | #endif\r |