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