|
1 // Copyright (c) 2006-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 // IP Default SubConnection Provider class definition. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #ifndef SYMBIAN_IPDEFTBASESCPR_H |
|
24 #define SYMBIAN_IPDEFTBASESCPR_H |
|
25 |
|
26 #include <comms-infras/ss_subconnprov.h> |
|
27 #include <comms-infras/corescpr.h> |
|
28 #include <comms-infras/corescprstates.h> |
|
29 #include <comms-infras/ss_nodeinterfaces.h> |
|
30 #include <comms-infras/ss_corepractivities.h> |
|
31 |
|
32 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
33 #include <tcprecvwin.h> |
|
34 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
35 |
|
36 namespace IPBaseSCprStates |
|
37 { |
|
38 class TStoreAddressUpdate; |
|
39 class TRejoinDataClient; |
|
40 } |
|
41 |
|
42 class CIpDefaultSubConnectionProviderFactory; |
|
43 class CIpSubConnectionProviderFactory; |
|
44 |
|
45 class RIPDataClientNodeInterface : public Messages::RNodeInterface |
|
46 /** IP SCPR override for RNodeInterface data client. |
|
47 Caches IP address updates reported by the data clients. |
|
48 |
|
49 @internalTechnology |
|
50 @released Since 9.4 */ |
|
51 { |
|
52 public: |
|
53 TSockAddr iCliSrcAddr; |
|
54 TSockAddr iCliDstAddr; |
|
55 TInt iProtocolId; |
|
56 TInt iActivityAwaitingResponse; |
|
57 TUid iAppSid; |
|
58 |
|
59 RIPDataClientNodeInterface() |
|
60 :Messages::RNodeInterface(), |
|
61 iActivityAwaitingResponse(MeshMachine::KActivityNull) |
|
62 {} |
|
63 }; |
|
64 |
|
65 NONSHARABLE_CLASS(CIpSubConnectionProviderBase) : public CCoreSubConnectionProvider |
|
66 /** IP subconnection provider base class |
|
67 |
|
68 @internalTechnology |
|
69 @released Since 9.4 */ |
|
70 { |
|
71 friend class IPBaseSCprStates::TStoreAddressUpdate; |
|
72 friend class IPBaseSCprStates::TRejoinDataClient; |
|
73 public: |
|
74 static const TUint32 KInvalidIapId = 0xFFFFFFFF; |
|
75 |
|
76 protected: |
|
77 virtual Messages::RNodeInterface* NewClientInterfaceL(const Messages::TClientType& aClientType, TAny* aClientInfo = NULL); |
|
78 CIpSubConnectionProviderBase(ESock::CSubConnectionProviderFactoryBase& aFactory, |
|
79 const MeshMachine::TNodeActivityMap& aActivityMap); |
|
80 |
|
81 protected: |
|
82 TUint32 iIapId; |
|
83 }; |
|
84 |
|
85 NONSHARABLE_CLASS(CIpDefaultBaseSubConnectionProvider) : public CIpSubConnectionProviderBase |
|
86 /** Default IP subconnection provider |
|
87 |
|
88 @internalTechnology |
|
89 @released Since 9.4 */ |
|
90 { |
|
91 friend class CIpDefaultSubConnectionProviderFactory; |
|
92 |
|
93 public: |
|
94 typedef CIpSubConnectionProviderFactory FactoryType; |
|
95 TBool ImsFlag(); |
|
96 |
|
97 protected: |
|
98 CIpDefaultBaseSubConnectionProvider(ESock::CSubConnectionProviderFactoryBase& aFactory, |
|
99 const MeshMachine::TNodeActivityMap& aActivityMap); |
|
100 static CIpDefaultBaseSubConnectionProvider* NewL(ESock::CSubConnectionProviderFactoryBase& aFactory); |
|
101 |
|
102 virtual ~CIpDefaultBaseSubConnectionProvider(); |
|
103 virtual void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage); |
|
104 }; |
|
105 |
|
106 //-========================================================= |
|
107 // |
|
108 // Activities |
|
109 // |
|
110 //-========================================================= |
|
111 namespace IPDeftSCprBaseActivities |
|
112 { |
|
113 enum TIPDeftSCprBaseActivities |
|
114 { |
|
115 ECFActivityAddressUpdate = ESock::ECFActivityCustom, |
|
116 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
117 ECFActivityCPFCreate = ESock::ECFActivityCustom + 1, |
|
118 ECFActivityReceiveWin = ESock::ECFActivityCustom+2 |
|
119 #else |
|
120 ECFActivityCPFCreate = ESock::ECFActivityCustom + 1 |
|
121 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
122 |
|
123 }; |
|
124 |
|
125 DECLARE_ACTIVITY_MAP(ipscprbaseActivityMap) |
|
126 } |
|
127 |
|
128 namespace IPDeftBaseSCprActivities |
|
129 { |
|
130 enum TIPDeftBaseSCprActivities |
|
131 { |
|
132 ECFActivityAddressUpdate = ESock::ECFActivityCustom, |
|
133 }; |
|
134 |
|
135 DECLARE_ACTIVITY_MAP(ipdeftbasescprActivityMap) |
|
136 } |
|
137 |
|
138 |
|
139 //-========================================================= |
|
140 // |
|
141 // States |
|
142 // |
|
143 //-========================================================= |
|
144 namespace IPBaseSCprStates |
|
145 { |
|
146 typedef MeshMachine::TNodeContext<CIpSubConnectionProviderBase, SCprStates::TContext> TContext; |
|
147 |
|
148 DECLARE_SMELEMENT_HEADER( TAwaitingAddressUpdate, MeshMachine::TState<TContext>, NetStateMachine::MState, IPBaseSCprStates::TContext ) |
|
149 virtual TBool Accept(); |
|
150 DECLARE_SMELEMENT_FOOTER( TAwaitingAddressUpdate ) |
|
151 |
|
152 DECLARE_SMELEMENT_HEADER( TStoreAddressUpdate, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, IPBaseSCprStates::TContext ) |
|
153 virtual void DoL(); |
|
154 DECLARE_SMELEMENT_FOOTER( TStoreAddressUpdate ) |
|
155 |
|
156 DECLARE_SMELEMENT_HEADER( TRejoinDataClient, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, IPBaseSCprStates::TContext ) |
|
157 virtual void DoL(); |
|
158 DECLARE_SMELEMENT_FOOTER( TRejoinDataClient ) |
|
159 |
|
160 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
161 //State transition to store bearer type in provisionconfig and send window size to data clients in custom message |
|
162 DECLARE_SMELEMENT_HEADER( TSendTransportNotificationToDataClients, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, IPBaseSCprStates::TContext ) |
|
163 virtual void DoL(); |
|
164 DECLARE_SMELEMENT_FOOTER( TSendTransportNotificationToDataClients ) |
|
165 |
|
166 //State to accept TTransportNotification from IPCPR. |
|
167 DECLARE_SMELEMENT_HEADER( TAwaitingTransportNotification, MeshMachine::TState<TContext>, NetStateMachine::MState, IPBaseSCprStates::TContext ) |
|
168 virtual TBool Accept(); |
|
169 DECLARE_SMELEMENT_FOOTER( TAwaitingTransportNotification ) |
|
170 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
171 |
|
172 } |
|
173 |
|
174 namespace IPDeftBaseSCprBinderRequestActivity |
|
175 { |
|
176 const TInt KPermissionDenied = 1; |
|
177 |
|
178 typedef MeshMachine::TNodeContext<CIpDefaultBaseSubConnectionProvider, SCprStates::TContext> TContext; |
|
179 |
|
180 DECLARE_SMELEMENT_HEADER( TNoTagOrUseExistingOrPermissionDenied, PRActivities::CCommsBinderActivity::TNoTagOrUseExisting, NetStateMachine::MStateFork, TContext ) |
|
181 virtual TInt TransitionTag(); |
|
182 DECLARE_SMELEMENT_FOOTER( TNoTagOrUseExistingOrPermissionDenied ) |
|
183 } |
|
184 |
|
185 namespace IPDeftBaseSCprDataClientStartActivity |
|
186 { |
|
187 typedef MeshMachine::TNodeContext<CIpDefaultBaseSubConnectionProvider, SCprStates::TContext> TContext; |
|
188 |
|
189 DECLARE_SMELEMENT_HEADER( TGetParams, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
|
190 virtual void DoL(); |
|
191 DECLARE_SMELEMENT_FOOTER( TGetParams ) |
|
192 } |
|
193 |
|
194 namespace IPDeftSCprStopActivity |
|
195 { |
|
196 typedef IPBaseSCprStates::TContext TContext; |
|
197 |
|
198 DECLARE_SMELEMENT_HEADER( TStopYourFlows, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
|
199 virtual void DoL(); |
|
200 DECLARE_SMELEMENT_FOOTER( TStopYourFlows ) |
|
201 |
|
202 DECLARE_SMELEMENT_HEADER( TNoTagBackwardsOrProviderStopped, MeshMachine::TStateFork<TContext>, NetStateMachine::MStateFork, TContext ) |
|
203 virtual TInt TransitionTag(); |
|
204 DECLARE_SMELEMENT_FOOTER( TNoTagBackwardsOrProviderStopped ) |
|
205 |
|
206 DECLARE_SMELEMENT_HEADER( TNoTagOrProviderStopped, MeshMachine::TStateFork<TContext>, NetStateMachine::MStateFork, TContext ) |
|
207 virtual TInt TransitionTag(); |
|
208 DECLARE_SMELEMENT_FOOTER( TNoTagOrProviderStopped ) |
|
209 |
|
210 |
|
211 |
|
212 DECLARE_SERIALIZABLE_STATE( |
|
213 TNoTagOrProviderStoppedBlockedByStart, |
|
214 CoreNetStates::TActivityStartMutex, |
|
215 IPDeftSCprStopActivity::TNoTagOrProviderStopped |
|
216 ) |
|
217 } |
|
218 |
|
219 #endif //SYMBIAN_IPDEFTBASESCPR_H |