|
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 * Header file for the QoS Mapping Messages |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 @file qos_msg.h |
|
24 */ |
|
25 |
|
26 #ifndef __QOS_MSG_H__ |
|
27 #define __QOS_MSG_H__ |
|
28 |
|
29 #include <e32base.h> |
|
30 #include <e32std.h> |
|
31 #include <comms-infras/eintsock.h> |
|
32 |
|
33 class CPfqosStream; |
|
34 |
|
35 |
|
36 NONSHARABLE_CLASS(CQoSMsg) : public CBase |
|
37 /** |
|
38 Encapsulation of a QoS PRT Message that can be stored in a |
|
39 link list of messages. |
|
40 |
|
41 @internalComponent |
|
42 |
|
43 @released Since v9.0 |
|
44 */ |
|
45 { |
|
46 public: |
|
47 // Construction |
|
48 static CQoSMsg* NewL( TPfqosMessages aMsgType ); |
|
49 ~CQoSMsg(); |
|
50 |
|
51 // Message Content |
|
52 inline void AddConnInfo(TUint32 aProtocol, const TUidType& aUid, TUint32 aIapId ); |
|
53 void AddSrcAddr(const TInetAddr &aAddr); |
|
54 void AddDstAddr(const TInetAddr &aAddr); |
|
55 inline void AddChannel(TInt aChannelId); |
|
56 inline void AddQoSParameters(const TQoSParameters& aParameters); |
|
57 void AddExtensionPolicy(TQoSExtensionQueue& aExtensions); |
|
58 |
|
59 // Send Message to PRT |
|
60 void Send(RInternalSocket &aSocket, TRequestStatus& aStatus); |
|
61 |
|
62 protected: |
|
63 // Construction |
|
64 CQoSMsg(); |
|
65 void ConstructL( TPfqosMessages aMsgType ); |
|
66 |
|
67 public: |
|
68 /** QoS PRT formatted Message */ |
|
69 CPfqosStream* iMsg; |
|
70 |
|
71 /** Message Type */ |
|
72 TPfqosMessages iType; |
|
73 |
|
74 /** Link to next item */ |
|
75 TSglQueLink iLink; |
|
76 }; |
|
77 |
|
78 |
|
79 class CIpSubConnectionProvider; |
|
80 |
|
81 |
|
82 NONSHARABLE_CLASS(CQoSMsgWriter) : public CActive |
|
83 /** |
|
84 Active Object that sends messages from IP Connection Provider to the QoS PRT |
|
85 |
|
86 @internalComponent |
|
87 |
|
88 @released Since v9.0 |
|
89 */ |
|
90 { |
|
91 public: |
|
92 // Construction |
|
93 static CQoSMsgWriter* NewL(CIpSubConnectionProvider* aOwner, RInternalSocket& aSocket); |
|
94 ~CQoSMsgWriter(); |
|
95 |
|
96 // Send Message over Internal Socket |
|
97 void Send(CQoSMsg* aMsg); |
|
98 |
|
99 protected: |
|
100 // Construction |
|
101 CQoSMsgWriter(CIpSubConnectionProvider* aOwner, RInternalSocket& aSocket); |
|
102 |
|
103 // Active Object Implementation |
|
104 void RunL(); |
|
105 inline void DoCancel(); |
|
106 |
|
107 private: |
|
108 /** Message Owner */ |
|
109 CIpSubConnectionProvider* iOwner; |
|
110 |
|
111 /** Reference to an Internal Socket */ |
|
112 RInternalSocket& iSocket; |
|
113 |
|
114 /** Current Message */ |
|
115 CQoSMsg* iCurrentMsg; |
|
116 |
|
117 /** List of Pending Messages */ |
|
118 TSglQue<CQoSMsg> iPendingMsg; |
|
119 |
|
120 /** Flag Set when Active Object is shuttin down */ |
|
121 TBool iClosing; |
|
122 }; |
|
123 |
|
124 |
|
125 NONSHARABLE_CLASS(CQoSMsgReader) : public CActive |
|
126 /** |
|
127 Active Object that receives messages from the QoS PRT and forwards them to the |
|
128 IP Connection Provider |
|
129 |
|
130 @internalComponent |
|
131 |
|
132 @released Since v9.0 |
|
133 */ |
|
134 { |
|
135 public: |
|
136 // Construction |
|
137 static CQoSMsgReader* NewL(CIpSubConnectionProvider *aOwner, RInternalSocket& aSocket); |
|
138 ~CQoSMsgReader(); |
|
139 |
|
140 protected: |
|
141 // Construction |
|
142 CQoSMsgReader(CIpSubConnectionProvider* aOwner, RInternalSocket& aSocket); |
|
143 void ConstructL(); |
|
144 |
|
145 // Active Object Implmentation |
|
146 void RunL(); |
|
147 inline void DoCancel(); |
|
148 |
|
149 private: |
|
150 /** Message Owner */ |
|
151 CIpSubConnectionProvider* iOwner; |
|
152 |
|
153 /** Reference of Internal Socket */ |
|
154 RInternalSocket& iSocket; |
|
155 |
|
156 /** Pointer to Buffer to receive data from QoS PRT */ |
|
157 TPtr8 iRecvPtr; |
|
158 |
|
159 /** Buffer to receive data from QoS PRT */ |
|
160 HBufC8* iRecvBuf; |
|
161 |
|
162 /** Flag Set when Active Object is shuttin down */ |
|
163 TBool iClosing; |
|
164 }; |
|
165 |
|
166 #include "qos_msg.inl" |
|
167 |
|
168 #endif // __QOS_MSG_H__ |