|
1 /* |
|
2 * Copyright (c) 2004-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: |
|
15 * Name : 6to4.h |
|
16 * Part of : 6to4 plugin / 6to4.prt |
|
17 * Implements 6to4 automatic and configured tunnels, see |
|
18 * RFC 3056 & RFC 2893 |
|
19 * Version : 0.2 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 /** |
|
27 @internalComponent |
|
28 */ |
|
29 |
|
30 #ifndef __6TO4_H |
|
31 #define __6TO4_H |
|
32 |
|
33 // INCLUDES |
|
34 #include <posthook.h> |
|
35 #include <es_ini.h> |
|
36 |
|
37 #include "6to4_tunnel.h" |
|
38 |
|
39 // CONSTANTS |
|
40 |
|
41 // Protocol Name |
|
42 _LIT(K6to4, "6to4"); |
|
43 |
|
44 // File name |
|
45 _LIT (K6To4IniData, "6to4.ini"); |
|
46 |
|
47 // Sections |
|
48 _LIT (K6To4IniSectionTunnels, "tunnels"); |
|
49 _LIT (K6To4IniTunnelFile, "filename"); |
|
50 |
|
51 // MACROS |
|
52 // DATA TYPES |
|
53 // FUNCTION PROTOTYPES |
|
54 // FORWARD DECLARATIONS |
|
55 class CProtocolIPv4; |
|
56 class CIpAddressDesc; |
|
57 class C6to4FlowInfo; |
|
58 class C6to4Listener; |
|
59 class MEventService; |
|
60 |
|
61 // CLASS DECLARATION |
|
62 |
|
63 /** |
|
64 * CProtocol6to4 |
|
65 * Plugin for 6to4 implementation. |
|
66 * |
|
67 * @lib |
|
68 * @since |
|
69 */ |
|
70 class CProtocol6to4 : public CProtocolPosthook |
|
71 { |
|
72 public: // Constructors and destructor |
|
73 |
|
74 CProtocol6to4 (); |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 virtual ~CProtocol6to4 (); |
|
80 |
|
81 public: // New functions |
|
82 |
|
83 /** |
|
84 * Compatibility checking for the notification service. |
|
85 * @since |
|
86 * @param |
|
87 * @return void |
|
88 */ |
|
89 void CheckCompatibility (); |
|
90 |
|
91 /** |
|
92 * Loads the configuration file and configures the system accordingly. |
|
93 * @since |
|
94 * @param |
|
95 * @return TBool ETrue if success. |
|
96 */ |
|
97 TBool LoadConfigurationFile (); |
|
98 |
|
99 /** |
|
100 * Loads the tunnel configuration file and configures the system |
|
101 * accordingly. |
|
102 * @since |
|
103 * @param aFile Tunnel configuration file to be parsed. |
|
104 * @return TInt KErrNone if success. |
|
105 */ |
|
106 TInt LoadFileL (const TDesC & aFile); |
|
107 |
|
108 /** |
|
109 * Private member access |
|
110 * @since |
|
111 * @param |
|
112 * @return TUint32 |
|
113 */ |
|
114 inline TUint32 InterfaceIndex () const { return iInterfaceIndex; } |
|
115 |
|
116 public: // Functions from base classes |
|
117 |
|
118 /** |
|
119 * From CProtocolBase |
|
120 * @since |
|
121 * @param aTag Name |
|
122 * @return void |
|
123 */ |
|
124 virtual void InitL (TDesC & aTag); |
|
125 |
|
126 /** |
|
127 * From CProtocolBase |
|
128 * @since |
|
129 * @param aDesc Descriptor to be filled by this method. |
|
130 * @return void |
|
131 */ |
|
132 virtual void Identify (TServerProtocolDesc * aDesc) const; |
|
133 |
|
134 /** |
|
135 * From CProtocolBase |
|
136 * @since |
|
137 * @param aDesc Descriptor to be filled by this method. |
|
138 * @return void |
|
139 */ |
|
140 static void Identify (TServerProtocolDesc & aDesc); |
|
141 |
|
142 /** |
|
143 * From CProtocolPostHook Handles attach to the stack |
|
144 * @since |
|
145 * @return void |
|
146 */ |
|
147 void NetworkAttachedL(); |
|
148 |
|
149 /** |
|
150 * From CProtocolPostHook Handles detach from the stack |
|
151 * @since |
|
152 * @return void |
|
153 */ |
|
154 void NetworkDetached(); |
|
155 |
|
156 /** |
|
157 * From MIp6Hook Handles received packets. |
|
158 * @since |
|
159 * @param aPacket Packet received. |
|
160 * @param aInfo Info structure. |
|
161 * @return void |
|
162 */ |
|
163 virtual TInt ApplyL (RMBufHookPacket & /* aPacket */ , |
|
164 RMBufRecvInfo & /* aInfo */ ); |
|
165 |
|
166 /** |
|
167 * From MIp6Hook Handles outbound opening. |
|
168 * @since |
|
169 * @param aHead Flow-specific precomputed data. |
|
170 * @param aFlow Flow. |
|
171 * @return void |
|
172 */ |
|
173 virtual MFlowHook *OpenL (TPacketHead & aHead, CFlowContext * aFlow); |
|
174 |
|
175 private: // Data |
|
176 |
|
177 // Configuration data |
|
178 CESockIniData *iConfig; |
|
179 |
|
180 // Non-zero if configuration file is not available |
|
181 TInt iConfigErr; |
|
182 |
|
183 // Parser object for the configured tunnels |
|
184 TTunnelParser iTunnelParser; |
|
185 |
|
186 // Event service |
|
187 MEventService *iEventService; |
|
188 |
|
189 // Object for receiving events |
|
190 C6to4Listener *iEventListener; |
|
191 |
|
192 // Interface index of the automatic 6to4 tunnels |
|
193 TUint32 iInterfaceIndex; |
|
194 }; |
|
195 |
|
196 #endif // __6TO4_H |
|
197 |
|
198 // End of File |