]>
Commit | Line | Data |
---|---|---|
a3bcde70 | 1 | /** @file\r |
9166f840 | 2 | The definition of functions and MACROs used for IPsec debug information printting.\r |
a3bcde70 HT |
3 | \r |
4 | Copyright (c) 2009 - 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 | |
a3bcde70 HT |
15 | #ifndef _EFI_IPSEC_DEBUG_H_\r |
16 | #define _EFI_IPSEC_DEBUG_H_\r | |
17 | \r | |
9166f840 | 18 | #include "IkeCommon.h"\r |
19 | #include "IkePacket.h"\r | |
a3bcde70 HT |
20 | \r |
21 | #define IPSEC_DUMP_ADDRESS(Level, Ip, Version) IpSecDumpAddress (Level, Ip, Version)\r | |
9166f840 | 22 | #define IKEV1_DUMP_STATE(Previous, Current) IkeDumpState (Previous, Current, 1)\r |
23 | #define IKEV2_DUMP_STATE(Previous, Current) IkeDumpState (Previous, Current, 2)\r | |
a3bcde70 | 24 | #define IPSEC_DUMP_PACKET(Packet, Direction, IpVersion) IpSecDumpPacket (Packet, Direction, IpVersion)\r |
9166f840 | 25 | #define IPSEC_DUMP_PAYLOAD(IkePayload) IpSecDumpPayload (IkePayload, 1)\r |
26 | #define IKEV2_DUMP_PAYLOAD(IkePayload) IpSecDumpPayload (IkePayload, 2)\r | |
a3bcde70 HT |
27 | #define IPSEC_DUMP_BUF(Title, Data, DataSize) IpSecDumpBuf (Title, Data, DataSize)\r |
28 | \r | |
29 | #define IPSEC_DEBUG_BYTE_PER_LINE 8\r | |
30 | \r | |
31 | \r | |
32 | /**\r | |
33 | Print the IP address.\r | |
34 | \r | |
35 | @param[in] Level Debug print error level. Pass to DEBUG().\r | |
36 | @param[in] Ip Point to specified IP address.\r | |
37 | @param[in] IpVersion The IP Version.\r | |
38 | \r | |
39 | **/\r | |
40 | VOID\r | |
41 | IpSecDumpAddress (\r | |
42 | IN UINTN Level,\r | |
43 | IN EFI_IP_ADDRESS *Ip,\r | |
44 | IN UINT8 IpVersion\r | |
45 | );\r | |
46 | \r | |
47 | /**\r | |
9166f840 | 48 | Print IKE Current states.\r |
a3bcde70 | 49 | \r |
9166f840 | 50 | @param[in] Previous The Previous state of IKE.\r |
51 | @param[in] Current The current state of IKE.\r | |
52 | @param[in] IkeVersion The version of IKE.\r | |
a3bcde70 HT |
53 | \r |
54 | **/\r | |
55 | VOID\r | |
9166f840 | 56 | IkeDumpState (\r |
a3bcde70 | 57 | IN UINT32 Previous,\r |
9166f840 | 58 | IN UINT32 Current, \r |
59 | IN UINT8 IkeVersion\r | |
a3bcde70 HT |
60 | );\r |
61 | \r | |
62 | /**\r | |
9166f840 | 63 | Print the IKE Packet.\r |
a3bcde70 HT |
64 | \r |
65 | @param[in] Packet Point to IKE packet to be printed.\r | |
66 | @param[in] Direction Point to the IKE packet is inbound or outbound.\r | |
67 | @param[in] IpVersion Specified IP Version.\r | |
68 | \r | |
69 | **/\r | |
a3bcde70 HT |
70 | VOID\r |
71 | IpSecDumpPacket (\r | |
72 | IN IKE_PACKET *Packet,\r | |
73 | IN EFI_IPSEC_TRAFFIC_DIR Direction,\r | |
74 | IN UINT8 IpVersion\r | |
75 | );\r | |
a3bcde70 HT |
76 | \r |
77 | /**\r | |
78 | Print the IKE Paylolad.\r | |
79 | \r | |
9166f840 | 80 | @param[in] IkePayload Point to payload to be printed.\r |
81 | @param[in] IkeVersion The specified version of IKE.\r | |
82 | \r | |
a3bcde70 | 83 | **/\r |
a3bcde70 HT |
84 | VOID\r |
85 | IpSecDumpPayload (\r | |
9166f840 | 86 | IN IKE_PAYLOAD *IkePayload,\r |
87 | IN UINT8 IkeVersion\r | |
a3bcde70 | 88 | );\r |
9166f840 | 89 | \r |
a3bcde70 HT |
90 | /**\r |
91 | Print the buffer in form of Hex.\r | |
92 | \r | |
93 | @param[in] Title The strings to be printed before the data of the buffer.\r | |
9166f840 | 94 | @param[in] Data Point to buffer to be printed.\r |
a3bcde70 HT |
95 | @param[in] DataSize The size of the buffer to be printed.\r |
96 | \r | |
97 | **/\r | |
98 | VOID\r | |
99 | IpSecDumpBuf (\r | |
100 | IN CHAR8 *Title,\r | |
101 | IN UINT8 *Data,\r | |
102 | IN UINTN DataSize\r | |
103 | );\r | |
104 | \r | |
105 | #endif\r |