|
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 #include <e32std.h> |
|
19 #include "family.h" |
|
20 #include "prt.h" |
|
21 // |
|
22 // Nothing interesting here... |
|
23 // |
|
24 GLDEF_C TInt E32Dll() |
|
25 { |
|
26 return KErrNone; |
|
27 } |
|
28 |
|
29 class CProtocolFamilyProbe : public CProtocolFamilyBase |
|
30 { |
|
31 public: |
|
32 CProtocolFamilyProbe(); |
|
33 ~CProtocolFamilyProbe(); |
|
34 TInt Install(); |
|
35 TInt Remove(); |
|
36 TUint ProtocolList(TServerProtocolDesc *& aProtocolList); |
|
37 CProtocolBase* NewProtocolL(TUint /*aSockType*/, TUint aProtocol); |
|
38 }; |
|
39 |
|
40 extern "C" { IMPORT_C CProtocolFamilyBase* Install(); } |
|
41 EXPORT_C CProtocolFamilyBase* Install() |
|
42 { |
|
43 // Due to naming convention this cannot leave |
|
44 // However null return value handled correctly in the caller... |
|
45 return new CProtocolFamilyProbe; |
|
46 } |
|
47 |
|
48 //---------------------------------------------------------------------- |
|
49 // Dummy protocol family declaration. Required for DLL's |
|
50 // |
|
51 |
|
52 CProtocolFamilyProbe::CProtocolFamilyProbe() |
|
53 { |
|
54 // __DECLARE_NAME(_S("CProtocolFamilyProbe")); |
|
55 } |
|
56 |
|
57 CProtocolFamilyProbe::~CProtocolFamilyProbe() |
|
58 { |
|
59 } |
|
60 |
|
61 TInt CProtocolFamilyProbe::Install() |
|
62 { |
|
63 return KErrNone; |
|
64 } |
|
65 |
|
66 TInt CProtocolFamilyProbe::Remove() |
|
67 { |
|
68 return KErrNone; |
|
69 } |
|
70 |
|
71 TUint CProtocolFamilyProbe::ProtocolList(TServerProtocolDesc *& aList) |
|
72 { |
|
73 aList = new TServerProtocolDesc[2]; |
|
74 if (aList == NULL) |
|
75 return 0; |
|
76 |
|
77 CProtocolProbe::Identify(aList[0], 1); |
|
78 CProtocolProbe::Identify(aList[1], 2); |
|
79 return 2; |
|
80 } |
|
81 |
|
82 |
|
83 CProtocolBase* CProtocolFamilyProbe::NewProtocolL(TUint /*aSockType*/, |
|
84 TUint aProtocol) |
|
85 { |
|
86 return CProtocolProbe::NewL(aProtocol); |
|
87 } |
|
88 |
|
89 void Panic(TProbePanic aPanic) |
|
90 { |
|
91 User::Panic(_L("PROBE"), aPanic); |
|
92 } |