|
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 // ipprotoscpr.h |
|
15 // |
|
16 // |
|
17 |
|
18 #if !defined(IPPROTOSCPRSTATES_H_DEFINED) |
|
19 #define IPPROTOSCPRSTATES_H_DEFINED |
|
20 |
|
21 #include <comms-infras/corescprstates.h> |
|
22 #include "ipprotomessages.h" |
|
23 |
|
24 class CIPQoSProtoSubConnectionProviderBase; |
|
25 |
|
26 //-========================================================= |
|
27 // |
|
28 //Generic States & Transitions |
|
29 // |
|
30 //-========================================================= |
|
31 |
|
32 namespace IPProtoSCpr |
|
33 { |
|
34 typedef MeshMachine::TNodeContext<CIPProtoSubConnectionProvider, SCprStates::TContext> TContext; |
|
35 |
|
36 const TInt KStartNetCfgExt = 1; |
|
37 const TInt KStopNetCfgExt = 2; |
|
38 //const TInt KTryServiceProvider = 3; |
|
39 const TInt KTryNetCfgExt = 4; |
|
40 const TInt KConfigureNetwork = 5; |
|
41 const TInt KNetworkConfigured = 6; |
|
42 const TInt KSwallowMessage = 7; |
|
43 const TInt KCancelIoctl = 8; |
|
44 |
|
45 enum TCFNodeActivityId |
|
46 { |
|
47 EActivityDataMonitoring, |
|
48 EActivityAgentEvent |
|
49 }; |
|
50 |
|
51 typedef MeshMachine::TAwaitingMessageState<ESock::TCFServiceProvider::TStarted> TAwaitingStarted; |
|
52 |
|
53 #ifndef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
54 DECLARE_SMELEMENT_HEADER( TSendParamsToServiceProvider, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, IPProtoSCpr::TContext ) |
|
55 virtual void DoL(); |
|
56 DECLARE_SMELEMENT_FOOTER( TSendParamsToServiceProvider ) |
|
57 #endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
58 |
|
59 //-========================================================= |
|
60 // Provisioning support |
|
61 //-========================================================= |
|
62 DECLARE_SMELEMENT_HEADER(TStoreProvision, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, IPProtoSCpr::TContext) |
|
63 virtual void DoL(); |
|
64 DECLARE_SMELEMENT_FOOTER(TStoreProvision) |
|
65 |
|
66 //-========================================================= |
|
67 // Data monitoring support |
|
68 //-========================================================= |
|
69 DECLARE_SMELEMENT_HEADER(TAwaitingDataMonitoringNotification, MeshMachine::TState<TContext>, NetStateMachine::MState, IPProtoSCpr::TContext) |
|
70 virtual TBool Accept(); |
|
71 DECLARE_SMELEMENT_FOOTER(TAwaitingDataMonitoringNotification) |
|
72 |
|
73 DECLARE_SMELEMENT_HEADER(TProcessDataMonitoringNotification, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, IPProtoSCpr::TContext) |
|
74 virtual void DoL(); |
|
75 DECLARE_SMELEMENT_FOOTER(TProcessDataMonitoringNotification) |
|
76 |
|
77 |
|
78 //-========================================================= |
|
79 // AddressUpdate |
|
80 //-========================================================= |
|
81 DECLARE_SMELEMENT_HEADER( TAwaitingAddressUpdate, MeshMachine::TState<TContext>, NetStateMachine::MState, TContext ) |
|
82 virtual TBool Accept(); |
|
83 DECLARE_SMELEMENT_FOOTER( TAwaitingAddressUpdate ) |
|
84 |
|
85 DECLARE_SMELEMENT_HEADER( TAddIpAddressInfo, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
|
86 virtual void DoL(); |
|
87 DECLARE_SMELEMENT_FOOTER( TAddIpAddressInfo ) |
|
88 |
|
89 DECLARE_SMELEMENT_HEADER( TSendDataClientRoutedToFlow, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext ) |
|
90 virtual void DoL(); |
|
91 DECLARE_SMELEMENT_FOOTER( TSendDataClientRoutedToFlow ) |
|
92 |
|
93 |
|
94 //-========================================================= |
|
95 |
|
96 DECLARE_SMELEMENT_HEADER(TNoTagOrProviderStopped, MeshMachine::TStateFork<TContext>, NetStateMachine::MStateFork, TContext) |
|
97 virtual TInt TransitionTag(); |
|
98 DECLARE_SMELEMENT_FOOTER(TNoTagOrProviderStopped) |
|
99 |
|
100 DECLARE_SMELEMENT_HEADER( TNoTagBackwardsOrProviderStopped, MeshMachine::TStateFork<TContext>, NetStateMachine::MStateFork, IPProtoSCpr::TContext ) |
|
101 virtual TInt TransitionTag(); |
|
102 DECLARE_SMELEMENT_FOOTER( TNoTagBackwardsOrProviderStopped ) |
|
103 |
|
104 // Support for Agent events received from AgentSCPr to be forwarded to NetCfgExt |
|
105 DECLARE_SMELEMENT_HEADER( TAwaitingAgentEventNotification, MeshMachine::TState<TContext>, NetStateMachine::MState, IPProtoSCpr::TContext ) |
|
106 virtual TBool Accept(); |
|
107 DECLARE_SMELEMENT_FOOTER( TAwaitingAgentEventNotification ) |
|
108 |
|
109 DECLARE_SMELEMENT_HEADER( TProcessAgentEvent, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, IPProtoSCpr::TContext) |
|
110 virtual void DoL(); |
|
111 DECLARE_SMELEMENT_FOOTER( TProcessAgentEvent ) |
|
112 |
|
113 DECLARE_SMELEMENT_HEADER(TDeleteAllContexts, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, IPProtoSCpr::TContext) |
|
114 virtual void DoL(); |
|
115 DECLARE_SMELEMENT_FOOTER(TDeleteAllContexts) |
|
116 |
|
117 |
|
118 class CSipAddressActivity : public MeshMachine::CNodeActivityBase |
|
119 /** |
|
120 Custom activity to store the sip ioctl when it is received, |
|
121 to be used by later transitions. |
|
122 @internal |
|
123 @prototype |
|
124 */ |
|
125 { |
|
126 public: |
|
127 static MeshMachine::CNodeActivityBase* NewL(const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode) |
|
128 { |
|
129 return new (ELeave) CSipAddressActivity(aActivitySig,aNode); |
|
130 } |
|
131 |
|
132 void SetIoctlMessage(const RMessage2& aIoctlMsg) { iIoctlMsg = aIoctlMsg; } |
|
133 const RMessage2& IoctlMessage() const { return iIoctlMsg; } |
|
134 void CompleteIoctlMessage(const TInt err) |
|
135 { |
|
136 if(!iIoctlMsg.IsNull()) |
|
137 iIoctlMsg.Complete(err); |
|
138 SetError(KErrNone); |
|
139 } |
|
140 |
|
141 protected: |
|
142 CSipAddressActivity(const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode) |
|
143 : MeshMachine::CNodeActivityBase(aActivitySig, aNode) |
|
144 { |
|
145 } |
|
146 |
|
147 virtual ~CSipAddressActivity() {} |
|
148 |
|
149 private: |
|
150 RMessage2 iIoctlMsg; |
|
151 }; |
|
152 |
|
153 } // namespace IPProtoSCpr |
|
154 |
|
155 #endif // IPPROTOSCPRSTATES_H_DEFINED |