24
|
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 |
// SPUD binder manager
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalComponent
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef BINDMAN_H
|
|
24 |
#define BINDMAN_H
|
|
25 |
|
|
26 |
#include "spudman.h"
|
|
27 |
#include <networking/mpdpfsminterface.h>
|
|
28 |
|
|
29 |
class CSpudNotify;
|
|
30 |
class CSpudMux;
|
|
31 |
class CSpudProtocol;
|
|
32 |
|
|
33 |
/**
|
|
34 |
PDP context states from the perspective of SpudMan
|
|
35 |
*/
|
|
36 |
enum TSpudContextStates
|
|
37 |
{
|
|
38 |
ESpudInactive = 0,
|
|
39 |
/** Default QoS has been set and CNifIfLink::Start is awaited */
|
|
40 |
ESpudHaveQos,
|
|
41 |
/** FSM is creating the primary context */
|
|
42 |
ESpudCreatingPrimary,
|
|
43 |
/** Start has been called on the SPUD */
|
|
44 |
ESpudStartingPrimary,
|
|
45 |
/** CNifIfLink::Start on lower NIF called, waiting for LinkLayerUp or Down.*/
|
|
46 |
ESpudStartingPrimaryLowerNif,
|
|
47 |
/** Secondary context is in the process of being started */
|
|
48 |
ESpudStartingSecondary,
|
|
49 |
/** CNifIfLink::Start on lower NIF called, waiting for LinkLayerUp or Down.*/
|
|
50 |
ESpudStartingSecondaryLowerNif,
|
|
51 |
/* Lower NIF is up, waiting for retrieval of the negotiated QoS. */
|
|
52 |
ESpudGettingNegQoS,
|
|
53 |
/** Spud is up and ready to for data */
|
|
54 |
ESpudUp,
|
|
55 |
/** Spud is up but currently flowed off by lower NIF */
|
|
56 |
ESpudFlowOff,
|
|
57 |
/** Spud is up but currently flowed off by the network */
|
|
58 |
ESpudSuspended,
|
|
59 |
/** Spud is up but currently flowed off by the network and the lower NIF */
|
|
60 |
ESpudFlowOffAndSuspended,
|
|
61 |
/** Context is going down, but it must still be deleted */
|
|
62 |
ESpudLinkDown,
|
|
63 |
/** Lower NIF has been stopped */
|
|
64 |
ESpudContextDelete,
|
|
65 |
/** All communication with GUQoS is finished for this context. */
|
|
66 |
ESpudWaitLinkDown,
|
|
67 |
/** MNifIfNotify::LinkLayerDown called by lower NIF. Binder must be deleted */
|
|
68 |
ESpudWaitBinderDelete
|
|
69 |
};
|
|
70 |
|
|
71 |
|
|
72 |
/**
|
|
73 |
Binder class between lower NIF and SPUD
|
|
74 |
*/
|
|
75 |
NONSHARABLE_CLASS(CSpudBinderRef) : public CBase
|
|
76 |
{
|
|
77 |
public:
|
|
78 |
CSpudBinderRef(CBindMan& aBindMan);
|
|
79 |
~CSpudBinderRef();
|
|
80 |
void ConstructL(MNifIfNotify* aNotify, TContextId aContextId);
|
|
81 |
void Bind(CNifIfLink* aNifLink, CNifIfBase* aNifBase);
|
|
82 |
|
|
83 |
TBool MatchBase(const CNifIfBase* aBase) const;
|
|
84 |
TBool IsBound() const;
|
|
85 |
|
|
86 |
// Setters
|
|
87 |
void SetState(TSpudContextStates aState);
|
|
88 |
void SetError(TInt aError);
|
|
89 |
|
|
90 |
// Getters
|
|
91 |
CNifIfLink* NifLink() const;
|
|
92 |
CNifIfBase* NifBase() const;
|
|
93 |
CSpudNotify* Notify() const;
|
|
94 |
TSpudContextStates State() const;
|
|
95 |
TInt Error() const;
|
|
96 |
|
|
97 |
private:
|
|
98 |
/** Reference to BindMan object */
|
|
99 |
CBindMan& iBindMan;
|
|
100 |
|
|
101 |
/* Pointer to SpudNotify object */
|
|
102 |
CSpudNotify* iNotify;
|
|
103 |
|
|
104 |
/* Pointer to CNifIfLink in lower NIF */
|
|
105 |
CNifIfLink* iNifLink;
|
|
106 |
|
|
107 |
/* Pointer to CNifIfBase in lower NIF */
|
|
108 |
CNifIfBase* iNifBase;
|
|
109 |
|
|
110 |
/** Current state of the PDP context associated with this lower NIF */
|
|
111 |
TSpudContextStates iState;
|
|
112 |
|
|
113 |
/** Context specific failure condition */
|
|
114 |
TInt iError;
|
|
115 |
};
|
|
116 |
|
|
117 |
|
|
118 |
/**
|
|
119 |
Binder management class
|
|
120 |
*/
|
|
121 |
NONSHARABLE_CLASS(CBindMan) : public CBase
|
|
122 |
{
|
|
123 |
public:
|
|
124 |
CBindMan(CSpudMan& aSpudMan, CSpudMux* aMux, CSpudProtocol* aProto);
|
|
125 |
~CBindMan();
|
|
126 |
|
|
127 |
void SetProtocolBaseL(CProtocolBase* aProtocolBase) const;
|
|
128 |
CSpudBinderRef* GetRefL(TContextId aContextId) const;
|
|
129 |
TContextId FindContextIdL(const CNifIfBase* aNifBase) const;
|
|
130 |
CSpudBinderRef* GetAnyRefL() const;
|
|
131 |
TUint NumContexts() const;
|
|
132 |
TBool IsLastContext(TContextId aContextId)const;
|
|
133 |
TUint SweepBinders();
|
|
134 |
void LoadNifL(const TDesC& aName, CSpudBinderRef& aBinder);
|
|
135 |
|
|
136 |
void MuxClosed();
|
|
137 |
CSpudMux* TransferSpudMux();
|
|
138 |
|
|
139 |
// Getters
|
|
140 |
CSpudMux* SpudMux() const;
|
|
141 |
CSpudMan* SpudMan() const;
|
|
142 |
CSpudProtocol* SpudProtocol() const;
|
|
143 |
|
|
144 |
CSpudBinderRef* GetNewRefForPrimaryL();
|
|
145 |
CSpudBinderRef* GetNewRefForSecondaryL(TContextId& aContextId);
|
|
146 |
|
|
147 |
protected:
|
|
148 |
void ReadLowerNifName(void);
|
|
149 |
|
|
150 |
private:
|
|
151 |
/** Reference to CSpudMan object */
|
|
152 |
CSpudMan& iSpudMan;
|
|
153 |
|
|
154 |
/** Pointer to CSpudMux object */
|
|
155 |
CSpudMux* iMux;
|
|
156 |
|
|
157 |
/** ETrue if it is our responsibility to delete the iMux object */
|
|
158 |
TBool iDeleteMux;
|
|
159 |
|
|
160 |
/** Pointer to CSpudProtocol object */
|
|
161 |
CSpudProtocol* iSpudProtocol;
|
|
162 |
|
|
163 |
/** Array of CSpudBinderRef objects */
|
|
164 |
TFixedArray<CSpudBinderRef*, KMaxPdpContexts> iBinders;
|
|
165 |
|
|
166 |
/** Name of lower NIF as configured in CommDB */
|
|
167 |
TBuf<KConnMaxInterfaceName> iLowerNifName;
|
|
168 |
};
|
|
169 |
|
|
170 |
#include "bindman.inl"
|
|
171 |
|
|
172 |
#endif
|