|
1 /* |
|
2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Definitions for logging in debug builds |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef M_IKEDEBUG_H |
|
19 #define M_IKEDEBUG_H |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 #ifndef _DEBUG |
|
24 |
|
25 class MIkeDebug |
|
26 { |
|
27 public: |
|
28 }; |
|
29 |
|
30 |
|
31 #define DEBUG_LOG(a) |
|
32 #define DEBUG_LOG1(a, b) |
|
33 #define DEBUG_LOG2(a, b, c) |
|
34 #define DEBUG_LOG3(a, b, c, d) |
|
35 #define DEBUG_LOG_ARRAY(a, b) |
|
36 #define DEBUG_LOG_NUM(a) |
|
37 #define TRACE_MSG(aMsg, aSrcAddr, aDstAddr, aEncryptType) |
|
38 |
|
39 #else |
|
40 |
|
41 #include "ikepcaptrace.h" |
|
42 |
|
43 // FORWARD DECLARATIONS |
|
44 class TInetAddr; |
|
45 |
|
46 /** |
|
47 * KMD debug interface for logging in debug builds. |
|
48 * @lib internal (kmdserver.exe) |
|
49 */ |
|
50 class MIkeDebug |
|
51 { |
|
52 public: |
|
53 |
|
54 virtual void LogWrite( const TDesC& aText ) = 0; |
|
55 virtual void LogWrite( const TDesC8& aText ) = 0; |
|
56 |
|
57 virtual void LogWriteF( TRefByValue<const TDesC> aFmt, ... ) = 0; |
|
58 virtual void LogWriteF( TRefByValue<const TDesC8> aFmt, ... ) = 0; |
|
59 |
|
60 virtual void LogWriteArray( const TUint8* aArray, TInt aLength ) = 0; |
|
61 |
|
62 virtual void LogWriteNum( TUint aNum ) = 0; |
|
63 |
|
64 virtual void TraceMessage( const TDesC8& aMessage, |
|
65 const TInetAddr& aSourceAddress, |
|
66 const TInetAddr& aDestinationAddress, |
|
67 CIkePcapTrace::TEncryptionType aEncryptionType ) = 0; |
|
68 |
|
69 }; |
|
70 |
|
71 #define DEBUG_LOG(a) iDebug.LogWrite((a)) |
|
72 #define DEBUG_LOG1(a, b) iDebug.LogWriteF((a), (b)) |
|
73 #define DEBUG_LOG2(a, b, c) iDebug.LogWriteF((a), (b), (c)) |
|
74 #define DEBUG_LOG3(a, b, c, d) iDebug.LogWriteF((a), (b), (c), (d)) |
|
75 #define DEBUG_LOG_ARRAY(a, b) iDebug.LogWriteArray((a), (b)) |
|
76 #define DEBUG_LOG_NUM(a) iDebug.LogWriteNum((a)) |
|
77 |
|
78 #define TRACE_MSG(aMsg, aSrcAddr, aDstAddr, aEncryptType) iDebug.TraceMessage((aMsg), (aSrcAddr), (aDstAddr), (aEncryptType)) |
|
79 #define TRACE_MSG_IKEV1(aMsg, aSrcAddr, aDstAddr ) iDebug.TraceMessage((aMsg), (aSrcAddr), (aDstAddr), (CIkePcapTrace::EEncrDes)) |
|
80 |
|
81 #endif //_DEBUG |
|
82 #endif //M_IKEDEBUG_H |