|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 // Ethernet logging |
|
22 #ifndef __ETH_LOG_H__ |
|
23 #define __ETH_LOG_H__ |
|
24 |
|
25 #include <comms-infras/commsdebugutility.h> |
|
26 #include <es_mbuf.h> |
|
27 #include <comms-infras/nifprvar.h> |
|
28 #include "EthProto.h" |
|
29 |
|
30 #ifdef __FLOG_ACTIVE |
|
31 #define TCPDUMP_LOGGING // log all ethernet frame in pcap format |
|
32 #endif // __FLOG_ACTIVE |
|
33 |
|
34 #if defined __FLOG_ACTIVE || defined SYMBIAN_TRACE_ENABLE |
|
35 _LIT8(KEther802LogTag1,"ethernet"); |
|
36 _LIT8(KEthLogTag2,"ethint"); |
|
37 _LIT8(KEthLogTag3,"etherpkt"); |
|
38 |
|
39 _LIT8(KEthTcpDumpFirstTag,"TcpDump"); |
|
40 _LIT8(KEthTcpDump, "EthTcpDp.log"); |
|
41 |
|
42 _LIT(KUnixTimeBaseDes, "19700101:"); |
|
43 #endif |
|
44 |
|
45 /** |
|
46 Non-static class for use with connected flogger sessions. |
|
47 Needed for logging of binary data |
|
48 @internalComponent |
|
49 @note There *might* be problems with this logging if IEEE 802.3 frames are received, but it should be OK |
|
50 */ |
|
51 __FLOG_STMT( // only define this logging class if floggerv2 is in use |
|
52 NONSHARABLE_CLASS(CEthLog) : public CBase |
|
53 { |
|
54 public: |
|
55 static CEthLog* NewL(); |
|
56 ~CEthLog(); |
|
57 void DumpTcpDumpFileHeader(); |
|
58 void DumpFrame(TTime timeStep, RMBufChain& aBuffer); |
|
59 |
|
60 private: |
|
61 CEthLog(); |
|
62 void ConstructL(); |
|
63 |
|
64 private: |
|
65 TTime iUnixTimeBase; // no global static in dlls, so have to stick it here since TTime needs its constructor calling |
|
66 TBuf8<KMaxTagLength> iEthTcpDumpLogFileName; |
|
67 __FLOG_DECLARATION_MEMBER; |
|
68 }; |
|
69 ) // end of __FLOG_STMT |
|
70 |
|
71 #endif // __ETH_LOG_H__ |