|
1 /** @file |
|
2 * Copyright (c) 2005-2008 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: Declares common structs (classes) for UPnP stack: |
|
15 * TUpnpAddLocalDevice, TUpnpRemoveLocalDevice, TUpnpGetHTTPMessage |
|
16 * TUpnpHTTPMessageSize, TUpnpHTTPMessage, TUpnpGetDeviceListSize |
|
17 * TUpnpGetDeviceList, TUpnpCancelRequest, TUpnpDevice, TUpnpService |
|
18 * TUpnpSsdpSearch |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 #ifndef C_UPNPCOMMONSTRUCTS_H |
|
24 #define C_UPNPCOMMONSTRUCTS_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <in_sock.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CUpnpDeviceLibraryElement; |
|
31 |
|
32 // CONSTANTS |
|
33 static const TInt KUrlMaxLength = 256;//DLNA : 7.2.24.4 Max URL sholdn't exided 256(1024) characters |
|
34 static const TInt KUdnMaxLength = 68; //DLNA 7.2.19.1 The maximum length is 68 bytes, including the "uuid:" portion |
|
35 static const TInt KServiceTypeBufferLength = 4 + 255 + 9 + 64 + 3;//urn:domain-name:service:serviceType:v SEE: UPNP-DeviceArchitecture v1.0 |
|
36 //4( urn: ) |
|
37 //255 max domain name SEE: http://www.ops.ietf.org/lists/namedroppers/namedroppers.2003/msg00964.html |
|
38 //9 ( :service: ) |
|
39 //64 max service name |
|
40 //3 - ( :xx ) |
|
41 //sum: 335 |
|
42 static const TInt KDeviceTypeBufferLength = 4 + 255 + 8 + 64 + 3;//urn:domain-name:device:deviceType:v SEE: UPNP-DeviceArchitecture v1.0 |
|
43 // 4( urn: ) |
|
44 //255 max domain name SEE: http://www.ops.ietf.org/lists/namedroppers/namedroppers.2003/msg00964.html |
|
45 //8 ( :device: ) |
|
46 //64 max service name |
|
47 //3 - ( :xx ) |
|
48 //sum: 334 |
|
49 static const TInt KMaxServiceCount = 10; |
|
50 |
|
51 |
|
52 // CLASS DECLARATIONS |
|
53 |
|
54 /** |
|
55 * TUpnpAddLocalDevice |
|
56 * |
|
57 * @since Series60 2.0 |
|
58 */ |
|
59 class TUpnpAddLocalDevice |
|
60 { |
|
61 public: |
|
62 // Data in buffer |
|
63 |
|
64 TInt iBufferLength; |
|
65 |
|
66 TInt iUuidLength; |
|
67 TInt iDeviceTypeLength; |
|
68 TInt iDescriptionUrlLength; |
|
69 TInt iDomainLength; |
|
70 TInt iPortNumberLength; |
|
71 TInt iLocalLength; |
|
72 TInt iRootDeviceLength; |
|
73 |
|
74 TInt iServiceLength[KMaxServiceCount]; |
|
75 |
|
76 // External data |
|
77 |
|
78 TInt iTimeout; |
|
79 }; |
|
80 |
|
81 /** |
|
82 * TUpnpRemoveLocalDevice |
|
83 * |
|
84 * @since Series60 2.0 |
|
85 */ |
|
86 class TUpnpRemoveLocalDevice |
|
87 { |
|
88 public: |
|
89 // UID buffer string |
|
90 TBuf8<50> iUUID; |
|
91 }; |
|
92 |
|
93 /** |
|
94 * TUpnpGetHTTPMessage |
|
95 * |
|
96 * @since Series60 2.0 |
|
97 */ |
|
98 class TUpnpGetHTTPMessage |
|
99 { |
|
100 public: |
|
101 // Device path string |
|
102 TBuf8<50> iDevicePath; |
|
103 }; |
|
104 |
|
105 /** |
|
106 * TUpnpHTTPMessageSize |
|
107 * |
|
108 * @since Series60 2.0 |
|
109 */ |
|
110 class TUpnpHTTPMessageSize |
|
111 { |
|
112 public: |
|
113 // Total length |
|
114 TInt iTotalLength; |
|
115 |
|
116 // Buffer length |
|
117 TInt iBufferLength; |
|
118 |
|
119 // Header length |
|
120 TInt iHeaderLength; |
|
121 // Body length |
|
122 TInt iBodyLength; |
|
123 |
|
124 // Destintion path length |
|
125 TInt iDestinationPathLength; |
|
126 // Sender path length |
|
127 TInt iSenderPathLength; |
|
128 |
|
129 // The incoming file lenght |
|
130 TInt iInFileLength; |
|
131 // The outgoing file length |
|
132 TInt iOutFileLength; |
|
133 }; |
|
134 |
|
135 /** |
|
136 * TUpnpHTTPMessage |
|
137 * |
|
138 * @since Series60 2.0 |
|
139 */ |
|
140 class TUpnpHTTPMessage |
|
141 { |
|
142 public: |
|
143 // Session ID |
|
144 TInt iSessionId; |
|
145 // Remote host IP address |
|
146 TInetAddr iRemoteHost; |
|
147 |
|
148 // The type variable |
|
149 TInt iType; |
|
150 // Pending request state variable |
|
151 void* iPendingRequest; |
|
152 }; |
|
153 |
|
154 /** |
|
155 * TUpnpGetDeviceListSize |
|
156 * |
|
157 * @since Series60 2.0 |
|
158 */ |
|
159 class TUpnpGetDeviceListSize |
|
160 { |
|
161 public: |
|
162 // The update ID variable |
|
163 TInt iUpdateId; |
|
164 // The device count variable |
|
165 TInt iDeviceCount; |
|
166 // The service count variable |
|
167 TInt iServiceCount; |
|
168 }; |
|
169 |
|
170 /** |
|
171 * TUpnpGetDeviceList |
|
172 * |
|
173 * @since Series60 2.0 |
|
174 */ |
|
175 class TUpnpGetDeviceList |
|
176 { |
|
177 public: |
|
178 |
|
179 }; |
|
180 |
|
181 /** |
|
182 * TUpnpCancelRequest |
|
183 * |
|
184 * @since Series60 2.0 |
|
185 */ |
|
186 class TUpnpCancelRequest |
|
187 { |
|
188 public: |
|
189 |
|
190 }; |
|
191 |
|
192 /** |
|
193 * TUpnpDevice |
|
194 * |
|
195 * @since Series60 2.0 |
|
196 */ |
|
197 class TUpnpDevice |
|
198 { |
|
199 public: |
|
200 /** |
|
201 * Set device |
|
202 * Defined in SSDPServer upnpdevicelibrary.cpp |
|
203 * @param elem the device library element to be set |
|
204 * @since Series60 2.0 |
|
205 */ |
|
206 IMPORT_C void Set( CUpnpDeviceLibraryElement* elem ); |
|
207 |
|
208 // Description URL string |
|
209 TBuf8<KUrlMaxLength> iDescriptionURL; |
|
210 // Device type string |
|
211 TBuf8<KDeviceTypeBufferLength> iDeviceType; |
|
212 // Domain string |
|
213 TBuf8<KDeviceTypeBufferLength> iDomain; |
|
214 // UID string |
|
215 TBuf8<KUdnMaxLength> iUUID; |
|
216 // Service count string |
|
217 TInt iServiceCount; |
|
218 // Is alive variable |
|
219 TBool iAlive; |
|
220 // Cache-control timeout indicator |
|
221 TBool iExpired; |
|
222 // Local variable |
|
223 TBool iLocal; |
|
224 // Remote variable |
|
225 TBool iRemote; |
|
226 }; |
|
227 |
|
228 /** |
|
229 * TUpnpService |
|
230 * |
|
231 * @since Series60 2.0 |
|
232 */ |
|
233 class TUpnpService |
|
234 { |
|
235 public: |
|
236 // Service type string |
|
237 TBuf8<KServiceTypeBufferLength> iServiceType; |
|
238 |
|
239 }; |
|
240 |
|
241 |
|
242 /** |
|
243 * TUpnpSsdpSearch |
|
244 * |
|
245 * @since Series60 2.0 |
|
246 */ |
|
247 class TUpnpSsdpSearch |
|
248 { |
|
249 public: |
|
250 // The search string |
|
251 TBuf8<100> iSearchString; |
|
252 }; |
|
253 |
|
254 |
|
255 #endif // C_UPNPCOMMONSTRUCTS_H |
|
256 |
|
257 // End Of File |