]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/IpSecDxe/IpSecDebug.h
NetworkPkg: Replace BSD License with BSD+Patent License
[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 - 2018, Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9 #ifndef _EFI_IPSEC_DEBUG_H_
10 #define _EFI_IPSEC_DEBUG_H_
11
12 #include "IkeCommon.h"
13 #include "IkePacket.h"
14
15 #define IPSEC_DUMP_ADDRESS(Level, Ip, Version) IpSecDumpAddress (Level, Ip, Version)
16 #define IKEV1_DUMP_STATE(Previous, Current) IkeDumpState (Previous, Current, 1)
17 #define IKEV2_DUMP_STATE(Previous, Current) IkeDumpState (Previous, Current, 2)
18 #define IPSEC_DUMP_PACKET(Packet, Direction, IpVersion) IpSecDumpPacket (Packet, Direction, IpVersion)
19 #define IPSEC_DUMP_PAYLOAD(IkePayload) IpSecDumpPayload (IkePayload, 1)
20 #define IKEV2_DUMP_PAYLOAD(IkePayload) IpSecDumpPayload (IkePayload, 2)
21 #define IPSEC_DUMP_BUF(Title, Data, DataSize) IpSecDumpBuf (Title, Data, DataSize)
22
23 #define IPSEC_DEBUG_BYTE_PER_LINE 8
24 #define IKE_STATE_NUM 7
25
26
27
28 /**
29 Print the IP address.
30
31 @param[in] Level Debug print error level. Pass to DEBUG().
32 @param[in] Ip Point to specified IP address.
33 @param[in] IpVersion The IP Version.
34
35 **/
36 VOID
37 IpSecDumpAddress (
38 IN UINTN Level,
39 IN EFI_IP_ADDRESS *Ip,
40 IN UINT8 IpVersion
41 );
42
43 /**
44 Print IKE Current states.
45
46 @param[in] Previous The Previous state of IKE.
47 @param[in] Current The current state of IKE.
48 @param[in] IkeVersion The version of IKE.
49
50 **/
51 VOID
52 IkeDumpState (
53 IN UINT32 Previous,
54 IN UINT32 Current,
55 IN UINT8 IkeVersion
56 );
57
58 /**
59 Print the IKE Packet.
60
61 @param[in] Packet Point to IKE packet to be printed.
62 @param[in] Direction Point to the IKE packet is inbound or outbound.
63 @param[in] IpVersion Specified IP Version.
64
65 **/
66 VOID
67 IpSecDumpPacket (
68 IN IKE_PACKET *Packet,
69 IN EFI_IPSEC_TRAFFIC_DIR Direction,
70 IN UINT8 IpVersion
71 );
72
73 /**
74 Print the IKE Paylolad.
75
76 @param[in] IkePayload Point to payload to be printed.
77 @param[in] IkeVersion The specified version of IKE.
78
79 **/
80 VOID
81 IpSecDumpPayload (
82 IN IKE_PAYLOAD *IkePayload,
83 IN UINT8 IkeVersion
84 );
85
86 /**
87 Print the buffer in form of Hex.
88
89 @param[in] Title The strings to be printed before the data of the buffer.
90 @param[in] Data Point to buffer to be printed.
91 @param[in] DataSize The size of the buffer to be printed.
92
93 **/
94 VOID
95 IpSecDumpBuf (
96 IN CHAR8 *Title,
97 IN UINT8 *Data,
98 IN UINTN DataSize
99 );
100
101 #endif