|
1 // Copyright (c) 2004-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 ramod.h |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef __ramod_H__ |
|
23 #define __ramod_H__ |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <e32property.h> |
|
27 #include <ip6_hook.h> |
|
28 |
|
29 #include "ipeventtypes.h" |
|
30 |
|
31 |
|
32 const TUint KMyProtocolId = 0x333; |
|
33 |
|
34 //using namespace IPEvent; |
|
35 |
|
36 |
|
37 class CProtocolInet6Binder; |
|
38 |
|
39 /** |
|
40 * IP Event Notifier protocol module class. |
|
41 * Coordinates opening and closing sessions, and |
|
42 * catching and publishing events to those sessions |
|
43 */ |
|
44 class Cramod : public CIp6Hook |
|
45 { |
|
46 // |
|
47 // Object lifetime // |
|
48 // |
|
49 |
|
50 public: |
|
51 |
|
52 static Cramod* NewL(); |
|
53 |
|
54 virtual ~Cramod(); |
|
55 |
|
56 protected: |
|
57 |
|
58 // Private constructor so can only be constructed with NewL |
|
59 Cramod(); |
|
60 |
|
61 // Initialisation function- only to be called by NewL (so private). |
|
62 void ConstructL(); |
|
63 |
|
64 |
|
65 |
|
66 // |
|
67 // Hook management // |
|
68 // |
|
69 |
|
70 public: |
|
71 |
|
72 // Fills in structure with info about this protocol |
|
73 void Identify(TServerProtocolDesc* aProtocolDesc)const; |
|
74 static void FillIdentification(TServerProtocolDesc& anEntry); |
|
75 |
|
76 // Binds this protocol from the given protocol |
|
77 void BindL(CProtocolBase* protocol, TUint id); |
|
78 |
|
79 // From CProtocolBaseUnbind. Unbinds this protocol |
|
80 void Unbind(CProtocolBase*, TUint); |
|
81 |
|
82 // Called by the stack for every incoming packet |
|
83 TInt ApplyL(RMBufHookPacket& aPacket, RMBufRecvInfo& aInfo); |
|
84 |
|
85 protected: |
|
86 void RegisterHooksL(void); |
|
87 void UnregisterHooks(void); |
|
88 |
|
89 |
|
90 // |
|
91 // Member data / |
|
92 // |
|
93 private: |
|
94 |
|
95 CProtocolInet6Binder* iProtocolIPv6; // the IP stack protocol itself |
|
96 |
|
97 }; |
|
98 |
|
99 |
|
100 #endif // __ramod_H__ |
|
101 |
|
102 |
|
103 |