]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/IpSecDxe/IpSecDebug.h
Before decrypting the packet, Ipsec will check if the inbound protected packet is...
[mirror_edk2.git] / NetworkPkg / IpSecDxe / IpSecDebug.h
1 /** @file
2 The definition of functions and MACROs used for IPsec debug information printting.
3
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15 #ifndef _EFI_IPSEC_DEBUG_H_
16 #define _EFI_IPSEC_DEBUG_H_
17
18 #include "IkeCommon.h"
19 #include "IkePacket.h"
20
21 #define IPSEC_DUMP_ADDRESS(Level, Ip, Version) IpSecDumpAddress (Level, Ip, Version)
22 #define IKEV1_DUMP_STATE(Previous, Current) IkeDumpState (Previous, Current, 1)
23 #define IKEV2_DUMP_STATE(Previous, Current) IkeDumpState (Previous, Current, 2)
24 #define IPSEC_DUMP_PACKET(Packet, Direction, IpVersion) IpSecDumpPacket (Packet, Direction, IpVersion)
25 #define IPSEC_DUMP_PAYLOAD(IkePayload) IpSecDumpPayload (IkePayload, 1)
26 #define IKEV2_DUMP_PAYLOAD(IkePayload) IpSecDumpPayload (IkePayload, 2)
27 #define IPSEC_DUMP_BUF(Title, Data, DataSize) IpSecDumpBuf (Title, Data, DataSize)
28
29 #define IPSEC_DEBUG_BYTE_PER_LINE 8
30
31
32 /**
33 Print the IP address.
34
35 @param[in] Level Debug print error level. Pass to DEBUG().
36 @param[in] Ip Point to specified IP address.
37 @param[in] IpVersion The IP Version.
38
39 **/
40 VOID
41 IpSecDumpAddress (
42 IN UINTN Level,
43 IN EFI_IP_ADDRESS *Ip,
44 IN UINT8 IpVersion
45 );
46
47 /**
48 Print IKE Current states.
49
50 @param[in] Previous The Previous state of IKE.
51 @param[in] Current The current state of IKE.
52 @param[in] IkeVersion The version of IKE.
53
54 **/
55 VOID
56 IkeDumpState (
57 IN UINT32 Previous,
58 IN UINT32 Current,
59 IN UINT8 IkeVersion
60 );
61
62 /**
63 Print the IKE Packet.
64
65 @param[in] Packet Point to IKE packet to be printed.
66 @param[in] Direction Point to the IKE packet is inbound or outbound.
67 @param[in] IpVersion Specified IP Version.
68
69 **/
70 VOID
71 IpSecDumpPacket (
72 IN IKE_PACKET *Packet,
73 IN EFI_IPSEC_TRAFFIC_DIR Direction,
74 IN UINT8 IpVersion
75 );
76
77 /**
78 Print the IKE Paylolad.
79
80 @param[in] IkePayload Point to payload to be printed.
81 @param[in] IkeVersion The specified version of IKE.
82
83 **/
84 VOID
85 IpSecDumpPayload (
86 IN IKE_PAYLOAD *IkePayload,
87 IN UINT8 IkeVersion
88 );
89
90 /**
91 Print the buffer in form of Hex.
92
93 @param[in] Title The strings to be printed before the data of the buffer.
94 @param[in] Data Point to buffer to be printed.
95 @param[in] DataSize The size of the buffer to be printed.
96
97 **/
98 VOID
99 IpSecDumpBuf (
100 IN CHAR8 *Title,
101 IN UINT8 *Data,
102 IN UINTN DataSize
103 );
104
105 #endif