]>
Commit | Line | Data |
---|---|---|
9166f840 | 1 | /** @file\r |
2 | IKE Packet related definitions and function declarations.\r | |
3 | \r | |
f75a7f56 | 4 | Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9166f840 | 5 | \r |
ecf98fbc | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
f75a7f56 | 7 | \r |
9166f840 | 8 | **/\r |
9 | \r | |
10 | #ifndef _IKE_V1_PACKET_H_\r | |
11 | #define _IKE_V1_PACKET_H_\r | |
12 | \r | |
13 | #include "Ike.h"\r | |
14 | \r | |
15 | #define IKE_PACKET_REF(p) ((p)->RefCount++)\r | |
16 | \r | |
17 | /**\r | |
18 | Allocate a buffer for the IKE_PACKET and intitalize its Header and payloadlist.\r | |
19 | \r | |
20 | @return The pointer of the IKE_PACKET.\r | |
21 | \r | |
22 | **/\r | |
23 | IKE_PACKET *\r | |
24 | IkePacketAlloc (\r | |
25 | VOID\r | |
26 | );\r | |
27 | \r | |
28 | \r | |
29 | /**\r | |
30 | Free the IkePacket by the specified IKE_PACKET pointer.\r | |
31 | \r | |
32 | @param[in] IkePacket The pointer of the IKE_PACKET to be freed.\r | |
33 | \r | |
34 | **/\r | |
35 | VOID\r | |
36 | IkePacketFree (\r | |
37 | IN IKE_PACKET *IkePacket\r | |
38 | );\r | |
39 | \r | |
40 | \r | |
41 | /**\r | |
42 | Copy the NetBuf into a IKE_PACKET sturcture.\r | |
f75a7f56 LG |
43 | \r |
44 | Create a IKE_PACKET and fill the received IKE header into the header of IKE_PACKET\r | |
9166f840 | 45 | and copy the recieved packet without IKE HEADER to the PayloadBuf of IKE_PACKET.\r |
46 | \r | |
f75a7f56 | 47 | @param[in] Netbuf The pointer of the Netbuf which contains the whole received\r |
9166f840 | 48 | IKE packet.\r |
49 | \r | |
50 | @return The pointer of the IKE_PACKET which contains the received packet.\r | |
51 | \r | |
52 | **/\r | |
53 | IKE_PACKET *\r | |
54 | IkePacketFromNetbuf (\r | |
55 | IN NET_BUF *Netbuf\r | |
56 | );\r | |
57 | \r | |
58 | /**\r | |
59 | Convert the format from IKE_PACKET to NetBuf.\r | |
60 | \r | |
61 | @param[in] SessionCommon Pointer of related IKE_COMMON_SESSION\r | |
62 | @param[in] IkePacket Pointer of IKE_PACKET to be copy to NetBuf\r | |
f75a7f56 LG |
63 | @param[in] IkeType The IKE type to pointer the packet is for which IKE\r |
64 | phase. Now it supports IKE_SA_TYPE, IKE_CHILDSA_TYPE,\r | |
9166f840 | 65 | IKE_INFO_TYPE.\r |
66 | \r | |
67 | @return A pointer of Netbuff which contains the contents of the IKE_PACKE in network order.\r | |
68 | **/\r | |
69 | NET_BUF *\r | |
70 | IkeNetbufFromPacket (\r | |
71 | IN UINT8 *SessionCommon,\r | |
72 | IN IKE_PACKET *IkePacket,\r | |
73 | IN UINTN IkeType\r | |
74 | );\r | |
75 | \r | |
76 | #endif\r |