|
1 // Copyright (c) 1998-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 // Purpose: This file contains definitions of types THttpStatusCode, |
|
15 // THttpParameter, THttpHeaderField, KHttpContentTypes, |
|
16 // KHttpCharacterSetNames and KHttpCharacterSetCodes |
|
17 // This header is a direct transcoding of [WSP] Appendix A - Assigned |
|
18 // Numbers, which contains the following assignment tables: |
|
19 // Table 34 : PDU Type Assignments |
|
20 // 35 : Abort Reason Code Assignments |
|
21 // 36 : Status Code Assignments |
|
22 // 37 : Capability Assignments |
|
23 // 38 : Well-Known Parameter Assignments |
|
24 // 39 : Header Field Name Assignments |
|
25 // 40 : Content-Type Assignments |
|
26 // 41 : ISO-639 Language Assignments |
|
27 // 42 : Character Set Assignments |
|
28 // |
|
29 // |
|
30 |
|
31 #if !defined(__THTTPFIELDS_H__) |
|
32 #define __THTTPFIELDS_H__ |
|
33 |
|
34 // |
|
35 // Table 34 not implemented |
|
36 // |
|
37 |
|
38 |
|
39 // |
|
40 // Table 35 not implemented |
|
41 // |
|
42 |
|
43 |
|
44 /** |
|
45 HTTP/1.1 Status Codes: WSP Code Assignments |
|
46 |
|
47 (see [WSP] Appdx A Table 36) |
|
48 Codes from RFC-2616 added where necessary for HTTP Caching |
|
49 @publishedAll |
|
50 @deprecated |
|
51 */ |
|
52 enum THttpStatusCode |
|
53 { |
|
54 EHttpUnknown = 0, |
|
55 EHttpContinue = 100, |
|
56 EHttpSwitchingProtocols, |
|
57 EHttpWarnStaleContent = 110, // From RFC-2616 |
|
58 EHttpWarnRevalidationFailed, // " |
|
59 EHttpWarnDisconnectedOperation, // " |
|
60 EHttpWarnHeuristicExpiration, // " |
|
61 EHttpWarnMiscellaneous, // " |
|
62 EHttpOK = 200, |
|
63 EHttpCreated, |
|
64 EHttpAccepted, |
|
65 EHttpNonAuthorativeInformation, |
|
66 EHttpNoContent, |
|
67 EHttpResetContent, |
|
68 EHttpPartialContent, |
|
69 EHttpWarnTransformationApplied, // From RFC-2616 |
|
70 EHttpWarnPersistentMiscellanous, // " |
|
71 EHttpMultipleChoices = 300, |
|
72 EHttpMovedPermanently, |
|
73 EHttpMovedTemporarily, |
|
74 EHttpSeeOther, |
|
75 EHttpNotModified, |
|
76 EHttpUseProxy, |
|
77 EHttpTemporaryRedirect = 307, // From RFC-2616 |
|
78 EHttpBadRequest = 400, |
|
79 EHttpUnauthorized, |
|
80 EHttpPaymentRequired, |
|
81 EHttpForbidden, |
|
82 EHttpNotFound, |
|
83 EHttpMethodNotAllowed, |
|
84 EHttpNotAcceptable, |
|
85 EHttpProxyAuthenticationRequired, |
|
86 EHttpRequestTimeout, |
|
87 EHttpConflict, |
|
88 EHttpGone, |
|
89 EHttpLengthRequired, |
|
90 EHttpPreconditionFailed, |
|
91 EHttpRequestEntityTooLarge, |
|
92 EHttpRequestURITooLong, |
|
93 EHttpUnsupportedMediaType, |
|
94 EHttpRequestRangeNotSatisfiable, // From RFC-2616 |
|
95 EHttpExpectationFailed, // From RFC-2616 |
|
96 EHttpInternalServerError = 500, |
|
97 EHttpNotImplemented, |
|
98 EHttpBadGateway, |
|
99 EHttpServiceUnavailable, |
|
100 EHttpGatewayTimeout, |
|
101 EHttpHTTPVersionNotSupported |
|
102 // All other codes are extension codes |
|
103 }; |
|
104 |
|
105 |
|
106 // |
|
107 // Table 37 not implemented |
|
108 // |
|
109 |
|
110 |
|
111 /** |
|
112 HTTP/1.1 Parameters: WSP Well-known Parameter Assignments |
|
113 |
|
114 (see [WSP] Appdx A Table 38) |
|
115 @publishedAll |
|
116 @deprecated |
|
117 */ |
|
118 enum THttpParameter |
|
119 { |
|
120 EHttpQ = 0x00, |
|
121 EHttpCharset = 0x01, |
|
122 EHttpLevel = 0x02, |
|
123 EHttpType = 0x03, |
|
124 EHttpName = 0x04, |
|
125 EHttpFilename = 0x05, |
|
126 EHttpDifferences = 0x06, |
|
127 EHttpPadding = 0x07 |
|
128 }; |
|
129 |
|
130 |
|
131 /** |
|
132 HTTP/1.1 Headers: WSP Field Name Assignments |
|
133 |
|
134 (see [WSP] Appdx A Table 39) |
|
135 @publishedAll |
|
136 @deprecated |
|
137 */ |
|
138 enum THttpHeaderField |
|
139 { |
|
140 EHttpAccept = 0x00, |
|
141 EHttpAcceptCharset, |
|
142 EHttpAcceptEncoding, |
|
143 EHttpAcceptLanguage, |
|
144 EHttpAcceptRanges, |
|
145 EHttpAge, |
|
146 EHttpAllow, |
|
147 EHttpAuthorization, |
|
148 EHttpCacheControl = 0x08, |
|
149 EHttpConnection, |
|
150 EHttpContentBase, |
|
151 EHttpContentEncoding, |
|
152 EHttpContentLanguage, |
|
153 EHttpContentLength, |
|
154 EHttpContentLocation, |
|
155 EHttpContentMD5, |
|
156 EHttpContentRange = 0x10, |
|
157 EHttpContentType, |
|
158 EHttpDate, |
|
159 EHttpETag, |
|
160 EHttpExpires, |
|
161 EHttpFrom, |
|
162 EHttpHost, |
|
163 EHttpIfModifiedSince, |
|
164 EHttpIfMatch = 0x18, |
|
165 EHttpIfNoneMatch, |
|
166 EHttpIfRange, |
|
167 EHttpIfUnmodifiedSince, |
|
168 EHttpLocation, |
|
169 EHttpLastModified, |
|
170 EHttpMaxForwards, |
|
171 EHttpPragma, |
|
172 EHttpProxyAuthenticate = 0x20, |
|
173 EHttpProxyAuthorization, |
|
174 EHttpPublic, |
|
175 EHttpRange, |
|
176 EHttpReferer, |
|
177 EHttpRetryAfter, |
|
178 EHttpServer, |
|
179 EHttpTransferEncoding, |
|
180 EHttpUpgrade = 0x28, |
|
181 EHttpUserAgent, |
|
182 EHttpVary, |
|
183 EHttpVia, |
|
184 EHttpWarning, |
|
185 EHttpWWWAuthenticate, |
|
186 EHttpContentDisposition, |
|
187 EHttpXWapApplicationID = 0x2F, // Additional Enums required for WAP1.2 Push |
|
188 EHttpXWapContentURI, |
|
189 EHttpXWapInitiatorURI, |
|
190 EHttpAcceptApplication, |
|
191 EHttpBearerIndication, |
|
192 EHttpPushFlag, |
|
193 EHttpProfile, |
|
194 EHttpProfileDiff, |
|
195 EHttpProfileWarning |
|
196 }; |
|
197 |
|
198 |
|
199 // |
|
200 // WSP Content-Type Assignments |
|
201 // |
|
202 // (see [WSP] Appdx A Table 40) |
|
203 // |
|
204 /** |
|
205 @publishedAll |
|
206 @deprecated |
|
207 */ |
|
208 const TInt KHttpNumContentTypes = 77; |
|
209 |
|
210 /** |
|
211 @publishedAll |
|
212 @deprecated |
|
213 */ |
|
214 const TInt KHttpMaxLenghtOfContentType = 42; |
|
215 |
|
216 /** |
|
217 @publishedAll |
|
218 @deprecated |
|
219 */ |
|
220 static const TText8* const KHttpContentTypes[] = |
|
221 { |
|
222 _S8("*/*"), //0x00 |
|
223 _S8("text/*"), |
|
224 _S8("text/html"), |
|
225 _S8("text/plain"), |
|
226 _S8("text/x-hdml"), |
|
227 _S8("text/x-ttml"), |
|
228 _S8("text/x-vCalendar"), |
|
229 _S8("text/x-vCard"), |
|
230 _S8("text/vnd.wap.wml"), // 0x08 |
|
231 _S8("text/vnd.wap.wmlscript"), |
|
232 _S8("application/vnd.wap.catc"), |
|
233 _S8("Multipart/*"), |
|
234 _S8("Multipart/mixed"), |
|
235 _S8("Multipart/form-data"), |
|
236 _S8("Multipart/byteranges"), |
|
237 _S8("multipart/alternative"), |
|
238 _S8("application/*"), // 0x10 |
|
239 _S8("application/java-vm"), |
|
240 _S8("application/x-www-form-urlencoded"), |
|
241 _S8("application/x-hdmlc"), |
|
242 _S8("application/vnd.wap.wmlc"), |
|
243 _S8("application/vnd.wap.wmlscriptc"), |
|
244 _S8("application/vnd.wap.wsic"), |
|
245 _S8("application/vnd.wap.uaprof"), |
|
246 _S8("application/vnd.wap.wtls-ca-certificate"), // 0x18 |
|
247 _S8("application/vnd.wap.wtls-user-certificate"), |
|
248 _S8("application/x-x509-ca-cert"), |
|
249 _S8("application/x-x509-user-cert"), |
|
250 _S8("image/*"), |
|
251 _S8("image/gif"), |
|
252 _S8("image/jpeg"), |
|
253 _S8("image/tiff"), |
|
254 _S8("image/png"), // 0x20 |
|
255 _S8("image/vnd.wap.wbmp"), |
|
256 _S8("application/vnd.wap.multipart.*"), |
|
257 _S8("application/vnd.wap.multipart.mixed"), |
|
258 _S8("application/vnd.wap.multipart.form-data"), |
|
259 _S8("application/vnd.wap.multipart.byteranges"), |
|
260 _S8("application/vnd.wap.multipart.alternative"), |
|
261 _S8("application/xml"), |
|
262 _S8("text/xml"), // 0x28 |
|
263 _S8("application/vnd.wap.wbxml"), |
|
264 _S8("application/x-x968-cross-cert"), //Additional C-Types in WAP 1.2 |
|
265 _S8("application/x-x968-ca-cert"), |
|
266 _S8("application/x-x968-user-cert"), |
|
267 _S8("text/vnd.wap.si"), |
|
268 _S8("application/vnd.wap.sic"), |
|
269 _S8("text/vnd.wap.sl"), |
|
270 _S8("application/vnd.wap.slc"), //0x30 |
|
271 _S8("text/vnd.wap.co"), |
|
272 _S8("application/vnd.wap.coc"), |
|
273 _S8("application/vnd.wap.multipart.related"), |
|
274 _S8("application/vnd.wap.sia"), //0x34 or 52 in decimal |
|
275 _S8("text/vnd.wap.connectivity-xml"), |
|
276 _S8("application/vnd.wap.connectivity-wbxml"), |
|
277 _S8("application/pkcs7-mime"), |
|
278 _S8("application/vnd.wap.hashed-certificate"), |
|
279 _S8("application/vnd.wap.signed-certificate"), |
|
280 _S8("application/vnd.wap.cert-response"), |
|
281 _S8("application/xhtml+xml"), |
|
282 _S8("application/wml+xml"), |
|
283 _S8("text/css"), |
|
284 _S8("application/vnd.wap.mms-message"), |
|
285 _S8("application/vnd.wap.rollover-certificate"), |
|
286 _S8("application/vnd.wap.locc+wbxml"), |
|
287 _S8("application/vnd.wap.loc+xml"), |
|
288 _S8("application/vnd.syncml.dm+wbxml"), |
|
289 _S8("application/vnd.syncml.dm+xml"), |
|
290 _S8("application/vnd.syncml.notification"), |
|
291 _S8("application/vnd.wap.xhtml+xml"), |
|
292 _S8("application/vnd.wv.csp.cir"), |
|
293 _S8("application/vnd.oma.dd+xml"), |
|
294 _S8("application/vnd.oma.drm.message"), |
|
295 _S8("application/vnd.oma.drm.content"), |
|
296 _S8("application/vnd.oma.drm.rights+xml"), |
|
297 _S8("application/vnd.oma.drm.rights+wbxml"), |
|
298 _S8("application/vnd.oma.drm.roap-trigger+xml"), |
|
299 _S8("application/vnd.oma.drm.roap-trigger+wbxml"),//0x4D |
|
300 }; |
|
301 |
|
302 |
|
303 // |
|
304 // Table 41. Languages |
|
305 // |
|
306 /** |
|
307 @publishedAll |
|
308 @deprecated |
|
309 */ |
|
310 const TInt KHttpNumLanguages = 0x8D; |
|
311 |
|
312 /** |
|
313 @publishedAll |
|
314 @deprecated |
|
315 */ |
|
316 static const TText8* const KHttpLanguages[] = |
|
317 { |
|
318 _S8("AFAR AA"), |
|
319 _S8("ABKHAZIAN AB"), |
|
320 _S8("AFRIKAANS AF"), |
|
321 _S8("AMHARIC AM"), |
|
322 _S8("ARABIC AR"), |
|
323 _S8("ASSAMESE AS"), |
|
324 _S8("AYMARA AY"), |
|
325 _S8("AZERBAIJANI AZ"), |
|
326 _S8("BASHKIR BA"), |
|
327 _S8("BYELORUSSIAN BE"), |
|
328 _S8("BULGARIAN BG"), |
|
329 _S8("BIHARI BH"), |
|
330 _S8("BISLAMA BI"), |
|
331 _S8("BENGALI BANGLA BN"), |
|
332 _S8("TIBETAN BO"), |
|
333 _S8("BRETON BR"), |
|
334 _S8("CATALAN CA"), |
|
335 _S8("CORSICAN CO"), |
|
336 _S8("CZECH CS"), |
|
337 _S8("WELSH CY"), |
|
338 _S8("DANISH DA"), |
|
339 _S8("GERMAN DE"), |
|
340 _S8("BHUTANI DZ"), |
|
341 _S8("GREEK EL"), |
|
342 _S8("ENGLISH EN"), |
|
343 _S8("ESPERANTO EO"), |
|
344 _S8("SPANISH ES"), |
|
345 _S8("ESTONIAN ET"), |
|
346 _S8("BASQUE EU"), |
|
347 _S8("PERSIAN farsi FA"), |
|
348 _S8("FINNISH FI"), |
|
349 _S8("FIJI FJ"), |
|
350 _S8("URDU UR"), |
|
351 _S8("FRENCH FR"), |
|
352 _S8("UZBEK UZ"), |
|
353 _S8("IRISH GA"), |
|
354 _S8("SCOTS-GAELIC GD"), |
|
355 _S8("GALICIAN GL"), |
|
356 _S8("GUARANI GN"), |
|
357 _S8("GUJARATI GU"), |
|
358 _S8("HAUSA HA"), |
|
359 _S8("HEBREW HE"), |
|
360 _S8("HINDI HI"), |
|
361 _S8("CROATIAN HR"), |
|
362 _S8("HUNGARIAN HU"), |
|
363 _S8("ARMENIAN HY"), |
|
364 _S8("VIETNAMESE VI"), |
|
365 _S8("INDONESIAN ID"), |
|
366 _S8("WOLOF WO"), |
|
367 _S8("XHOSA XH"), |
|
368 _S8("ICELANDIC IS"), |
|
369 _S8("ITALIAN IT"), |
|
370 _S8("YORUBA YO"), |
|
371 _S8("JAPANESE JA"), |
|
372 _S8("JAVANESE JV"), |
|
373 _S8("GEORGIAN KA"), |
|
374 _S8("KAZAKH KK"), |
|
375 _S8("ZHUANG ZA"), |
|
376 _S8("CAMBODIAN KM"), |
|
377 _S8("KANNADA KN"), |
|
378 _S8("KOREAN KO"), |
|
379 _S8("KASHMIRI KS"), |
|
380 _S8("KURDISH KU"), |
|
381 _S8("KIRGHIZ KY"), |
|
382 _S8("CHINESE ZH"), |
|
383 _S8("LINGALA LN"), |
|
384 _S8("LAOTHIAN LO"), |
|
385 _S8("LITHUANIAN LT"), |
|
386 _S8("LATVIAN LETTISH LV"), |
|
387 _S8("MALAGASY MG"), |
|
388 _S8("MAORI MI"), |
|
389 _S8("MACEDONIAN MK"), |
|
390 _S8("MALAYALAM ML"), |
|
391 _S8("MONGOLIAN MN"), |
|
392 _S8("MOLDAVIAN MO"), |
|
393 _S8("MARATHI MR"), |
|
394 _S8("MALAY MS"), |
|
395 _S8("MALTESE MT"), |
|
396 _S8("BURMESE MY"), |
|
397 _S8("UKRAINIAN UK"), |
|
398 _S8("NEPALI NE"), |
|
399 _S8("DUTCH NL"), |
|
400 _S8("NORWEGIAN NO"), |
|
401 _S8("OCCITAN OC"), |
|
402 _S8("AFAN OROMO OM"), |
|
403 _S8("ORIYA OR"), |
|
404 _S8("PUNJABI PA"), |
|
405 _S8("POLISH PL"), |
|
406 _S8("PASHTO PUSHTO PS"), |
|
407 _S8("PORTUGUESE PT"), |
|
408 _S8("QUECHUA QU"), |
|
409 _S8("ZULU ZU"), |
|
410 _S8("KURUNDI RN"), |
|
411 _S8("ROMANIAN RO"), |
|
412 _S8("RUSSIAN RU"), |
|
413 _S8("KINYARWANDA RW"), |
|
414 _S8("SANSKRIT SA"), |
|
415 _S8("SINDHI SD"), |
|
416 _S8("SANGHO SG"), |
|
417 _S8("SERBO-CROATIAN SH"), |
|
418 _S8("SINGHALESE SI"), |
|
419 _S8("SLOVAK SK"), |
|
420 _S8("SLOVENIAN SL"), |
|
421 _S8("SAMOAN SM"), |
|
422 _S8("SHONA SN"), |
|
423 _S8("SOMALI SO"), |
|
424 _S8("ALBANIAN SQ"), |
|
425 _S8("SERBIAN SR"), |
|
426 _S8("SISWATI SS"), |
|
427 _S8("SESOTHO ST"), |
|
428 _S8("SUNDANESE SU"), |
|
429 _S8("SWEDISH SV"), |
|
430 _S8("SWAHILI SW"), |
|
431 _S8("TAMIL TA"), |
|
432 _S8("TELUGU TE"), |
|
433 _S8("TAJIK TG"), |
|
434 _S8("THAI TH"), |
|
435 _S8("TIGRINYA TI"), |
|
436 _S8("TURKMEN TK"), |
|
437 _S8("TAGALOG TL"), |
|
438 _S8("SETSWANA TN"), |
|
439 _S8("TONGA TO"), |
|
440 _S8("TURKISH TR"), |
|
441 _S8("TSONGA TS"), |
|
442 _S8("TATAR TT"), |
|
443 _S8("TWI TW"), |
|
444 _S8("UIGUR UG"), |
|
445 _S8(""), |
|
446 _S8("NAURU NA"), |
|
447 _S8("FAROESE FO"), |
|
448 _S8("FRISIAN FY"), |
|
449 _S8("INTERLINGUA IA"), |
|
450 _S8("VOLAPUK VO"), |
|
451 _S8("INTERLINGUE IE"), |
|
452 _S8("INUPIAK IK"), |
|
453 _S8("YIDDISH YI"), |
|
454 _S8("INUKTITUT IU"), |
|
455 _S8("GREENLANDIC KL"), |
|
456 _S8("LATIN LA"), |
|
457 _S8("RHAETO-ROMANCE RM") |
|
458 }; |
|
459 |
|
460 // |
|
461 // WSP Character Set Assignments |
|
462 // |
|
463 // (see [WSP] Appdx A Table 42) |
|
464 // |
|
465 // The following two arrays form a paired look-up table |
|
466 // |
|
467 /** |
|
468 @publishedAll |
|
469 @deprecated |
|
470 */ |
|
471 const TInt KHttpNumCharacterSets = 15; |
|
472 |
|
473 /** |
|
474 @publishedAll |
|
475 @deprecated |
|
476 */ |
|
477 static const TText8* const KHttpCharacterSetNames[] = |
|
478 { |
|
479 _S8("big5"), |
|
480 _S8("iso-10646-ucs-2"), |
|
481 _S8("iso-8859-1"), |
|
482 _S8("iso-8859-2"), |
|
483 _S8("iso-8859-3"), |
|
484 _S8("iso-8859-4"), |
|
485 _S8("iso-8859-5"), |
|
486 _S8("iso-8859-6"), |
|
487 _S8("iso-8859-7"), |
|
488 _S8("iso-8859-8"), |
|
489 _S8("iso-8859-9"), |
|
490 _S8("shift_JIS"), |
|
491 _S8("us-ascii"), |
|
492 _S8("utf-8"), |
|
493 _S8("gsm-default-alphabet") // (not yet assigned) |
|
494 }; |
|
495 |
|
496 /** |
|
497 @publishedAll |
|
498 @deprecated |
|
499 */ |
|
500 static const TInt KHttpCharacterSetCodes[] = |
|
501 { |
|
502 0x07ea, // big5 |
|
503 0x03e8, // iso-10646-ucs-2 |
|
504 0x04, // iso-8859-1 |
|
505 0x05, // iso-8859-2 |
|
506 0x06, // iso-8859-3 |
|
507 0x07, // iso-8859-4 |
|
508 0x08, // iso-8859-5 |
|
509 0x09, // iso-8859-6 |
|
510 0x0a, // iso-8859-7 |
|
511 0x0b, // iso-8859-8 |
|
512 0x0c, // iso-8859-9 |
|
513 0x11, // shift_JIS |
|
514 0x03, // us-ascii |
|
515 0x6a, // utf-8 |
|
516 0xffff // gsm-default-alphabet (not yet assigned) |
|
517 }; |
|
518 |
|
519 |
|
520 /** |
|
521 Additional enumeration implementations for well known field values |
|
522 that may be found in the Cache-Control header |
|
523 As described in section 14.9 of RFC-2616 |
|
524 Assigned WSP encodings |
|
525 @publishedAll |
|
526 @deprecated |
|
527 */ |
|
528 enum TCacheControlFieldValue |
|
529 { |
|
530 ECacheControlNoCache = 0x80,// "no-cache" |
|
531 ECacheCtrlNoStore, // "no-store" |
|
532 ECacheCtrlMaxAge, // "max-age" |
|
533 ECacheCtrlMaxStale, // "max-stale" |
|
534 ECacheCtrlMinFresh, // "min-fresh" |
|
535 ECacheCtrlOnlyIfCached, // "only-if-cached" |
|
536 ECacheCtrlPublic, // "public" |
|
537 ECacheCtrlPrivate, // "private" |
|
538 ECacheCtrlNoTransform, // "no-transform" |
|
539 ECacheCtrlMustRevalidate, // "must-revalidate" |
|
540 ECacheCtrlProxyRevalidate, // "proxy-revalidate" |
|
541 ECacheCtrlCacheExtension // "cache-extension" |
|
542 }; |
|
543 |
|
544 #endif // __THTTPFIELDS_H__ |