|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Packet probe hook |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __PROBE_PRT_H |
|
19 #define __PROBE_PRT_H |
|
20 |
|
21 #include <e32std.h> |
|
22 #include <es_sock.h> |
|
23 #include <nifman.h> |
|
24 #include <in_bind.h> |
|
25 #include <posthook.h> |
|
26 |
|
27 #include "family.h" |
|
28 |
|
29 class CProviderProbe; |
|
30 |
|
31 class CProtocolProbe : public CProtocolPosthook |
|
32 { |
|
33 friend class CProviderProbe; |
|
34 CProtocolProbe(TUint aId); |
|
35 virtual ~CProtocolProbe(); |
|
36 public: |
|
37 virtual void InitL(TDesC& aTag); |
|
38 virtual void StartL(); |
|
39 virtual void Identify(TServerProtocolDesc *aDesc) const; |
|
40 static void Identify(TServerProtocolDesc& aDesc, TUint aId); |
|
41 static CProtocolProbe *NewL(TUint aId); |
|
42 |
|
43 virtual void NetworkAttachedL(); |
|
44 virtual TInt Send(RMBufChain &aPacket, CProtocolBase* aSrc); |
|
45 virtual void Process(RMBufChain &aPacket, CProtocolBase* aSrc); |
|
46 |
|
47 virtual CServProviderBase* NewSAPL(TUint aProtocol); |
|
48 void CancelSAP(CServProviderBase *aSAP); |
|
49 protected: |
|
50 void Dump(RMBufChain &aPacket); |
|
51 void LibcapDumpFileHeader(); |
|
52 void LibcapDump(const TDesC8& aBuffer, TUint32 aTimeStampSecs, TUint32 aTimeStampMicros); |
|
53 void Queue(RMBufChain &aPacket); |
|
54 static TInt DumpCb(TAny* aThisPtr); |
|
55 void DumpQueuedPackets(); |
|
56 |
|
57 protected: |
|
58 TTime iTimeOrigin; |
|
59 const TUint iId; |
|
60 CProviderProbe *iList; |
|
61 CAsyncCallBack iDumpCb; |
|
62 RMBufPktQ iQueue; |
|
63 RFs iFs; |
|
64 RFile iFile; |
|
65 RBuf8 iBuf; |
|
66 TBool iFileServerOpen; |
|
67 TBool iFileOpen; |
|
68 TBool iBufCreated; |
|
69 }; |
|
70 |
|
71 #endif |