HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-wbxml.c
bloba6682565b60ce39c5599e6e75bbe503daf540252
1 /* packet-wbxml.c
3 * Routines for WAP Binary XML dissection
4 * Copyright 2003, 2004, Olivier Biot.
6 * Routines for WV-CSP 1.3 dissection
7 * Copyright 2007, Andrei Rubaniuk.
9 * $Id$
11 * Refer to the AUTHORS file or the AUTHORS section in the man page
12 * for contacting the author(s) of this file.
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
18 * WAP Binary XML decoding functionality provided by Olivier Biot.
19 * WV-CSP 1.2 updated to Release version and WV-CSP 1.3 protocol
20 * decoding functionality provided by Andrei Rubaniuk.
22 * The WAP specifications used to be found at the WAP Forum:
23 * <http://www.wapforum.org/what/Technical.htm>
24 * But now the correct link is at the Open Mobile Alliance:
25 * <http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html>
26 * Media types defined by OMA affiliates will have their standards at:
27 * <http://www.openmobilealliance.org/tech/affiliates/index.html>
28 * <http://www.openmobilealliance.org/release_program/index.html>
30 * This program is free software; you can redistribute it and/or
31 * modify it under the terms of the GNU General Public License
32 * as published by the Free Software Foundation; either version 2
33 * of the License, or (at your option) any later version.
35 * This program is distributed in the hope that it will be useful,
36 * but WITHOUT ANY WARRANTY; without even the implied warranty of
37 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 * GNU General Public License for more details.
40 * You should have received a copy of the GNU General Public License
41 * along with this program; if not, write to the Free Software
42 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
45 /* Edit this file with 4-space tabulation */
47 #include "config.h"
49 #include <string.h>
51 #include <glib.h>
53 #include <epan/packet.h>
54 #include <epan/exceptions.h>
55 #include <epan/prefs.h>
56 #include <epan/wmem/wmem.h>
58 /* We need the function tvb_get_guintvar() */
59 #include "packet-wap.h"
62 /* General-purpose debug logger.
63 * Requires double parentheses because of variable arguments of printf().
65 * Enable debug logging for WBXML by defining AM_FLAGS
66 * so that it contains "-DDEBUG_wbxml"
68 #ifdef DEBUG_wbxml
69 #define DebugLog(x) \
70 g_print("%s:%u: ", __FILE__, __LINE__); \
71 g_print x
72 #else
73 #define DebugLog(x) ;
74 #endif
76 /* The code in this source file dissects the WAP Binary XML content,
77 * and if possible renders it. WBXML mappings are defined in the
78 * "wbxml_decoding" structure.
80 * NOTES:
82 * - Some WBXML content is *not* backwards compatible across minor versions.
83 * This painful remark is true for:
84 * o WMLC 1.0 with respect to later WMLC 1.x
85 * o All WV-CSP versions (never backwards compatible)
86 * The only way of correctly rendering the WBXML is to let the end-user
87 * choose from the possible renderings. This only applies to the case when
88 * the WBXML DocType is not included in the WBXML header (unknown/missing).
90 * - Some WBXML content uses EXT_T_* in a non-tableref manner. This is the
91 * case with WV-CSP 1.1 and up, where the index points to a value_string
92 * containing WV-CSP specific token values. This is allowed as it is not
93 * explicitly forbidden in the WBXML specifications. Hence the global token
94 * map for content must also contain a function pointer if no tableref
95 * string is used.
97 * - Code page switches apply until a new code page switch. In the WBXML/1.x
98 * ABNF notation, it can be proven that the switch_page can only precede
99 * the following tokens:
100 * o stag : TAG | LITERAL | LITERAL_A | LITERAL_C | LITERAL_AC
101 * o attr : ATTRSTART | ATTRVALUE
102 * o extension : EXT_I | EXT_T | EXT
103 * Code page switches are displayed in a separate column.
105 * - The WBXML spec states that code pages are static to both the tag and the
106 * attribute state parser. A SWITCH_PAGE within a state switches the code
107 * page of the active state only. Note that code page 255 is reserved for
108 * application-specific (read: testing) purposes.
110 * - In order to render the XML content, recursion is inevitable at some
111 * point (when a tag with content occurs in the content of a tag with
112 * content). The code will however not recurse if this is not strictly
113 * required (e.g., tag without content in the content of a tag with
114 * content).
116 * - I found it useful to display the XML nesting level as a first "column",
117 * followed by the abbreviated WBXML token interpretation. When a mapping
118 * is defined for the parsed WBXML content, then the XML rendering is
119 * displayed with appropriate indentation (maximum nesting level = 255,
120 * after which the nesting and level will safely roll-over to 0).
122 * - The WAP Forum defines the order of precedence for finding out the
123 * WBXML content type (same rules for charset) as follows:
124 * 1. Look in the Content-Type WSP header
125 * 2. Look in the WBXML header
126 * Currently there is no means of using content type parameters:
127 * o Type=<some_type>
128 * o Charset=<charset_of_the_content>
129 * So it is possible some WBXML content types are incorrectly parsed.
130 * This would only be the case when the content type declaration in the
131 * WSP Content-Type header would be different (or would have parameters
132 * which are relevant to the WBXML decoding) from the content type
133 * identifier specified in the WBXML header. This has to do with the
134 * decoding of terminated text strings in the different character codings.
135 * TODO: investigate this and provide correct decoding at all times.
138 typedef struct _value_valuestring {
139 guint32 value;
140 const value_string *valstrptr;
141 } value_valuestring;
143 /* Tries to match val against each element in the value_value_string array vvs.
144 * Returns the associated value_string ptr on a match, or NULL on failure. */
145 static const value_string *
146 val_to_valstr(guint32 val, const value_valuestring *vvs)
148 gint i = 0;
150 while (vvs[i].valstrptr) {
151 if (vvs[i].value == val)
152 return(vvs[i].valstrptr);
153 i++;
156 return(NULL);
159 /* Note on Token mapping
160 * ---------------------
162 * The WBXML dissector will try mapping the token decoding to their textual
163 * representation if the media type has a defined token representation. The
164 * following logic applies:
166 * a. Inspect the WBXML PublicID
167 * This means that I need a list { PublicID, decoding }
169 * b. Inspect the literal media type
170 * This requires a list { "media/type", discriminator, { decodings } }
172 * b.1. Use a discriminator to choose an appropriate token mapping;
173 * The disciminator needs a small number of bytes from the data tvbuff_t.
175 * else
176 * b.2. Provide a list to the end-user with all possible token mappings.
178 * c. If none match then only show the tokens without mapping.
182 /* ext_t_func_ptr is a pointer to a function handling the EXT_T_i tokens:
184 * char * ext_t_function(tvbuff_t *tvb, guint32 value, guint32 strtbl);
186 typedef char * (* ext_t_func_ptr)(tvbuff_t *, guint32, guint32);
188 /* Note on parsing of OPAQUE data
189 * ------------------------------
191 * The WBXML encapsulation allows the insertion of opaque binary data in the
192 * WBXML body. Although this opaque data has no meaning in WBXML, the media
193 * type itself may define compact encoding of given input by encoding it in
194 * such a OPAQUE blob of bytes.
196 * The WBXML dissector now supports dissection of OPAQUE data by means of a
197 * mapping function that will operate based on the token (well-known or literal)
198 * and the active code page.
200 * For well-known tokens the simplest approach is to use a switch for the code
201 * pages and another switch for the relevant tokens within a code page.
203 * For literal tokens (tags and attribute names), the only approach is a string
204 * comparison with the literal representation of the given tag or attribute
205 * name.
207 * opaque_token_func_ptr is a pointer to a function handling OPAQUE values
208 * for binary tokens representing tags or attribute starts.
209 * opaque_literal_func_ptr is a pointer to a function handling OPAQUE values
210 * for literal tokens representing tags or attribute starts.
212 * The length field of the OPAQUE entry starts at offset (not offset + 1).
214 * The length of the processed OPAQUE value is returned by reference.
216 * char * opaque_token_function(tvbuff_t *tvb, guint32 offset,
217 * guint8 token, guint8 codepage, guint32 *length);
218 * char * opaque_literal_function(tvbuff_t *tvb, guint32 offset,
219 * const char *token, guint8 codepage, guint32 *length);
221 typedef char * (* opaque_token_func_ptr)(tvbuff_t *, guint32, guint8, guint8, guint32 *);
222 typedef char * (* opaque_literal_func_ptr)(tvbuff_t *, guint32, const char *, guint8, guint32 *);
224 static char *
225 default_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
226 guint8 token _U_, guint8 codepage _U_, guint32 *length)
228 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
229 char *str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of opaque data)", data_len);
230 *length += data_len;
231 return str;
234 static char *
235 default_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
236 const char *token _U_, guint8 codepage _U_, guint32 *length)
238 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
239 char *str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of opaque data)", data_len);
240 *length += data_len;
241 return str;
244 static char *
245 default_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
246 guint8 token _U_, guint8 codepage _U_, guint32 *length)
248 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
249 char *str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of opaque data)", data_len);
250 *length += data_len;
251 return str;
254 static char *
255 default_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
256 const char *token _U_, guint8 codepage _U_, guint32 *length)
258 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
259 char *str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of opaque data)", data_len);
260 *length += data_len;
261 return str;
264 /* Render a hex %dateTime encoded timestamp as a string.
265 * 0x20011231123456 becomes "2001-12-31T12:34:56Z" */
266 static char *
267 date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
269 char *str;
271 switch (data_len) {
272 case 4: /* YYYY-MM-DD[T00:00:00Z] */
273 str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: "
274 "%02x%02x-%02x-%02xT00:00:00Z",
275 tvb_get_guint8(tvb, offset),
276 tvb_get_guint8(tvb, offset + 1),
277 tvb_get_guint8(tvb, offset + 2),
278 tvb_get_guint8(tvb, offset + 3));
279 break;
280 case 5: /* YYYY-MM-DDThh[:00:00Z] */
281 str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: "
282 "%02x%02x-%02x-%02xT%02x:00:00Z",
283 tvb_get_guint8(tvb, offset),
284 tvb_get_guint8(tvb, offset + 1),
285 tvb_get_guint8(tvb, offset + 2),
286 tvb_get_guint8(tvb, offset + 3),
287 tvb_get_guint8(tvb, offset + 4));
288 break;
289 case 6: /* YYYY-MM-DDThh:mm[:00Z] */
290 str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: "
291 "%02x%02x-%02x-%02xT%02x:%02x:00Z",
292 tvb_get_guint8(tvb, offset),
293 tvb_get_guint8(tvb, offset + 1),
294 tvb_get_guint8(tvb, offset + 2),
295 tvb_get_guint8(tvb, offset + 3),
296 tvb_get_guint8(tvb, offset + 4),
297 tvb_get_guint8(tvb, offset + 5));
298 break;
299 case 7: /* YYYY-MM-DDThh:mm[:00Z] */
300 str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: "
301 "%02x%02x-%02x-%02xT%02x:%02x:%02xZ",
302 tvb_get_guint8(tvb, offset),
303 tvb_get_guint8(tvb, offset + 1),
304 tvb_get_guint8(tvb, offset + 2),
305 tvb_get_guint8(tvb, offset + 3),
306 tvb_get_guint8(tvb, offset + 4),
307 tvb_get_guint8(tvb, offset + 5),
308 tvb_get_guint8(tvb, offset + 6));
309 break;
310 default:
311 str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary %%DateTime "
312 "(%d bytes of opaque data)>", data_len);
313 break;
316 return str;
319 /* Is ALWAYS 6 bytes long:
320 * 00YY YYYY YYYY YYMM MMDD DDDh hhhh mmmm mmss ssss ZZZZ ZZZZ */
321 static char *
322 wv_datetime_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
324 char *str;
325 guint16 year;
326 guint8 month, day, hour, minute, second, time_zone;
327 guint8 peek;
329 if (data_len == 6) { /* Valid */
331 /* Octet 1: 00YY YYYY */
332 year = tvb_get_guint8(tvb, offset) & 0x3F; /* ..11 1111 */
333 year <<=6;
334 /* Octet 2: YYYY YYMM */
335 peek = tvb_get_guint8(tvb, offset + 1);
336 year += (peek >> 2); /* 1111 11.. */
337 month = (peek & 0x03) << 2; /* .... ..11 */
338 /* Octet 3: MMDD DDDh */
339 peek = tvb_get_guint8(tvb, offset + 2);
340 month += (peek >> 6); /* 11.. .... */
341 day = (peek & 0x3E) >> 1; /* ..11 111. */
342 hour = (peek & 0x01) << 4; /* .... ...1 */
343 /* Octet 4: hhhh mmmm */
344 peek = tvb_get_guint8(tvb, offset + 3);
345 hour += (peek >> 4);
346 minute = (peek & 0x0F) << 2; /* .... 1111 */
347 /* Octet 5: mmss ssss */
348 peek = tvb_get_guint8(tvb, offset + 4);
349 minute += (peek >> 6); /* 11.. .... */
350 second = peek & 0x3F; /* ..11 1111 */
351 /* octet 6: ZZZZZZZZ */
352 time_zone = tvb_get_guint8(tvb, offset + 5);
353 /* Now construct the string */
354 str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP DateTime: "
355 "%04d-%02d-%02dT%02d:%02d:%02d%c",
356 year, month, day, hour, minute, second, time_zone);
357 } else { /* Invalid length for a WV-CSP DateTime tag value */
358 str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary WV-CSP DateTime value "
359 "(%d bytes of opaque data)>", data_len);
361 return str;
364 /* WV-CSP integer values for tag content is encoded in a fashion similar
365 * to a Long-Integer in WSP */
366 static char *
367 wv_integer_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
369 char *str;
371 switch (data_len) {
372 case 1:
373 str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d",
374 tvb_get_guint8(tvb, offset));
375 break;
376 case 2:
377 str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d",
378 tvb_get_ntohs(tvb, offset));
379 break;
380 case 3:
381 str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d",
382 tvb_get_ntoh24(tvb, offset));
383 break;
384 case 4:
385 str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d",
386 tvb_get_ntohl(tvb, offset));
387 break;
388 default:
389 str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary WV-CSP Integer value "
390 "(%d bytes of opaque data)>", data_len);
391 break;
394 return str;
397 static char *
398 wv_csp10_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
399 guint8 token, guint8 codepage, guint32 *length)
401 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
402 char *str = NULL;
404 switch (codepage) {
405 case 0: /* Common code page */
406 switch (token) {
407 case 0x0B: /* <Code> */
408 case 0x0F: /* <ContentSize> */
409 case 0x1A: /* <MessageCount> */
410 case 0x3C: /* <Validity> */
411 str = wv_integer_from_opaque(tvb,
412 offset + *length, data_len);
413 break;
414 case 0x11: /* <DateTime> */
415 str = wv_datetime_from_opaque(tvb,
416 offset + *length, data_len);
417 break;
418 default:
419 break;
421 break;
422 case 1: /* Access code page */
423 switch (token) {
424 case 0x1C: /* <KeepAliveTime> */
425 case 0x32: /* <TimeToLive> */
426 str = wv_integer_from_opaque(tvb,
427 offset + *length, data_len);
428 break;
429 default:
430 break;
432 break;
433 case 3: /* Client capability code page */
434 switch (token) {
435 case 0x06: /* <AcceptedContentLength> */
436 case 0x0C: /* <MultiTrans> */
437 case 0x0D: /* <ParserSize> */
438 case 0x0E: /* <ServerPollMin> */
439 case 0x11: /* <TCPAddress> */
440 case 0x12: /* <TCPPort> */
441 case 0x13: /* <UDPPort> */
442 str = wv_integer_from_opaque(tvb,
443 offset + *length, data_len);
444 break;
445 default:
446 break;
448 break;
449 default:
450 break;
452 if (str == NULL) { /* Error, or not parsed */
453 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
455 *length += data_len;
457 return str;
460 static char *
461 wv_csp10_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
462 const char *token, guint8 codepage _U_, guint32 *length)
464 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
465 char *str = NULL;
467 if ( token && ( (strcmp(token, "Code") == 0)
468 || (strcmp(token, "ContentSize") == 0)
469 || (strcmp(token, "MessageCount") == 0)
470 || (strcmp(token, "Validity") == 0)
471 || (strcmp(token, "KeepAliveTime") == 0)
472 || (strcmp(token, "TimeToLive") == 0)
473 || (strcmp(token, "AcceptedContentLength") == 0)
474 || (strcmp(token, "MultiTrans") == 0)
475 || (strcmp(token, "ParserSize") == 0)
476 || (strcmp(token, "ServerPollMin") == 0)
477 || (strcmp(token, "TCPAddress") == 0)
478 || (strcmp(token, "TCPPort") == 0)
479 || (strcmp(token, "UDPPort") == 0) ) )
481 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
483 else if ( token && ( strcmp(token, "DateTime") == 0) )
485 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
488 if (str == NULL) { /* Error, or not parsed */
489 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
491 *length += data_len;
492 return str;
495 static char *
496 wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
497 guint8 token, guint8 codepage, guint32 *length)
499 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
500 char *str = NULL;
502 switch (codepage) {
503 case 0: /* Common code page */
504 switch (token) {
505 case 0x0B: /* <Code> */
506 case 0x0F: /* <ContentSize> */
507 case 0x1A: /* <MessageCount> */
508 case 0x3C: /* <Validity> */
509 str = wv_integer_from_opaque(tvb,
510 offset + *length, data_len);
511 break;
512 case 0x11: /* <DateTime> */
513 str = wv_datetime_from_opaque(tvb,
514 offset + *length, data_len);
515 break;
516 default:
517 break;
519 break;
520 case 1: /* Access code page */
521 switch (token) {
522 case 0x1C: /* <KeepAliveTime> */
523 case 0x32: /* <TimeToLive> */
524 str = wv_integer_from_opaque(tvb,
525 offset + *length, data_len);
526 break;
527 default:
528 break;
530 break;
531 case 3: /* Client capability code page */
532 switch (token) {
533 case 0x06: /* <AcceptedContentLength> */
534 case 0x0C: /* <MultiTrans> */
535 case 0x0D: /* <ParserSize> */
536 case 0x0E: /* <ServerPollMin> */
537 case 0x12: /* <TCPPort> */
538 case 0x13: /* <UDPPort> */
539 str = wv_integer_from_opaque(tvb,
540 offset + *length, data_len);
541 break;
542 default:
543 break;
545 break;
546 case 6: /* Messaging code page */
547 switch (token) {
548 case 0x1A: /* <DeliveryTime> - not in 1.0 */
549 str = wv_datetime_from_opaque(tvb,
550 offset + *length, data_len);
551 break;
552 default:
553 break;
555 break;
556 default:
557 break;
559 if (str == NULL) { /* Error, or not parsed */
560 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
562 *length += data_len;
564 return str;
567 static char *
568 wv_csp11_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
569 const char *token, guint8 codepage _U_, guint32 *length)
571 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
572 char *str = NULL;
574 if ( token && ( (strcmp(token, "Code") == 0)
575 || (strcmp(token, "ContentSize") == 0)
576 || (strcmp(token, "MessageCount") == 0)
577 || (strcmp(token, "Validity") == 0)
578 || (strcmp(token, "KeepAliveTime") == 0)
579 || (strcmp(token, "TimeToLive") == 0)
580 || (strcmp(token, "AcceptedContentLength") == 0)
581 || (strcmp(token, "MultiTrans") == 0)
582 || (strcmp(token, "ParserSize") == 0)
583 || (strcmp(token, "ServerPollMin") == 0)
584 || (strcmp(token, "TCPPort") == 0)
585 || (strcmp(token, "UDPPort") == 0) ) )
587 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
589 else
590 if ( token && ( (strcmp(token, "DateTime") == 0)
591 || (strcmp(token, "DeliveryTime") == 0) ) )
593 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
596 if (str == NULL) { /* Error, or not parsed */
597 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
599 *length += data_len;
600 return str;
604 static char *
605 wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
606 guint8 token, guint8 codepage, guint32 *length)
608 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
609 char *str = NULL;
611 switch (codepage) {
612 case 0: /* Common code page */
613 switch (token) {
614 case 0x0B: /* <Code> */
615 case 0x0F: /* <ContentSize> */
616 case 0x1A: /* <MessageCount> */
617 case 0x3C: /* <Validity> */
618 str = wv_integer_from_opaque(tvb,
619 offset + *length, data_len);
620 break;
621 case 0x11: /* <DateTime> */
622 str = wv_datetime_from_opaque(tvb,
623 offset + *length, data_len);
624 break;
625 default:
626 break;
628 break;
629 case 1: /* Access code page */
630 switch (token) {
631 case 0x1C: /* <KeepAliveTime> */
632 case 0x32: /* <TimeToLive> */
633 str = wv_integer_from_opaque(tvb,
634 offset + *length, data_len);
635 break;
636 default:
637 break;
639 break;
640 case 3: /* Client capability code page */
641 switch (token) {
642 case 0x06: /* <AcceptedContentLength> */
643 case 0x0C: /* <MultiTrans> */
644 case 0x0D: /* <ParserSize> */
645 case 0x0E: /* <ServerPollMin> */
646 case 0x12: /* <TCPPort> */
647 case 0x13: /* <UDPPort> */
648 str = wv_integer_from_opaque(tvb,
649 offset + *length, data_len);
650 break;
651 default:
652 break;
654 break;
655 case 6: /* Messaging code page */
656 switch (token) {
657 case 0x1A: /* <DeliveryTime> - not in 1.0 */
658 str = wv_datetime_from_opaque(tvb,
659 offset + *length, data_len);
660 break;
661 default:
662 break;
664 break;
665 case 9: /* Common code page (continued) */
666 switch (token) {
667 case 0x08: /* <HistoryPeriod> - 1.2 only */
668 case 0x0A: /* <MaxWatcherList> - 1.2 only */
669 str = wv_integer_from_opaque(tvb,
670 offset + *length, data_len);
671 break;
672 default:
673 break;
675 break;
676 default:
677 break;
679 if (str == NULL) { /* Error, or not parsed */
680 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
682 *length += data_len;
684 return str;
687 static char *
688 wv_csp12_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
689 const char *token, guint8 codepage _U_, guint32 *length)
691 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
692 char *str = NULL;
694 if ( token && ( (strcmp(token, "Code") == 0)
695 || (strcmp(token, "ContentSize") == 0)
696 || (strcmp(token, "MessageCount") == 0)
697 || (strcmp(token, "Validity") == 0)
698 || (strcmp(token, "KeepAliveTime") == 0)
699 || (strcmp(token, "TimeToLive") == 0)
700 || (strcmp(token, "AcceptedContentLength") == 0)
701 || (strcmp(token, "MultiTrans") == 0)
702 || (strcmp(token, "ParserSize") == 0)
703 || (strcmp(token, "ServerPollMin") == 0)
704 || (strcmp(token, "TCPPort") == 0)
705 || (strcmp(token, "UDPPort") == 0)
706 || (strcmp(token, "HistoryPeriod") == 0)
707 || (strcmp(token, "MaxWatcherList") == 0) ) )
709 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
711 else
712 if ( token && ( (strcmp(token, "DateTime") == 0)
713 || (strcmp(token, "DeliveryTime") == 0) ) )
715 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
718 if (str == NULL) { /* Error, or not parsed */
719 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
721 *length += data_len;
722 return str;
725 static char *
726 wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
727 guint8 token, guint8 codepage, guint32 *length)
729 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
730 char *str = NULL;
732 switch (codepage)
734 case 0: /* Common code page */
735 switch (token)
737 case 0x0B: /* <Code> */
738 case 0x0F: /* <ContentSize> */
739 case 0x1A: /* <MessageCount> */
740 case 0x3C: /* <Validity> */
741 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
742 break;
743 case 0x11: /* <DateTime> */
744 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
745 break;
746 default:
747 break;
749 break;
751 case 1: /* Access code page */
752 switch (token)
754 case 0x1C: /* <KeepAliveTime> */
755 case 0x25: /* <SearchFindings> */
756 case 0x26: /* <SearchID> */
757 case 0x27: /* <SearchIndex> */
758 case 0x28: /* <SearchLimit> */
759 case 0x32: /* <TimeToLive> */
760 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
761 break;
762 default:
763 break;
765 break;
767 case 3: /* Client capability code page */
768 switch (token)
770 case 0x06: /* <AcceptedContentLength> */
771 case 0x0C: /* <MultiTrans> */
772 case 0x0D: /* <ParserSize> */
773 case 0x0E: /* <ServerPollMin> */
774 case 0x12: /* <TCPPort> */
775 case 0x13: /* <UDPPort> */
776 /* New in WV-CSP 1.3*/
777 case 0x16: /* <AcceptedPullLength> */
778 case 0x17: /* <AcceptedPushLength> */
779 case 0x18: /* <AcceptedRichContentLength> */
780 case 0x19: /* <AcceptedTextContentLength> */
781 case 0x1B: /* <PlainTextCharset> MIBenum number - character set, i.e. UTF-8, windows-1251, etc. */
782 case 0x1C: /* <SessionPriority> */
783 case 0x1F: /* <UserSessionLimit> */
784 case 0x21: /* <MultiTransPerMessage> */
785 case 0x24: /* <ContentPolicyLimit> */
786 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
787 break;
788 default:
789 break;
791 break;
793 case 5: /* Presence attribute code page */
794 switch (token)
796 /* New in WV-CSP 1.3*/
797 /* case 0x3B: */ /* <ClientContentLimit> */
798 case 0x3C: /* <ClientIMPriority> */
799 case 0x3D: /* <MaxPullLength> */
800 case 0x3E: /* <MaxPushLength> */
801 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
802 break;
803 default:
804 break;
806 break;
808 case 6: /* Messaging code page */
809 switch (token)
811 case 0x1A: /* <DeliveryTime> - not in 1.0 */
812 /* New in WV-CSP 1.3*/
813 case 0x1C: /* <AnswerOptionID> */
814 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
815 break;
816 default:
817 break;
819 break;
821 case 9: /* Common code page (continued) */
822 switch (token)
824 case 0x08: /* <HistoryPeriod> - 1.2 only */
825 case 0x0A: /* <MaxWatcherList> - 1.2 only */
826 /* New in WV-CSP 1.3*/
827 case 0x25: /* <SegmentCount> */
828 case 0x28: /* <SegmentReference> */
829 case 0x30: /* <TryAgainTimeout> */
830 case 0x3A: /* <GroupContentLimit> */
831 case 0x3B: /* <MessageTotalCount> */
832 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
833 break;
834 default:
835 break;
837 break;
839 case 10:
840 switch (token)
842 /* New in WV-CSP 1.3*/
843 case 0x0C: /* <PairID> */
844 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
845 break;
846 default:
847 break;
849 break;
850 default:
851 break;
854 if (str == NULL)
855 { /* Error, or not parsed */
856 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
858 *length += data_len;
860 return str;
864 static char *
865 wv_csp13_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
866 const char *token, guint8 codepage _U_, guint32 *length)
868 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
869 char *str = NULL;
871 if ( token && ( (strcmp(token, "Code") == 0)
872 || (strcmp(token, "ContentSize") == 0)
873 || (strcmp(token, "MessageCount") == 0)
874 || (strcmp(token, "Validity") == 0)
875 || (strcmp(token, "KeepAliveTime") == 0)
876 || (strcmp(token, "TimeToLive") == 0)
877 || (strcmp(token, "AcceptedContentLength") == 0)
878 || (strcmp(token, "MultiTrans") == 0)
879 || (strcmp(token, "ParserSize") == 0)
880 || (strcmp(token, "ServerPollMin") == 0)
881 || (strcmp(token, "TCPPort") == 0)
882 || (strcmp(token, "UDPPort") == 0)
883 || (strcmp(token, "HistoryPeriod") == 0)
884 || (strcmp(token, "MaxWatcherList") == 0)
885 /* New in WV-CSP 1.3*/
886 || (strcmp(token, "SearchFindings") == 0)
887 || (strcmp(token, "SearchID") == 0)
888 || (strcmp(token, "SearchIndex") == 0)
889 || (strcmp(token, "SearchLimit") == 0)
890 || (strcmp(token, "AcceptedPullLength") == 0)
891 || (strcmp(token, "AcceptedPushLength") == 0)
892 || (strcmp(token, "AcceptedRichContentLength") == 0)
893 || (strcmp(token, "AcceptedTextContentLength") == 0)
894 || (strcmp(token, "SessionPriority") == 0)
895 || (strcmp(token, "UserSessionLimit") == 0)
896 || (strcmp(token, "MultiTransPerMessage") == 0)
897 || (strcmp(token, "ContentPolicyLimit") == 0)
898 || (strcmp(token, "AnswerOptionID") == 0)
899 || (strcmp(token, "SegmentCount") == 0)
900 || (strcmp(token, "SegmentReference") == 0)
901 || (strcmp(token, "TryAgainTimeout") == 0)
902 || (strcmp(token, "GroupContentLimit") == 0)
903 || (strcmp(token, "MessageTotalCount") == 0)
904 || (strcmp(token, "PairID") == 0) ) )
906 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
908 else
909 if ( token && ( (strcmp(token, "DateTime") == 0)
910 || (strcmp(token, "DeliveryTime") == 0) ) )
912 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
915 if (str == NULL) { /* Error, or not parsed */
916 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
918 *length += data_len;
919 return str;
922 static char *
923 sic10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
924 const char *token, guint8 codepage _U_, guint32 *length)
926 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
927 char *str = NULL;
929 if ( token && ( (strcmp(token, "created") == 0)
930 || (strcmp(token, "si-expires") == 0) ) )
932 str = date_time_from_opaque(tvb, offset + *length, data_len);
934 if (str == NULL) { /* Error, or not parsed */
935 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
937 *length += data_len;
939 return str;
942 static char *
943 sic10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
944 guint8 token, guint8 codepage, guint32 *length)
946 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
947 char *str = NULL;
949 switch (codepage) {
950 case 0: /* Only valid codepage for SI */
951 switch (token) {
952 case 0x0A: /* created= */
953 case 0x10: /* si-expires= */
954 str = date_time_from_opaque(tvb,
955 offset + *length, data_len);
956 break;
957 default:
958 break;
960 break;
961 default:
962 break;
964 if (str == NULL) { /* Error, or not parsed */
965 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
967 *length += data_len;
969 return str;
972 static char *
973 emnc10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
974 const char *token, guint8 codepage _U_, guint32 *length)
976 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
977 char *str = NULL;
979 if ( token && (strcmp(token, "timestamp") == 0) )
981 str = date_time_from_opaque(tvb, offset + *length, data_len);
983 if (str == NULL) { /* Error, or not parsed */
984 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
986 *length += data_len;
988 return str;
991 static char *
992 emnc10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
993 guint8 token, guint8 codepage, guint32 *length)
995 guint32 data_len = tvb_get_guintvar(tvb, offset, length);
996 char *str = NULL;
998 switch (codepage) {
999 case 0: /* Only valid codepage for EMN */
1000 switch (token) {
1001 case 0x05: /* timestamp= */
1002 str = date_time_from_opaque(tvb,
1003 offset + *length, data_len);
1004 break;
1005 default:
1006 break;
1008 break;
1009 default:
1010 break;
1012 if (str == NULL) { /* Error, or not parsed */
1013 str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
1015 *length += data_len;
1017 return str;
1020 typedef struct _wbxml_decoding {
1021 const char *name;
1022 const char *abbrev;
1023 ext_t_func_ptr ext_t[3];
1024 opaque_token_func_ptr opaque_binary_tag;
1025 opaque_literal_func_ptr opaque_literal_tag;
1026 opaque_token_func_ptr opaque_binary_attr;
1027 opaque_literal_func_ptr opaque_literal_attr;
1028 const value_valuestring *global;
1029 const value_valuestring *tags;
1030 const value_valuestring *attrStart;
1031 const value_valuestring *attrValue;
1032 } wbxml_decoding;
1034 /* Define a pointer to a discriminator function taking a tvb and the start
1035 * offset of the WBXML tokens in the body as arguments.
1037 typedef const wbxml_decoding * (* discriminator_func_ptr)(tvbuff_t *, guint32);
1039 /* For the decoding lists based on the known WBXML public ID */
1040 typedef struct _wbxml_integer_list {
1041 guint32 public_id;
1042 const wbxml_decoding *map;
1043 } wbxml_integer_list;
1045 /* For the decoding lists on the literal content type */
1046 typedef struct _wbxml_literal_list {
1047 const char *content_type;
1048 discriminator_func_ptr discriminator; /* TODO */
1049 const wbxml_decoding *map;
1050 } wbxml_literal_list;
1052 /************************** Variable declarations **************************/
1055 /* Initialize the protocol and registered fields */
1056 static int proto_wbxml = -1;
1057 static int hf_wbxml_version = -1;
1058 static int hf_wbxml_public_id_known = -1;
1059 static int hf_wbxml_public_id_literal = -1;
1060 static int hf_wbxml_charset = -1;
1062 /* Initialize the subtree pointers */
1063 static gint ett_wbxml = -1;
1064 static gint ett_wbxml_str_tbl = -1;
1065 static gint ett_wbxml_content = -1;
1067 /* WBXML Preferences */
1068 static gboolean skip_wbxml_token_mapping = FALSE;
1069 static gboolean disable_wbxml_token_parsing = FALSE;
1072 /**************** WBXML related declarations and definitions ****************/
1075 /* WBXML public ID mappings. For an up-to-date list, see
1076 * http://www.openmobilealliance.org/tech/omna/ */
1077 static const value_string vals_wbxml_public_ids[] = {
1078 /* 0x00 = literal public identifier */
1079 { 0x01, "Unknown or missing Public Identifier" },
1080 { 0x02, "-//WAPFORUM//DTD WML 1.0//EN (WML 1.0)" },
1081 { 0x03, "-//WAPFORUM//DTD WTA 1.0//EN (WTA Event 1.0) - Deprecated" },
1082 { 0x04, "-//WAPFORUM//DTD WML 1.1//EN (WML 1.1)" },
1083 { 0x05, "-//WAPFORUM//DTD SI 1.0//EN (Service Indication 1.0)" },
1084 { 0x06, "-//WAPFORUM//DTD SL 1.0//EN (Service Loading 1.0)" },
1085 { 0x07, "-//WAPFORUM//DTD CO 1.0//EN (Cache Operation 1.0)" },
1086 { 0x08, "-//WAPFORUM//DTD CHANNEL 1.1//EN (Channel 1.1)" },
1087 { 0x09, "-//WAPFORUM//DTD WML 1.2//EN (WML 1.2)" },
1088 { 0x0a, "-//WAPFORUM//DTD WML 1.3//EN (WML 1.3)" },
1089 { 0x0b, "-//WAPFORUM//DTD PROV 1.0//EN (Provisioning 1.0)" },
1090 { 0x0c, "-//WAPFORUM//DTD WTA-WML 1.2//EN (WTA-WML 1.2)" },
1091 { 0x0d, "-//WAPFORUM//DTD EMN 1.0//EN (Email Notification 1.0)" },
1092 { 0x0e, "-//WAPFORUM//DTD DRMREL 1.0//EN (DRMREL 1.0)" },
1093 { 0x0f, "-//WIRELESSVILLAGE//DTD CSP 1.0//EN"
1094 " (Wireless Village Client-Server Protocol DTD v1.0)" },
1095 { 0x10, "-//WIRELESSVILLAGE//DTD CSP 1.1//EN"
1096 " (Wireless Village Client-Server Protocol DTD v1.1)" },
1097 { 0x11, "-//OMA//DTD WV-CSP 1.2//EN (OMA IMPS - CSP protocol DTD v1.2)" },
1098 { 0x12, "-//OMA//DTD IMPS-CSP 1.3//EN (OMA IMPS - CSP protocol DTD v1.3)" },
1099 { 0x13, "-//OMA//DRM 2.1//EN (OMA DRM 2.1)" },
1100 /* 0x14 -- 0x7F: reserved */
1102 /* Registered values - www.syncml.org */
1103 { 0x0fd1, "-//SYNCML//DTD SyncML 1.0//EN (SyncML 1.0)" },
1104 { 0x0fd3, "-//SYNCML//DTD SyncML 1.1//EN (SyncML 1.1)" },
1106 /* Registered values - www.wapforum.org/wina/ */
1107 { 0x1100, "-//PHONE.COM//DTD ALERT 1.0//EN" },
1108 { 0x1101, "-//PHONE.COM//DTD CACHE-OPERATION 1.0//EN" },
1109 { 0x1102, "-//PHONE.COM//DTD SIGNAL 1.0//EN" },
1110 { 0x1103, "-//PHONE.COM//DTD LIST 1.0//EN" },
1111 { 0x1104, "-//PHONE.COM//DTD LISTCMD 1.0//EN" },
1112 { 0x1105, "-//PHONE.COM//DTD CHANNEL 1.0//EN" },
1113 { 0x1106, "-//PHONE.COM//DTD MMC 1.0//EN" },
1114 { 0x1107, "-//PHONE.COM//DTD BEARER-CHOICE 1.0//EN" },
1115 { 0x1108, "-//PHONE.COM//DTD WML 1.1//EN (WML+ 1.1)" },
1116 { 0x1109, "-//PHONE.COM//DTD CHANNEL 1.1//EN" },
1117 { 0x110a, "-//PHONE.COM//DTD LIST 1.1//EN" },
1118 { 0x110b, "-//PHONE.COM//DTD LISTCMD 1.1//EN" },
1119 { 0x110c, "-//PHONE.COM//DTD MMC 1.1//EN" },
1120 { 0x110d, "-//PHONE.COM//DTD WML 1.3//EN (WML+ 1.3)" },
1121 { 0x110e, "-//PHONE.COM//DTD MMC 2.0//EN" },
1122 /* 0x110F -- 0x11FF: unassigned */
1123 { 0x1200, "-//3GPP2.COM//DTD IOTA 1.0//EN" },
1124 { 0x1201, "-//SYNCML//DTD SyncML 1.2//EN" },
1125 { 0x1202, "-//SYNCML//DTD MetaInf 1.2//EN" },
1126 { 0x1203, "-//SYNCML//DTD DevInf 1.2//EN" },
1127 { 0x1204, "-//NOKIA//DTD LANDMARKS 1.0//EN" },
1129 { 0x00, NULL }
1131 static value_string_ext vals_wbxml_public_ids_ext = VALUE_STRING_EXT_INIT(vals_wbxml_public_ids);
1133 static const value_string vals_wbxml_versions[] = {
1134 { 0x00, "1.0" }, /* WAP-104-WBXML */
1135 { 0x01, "1.1" }, /* WAP-135-WBXML */
1136 { 0x02, "1.2" }, /* WAP-154-WBXML */
1137 { 0x03, "1.3" }, /* WAP-192-WBXML */
1139 { 0x00, NULL }
1141 static value_string_ext vals_wbxml_versions_ext = VALUE_STRING_EXT_INIT(vals_wbxml_versions);
1143 /* WBXML 1.0 global tokens: WAP-104-WBXML
1144 * Same token mapping as in vals_wbxml1x_global_tokens, but:
1145 * { 0xC3, "RESERVED_2" }
1148 /* WBXML 1.x (x>0) global tokens: WAP-135-WBXML, WAP-154-WBXML, WAP-192-WBXML
1150 static const value_string vals_wbxml1x_global_tokens[] = {
1151 { 0x00, "SWITCH_PAGE" },
1152 { 0x01, "END" },
1153 { 0x02, "ENTITY" },
1154 { 0x03, "STR_I" },
1155 { 0x04, "LITERAL" },
1157 { 0x40, "EXT_I_0" },
1158 { 0x41, "EXT_I_1" },
1159 { 0x42, "EXT_I_2" },
1160 { 0x43, "PI" },
1161 { 0x44, "LITERAL_C" },
1163 { 0x80, "EXT_T_0" },
1164 { 0x81, "EXT_T_1" },
1165 { 0x82, "EXT_T_2" },
1166 { 0x83, "STR_T" },
1167 { 0x84, "LITERAL_A" },
1169 { 0xC0, "EXT_0" },
1170 { 0xC1, "EXT_1" },
1171 { 0xC2, "EXT_2" },
1172 { 0xC3, "OPAQUE" },
1173 { 0xC4, "LITERAL_AC" },
1175 { 0x00, NULL }
1177 static value_string_ext vals_wbxml1x_global_tokens_ext = VALUE_STRING_EXT_INIT(vals_wbxml1x_global_tokens);
1183 /********************** WBXML token mapping definition **********************/
1186 * NOTE: Please make sure the Attribute Start values all contain an equal sign
1187 * even in cases where they do not contain the start of an Attribute
1188 * Value.
1192 /* WML 1.0
1194 * Wireless Markup Language
1195 ***************************************/
1196 static char *
1197 ext_t_0_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
1199 char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - escaped: '%s'",
1200 tvb_get_const_stringz(tvb, str_tbl + value, NULL));
1201 return str;
1204 static char *
1205 ext_t_1_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
1207 char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - unescaped: '%s'",
1208 tvb_get_const_stringz(tvb, str_tbl + value, NULL));
1209 return str;
1212 static char *
1213 ext_t_2_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
1215 char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - no transformation: '%s'",
1216 tvb_get_const_stringz(tvb, str_tbl + value, NULL));
1217 return str;
1219 /***** Global extension tokens *****/
1220 static const value_string wbxml_wmlc10_global_cp0[] = {
1221 { 0x40, "Variable substitution - escaped" },
1222 { 0x41, "Variable substitution - unescaped" },
1223 { 0x42, "Variable substitution - no transformation" },
1224 { 0x80, "Variable substitution - escaped" },
1225 { 0x81, "Variable substitution - unescaped" },
1226 { 0x82, "Variable substitution - no transformation" },
1227 { 0xC0, "Reserved" },
1228 { 0xC1, "Reserved" },
1229 { 0xC2, "Reserved" },
1231 { 0x00, NULL }
1234 /***** Tag tokens *****/
1235 static const value_string wbxml_wmlc10_tags_cp0[] = {
1236 /* 0x00 -- 0x04 GLOBAL */
1237 /* 0x05 -- 0x21 */
1238 { 0x22, "A" },
1239 { 0x23, "ACCESS" },
1240 { 0x24, "B" },
1241 { 0x25, "BIG" },
1242 { 0x26, "BR" },
1243 { 0x27, "CARD" },
1244 { 0x28, "DO" },
1245 { 0x29, "EM" },
1246 { 0x2A, "FIELDSET" },
1247 { 0x2B, "GO" },
1248 { 0x2C, "HEAD" },
1249 { 0x2D, "I" },
1250 { 0x2E, "IMG" },
1251 { 0x2F, "INPUT" },
1252 { 0x30, "META" },
1253 { 0x31, "NOOP" },
1254 { 0x32, "PREV" },
1255 { 0x33, "ONEVENT" },
1256 { 0x34, "OPTGROUP" },
1257 { 0x35, "OPTION" },
1258 { 0x36, "REFRESH" },
1259 { 0x37, "SELECT" },
1260 { 0x38, "SMALL" },
1261 { 0x39, "STRONG" },
1262 { 0x3A, "TAB" },
1263 { 0x3B, "TEMPLATE" },
1264 { 0x3C, "TIMER" },
1265 { 0x3D, "U" },
1266 { 0x3E, "VAR" },
1267 { 0x3F, "WML" },
1269 { 0x00, NULL }
1272 /***** Attribute Start tokens *****/
1273 static const value_string wbxml_wmlc10_attrStart_cp0[] = {
1274 /* 0x00 -- 0x04 GLOBAL */
1275 { 0x05, "ACCEPT-CHARSET=" },
1276 { 0x06, "ALIGN='BOTTOM'" },
1277 { 0x07, "ALIGN='CENTER'" },
1278 { 0x08, "ALIGN='LEFT'" },
1279 { 0x09, "ALIGN='MIDDLE'" },
1280 { 0x0A, "ALIGN='RIGHT'" },
1281 { 0x0B, "ALIGN='TOP'" },
1282 { 0x0C, "ALT=" },
1283 { 0x0D, "CONTENT=" },
1284 { 0x0E, "DEFAULT=" },
1285 { 0x0F, "DOMAIN=" },
1286 { 0x10, "EMPTYOK='FALSE'" },
1287 { 0x11, "EMPTYOK='TRUE'" },
1288 { 0x12, "FORMAT=" },
1289 { 0x13, "HEIGHT=" },
1290 { 0x14, "HSPACE=" },
1291 { 0x15, "IDEFAULT=" },
1292 { 0x16, "IKEY=" },
1293 { 0x17, "KEY=" },
1294 { 0x18, "LABEL=" },
1295 { 0x19, "LOCALSRC=" },
1296 { 0x1A, "MAXLENGTH=" },
1297 { 0x1B, "METHOD='GET'" },
1298 { 0x1C, "METHOD='POST'" },
1299 { 0x1D, "MODE='NOWRAP'" },
1300 { 0x1E, "MODE='WRAP'" },
1301 { 0x1F, "MULTIPLE='FALSE'" },
1302 { 0x20, "MULTIPLE='TRUE'" },
1303 { 0x21, "NAME=" },
1304 { 0x22, "NEWCONTEXT='FALSE'" },
1305 { 0x23, "NEWCONTEXT='TRUE'" },
1306 { 0x24, "ONCLICK=" },
1307 { 0x25, "ONENTERBACKWARD=" },
1308 { 0x26, "ONENTERFORWARD=" },
1309 { 0x27, "ONTIMER=" },
1310 { 0x28, "OPTIONAL='FALSE'" },
1311 { 0x29, "OPTIONAL='TRUE'" },
1312 { 0x2A, "PATH=" },
1313 { 0x2B, "POSTDATA=" },
1314 { 0x2C, "PUBLIC='FALSE'" },
1315 { 0x2D, "PUBLIC='TRUE'" },
1316 { 0x2E, "SCHEME=" },
1317 { 0x2F, "SENDREFERER='FALSE'" },
1318 { 0x30, "SENDREFERER='TRUE'" },
1319 { 0x31, "SIZE=" },
1320 { 0x32, "SRC=" },
1321 { 0x33, "STYLE='LIST'" },
1322 { 0x34, "STYLE='SET'" },
1323 { 0x35, "TABINDEX=" },
1324 { 0x36, "TITLE=" },
1325 { 0x37, "TYPE=" },
1326 { 0x38, "TYPE='ACCEPT'" },
1327 { 0x39, "TYPE='DELETE'" },
1328 { 0x3A, "TYPE='HELP'" },
1329 { 0x3B, "TYPE='PASSWORD'" },
1330 { 0x3C, "TYPE='ONCLICK'" },
1331 { 0x3D, "TYPE='ONENTERBACKWARD'" },
1332 { 0x3E, "TYPE='ONENTERFORWARD'" },
1333 { 0x3F, "TYPE='ONTIMER'" },
1334 /* 0x40 -- 0x44 GLOBAL */
1335 { 0x45, "TYPE='OPTIONS'" },
1336 { 0x46, "TYPE='PREV'" },
1337 { 0x47, "TYPE='RESET'" },
1338 { 0x48, "TYPE='TEXT'" },
1339 { 0x49, "TYPE='vnd.'" },
1340 { 0x4A, "URL=" },
1341 { 0x4B, "URL='http://'" },
1342 { 0x4C, "URL='https://'" },
1343 { 0x4D, "USER-AGENT=" },
1344 { 0x4E, "VALUE=" },
1345 { 0x4F, "VSPACE=" },
1346 { 0x50, "WIDTH=" },
1347 { 0x51, "xml:lang=" },
1349 { 0x00, NULL }
1352 /***** Attribute Value tokens *****/
1353 static const value_string wbxml_wmlc10_attrValue_cp0[] = {
1354 /* 0x80 -- 0x84 GLOBAL */
1355 { 0x85, "'.com/'" },
1356 { 0x86, "'.edu/'" },
1357 { 0x87, "'.net/'" },
1358 { 0x88, "'.org/'" },
1359 { 0x89, "'ACCEPT'" },
1360 { 0x8A, "'BOTTOM'" },
1361 { 0x8B, "'CLEAR'" },
1362 { 0x8C, "'DELETE'" },
1363 { 0x8D, "'HELP'" },
1364 { 0x8E, "'http://'" },
1365 { 0x8F, "'http://www.'" },
1366 { 0x90, "'https://'" },
1367 { 0x91, "'https://www.'" },
1368 { 0x92, "'LIST'" },
1369 { 0x93, "'MIDDLE'" },
1370 { 0x94, "'NOWRAP'" },
1371 { 0x95, "'ONCLICK'" },
1372 { 0x96, "'ONENTERBACKWARD'" },
1373 { 0x97, "'ONENTERFORWARD'" },
1374 { 0x98, "'ONTIMER'" },
1375 { 0x99, "'OPTIONS'" },
1376 { 0x9A, "'PASSWORD'" },
1377 { 0x9B, "'RESET'" },
1378 { 0x9C, "'SET'" },
1379 { 0x9D, "'TEXT'" },
1380 { 0x9E, "'TOP'" },
1381 { 0x9F, "'UNKNOWN'" },
1382 { 0xA0, "'WRAP'" },
1383 { 0xA1, "'www.'" },
1385 { 0x00, NULL }
1388 /***** Token code page aggregation *****/
1389 static const value_valuestring wbxml_wmlc10_global[] = {
1390 { 0, wbxml_wmlc10_global_cp0 },
1391 { 0, NULL }
1394 static const value_valuestring wbxml_wmlc10_tags[] = {
1395 { 0, wbxml_wmlc10_tags_cp0 },
1396 { 0, NULL }
1399 static const value_valuestring wbxml_wmlc10_attrStart[] = {
1400 { 0, wbxml_wmlc10_attrStart_cp0 },
1401 { 0, NULL }
1404 static const value_valuestring wbxml_wmlc10_attrValue[] = {
1405 { 0, wbxml_wmlc10_attrValue_cp0 },
1406 { 0, NULL }
1409 static const wbxml_decoding decode_wmlc_10 = {
1410 "Wireless Markup Language 1.0",
1411 "WML 1.0",
1412 { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 },
1413 default_opaque_binary_tag,
1414 default_opaque_literal_tag,
1415 default_opaque_binary_attr,
1416 default_opaque_literal_attr,
1417 wbxml_wmlc10_global,
1418 wbxml_wmlc10_tags,
1419 wbxml_wmlc10_attrStart,
1420 wbxml_wmlc10_attrValue
1426 /* WML 1.1
1428 * Wireless Markup Language
1429 ***************************************/
1431 /***** Global extension tokens *****/
1432 /* Same as in WML 1.0 */
1434 /***** Tag tokens *****/
1435 static const value_string wbxml_wmlc11_tags_cp0[] = {
1436 /* 0x00 -- 0x04 GLOBAL */
1437 /* 0x05 -- 0x1B */
1438 { 0x1C, "a" },
1439 { 0x1D, "td" },
1440 { 0x1E, "tr" },
1441 { 0x1F, "table" },
1442 { 0x20, "p" },
1443 { 0x21, "postfield" },
1444 { 0x22, "anchor" },
1445 { 0x23, "access" },
1446 { 0x24, "b" },
1447 { 0x25, "big" },
1448 { 0x26, "br" },
1449 { 0x27, "card" },
1450 { 0x28, "do" },
1451 { 0x29, "em" },
1452 { 0x2A, "fieldset" },
1453 { 0x2B, "go" },
1454 { 0x2C, "head" },
1455 { 0x2D, "i" },
1456 { 0x2E, "img" },
1457 { 0x2F, "input" },
1458 { 0x30, "meta" },
1459 { 0x31, "noop" },
1460 { 0x32, "prev" },
1461 { 0x33, "onevent" },
1462 { 0x34, "optgroup" },
1463 { 0x35, "option" },
1464 { 0x36, "refresh" },
1465 { 0x37, "select" },
1466 { 0x38, "small" },
1467 { 0x39, "strong" },
1468 /* 0x3A */
1469 { 0x3B, "template" },
1470 { 0x3C, "timer" },
1471 { 0x3D, "u" },
1472 { 0x3E, "setvar" },
1473 { 0x3F, "wml" },
1475 { 0x00, NULL }
1478 /***** Attribute Start tokens *****/
1479 static const value_string wbxml_wmlc11_attrStart_cp0[] = {
1480 /* 0x00 -- 0x04 GLOBAL */
1481 { 0x05, "accept-charset=" },
1482 { 0x06, "align='bottom'" },
1483 { 0x07, "align='center'" },
1484 { 0x08, "align='left'" },
1485 { 0x09, "align='middle'" },
1486 { 0x0A, "align='right'" },
1487 { 0x0B, "align='top'" },
1488 { 0x0C, "alt=" },
1489 { 0x0D, "content=" },
1490 /* 0x0E */
1491 { 0x0F, "domain=" },
1492 { 0x10, "emptyok='false'" },
1493 { 0x11, "emptyok='true'" },
1494 { 0x12, "format=" },
1495 { 0x13, "height=" },
1496 { 0x14, "hspace=" },
1497 { 0x15, "ivalue=" },
1498 { 0x16, "iname=" },
1499 /* 0x17 */
1500 { 0x18, "label=" },
1501 { 0x19, "localsrc=" },
1502 { 0x1A, "maxlength=" },
1503 { 0x1B, "method='get'" },
1504 { 0x1C, "method='post'" },
1505 { 0x1D, "mode='nowrap'" },
1506 { 0x1E, "mode='wrap'" },
1507 { 0x1F, "multiple='false'" },
1508 { 0x20, "multiple='true'" },
1509 { 0x21, "name=" },
1510 { 0x22, "newcontext='false'" },
1511 { 0x23, "newcontext='true'" },
1512 { 0x24, "onpick=" },
1513 { 0x25, "onenterbackward=" },
1514 { 0x26, "onenterforward=" },
1515 { 0x27, "ontimer=" },
1516 { 0x28, "optional='false'" },
1517 { 0x29, "optional='true'" },
1518 { 0x2A, "path=" },
1519 /* 0x2B -- 0x2D */
1520 { 0x2E, "scheme=" },
1521 { 0x2F, "sendreferer='false'" },
1522 { 0x30, "sendreferer='true'" },
1523 { 0x31, "size=" },
1524 { 0x32, "src=" },
1525 { 0x33, "ordered='false'" },
1526 { 0x34, "ordered='true'" },
1527 { 0x35, "tabindex=" },
1528 { 0x36, "title=" },
1529 { 0x37, "type=" },
1530 { 0x38, "type='accept'" },
1531 { 0x39, "type='delete'" },
1532 { 0x3A, "type='help'" },
1533 { 0x3B, "type='password'" },
1534 { 0x3C, "type='onpick'" },
1535 { 0x3D, "type='onenterbackward'" },
1536 { 0x3E, "type='onenterforward'" },
1537 { 0x3F, "type='ontimer'" },
1538 /* 0x40 -- 0x44 GLOBAL */
1539 { 0x45, "type='options'" },
1540 { 0x46, "type='prev'" },
1541 { 0x47, "type='reset'" },
1542 { 0x48, "type='text'" },
1543 { 0x49, "type='vnd.'" },
1544 { 0x4A, "href=" },
1545 { 0x4B, "href='http://'" },
1546 { 0x4C, "href='https://'" },
1547 { 0x4D, "value=" },
1548 { 0x4E, "vspace=" },
1549 { 0x4F, "width=" },
1550 { 0x50, "xml:lang=" },
1551 /* 0x51 */
1552 { 0x52, "align=" },
1553 { 0x53, "columns=" },
1554 { 0x54, "class=" },
1555 { 0x55, "id=" },
1556 { 0x56, "forua='false'" },
1557 { 0x57, "forua='true'" },
1558 { 0x58, "src='http://'" },
1559 { 0x59, "src='https://'" },
1560 { 0x5A, "http-equiv=" },
1561 { 0x5B, "http-equiv='Content-Type'" },
1562 { 0x5C, "content='application/vnd.wap.wmlc;charset='" },
1563 { 0x5D, "http-equiv='Expires'" },
1565 { 0x00, NULL }
1568 /***** Attribute Value tokens *****/
1569 static const value_string wbxml_wmlc11_attrValue_cp0[] = {
1570 /* 0x80 -- 0x84 GLOBAL */
1571 { 0x85, "'.com/'" },
1572 { 0x86, "'.edu/'" },
1573 { 0x87, "'.net/'" },
1574 { 0x88, "'.org/'" },
1575 { 0x89, "'accept'" },
1576 { 0x8A, "'bottom'" },
1577 { 0x8B, "'clear'" },
1578 { 0x8C, "'delete'" },
1579 { 0x8D, "'help'" },
1580 { 0x8E, "'http://'" },
1581 { 0x8F, "'http://www.'" },
1582 { 0x90, "'https://'" },
1583 { 0x91, "'https://www.'" },
1584 /* 0x92 */
1585 { 0x93, "'middle'" },
1586 { 0x94, "'nowrap'" },
1587 { 0x95, "'onpick'" },
1588 { 0x96, "'onenterbackward'" },
1589 { 0x97, "'onenterforward'" },
1590 { 0x98, "'ontimer'" },
1591 { 0x99, "'options'" },
1592 { 0x9A, "'password'" },
1593 { 0x9B, "'reset'" },
1594 /* 0x9C */
1595 { 0x9D, "'text'" },
1596 { 0x9E, "'top'" },
1597 { 0x9F, "'unknown'" },
1598 { 0xA0, "'wrap'" },
1599 { 0xA1, "'www.'" },
1601 { 0x00, NULL }
1604 /***** Token code page aggregation *****/
1605 static const value_valuestring wbxml_wmlc11_global[] = {
1606 { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */
1607 { 0, NULL }
1610 static const value_valuestring wbxml_wmlc11_tags[] = {
1611 { 0, wbxml_wmlc11_tags_cp0 },
1612 { 0, NULL }
1615 static const value_valuestring wbxml_wmlc11_attrStart[] = {
1616 { 0, wbxml_wmlc11_attrStart_cp0 },
1617 { 0, NULL }
1620 static const value_valuestring wbxml_wmlc11_attrValue[] = {
1621 { 0, wbxml_wmlc11_attrValue_cp0 },
1622 { 0, NULL }
1625 static const wbxml_decoding decode_wmlc_11 = {
1626 "Wireless Markup Language 1.1",
1627 "WML 1.1",
1628 { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 },
1629 default_opaque_binary_tag,
1630 default_opaque_literal_tag,
1631 default_opaque_binary_attr,
1632 default_opaque_literal_attr,
1633 wbxml_wmlc11_global,
1634 wbxml_wmlc11_tags,
1635 wbxml_wmlc11_attrStart,
1636 wbxml_wmlc11_attrValue
1643 /* WML 1.2
1645 * Wireless Markup Language
1646 ***************************************/
1648 /***** Global extension tokens *****/
1649 /* Same as in WML 1.0 */
1651 /***** Tag tokens *****/
1652 static const value_string wbxml_wmlc12_tags_cp0[] = {
1653 /* 0x00 -- 0x04 GLOBAL */
1654 /* 0x05 -- 0x1A */
1655 { 0x1B, "pre" },
1656 { 0x1C, "a" },
1657 { 0x1D, "td" },
1658 { 0x1E, "tr" },
1659 { 0x1F, "table" },
1660 { 0x20, "p" },
1661 { 0x21, "postfield" },
1662 { 0x22, "anchor" },
1663 { 0x23, "access" },
1664 { 0x24, "b" },
1665 { 0x25, "big" },
1666 { 0x26, "br" },
1667 { 0x27, "card" },
1668 { 0x28, "do" },
1669 { 0x29, "em" },
1670 { 0x2A, "fieldset" },
1671 { 0x2B, "go" },
1672 { 0x2C, "head" },
1673 { 0x2D, "i" },
1674 { 0x2E, "img" },
1675 { 0x2F, "input" },
1676 { 0x30, "meta" },
1677 { 0x31, "noop" },
1678 { 0x32, "prev" },
1679 { 0x33, "onevent" },
1680 { 0x34, "optgroup" },
1681 { 0x35, "option" },
1682 { 0x36, "refresh" },
1683 { 0x37, "select" },
1684 { 0x38, "small" },
1685 { 0x39, "strong" },
1686 /* 0x3A */
1687 { 0x3B, "template" },
1688 { 0x3C, "timer" },
1689 { 0x3D, "u" },
1690 { 0x3E, "setvar" },
1691 { 0x3F, "wml" },
1693 { 0x00, NULL }
1696 /***** Attribute Start tokens *****/
1697 static const value_string wbxml_wmlc12_attrStart_cp0[] = {
1698 /* 0x00 -- 0x04 GLOBAL */
1699 { 0x05, "accept-charset=" },
1700 { 0x06, "align='bottom'" },
1701 { 0x07, "align='center'" },
1702 { 0x08, "align='left'" },
1703 { 0x09, "align='middle'" },
1704 { 0x0A, "align='right'" },
1705 { 0x0B, "align='top'" },
1706 { 0x0C, "alt=" },
1707 { 0x0D, "content=" },
1708 /* 0x0E */
1709 { 0x0F, "domain=" },
1710 { 0x10, "emptyok='false'" },
1711 { 0x11, "emptyok='true'" },
1712 { 0x12, "format=" },
1713 { 0x13, "height=" },
1714 { 0x14, "hspace=" },
1715 { 0x15, "ivalue=" },
1716 { 0x16, "iname=" },
1717 /* 0x17 */
1718 { 0x18, "label=" },
1719 { 0x19, "localsrc=" },
1720 { 0x1A, "maxlength=" },
1721 { 0x1B, "method='get'" },
1722 { 0x1C, "method='post'" },
1723 { 0x1D, "mode='nowrap'" },
1724 { 0x1E, "mode='wrap'" },
1725 { 0x1F, "multiple='false'" },
1726 { 0x20, "multiple='true'" },
1727 { 0x21, "name=" },
1728 { 0x22, "newcontext='false'" },
1729 { 0x23, "newcontext='true'" },
1730 { 0x24, "onpick=" },
1731 { 0x25, "onenterbackward=" },
1732 { 0x26, "onenterforward=" },
1733 { 0x27, "ontimer=" },
1734 { 0x28, "optional='false'" },
1735 { 0x29, "optional='true'" },
1736 { 0x2A, "path=" },
1737 /* 0x2B -- 0x2D */
1738 { 0x2E, "scheme=" },
1739 { 0x2F, "sendreferer='false'" },
1740 { 0x30, "sendreferer='true'" },
1741 { 0x31, "size=" },
1742 { 0x32, "src=" },
1743 { 0x33, "ordered='false'" },
1744 { 0x34, "ordered='true'" },
1745 { 0x35, "tabindex=" },
1746 { 0x36, "title=" },
1747 { 0x37, "type=" },
1748 { 0x38, "type='accept'" },
1749 { 0x39, "type='delete'" },
1750 { 0x3A, "type='help'" },
1751 { 0x3B, "type='password'" },
1752 { 0x3C, "type='onpick'" },
1753 { 0x3D, "type='onenterbackward'" },
1754 { 0x3E, "type='onenterforward'" },
1755 { 0x3F, "type='ontimer'" },
1756 /* 0x40 -- 0x44 GLOBAL */
1757 { 0x45, "type='options'" },
1758 { 0x46, "type='prev'" },
1759 { 0x47, "type='reset'" },
1760 { 0x48, "type='text'" },
1761 { 0x49, "type='vnd.'" },
1762 { 0x4A, "href=" },
1763 { 0x4B, "href='http://'" },
1764 { 0x4C, "href='https://'" },
1765 { 0x4D, "value=" },
1766 { 0x4E, "vspace=" },
1767 { 0x4F, "width=" },
1768 { 0x50, "xml:lang=" },
1769 /* 0x51 */
1770 { 0x52, "align=" },
1771 { 0x53, "columns=" },
1772 { 0x54, "class=" },
1773 { 0x55, "id=" },
1774 { 0x56, "forua='false'" },
1775 { 0x57, "forua='true'" },
1776 { 0x58, "src='http://'" },
1777 { 0x59, "src='https://'" },
1778 { 0x5A, "http-equiv=" },
1779 { 0x5B, "http-equiv='Content-Type'" },
1780 { 0x5C, "content='application/vnd.wap.wmlc;charset='" },
1781 { 0x5D, "http-equiv='Expires'" },
1782 { 0x5E, "accesskey=" },
1783 { 0x5F, "enctype=" },
1784 { 0x60, "enctype='application/x-www-form-urlencoded'" },
1785 { 0x61, "enctype='multipart/form-data'" },
1787 { 0x00, NULL }
1790 /***** Attribute Value tokens *****/
1791 /* Same as in WML 1.1 */
1793 /***** Token code page aggregation *****/
1794 static const value_valuestring wbxml_wmlc12_global[] = {
1795 { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */
1796 { 0, NULL }
1799 static const value_valuestring wbxml_wmlc12_tags[] = {
1800 { 0, wbxml_wmlc12_tags_cp0 },
1801 { 0, NULL }
1804 static const value_valuestring wbxml_wmlc12_attrStart[] = {
1805 { 0, wbxml_wmlc12_attrStart_cp0 },
1806 { 0, NULL }
1809 static const value_valuestring wbxml_wmlc12_attrValue[] = {
1810 { 0, wbxml_wmlc11_attrValue_cp0 }, /* Same as WML 1.1 */
1811 { 0, NULL }
1814 static const wbxml_decoding decode_wmlc_12 = {
1815 "Wireless Markup Language 1.2",
1816 "WML 1.2",
1817 { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 },
1818 default_opaque_binary_tag,
1819 default_opaque_literal_tag,
1820 default_opaque_binary_attr,
1821 default_opaque_literal_attr,
1822 wbxml_wmlc12_global,
1823 wbxml_wmlc12_tags,
1824 wbxml_wmlc12_attrStart,
1825 wbxml_wmlc12_attrValue
1832 /* WML 1.3
1834 * Wireless Markup Language
1835 ***************************************/
1837 /***** Global extension tokens *****/
1838 /* Same as in WML 1.0 */
1840 /***** Tag tokens *****/
1841 /* Same as in WML 1.2 */
1843 /***** Attribute Start tokens *****/
1844 static const value_string wbxml_wmlc13_attrStart_cp0[] = {
1845 /* 0x00 -- 0x04 GLOBAL */
1846 { 0x05, "accept-charset=" },
1847 { 0x06, "align='bottom'" },
1848 { 0x07, "align='center'" },
1849 { 0x08, "align='left'" },
1850 { 0x09, "align='middle'" },
1851 { 0x0A, "align='right'" },
1852 { 0x0B, "align='top'" },
1853 { 0x0C, "alt=" },
1854 { 0x0D, "content=" },
1855 /* 0x0E */
1856 { 0x0F, "domain=" },
1857 { 0x10, "emptyok='false'" },
1858 { 0x11, "emptyok='true'" },
1859 { 0x12, "format=" },
1860 { 0x13, "height=" },
1861 { 0x14, "hspace=" },
1862 { 0x15, "ivalue=" },
1863 { 0x16, "iname=" },
1864 /* 0x17 */
1865 { 0x18, "label=" },
1866 { 0x19, "localsrc=" },
1867 { 0x1A, "maxlength=" },
1868 { 0x1B, "method='get'" },
1869 { 0x1C, "method='post'" },
1870 { 0x1D, "mode='nowrap'" },
1871 { 0x1E, "mode='wrap'" },
1872 { 0x1F, "multiple='false'" },
1873 { 0x20, "multiple='true'" },
1874 { 0x21, "name=" },
1875 { 0x22, "newcontext='false'" },
1876 { 0x23, "newcontext='true'" },
1877 { 0x24, "onpick=" },
1878 { 0x25, "onenterbackward=" },
1879 { 0x26, "onenterforward=" },
1880 { 0x27, "ontimer=" },
1881 { 0x28, "optional='false'" },
1882 { 0x29, "optional='true'" },
1883 { 0x2A, "path=" },
1884 /* 0x2B -- 0x2D */
1885 { 0x2E, "scheme=" },
1886 { 0x2F, "sendreferer='false'" },
1887 { 0x30, "sendreferer='true'" },
1888 { 0x31, "size=" },
1889 { 0x32, "src=" },
1890 { 0x33, "ordered='false'" },
1891 { 0x34, "ordered='true'" },
1892 { 0x35, "tabindex=" },
1893 { 0x36, "title=" },
1894 { 0x37, "type=" },
1895 { 0x38, "type='accept'" },
1896 { 0x39, "type='delete'" },
1897 { 0x3A, "type='help'" },
1898 { 0x3B, "type='password'" },
1899 { 0x3C, "type='onpick'" },
1900 { 0x3D, "type='onenterbackward'" },
1901 { 0x3E, "type='onenterforward'" },
1902 { 0x3F, "type='ontimer'" },
1903 /* 0x40 -- 0x44 GLOBAL */
1904 { 0x45, "type='options'" },
1905 { 0x46, "type='prev'" },
1906 { 0x47, "type='reset'" },
1907 { 0x48, "type='text'" },
1908 { 0x49, "type='vnd.'" },
1909 { 0x4A, "href=" },
1910 { 0x4B, "href='http://'" },
1911 { 0x4C, "href='https://'" },
1912 { 0x4D, "value=" },
1913 { 0x4E, "vspace=" },
1914 { 0x4F, "width=" },
1915 { 0x50, "xml:lang=" },
1916 /* 0x51 */
1917 { 0x52, "align=" },
1918 { 0x53, "columns=" },
1919 { 0x54, "class=" },
1920 { 0x55, "id=" },
1921 { 0x56, "forua='false'" },
1922 { 0x57, "forua='true'" },
1923 { 0x58, "src='http://'" },
1924 { 0x59, "src='https://'" },
1925 { 0x5A, "http-equiv=" },
1926 { 0x5B, "http-equiv='Content-Type'" },
1927 { 0x5C, "content='application/vnd.wap.wmlc;charset='" },
1928 { 0x5D, "http-equiv='Expires'" },
1929 { 0x5E, "accesskey=" },
1930 { 0x5F, "enctype=" },
1931 { 0x60, "enctype='application/x-www-form-urlencoded'" },
1932 { 0x61, "enctype='multipart/form-data'" },
1933 { 0x62, "xml:space='preserve'" },
1934 { 0x63, "xml:space='default'" },
1935 { 0x64, "cache-control='no-cache'" },
1937 { 0x00, NULL }
1940 /***** Attribute Value tokens *****/
1941 /* Same as in WML 1.1 */
1943 /***** Token code page aggregation *****/
1944 static const value_valuestring wbxml_wmlc13_global[] = {
1945 { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */
1946 { 0, NULL }
1949 static const value_valuestring wbxml_wmlc13_tags[] = {
1950 { 0, wbxml_wmlc12_tags_cp0 },
1951 { 0, NULL }
1954 static const value_valuestring wbxml_wmlc13_attrStart[] = {
1955 { 0, wbxml_wmlc13_attrStart_cp0 },
1956 { 0, NULL }
1959 static const value_valuestring wbxml_wmlc13_attrValue[] = {
1960 { 0, wbxml_wmlc11_attrValue_cp0 }, /* Same as WML 1.1 */
1961 { 0, NULL }
1964 static const wbxml_decoding decode_wmlc_13 = {
1965 "Wireless Markup Language 1.3",
1966 "WML 1.3",
1967 { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 },
1968 default_opaque_binary_tag,
1969 default_opaque_literal_tag,
1970 default_opaque_binary_attr,
1971 default_opaque_literal_attr,
1972 wbxml_wmlc13_global,
1973 wbxml_wmlc13_tags,
1974 wbxml_wmlc13_attrStart,
1975 wbxml_wmlc13_attrValue
1982 /* SI 1.0
1984 * Service Indication
1985 ***************************************/
1987 /***** Global extension tokens *****/
1989 /***** Tag tokens *****/
1990 static const value_string wbxml_sic10_tags_cp0[] = {
1991 /* 0x00 -- 0x04 GLOBAL */
1992 { 0x05, "si" },
1993 { 0x06, "indication" },
1994 { 0x07, "info" },
1995 { 0x08, "item" },
1997 { 0x00, NULL }
2000 /***** Attribute Start tokens *****/
2001 static const value_string wbxml_sic10_attrStart_cp0[] = {
2002 /* 0x00 -- 0x04 GLOBAL */
2003 { 0x05, "action='signal-none'" },
2004 { 0x06, "action='signal-low'" },
2005 { 0x07, "action='signal-medium'" },
2006 { 0x08, "action='signal-high'" },
2007 { 0x09, "action='delete'" },
2008 { 0x0a, "created=" },
2009 { 0x0b, "href=" },
2010 { 0x0c, "href='http://'" },
2011 { 0x0d, "href='http://www.'" },
2012 { 0x0e, "href='https://'" },
2013 { 0x0f, "href='https://www.'" },
2014 { 0x10, "si-expires=" },
2015 { 0x11, "si-id=" },
2016 { 0x12, "class=" },
2018 { 0x00, NULL }
2021 /***** Attribute Value tokens *****/
2022 static const value_string wbxml_sic10_attrValue_cp0[] = {
2023 /* 0x80 -- 0x84 GLOBAL */
2024 { 0x85, "'.com/'" },
2025 { 0x86, "'.edu/'" },
2026 { 0x87, "'.net/'" },
2027 { 0x88, "'.org/'" },
2029 { 0x00, NULL }
2032 /***** Token code page aggregation *****/
2033 static const value_valuestring wbxml_sic10_tags[] = {
2034 { 0, wbxml_sic10_tags_cp0 },
2035 { 0, NULL }
2038 static const value_valuestring wbxml_sic10_attrStart[] = {
2039 { 0, wbxml_sic10_attrStart_cp0 },
2040 { 0, NULL }
2043 static const value_valuestring wbxml_sic10_attrValue[] = {
2044 { 0, wbxml_sic10_attrValue_cp0 },
2045 { 0, NULL }
2048 static const wbxml_decoding decode_sic_10 = {
2049 "Service Indication 1.0",
2050 "SI 1.0",
2051 { NULL, NULL, NULL },
2052 default_opaque_binary_tag,
2053 default_opaque_literal_tag,
2054 sic10_opaque_binary_attr,
2055 sic10_opaque_literal_attr,
2056 NULL,
2057 wbxml_sic10_tags,
2058 wbxml_sic10_attrStart,
2059 wbxml_sic10_attrValue
2066 /* SL 1.0
2068 * Service Loading
2069 ***************************************/
2071 /***** Global extension tokens *****/
2073 /***** Tag tokens *****/
2074 static const value_string wbxml_slc10_tags_cp0[] = {
2075 /* 0x00 -- 0x04 GLOBAL */
2076 { 0x05, "sl" },
2078 { 0x00, NULL }
2081 /***** Attribute Start tokens *****/
2082 static const value_string wbxml_slc10_attrStart_cp0[] = {
2083 /* 0x00 -- 0x04 GLOBAL */
2084 { 0x05, "action='execute-low'" },
2085 { 0x06, "action='execute-high'" },
2086 { 0x07, "action='cache'" },
2087 { 0x08, "href=" },
2088 { 0x09, "href='http://'" },
2089 { 0x0a, "href='http://www.'" },
2090 { 0x0b, "href='https://'" },
2091 { 0x0c, "href='https://www.'" },
2093 { 0x00, NULL }
2096 /***** Attribute Value tokens *****/
2097 /* Same as in SI 1.0 */
2099 /***** Token code page aggregation *****/
2100 static const value_valuestring wbxml_slc10_tags[] = {
2101 { 0, wbxml_slc10_tags_cp0 },
2102 { 0, NULL }
2105 static const value_valuestring wbxml_slc10_attrStart[] = {
2106 { 0, wbxml_slc10_attrStart_cp0 },
2107 { 0, NULL }
2110 static const value_valuestring wbxml_slc10_attrValue[] = {
2111 { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */
2112 { 0, NULL }
2115 static const wbxml_decoding decode_slc_10 = {
2116 "Service Loading 1.0",
2117 "SL 1.0",
2118 { NULL, NULL, NULL },
2119 default_opaque_binary_tag,
2120 default_opaque_literal_tag,
2121 default_opaque_binary_attr,
2122 default_opaque_literal_attr,
2123 NULL,
2124 wbxml_slc10_tags,
2125 wbxml_slc10_attrStart,
2126 wbxml_slc10_attrValue
2133 /* CO 1.0
2135 * Cache Operation
2136 ***************************************/
2138 /***** Global extension tokens *****/
2140 /***** Tag tokens *****/
2141 static const value_string wbxml_coc10_tags_cp0[] = {
2142 /* 0x00 -- 0x04 GLOBAL */
2143 { 0x05, "co" },
2144 { 0x06, "invalidate-object" },
2145 { 0x07, "invalidate-service" },
2147 { 0x00, NULL }
2150 /***** Attribute Start tokens *****/
2151 static const value_string wbxml_coc10_attrStart_cp0[] = {
2152 /* 0x00 -- 0x04 GLOBAL */
2153 { 0x05, "uri=" },
2154 { 0x06, "uri='http://'" },
2155 { 0x07, "uri='http://www.'" },
2156 { 0x08, "uri='https://'" },
2157 { 0x09, "uri='https://www.'" },
2159 { 0x00, NULL }
2162 /***** Attribute Value tokens *****/
2163 /* Same as in SI 1.0 */
2165 /***** Token code page aggregation *****/
2166 static const value_valuestring wbxml_coc10_tags[] = {
2167 { 0, wbxml_coc10_tags_cp0 },
2168 { 0, NULL }
2171 static const value_valuestring wbxml_coc10_attrStart[] = {
2172 { 0, wbxml_coc10_attrStart_cp0 },
2173 { 0, NULL }
2176 static const value_valuestring wbxml_coc10_attrValue[] = {
2177 { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */
2178 { 0, NULL }
2181 static const wbxml_decoding decode_coc_10 = {
2182 "Cache Operation 1.0",
2183 "CO 1.0",
2184 { NULL, NULL, NULL },
2185 default_opaque_binary_tag,
2186 default_opaque_literal_tag,
2187 default_opaque_binary_attr,
2188 default_opaque_literal_attr,
2189 NULL,
2190 wbxml_coc10_tags,
2191 wbxml_coc10_attrStart,
2192 wbxml_coc10_attrValue
2199 /* PROV 1.0
2201 * Client Provisioning
2202 ***************************************/
2204 /***** Global extension tokens *****/
2206 /***** Tag tokens *****/
2207 static const value_string wbxml_provc10_tags_cp0[] = {
2208 /* 0x00 -- 0x04 GLOBAL */
2209 { 0x05, "wap-provisioningdoc" },
2210 { 0x06, "characteristic" },
2211 { 0x07, "parm" },
2213 { 0x00, NULL }
2215 static const value_string wbxml_provc10_tags_cp1[] = {
2216 /* 0x00 -- 0x04 GLOBAL */
2217 /* 0x05 */
2218 { 0x06, "characteristic" },
2219 { 0x07, "parm" },
2221 { 0x00, NULL }
2224 /***** Attribute Start tokens *****/
2225 static const value_string wbxml_provc10_attrStart_cp0[] = {
2226 /* 0x00 -- 0x04 GLOBAL */
2227 { 0x05, "name=" },
2228 { 0x06, "value=" },
2229 { 0x07, "name='NAME'" },
2230 { 0x08, "name='NAP-ADDRESS'" },
2231 { 0x09, "name='NAP-ADDRTYPE'" },
2232 { 0x0A, "name='CALLTYPE'" },
2233 { 0x0B, "name='VALIDUNTIL'" },
2234 { 0x0C, "name='AUTHTYPE'" },
2235 { 0x0D, "name='AUTHNAME'" },
2236 { 0x0E, "name='AUTHSECRET'" },
2237 { 0x0F, "name='LINGER'" },
2238 { 0x10, "name='BEARER'" },
2239 { 0x11, "name='NAPID'" },
2240 { 0x12, "name='COUNTRY'" },
2241 { 0x13, "name='NETWORK'" },
2242 { 0x14, "name='INTERNET'" },
2243 { 0x15, "name='PROXY-ID'" },
2244 { 0x16, "name='PROXY-PROVIDER-ID'" },
2245 { 0x17, "name='DOMAIN'" },
2246 { 0x18, "name='PROVURL'" },
2247 { 0x19, "name='PXAUTH-TYPE'" },
2248 { 0x1A, "name='PXAUTH-ID'" },
2249 { 0x1B, "name='PXAUTH-PW'" },
2250 { 0x1C, "name='STARTPAGE'" },
2251 { 0x1D, "name='BASAUTH-ID'" },
2252 { 0x1E, "name='BASAUTH-PW'" },
2253 { 0x1F, "name='PUSHENABLED'" },
2254 { 0x20, "name='PXADDR'" },
2255 { 0x21, "name='PXADDRTYPE'" },
2256 { 0x22, "name='TO-NAPID'" },
2257 { 0x23, "name='PORTNBR'" },
2258 { 0x24, "name='SERVICE'" },
2259 { 0x25, "name='LINKSPEED'" },
2260 { 0x26, "name='DNLINKSPEED'" },
2261 { 0x27, "name='LOCAL-ADDR'" },
2262 { 0x28, "name='LOCAL-ADDRTYPE'" },
2263 { 0x29, "name='CONTEXT-ALLOW'" },
2264 { 0x2A, "name='TRUST'" },
2265 { 0x2B, "name='MASTER'" },
2266 { 0x2C, "name='SID'" },
2267 { 0x2D, "name='SOC'" },
2268 { 0x2E, "name='WSP-VERSION'" },
2269 { 0x2F, "name='PHYSICAL-PROXY-ID'" },
2270 { 0x30, "name='CLIENT-ID'" },
2271 { 0x31, "name='DELIVERY-ERR-SDU'" },
2272 { 0x32, "name='DELIVERY-ORDER'" },
2273 { 0x33, "name='TRAFFIC-CLASS'" },
2274 { 0x34, "name='MAX-SDU-SIZE'" },
2275 { 0x35, "name='MAX-BITRATE-UPLINK'" },
2276 { 0x36, "name='MAX-BITRATE-DNLINK'" },
2277 { 0x37, "name='RESIDUAL-BER'" },
2278 { 0x38, "name='SDU-ERROR-RATIO'" },
2279 { 0x39, "name='TRAFFIC-HANDL-PRIO'" },
2280 { 0x3A, "name='TRANSFER-DELAY'" },
2281 { 0x3B, "name='GUARANTEED-BITRATE-UPLINK'" },
2282 { 0x3C, "name='GUARANTEED-BITRATE-DNLINK'" },
2283 { 0x3D, "name='PXADDR-FQDN'" },
2284 { 0x3E, "name='PROXY-PW'" },
2285 { 0x3F, "name='PPGAUTH-TYPE'" },
2286 /* 0x40 -- 0x44 GLOBAL */
2287 { 0x45, "version=" },
2288 { 0x46, "version='1.0'" },
2289 { 0x47, "name='PULLENABLED'" },
2290 { 0x48, "name='DNS-ADDR'" },
2291 { 0x49, "name='MAX-NUM-RETRY'" },
2292 { 0x4A, "name='FIRST-RETRY-TIMEOUT'" },
2293 { 0x4B, "name='REREG-THRESHOLD'" },
2294 { 0x4C, "name='T-BIT'" },
2295 /* 0x4D */
2296 { 0x4E, "name='AUTH-ENTITY'" },
2297 { 0x4F, "name='SPI'" },
2298 { 0x50, "type=" },
2299 { 0x51, "type='PXLOGICAL'" },
2300 { 0x52, "type='PXPHYSICAL'" },
2301 { 0x53, "type='PORT'" },
2302 { 0x54, "type='VALIDITY'" },
2303 { 0x55, "type='NAPDEF'" },
2304 { 0x56, "type='BOOTSTRAP'" },
2305 { 0x57, "type='VENDORCONFIG'" },
2306 { 0x58, "type='CLIENTIDENTITY'" },
2307 { 0x59, "type='PXAUTHINFO'" },
2308 { 0x5A, "type='NAPAUTHINFO'" },
2309 { 0x5B, "type='ACCESS'" },
2311 { 0x00, NULL }
2313 static const value_string wbxml_provc10_attrStart_cp1[] = {
2314 /* 0x00 -- 0x04 GLOBAL */
2315 /* 0x05 -- 0x06 */
2316 { 0x07, "name='NAME'" },
2317 /* 0x08 -- 0x13 */
2318 { 0x14, "name='INTERNET'" },
2319 /* 0x15 -- 0x1B */
2320 { 0x1C, "name='STARTPAGE'" },
2321 /* 0x1D -- 0x21 */
2322 { 0x22, "name='TO-NAPID'" },
2323 { 0x23, "name='PORTNBR'" },
2324 { 0x24, "name='SERVICE'" },
2325 /* 0x25 -- 0x2D */
2326 { 0x2E, "name='AACCEPT'" },
2327 { 0x2F, "name='AAUTHDATA'" },
2328 { 0x30, "name='AAUTHLEVEL'" },
2329 { 0x31, "name='AAUTHNAME'" },
2330 { 0x32, "name='AAUTHSECRET'" },
2331 { 0x33, "name='AAUTHTYPE'" },
2332 { 0x34, "name='ADDR'" },
2333 { 0x35, "name='ADDRTYPE'" },
2334 { 0x36, "name='APPID'" },
2335 { 0x37, "name='APROTOCOL'" },
2336 { 0x38, "name='PROVIDER-ID'" },
2337 { 0x39, "name='TO-PROXY'" },
2338 { 0x3A, "name='URI'" },
2339 { 0x3B, "name='RULE'" },
2340 /* 0x3C -- 0x3F */
2341 /* 0x40 -- 0x44 GLOBAL */
2342 /* 0x45 -- 0x4F */
2343 { 0x50, "type=" },
2344 /* 0x51 -- 0x52 */
2345 { 0x53, "type='PORT'" },
2346 /* 0x54 */
2347 { 0x55, "type='APPLICATION'" },
2348 { 0x56, "type='APPADDR'" },
2349 { 0x57, "type='APPAUTH'" },
2350 { 0x58, "type='CLIENTIDENTITY'" },
2351 { 0x59, "type='RESOURCE'" },
2352 /* 0x5A -- 0x7F */
2354 { 0x00, NULL }
2357 /***** Attribute Start tokens *****/
2358 static const value_string wbxml_provc10_attrValue_cp0[] = {
2359 /* 0x80 -- 0x84 GLOBAL */
2360 { 0x85, "'IPV4'" },
2361 { 0x86, "'IPV6'" },
2362 { 0x87, "'E164'" },
2363 { 0x88, "'ALPHA'" },
2364 { 0x89, "'APN'" },
2365 { 0x8A, "'SCODE'" },
2366 { 0x8B, "'TETRA-ITSI'" },
2367 { 0x8C, "'MAN'" },
2368 /* 0x8D -- 0x8F */
2369 { 0x90, "'ANALOG-MODEM'" },
2370 { 0x91, "'V.120'" },
2371 { 0x92, "'V.110'" },
2372 { 0x93, "'X.31'" },
2373 { 0x94, "'BIT-TRANSPARENT'" },
2374 { 0x95, "'DIRECT-ASYNCHRONOUS-DATA-SERVICE'" },
2375 /* 0x96 -- 0x99 */
2376 { 0x9A, "'PAP'" },
2377 { 0x9B, "'CHAP'" },
2378 { 0x9C, "'HTTP-BASIC'" },
2379 { 0x9D, "'HTTP-DIGEST'" },
2380 { 0x9E, "'WTLS-SS'" },
2381 { 0x9F, "'MD5'" },
2382 /* 0xA0 -- 0xA1 */
2383 { 0xA2, "'GSM-USSD'" },
2384 { 0xA3, "'GSM-SMS'" },
2385 { 0xA4, "'ANSI-136-GUTS'" },
2386 { 0xA5, "'IS-95-CDMA-SMS'" },
2387 { 0xA6, "'IS-95-CDMA-CSD'" },
2388 { 0xA7, "'IS-95-CDMA-PACKET'" },
2389 { 0xA8, "'ANSI-136-CSD'" },
2390 { 0xA9, "'ANSI-136-GPRS'" },
2391 { 0xAA, "'GSM-CSD'" },
2392 { 0xAB, "'GSM-GPRS'" },
2393 { 0xAC, "'AMPS-CDPD'" },
2394 { 0xAD, "'PDC-CSD'" },
2395 { 0xAE, "'PDC-PACKET'" },
2396 { 0xAF, "'IDEN-SMS'" },
2397 { 0xB0, "'IDEN-CSD'" },
2398 { 0xB1, "'IDEN-PACKET'" },
2399 { 0xB2, "'FLEX/REFLEX'" },
2400 { 0xB3, "'PHS-SMS'" },
2401 { 0xB4, "'PHS-CSD'" },
2402 { 0xB5, "'TETRA-SDS'" },
2403 { 0xB6, "'TETRA-PACKET'" },
2404 { 0xB7, "'ANSI-136-GHOST'" },
2405 { 0xB8, "'MOBITEX-MPAK'" },
2406 { 0xB9, "'CDMA2000-IX-SIMPLE-IP'" },
2407 { 0xBA, "'CDMA2000-IX-MOBILE-IP'" },
2408 /* 0xBB -- 0xBF */
2409 /* 0xC0 -- 0xC4 GLOBAL */
2410 { 0xC5, "'AUTOBAUDING'" },
2411 /* 0xC6 -- 0xC9 */
2412 { 0xCA, "'CL-WSP'" },
2413 { 0xCB, "'CO-WSP'" },
2414 { 0xCC, "'CL-SEC-WSP'" },
2415 { 0xCD, "'CO-SEC-WSP'" },
2416 { 0xCE, "'CL-SEC-WTA'" },
2417 { 0xCF, "'CO-SEC-WTA'" },
2418 { 0xD0, "'OTA-HTTP-TO'" },
2419 { 0xD1, "'OTA-HTTP-TLS-TO'" },
2420 { 0xD2, "'OTA-HTTP-PO'" },
2421 { 0xD3, "'OTA-HTTP-TLS-PO'" },
2422 /* 0xD4 -- 0xFF */
2424 { 0x00, NULL }
2426 static const value_string wbxml_provc10_attrValue_cp1[] = {
2427 /* 0x80 -- 0x84 GLOBAL */
2428 /* 0x85 */
2429 { 0x86, "'IPV6'" },
2430 { 0x87, "'E164'" },
2431 { 0x88, "'ALPHA'" },
2432 { 0x8D, "'APPSRV'" },
2433 { 0x8E, "'OBEX'" },
2434 /* 0x8F */
2436 /* XXX - Errors that require a fix in the OMA/WAP Client Provisioning specs:
2437 { 0xXXX, "','" },
2438 { 0xXXX, "'HTTP-'" },
2439 { 0xXXX, "'BASIC'" },
2440 { 0xXXX, "'DIGEST'" },
2443 { 0xE0, "'AAA'" },
2444 { 0xE1, "'HA'" },
2446 { 0x00, NULL }
2449 /***** Token code page aggregation *****/
2450 static const value_valuestring wbxml_provc10_tags[] = {
2451 { 0, wbxml_provc10_tags_cp0 },
2452 { 1, wbxml_provc10_tags_cp1 },
2453 { 0, NULL }
2456 static const value_valuestring wbxml_provc10_attrStart[] = {
2457 { 0, wbxml_provc10_attrStart_cp0 },
2458 { 1, wbxml_provc10_attrStart_cp1 },
2459 { 0, NULL }
2462 static const value_valuestring wbxml_provc10_attrValue[] = {
2463 { 0, wbxml_provc10_attrValue_cp0 },
2464 { 1, wbxml_provc10_attrValue_cp1 },
2465 { 0, NULL }
2468 static const wbxml_decoding decode_provc_10 = {
2469 "WAP Client Provisioning Document 1.0",
2470 "WAP ProvisioningDoc 1.0",
2471 { NULL, NULL, NULL },
2472 default_opaque_binary_tag,
2473 default_opaque_literal_tag,
2474 default_opaque_binary_attr,
2475 default_opaque_literal_attr,
2476 NULL,
2477 wbxml_provc10_tags,
2478 wbxml_provc10_attrStart,
2479 wbxml_provc10_attrValue
2486 /* EMN 1.0
2488 * Email Notification
2489 ***************************************/
2491 /***** Global extension tokens *****/
2493 /***** Tag tokens *****/
2494 static const value_string wbxml_emnc10_tags_cp0[] = {
2495 /* 0x00 -- 0x04 GLOBAL */
2496 { 0x05, "emn" },
2498 { 0x00, NULL }
2501 /***** Attribute Start tokens *****/
2502 static const value_string wbxml_emnc10_attrStart_cp0[] = {
2503 /* 0x00 -- 0x04 GLOBAL */
2504 { 0x05, "timestamp=" },
2505 { 0x06, "mailbox=" },
2506 { 0x07, "mailbox='mailat:'" },
2507 { 0x08, "mailbox='pop://'" },
2508 { 0x09, "mailbox='imap://'" },
2509 { 0x0a, "mailbox='http://'" },
2510 { 0x0b, "mailbox='http://www.'" },
2511 { 0x0c, "mailbox='https://'" },
2512 { 0x0D, "mailbox='https://www.'" },
2514 { 0x00, NULL }
2517 /***** Attribute Value tokens *****/
2518 /* Same as in SI 1.0 */
2520 /***** Token code page aggregation *****/
2521 static const value_valuestring wbxml_emnc10_tags[] = {
2522 { 0, wbxml_emnc10_tags_cp0 },
2523 { 0, NULL }
2526 static const value_valuestring wbxml_emnc10_attrStart[] = {
2527 { 0, wbxml_emnc10_attrStart_cp0 },
2528 { 0, NULL }
2531 static const value_valuestring wbxml_emnc10_attrValue[] = {
2532 { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */
2533 { 0, NULL }
2536 static const wbxml_decoding decode_emnc_10 = {
2537 "E-Mail Notification 1.0",
2538 "EMN 1.0",
2539 { NULL, NULL, NULL },
2540 default_opaque_binary_tag,
2541 default_opaque_literal_tag,
2542 emnc10_opaque_binary_attr,
2543 emnc10_opaque_literal_attr,
2544 NULL,
2545 wbxml_emnc10_tags,
2546 wbxml_emnc10_attrStart,
2547 wbxml_emnc10_attrValue
2554 /* SyncML 1.0
2556 * SyncML Representation Protocol
2557 ***************************************/
2559 /***** Global extension tokens *****/
2561 /***** Tag tokens *****/
2562 static const value_string wbxml_syncmlc10_tags_cp0[] = { /* SyncML 1.0 */
2563 /* 0x00 -- 0x04 GLOBAL */
2564 { 0x05, "Add" },
2565 { 0x06, "Alert" },
2566 { 0x07, "Archive" },
2567 { 0x08, "Atomic" },
2568 { 0x09, "Chal" },
2569 { 0x0A, "Cmd" },
2570 { 0x0B, "CmdID" },
2571 { 0x0C, "CmdRef" },
2572 { 0x0D, "Copy" },
2573 { 0x0E, "Cred" },
2574 { 0x0F, "Data" },
2575 { 0x10, "Delete" },
2576 { 0x11, "Exec" },
2577 { 0x12, "Final" },
2578 { 0x13, "Get" },
2579 { 0x14, "Item" },
2580 { 0x15, "Lang" },
2581 { 0x16, "LocName" },
2582 { 0x17, "LocURI" },
2583 { 0x18, "Map" },
2584 { 0x19, "MapItem" },
2585 { 0x1A, "Meta" },
2586 { 0x1B, "MsgID" },
2587 { 0x1C, "MsgRef" },
2588 { 0x1D, "NoResp" },
2589 { 0x1E, "NoResults" },
2590 { 0x1F, "Put" },
2591 { 0x20, "Replace" },
2592 { 0x21, "RespURI" },
2593 { 0x22, "Results" },
2594 { 0x23, "Search" },
2595 { 0x24, "Sequence" },
2596 { 0x25, "SessionID" },
2597 { 0x26, "SftDel" },
2598 { 0x27, "Source" },
2599 { 0x28, "SourceRef" },
2600 { 0x29, "Status" },
2601 { 0x2A, "Sync" },
2602 { 0x2B, "SyncBody" },
2603 { 0x2C, "SyncHdr" },
2604 { 0x2D, "SyncML" },
2605 { 0x2E, "Target" },
2606 { 0x2F, "TargetRef" },
2607 /* 0x30 - Reserved */
2608 { 0x31, "VerDTD" },
2609 { 0x32, "VerProto" },
2611 { 0x00, NULL }
2614 static const value_string wbxml_syncmlc10_tags_cp1[] = { /* MetInf 1.0 */
2615 /* 0x00 -- 0x04 GLOBAL */
2616 { 0x05, "Anchor" },
2617 { 0x06, "EMI" },
2618 { 0x07, "Format" },
2619 { 0x08, "FreeID" },
2620 { 0x09, "FreeMem" },
2621 { 0x0A, "Last" },
2622 { 0x0B, "Mark" },
2623 { 0x0C, "MaxMsgSize" },
2624 { 0x0D, "Mem" },
2625 { 0x0E, "MetInf" },
2626 { 0x0F, "Next" },
2627 { 0x10, "NextNonce" },
2628 { 0x11, "SharedMem" },
2629 { 0x12, "Size" },
2630 { 0x13, "Type" },
2631 { 0x14, "Version" },
2633 { 0x00, NULL }
2636 /***** Attribute Start tokens *****/
2638 /***** Attribute Value tokens *****/
2640 /***** Token code page aggregation *****/
2641 static const value_valuestring wbxml_syncmlc10_tags[] = {
2642 { 0, wbxml_syncmlc10_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.0//EN */
2643 { 1, wbxml_syncmlc10_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.0//EN */
2644 { 0, NULL }
2647 static const wbxml_decoding decode_syncmlc_10 = {
2648 "SyncML Representation Protocol 1.0",
2649 "SyncML 1.0",
2650 { NULL, NULL, NULL },
2651 default_opaque_binary_tag,
2652 default_opaque_literal_tag,
2653 default_opaque_binary_attr,
2654 default_opaque_literal_attr,
2655 NULL,
2656 wbxml_syncmlc10_tags,
2657 NULL,
2658 NULL
2665 /* SyncML 1.1
2667 * SyncML Representation Protocol
2668 ***************************************/
2670 /***** Global extension tokens *****/
2672 /***** Tag tokens *****/
2673 static const value_string wbxml_syncmlc11_tags_cp0[] = { /* SyncML 1.1 */
2674 /* 0x00 -- 0x04 GLOBAL */
2675 { 0x05, "Add" },
2676 { 0x06, "Alert" },
2677 { 0x07, "Archive" },
2678 { 0x08, "Atomic" },
2679 { 0x09, "Chal" },
2680 { 0x0a, "Cmd" },
2681 { 0x0b, "CmdID" },
2682 { 0x0c, "CmdRef" },
2683 { 0x0d, "Copy" },
2684 { 0x0e, "Cred" },
2685 { 0x0f, "Data" },
2686 { 0x10, "Delete" },
2687 { 0x11, "Exec" },
2688 { 0x12, "Final" },
2689 { 0x13, "Get" },
2690 { 0x14, "Item" },
2691 { 0x15, "Lang" },
2692 { 0x16, "LocName" },
2693 { 0x17, "LocURI" },
2694 { 0x18, "Map" },
2695 { 0x19, "MapItem" },
2696 { 0x1a, "Meta" },
2697 { 0x1b, "MsgID" },
2698 { 0x1c, "MsgRef" },
2699 { 0x1d, "NoResp" },
2700 { 0x1e, "NoResults" },
2701 { 0x1f, "Put" },
2702 { 0x20, "Replace" },
2703 { 0x21, "RespURI" },
2704 { 0x22, "Results" },
2705 { 0x23, "Search" },
2706 { 0x24, "Sequence" },
2707 { 0x25, "SessionID" },
2708 { 0x26, "SftDel" },
2709 { 0x27, "Source" },
2710 { 0x28, "SourceRef" },
2711 { 0x29, "Status" },
2712 { 0x2a, "Sync" },
2713 { 0x2b, "SyncBody" },
2714 { 0x2c, "SyncHdr" },
2715 { 0x2d, "SyncML" },
2716 { 0x2e, "Target" },
2717 { 0x2f, "TargetRef" },
2718 /* 0x30 - Reserved */
2719 { 0x31, "VerDTD" },
2720 { 0x32, "VerProto" },
2721 { 0x33, "NumberOfChanges" },
2722 { 0x34, "MoreData" },
2724 { 0x00, NULL }
2727 static const value_string wbxml_syncmlc11_tags_cp1[] = { /* MetInf 1.1 */
2728 /* 0x00 -- 0x04 GLOBAL */
2729 { 0x05, "Anchor" },
2730 { 0x06, "EMI" },
2731 { 0x07, "Format" },
2732 { 0x08, "FreeID" },
2733 { 0x09, "FreeMem" },
2734 { 0x0A, "Last" },
2735 { 0x0B, "Mark" },
2736 { 0x0C, "MaxMsgSize" },
2737 { 0x0D, "Mem" },
2738 { 0x0E, "MetInf" },
2739 { 0x0F, "Next" },
2740 { 0x10, "NextNonce" },
2741 { 0x11, "SharedMem" },
2742 { 0x12, "Size" },
2743 { 0x13, "Type" },
2744 { 0x14, "Version" },
2745 { 0x15, "MaxObjSize" },
2747 { 0x00, NULL }
2750 /***** Attribute Start tokens *****/
2752 /***** Attribute Value tokens *****/
2754 /***** Token code page aggregation *****/
2755 static const value_valuestring wbxml_syncmlc11_tags[] = {
2756 { 0, wbxml_syncmlc11_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.1//EN */
2757 { 1, wbxml_syncmlc11_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.1//EN */
2758 { 0, NULL }
2761 static const wbxml_decoding decode_syncmlc_11 = {
2762 "SyncML Representation Protocol 1.1",
2763 "SyncML 1.1",
2764 { NULL, NULL, NULL },
2765 default_opaque_binary_tag,
2766 default_opaque_literal_tag,
2767 default_opaque_binary_attr,
2768 default_opaque_literal_attr,
2769 NULL,
2770 wbxml_syncmlc11_tags,
2771 NULL,
2772 NULL
2779 /* SyncML 1.2
2781 * SyncML Representation Protocol
2782 ***************************************/
2784 /***** Global extension tokens *****/
2786 /***** Tag tokens *****/
2787 static const value_string wbxml_syncmlc12_tags_cp0[] = { /* SyncML 1.2 */
2788 /* 0x00 -- 0x04 GLOBAL */
2789 { 0x05, "Add" },
2790 { 0x06, "Alert" },
2791 { 0x07, "Archive" },
2792 { 0x08, "Atomic" },
2793 { 0x09, "Chal" },
2794 { 0x0a, "Cmd" },
2795 { 0x0b, "CmdID" },
2796 { 0x0c, "CmdRef" },
2797 { 0x0d, "Copy" },
2798 { 0x0e, "Cred" },
2799 { 0x0f, "Data" },
2800 { 0x10, "Delete" },
2801 { 0x11, "Exec" },
2802 { 0x12, "Final" },
2803 { 0x13, "Get" },
2804 { 0x14, "Item" },
2805 { 0x15, "Lang" },
2806 { 0x16, "LocName" },
2807 { 0x17, "LocURI" },
2808 { 0x18, "Map" },
2809 { 0x19, "MapItem" },
2810 { 0x1a, "Meta" },
2811 { 0x1b, "MsgID" },
2812 { 0x1c, "MsgRef" },
2813 { 0x1d, "NoResp" },
2814 { 0x1e, "NoResults" },
2815 { 0x1f, "Put" },
2816 { 0x20, "Replace" },
2817 { 0x21, "RespURI" },
2818 { 0x22, "Results" },
2819 { 0x23, "Search" },
2820 { 0x24, "Sequence" },
2821 { 0x25, "SessionID" },
2822 { 0x26, "SftDel" },
2823 { 0x27, "Source" },
2824 { 0x28, "SourceRef" },
2825 { 0x29, "Status" },
2826 { 0x2a, "Sync" },
2827 { 0x2b, "SyncBody" },
2828 { 0x2c, "SyncHdr" },
2829 { 0x2d, "SyncML" },
2830 { 0x2e, "Target" },
2831 { 0x2f, "TargetRef" },
2832 /* 0x30 - Reserved */
2833 { 0x31, "VerDTD" },
2834 { 0x32, "VerProto" },
2835 { 0x33, "NumberOfChanges" },
2836 { 0x34, "MoreData" },
2837 { 0x35, "Field" },
2838 { 0x36, "Filter" },
2839 { 0x37, "Record" },
2840 { 0x38, "FilterType" },
2841 { 0x39, "SourceParent" },
2842 { 0x3a, "TargetParent" },
2843 { 0x3b, "Move" },
2844 { 0x3c, "Correlator" },
2846 { 0x00, NULL }
2849 static const value_string wbxml_syncmlc12_tags_cp1[] = { /* MetInf 1.2 */
2850 /* 0x00 -- 0x04 GLOBAL */
2851 { 0x05, "Anchor" },
2852 { 0x06, "EMI" },
2853 { 0x07, "Format" },
2854 { 0x08, "FreeID" },
2855 { 0x09, "FreeMem" },
2856 { 0x0A, "Last" },
2857 { 0x0B, "Mark" },
2858 { 0x0C, "MaxMsgSize" },
2859 { 0x0D, "Mem" },
2860 { 0x0E, "MetInf" },
2861 { 0x0F, "Next" },
2862 { 0x10, "NextNonce" },
2863 { 0x11, "SharedMem" },
2864 { 0x12, "Size" },
2865 { 0x13, "Type" },
2866 { 0x14, "Version" },
2867 { 0x15, "MaxObjSize" },
2868 { 0x16, "FieldLevel" },
2869 { 0x17, "FP" }, /* Extensions on certain devices */
2870 { 0x18, "ID" }, /* Extensions on certain devices */
2871 { 0x19, "IDContainer" }, /* Extensions on certain devices */
2872 { 0x1a, "IDPair" }, /* Extensions on certain devices */
2874 { 0x00, NULL }
2877 /***** Attribute Start tokens *****/
2879 /***** Attribute Value tokens *****/
2881 /***** Token code page aggregation *****/
2882 static const value_valuestring wbxml_syncmlc12_tags[] = {
2883 { 0, wbxml_syncmlc12_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.2//EN */
2884 { 1, wbxml_syncmlc12_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.2//EN */
2885 /* Note: 02 reserved for DM use */
2886 { 0, NULL }
2889 static const wbxml_decoding decode_syncmlc_12 = {
2890 "SyncML Representation Protocol 1.2",
2891 "SyncML 1.2",
2892 { NULL, NULL, NULL },
2893 default_opaque_binary_tag,
2894 default_opaque_literal_tag,
2895 default_opaque_binary_attr,
2896 default_opaque_literal_attr,
2897 NULL,
2898 wbxml_syncmlc12_tags,
2899 NULL,
2900 NULL
2902 /* Microsoft ActiveSync 1.0 (Actual Version Unknown - either 1.0 or 2.0, taken from [MS-ASWBXML].pdf)
2904 * ActiveSync Representation Protocol
2905 ***************************************/
2907 /***** Global extension tokens *****/
2909 /***** Tag tokens *****/
2910 static const value_string wbxml_mssyncc10_tags_cp0[] = { /* ActiveSync 'AirSync:' Page */
2911 /* 0x00 -- 0x04 GLOBAL */
2912 { 0x05, "Sync" },
2913 { 0x06, "Responses" },
2914 { 0x07, "Add" },
2915 { 0x08, "Change" },
2916 { 0x09, "Delete" },
2917 { 0x0A, "Fetch" },
2918 { 0x0B, "SyncKey" },
2919 { 0x0C, "ClientId" },
2920 { 0x0D, "ServerId" },
2921 { 0x0E, "Status" },
2922 { 0x0F, "Collection" },
2923 { 0x10, "Class" },
2924 { 0x12, "CollectionId" },
2925 { 0x13, "GetChanges" },
2926 { 0x14, "MoreAvailable" },
2927 { 0x15, "WindowSize" },
2928 { 0x16, "Commands" },
2929 { 0x17, "Options" },
2930 { 0x18, "FilterType" },
2931 { 0x1B, "Conflict" },
2932 { 0x1C, "Collections" },
2933 { 0x1D, "ApplicationData" },
2934 { 0x1E, "DeletesAsMoves" },
2935 { 0x20, "Supported" },
2936 { 0x21, "SoftDelete" },
2937 { 0x22, "MIMESupport" },
2938 { 0x23, "MIMETruncation" },
2939 { 0x24, "Wait" },
2940 { 0x25, "Limit" },
2941 { 0x26, "Partial" },
2942 { 0x27, "ConversationMode" },
2943 { 0x28, "MaxItems" },
2944 { 0x29, "HeartbeatInterval" },
2946 { 0x00, NULL }
2949 static const value_string wbxml_mssyncc10_tags_cp1[] = { /* ActiveSync 'Contacts:' Page */
2950 /* 0x00 -- 0x04 GLOBAL */
2951 { 0x05, "Anniversary" },
2952 { 0x06, "AssistantName" },
2953 { 0x07, "AssistantTelephoneNumber" },
2954 { 0x08, "Birthday" },
2955 { 0x0C, "Business2PhoneNumber" },
2956 { 0x0D, "BusinessCity" },
2957 { 0x0E, "BusinessCountry" },
2958 { 0x0F, "BusinessPostalCode" },
2959 { 0x10, "BusinessState" },
2960 { 0x11, "BusinessStreet" },
2961 { 0x12, "BusinessFaxNumber" },
2962 { 0x13, "BusinessPhoneNumber" },
2963 { 0x14, "CarPhoneNumber" },
2964 { 0x15, "Categories" },
2965 { 0x16, "Category" },
2966 { 0x17, "Children" },
2967 { 0x18, "Child" },
2968 { 0x19, "CompanyName" },
2969 { 0x1A, "Department" },
2970 { 0x1B, "Email1Address" },
2971 { 0x1C, "Email2Address" },
2972 { 0x1D, "Email3Address" },
2973 { 0x1E, "FileAs" },
2974 { 0x1F, "FirstName" },
2975 { 0x20, "Home2PhoneNumber" },
2976 { 0x21, "HomeCity" },
2977 { 0x22, "HomeCountry" },
2978 { 0x23, "HomePostalCode" },
2979 { 0x24, "HomeState" },
2980 { 0x25, "HomeStreet" },
2981 { 0x26, "HomeFaxNumber" },
2982 { 0x27, "HomePhoneNumber" },
2983 { 0x29, "JobTitle" },
2984 { 0x2A, "MiddleName" },
2985 { 0x2B, "MobilePhoneNumber" },
2986 { 0x2C, "OfficeLocation" },
2987 { 0x2D, "OtherCity" },
2988 { 0x2E, "OtherCountry" },
2989 { 0x2F, "OtherPostalCode" },
2990 { 0x30, "OtherState" },
2991 { 0x31, "OtherStreet" },
2992 { 0x32, "PagerNumber" },
2993 { 0x33, "RadioPhoneNumber" },
2994 { 0x34, "Spouse" },
2995 { 0x35, "Suffix" },
2996 { 0x36, "Title" },
2997 { 0x37, "Webpage" },
2998 { 0x38, "YomiCompanyName" },
2999 { 0x39, "YomiFirstName" },
3000 { 0x3A, "YomiLastName" },
3001 { 0x3C, "Picture" },
3002 { 0x3D, "Alias" },
3003 { 0x3E, "WeightedRank" },
3005 { 0x00, NULL }
3008 static const value_string wbxml_mssyncc10_tags_cp2[] = { /* ActiveSync 'Email:' Page */
3009 /* 0x00 -- 0x04 GLOBAL */
3010 { 0x0F, "DateReceived" },
3011 { 0x11, "DisplayTo" },
3012 { 0x12, "Importance" },
3013 { 0x13, "MessageClass" },
3014 { 0x14, "Subject" },
3015 { 0x15, "Read" },
3016 { 0x16, "To" },
3017 { 0x17, "CC" },
3018 { 0x18, "From" },
3019 { 0x19, "ReplyTo" },
3020 { 0x1A, "AllDayEvent" },
3021 { 0x1B, "Categories" },
3022 { 0x1C, "Category" },
3023 { 0x1D, "DTStamp" },
3024 { 0x1E, "EndTime" },
3025 { 0x1F, "InstanceType" },
3026 { 0x20, "BusyStatus" },
3027 { 0x21, "Location" },
3028 { 0x22, "MeetingRequest" },
3029 { 0x23, "Organizer" },
3030 { 0x24, "RecurrenceId" },
3031 { 0x25, "Reminder" },
3032 { 0x26, "ResponseRequest" },
3033 { 0x27, "Recurrences" },
3034 { 0x28, "Recurrence" },
3035 { 0x29, "Recurrence_Type" },
3036 { 0x2A, "Recurrence_Until" },
3037 { 0x2B, "Recurrence_Occurrences" },
3038 { 0x2C, "Recurrence_Interval" },
3039 { 0x2D, "Recurrence_DayOfWeek" },
3040 { 0x2E, "Recurrence_DayOfMonth" },
3041 { 0x2F, "Recurrence_WeekOfMonth" },
3042 { 0x30, "Recurrence_MonthOfYear" },
3043 { 0x31, "StartTime" },
3044 { 0x32, "Sensitivity" },
3045 { 0x33, "TimeZone" },
3046 { 0x34, "GlobalObjId" },
3047 { 0x35, "ThreadTopic" },
3048 { 0x39, "InternetCPID" },
3049 { 0x3A, "Flag" },
3050 { 0x3B, "FlagStatus" },
3051 { 0x3C, "ContentClass" },
3052 { 0x3D, "FlagType" },
3053 { 0x3E, "CompleteTime" },
3054 { 0x3F, "DisallowNewTimeProposal" },
3056 { 0x00, NULL }
3059 static const value_string wbxml_mssyncc10_tags_cp4[] = { /* ActiveSync 'Calendar:' Page */
3060 /* 0x00 -- 0x04 GLOBAL */
3061 { 0x05, "TimeZone" },
3062 { 0x06, "AllDAyEvent" },
3063 { 0x07, "Attendees" },
3064 { 0x08, "Attendee" },
3065 { 0x09, "Attendee_Email" },
3066 { 0x0A, "Attendee_Name" },
3067 { 0x0D, "BusyStatus" },
3068 { 0x0E, "Categories" },
3069 { 0x0F, "Category" },
3070 { 0x11, "DTStamp" },
3071 { 0x12, "EndTime" },
3072 { 0x13, "Exception" },
3073 { 0x14, "Exceptions" },
3074 { 0x15, "Exception_Deleted" },
3075 { 0x16, "Exception_StartTime" },
3076 { 0x17, "Location" },
3077 { 0x18, "MeetingStatus" },
3078 { 0x19, "Organizer_Email" },
3079 { 0x1A, "Organizer_Name" },
3080 { 0x1B, "Recurrence" },
3081 { 0x1C, "Recurrence_Type" },
3082 { 0x1D, "Recurrence_Until" },
3083 { 0x1E, "Recurrence_Occurrences" },
3084 { 0x1F, "Recurrence_Interval" },
3085 { 0x20, "Recurrence_DayOfWeek" },
3086 { 0x21, "Recurrence_DayOfMonth" },
3087 { 0x22, "Recurrence_WeekOfMonth" },
3088 { 0x23, "Recurrence_MonthOfYear" },
3089 { 0x24, "Reminder" },
3090 { 0x25, "Sensitivity" },
3091 { 0x26, "Subject" },
3092 { 0x27, "StartTime" },
3093 { 0x28, "UID" },
3094 { 0x29, "Attendee_Status" },
3095 { 0x2A, "Attendee_Type" },
3096 { 0x33, "DisallowNewTimeProposal" },
3097 { 0x34, "ResponseRequested" },
3098 { 0x35, "AppointmentReplyTime" },
3099 { 0x36, "ResponseType" },
3100 { 0x37, "CalendarType" },
3101 { 0x38, "IsLeapMonth" },
3102 { 0x39, "FirstDayOfWeek" },
3103 { 0x3A, "OnlineMeetingConfLink" },
3104 { 0x3B, "OnlineMeetingExternalLink" },
3106 { 0x00, NULL }
3109 static const value_string wbxml_mssyncc10_tags_cp5[] = { /* ActiveSync 'Move:' Page */
3110 /* 0x00 -- 0x04 GLOBAL */
3111 { 0x05, "MoveItems" },
3112 { 0x06, "Move" },
3113 { 0x07, "SrcMsgId" },
3114 { 0x08, "SrcFldId" },
3115 { 0x09, "DstFldId" },
3116 { 0x0A, "Response" },
3117 { 0x0B, "Status" },
3118 { 0x0C, "DstMsgId" },
3120 { 0x00, NULL }
3123 static const value_string wbxml_mssyncc10_tags_cp6[] = { /* ActiveSync 'GetItemEstimate:' Page */
3124 /* 0x00 -- 0x04 GLOBAL */
3125 { 0x05, "GetItemEstimate" },
3126 { 0x06, "Version" },
3127 { 0x07, "Collections" },
3128 { 0x08, "Collection" },
3129 { 0x09, "Class" },
3130 { 0x0A, "CollectionId" },
3131 { 0x0B, "DateTime" },
3132 { 0x0C, "Estimate" },
3133 { 0x0D, "Response" },
3134 { 0x0E, "Status" },
3136 { 0x00, NULL }
3139 static const value_string wbxml_mssyncc10_tags_cp7[] = { /* ActiveSync 'FolderHierarchy:' Page */
3140 /* 0x00 -- 0x04 GLOBAL */
3141 { 0x07, "DisplayName" },
3142 { 0x08, "ServerId" },
3143 { 0x09, "ParentId" },
3144 { 0x0A, "Type" },
3145 { 0x0C, "Status" },
3146 { 0x0E, "Changes" },
3147 { 0x0F, "Add" },
3148 { 0x10, "Delete" },
3149 { 0x11, "Update" },
3150 { 0x12, "SyncKey" },
3151 { 0x13, "FolderCreate" },
3152 { 0x14, "FolderDelete" },
3153 { 0x15, "FolderUpdate" },
3154 { 0x16, "FolderSync" },
3155 { 0x17, "Count" },
3157 { 0x00, NULL }
3160 static const value_string wbxml_mssyncc10_tags_cp8[] = { /* ActiveSync 'MeetingResponse:' Page */
3161 /* 0x00 -- 0x04 GLOBAL */
3162 { 0x05, "CalendarId" },
3163 { 0x06, "CollectionId" },
3164 { 0x07, "MeetingResponse" },
3165 { 0x08, "RequestId" },
3166 { 0x09, "Request" },
3167 { 0x0A, "Result" },
3168 { 0x0B, "Status" },
3169 { 0x0C, "UserResponse" },
3170 { 0x0E, "InstanceId" },
3172 { 0x00, NULL }
3175 static const value_string wbxml_mssyncc10_tags_cp9[] = { /* ActiveSync 'Tasks:' Page */
3176 /* 0x00 -- 0x04 GLOBAL */
3177 { 0x08, "Categories" },
3178 { 0x09, "Category" },
3179 { 0x0A, "Complete" },
3180 { 0x0B, "DateCompleted" },
3181 { 0x0D, "DueDate" },
3182 { 0x0E, "Importance" },
3183 { 0x0F, "Recurrence" },
3184 { 0x10, "Recurrence_Type" },
3185 { 0x11, "Recurrence_Start" },
3186 { 0x12, "Recurrence_Until" },
3187 { 0x13, "Recurrence_Occurrences" },
3188 { 0x14, "Recurrence_Interval" },
3189 { 0x15, "Recurrence_DayOfMonth" },
3190 { 0x16, "Recurrence_DayOfWeek" },
3191 { 0x17, "Recurrence_WeekOfMonth" },
3192 { 0x18, "Recurrence_MonthOfYear" },
3193 { 0x19, "Recurrence_Regenerate" },
3194 { 0x1A, "Recurrence_DeadOccur" },
3195 { 0x1B, "ReminderSet" },
3196 { 0x1C, "ReminderTime" },
3197 { 0x1D, "Sensitivity" },
3198 { 0x1E, "StartDate" },
3199 { 0x1F, "UTCStartDate" },
3200 { 0x20, "Subject" },
3201 { 0x22, "OrdinalDate" },
3202 { 0x23, "SubOrdinalDate" },
3203 { 0x24, "CalendarType" },
3204 { 0x25, "IsLeapMonth" },
3205 { 0x26, "FirstDayOfWeek" },
3207 { 0x00, NULL }
3210 static const value_string wbxml_mssyncc10_tags_cp10[] = { /* ActiveSync 'ResolveRecipients:' Page */
3211 /* 0x00 -- 0x04 GLOBAL */
3212 { 0x05, "ResolveRecipients" },
3213 { 0x06, "Response" },
3214 { 0x07, "Status" },
3215 { 0x08, "Type" },
3216 { 0x09, "Recipient" },
3217 { 0x0A, "DisplayName" },
3218 { 0x0B, "EmailAddress" },
3219 { 0x0C, "Certificates" },
3220 { 0x0D, "Certificate" },
3221 { 0x0E, "MiniCertificate" },
3222 { 0x0F, "Options" },
3223 { 0x10, "To" },
3224 { 0x11, "CertificateRetrieval" },
3225 { 0x12, "RecipientCount" },
3226 { 0x13, "MaxCertificates" },
3227 { 0x14, "MaxAmbiguousRecipients" },
3228 { 0x15, "CertificateCount" },
3229 { 0x16, "Availability" },
3230 { 0x17, "StartTime" },
3231 { 0x18, "EndTime" },
3232 { 0x19, "MergedFreeBusy" },
3233 { 0x1A, "Picture" },
3234 { 0x1B, "MaxSize" },
3235 { 0x1C, "Data" },
3236 { 0x1D, "MaxPictures" },
3238 { 0x00, NULL }
3241 static const value_string wbxml_mssyncc10_tags_cp11[] = { /* ActiveSync 'ValidateCert:' Page */
3242 /* 0x00 -- 0x04 GLOBAL */
3243 { 0x05, "ValidateCert" },
3244 { 0x06, "Certificates" },
3245 { 0x07, "Certificate" },
3246 { 0x08, "CertificateChain" },
3247 { 0x09, "CheckCRL" },
3248 { 0x0A, "Status" },
3250 { 0x00, NULL }
3253 static const value_string wbxml_mssyncc10_tags_cp12[] = { /* ActiveSync 'Contacts2:' Page */
3254 /* 0x00 -- 0x04 GLOBAL */
3255 { 0x05, "CustomerId" },
3256 { 0x06, "GovernmentId" },
3257 { 0x07, "IMAddress" },
3258 { 0x08, "IMAddress2" },
3259 { 0x09, "IMAddress3" },
3260 { 0x0A, "ManagerName" },
3261 { 0x0B, "CompanyMainPhone" },
3262 { 0x0C, "AccountName" },
3263 { 0x0D, "NickName" },
3264 { 0x0E, "MMS" },
3266 { 0x00, NULL }
3269 static const value_string wbxml_mssyncc10_tags_cp13[] = { /* ActiveSync 'Ping:' Page */
3270 /* 0x00 -- 0x04 GLOBAL */
3271 { 0x05, "Ping" },
3272 { 0x06, "AutdState" },
3273 { 0x07, "Status" },
3274 { 0x08, "HeartbeatInterval" },
3275 { 0x09, "Folders" },
3276 { 0x0A, "Folder" },
3277 { 0x0B, "Id" },
3278 { 0x0C, "Class" },
3279 { 0x0D, "MaxFolders" },
3281 { 0x00, NULL }
3284 static const value_string wbxml_mssyncc10_tags_cp14[] = { /* ActiveSync 'Provision:' Page */
3285 /* 0x00 -- 0x04 GLOBAL */
3286 { 0x05, "Provision" },
3287 { 0x06, "Policies" },
3288 { 0x07, "Policy" },
3289 { 0x08, "PolicyType" },
3290 { 0x09, "PolicyKey" },
3291 { 0x0A, "Data" },
3292 { 0x0B, "Status" },
3293 { 0x0C, "RemoteWipe" },
3294 { 0x0D, "EASProvisionDoc" },
3295 { 0x0E, "DevicePasswordEnabled" },
3296 { 0x0F, "AlphanumericDevicePasswordRequired" },
3297 { 0x10, "DeviceEncryptionEnabled" },
3298 { 0x11, "PasswordRecoveryEnabled" },
3299 { 0x13, "AttachmentsEnabled" },
3300 { 0x14, "MinDevicePasswordLength" },
3301 { 0x15, "MaxInactivityTimeDeviceLock" },
3302 { 0x16, "MaxDevicePasswordFailedAttempts" },
3303 { 0x17, "MaxAttachmentSize" },
3304 { 0x18, "AllowSimpleDevicePassword" },
3305 { 0x19, "DevicePasswordExpiration" },
3306 { 0x1A, "DevicePasswordHistory" },
3307 { 0x1B, "AllowStorageCard" },
3308 { 0x1C, "AllowCamera" },
3309 { 0x1D, "RequireDeviceEncryption" },
3310 { 0x1E, "AllowUnsignedApplications" },
3311 { 0x1F, "AllowUnsignedInstallationPackages" },
3312 { 0x20, "MinDevicePasswordComplexCharacters" },
3313 { 0x21, "AllowWiFi" },
3314 { 0x22, "AllowTextMessaging" },
3315 { 0x23, "AllowPOPIMAPEmail" },
3316 { 0x24, "AllowBluetooth" },
3317 { 0x25, "AllowIrDA" },
3318 { 0x26, "RequireManualSyncWhenRoaming" },
3319 { 0x27, "AllowDesktopSync" },
3320 { 0x28, "MaxCalendarAgeFilter" },
3321 { 0x29, "AllowHTMLEmail" },
3322 { 0x2A, "MaxEmailAgeFilter" },
3323 { 0x2B, "MaxEmailBodyTruncationSize" },
3324 { 0x2C, "MaxEmailHTMLBodyTruncationSize" },
3325 { 0x2D, "RequireSignedSMIMEMessages" },
3326 { 0x2E, "RequireEncryptedSMIMEMessages" },
3327 { 0x2F, "RequireSignedSMIMEAlgorithm" },
3328 { 0x30, "RequireEncryptionSMIMEAlgorithm" },
3329 { 0x31, "AllowSMIMEEncryptionAlgorithmNegotiation" },
3330 { 0x32, "AllowSMIMESoftCerts" },
3331 { 0x33, "AllowBrowser" },
3332 { 0x34, "AllowConsumerEmail" },
3333 { 0x35, "AllowRemoteDesktop" },
3334 { 0x36, "AllowInternetSharing" },
3335 { 0x37, "UnapprovedInROMApplicationList" },
3336 { 0x38, "ApplicationName" },
3337 { 0x39, "ApprovedApplicationList" },
3338 { 0x3A, "Hash" },
3340 { 0x00, NULL }
3343 static const value_string wbxml_mssyncc10_tags_cp15[] = { /* ActiveSync 'Search:' Page */
3344 /* 0x00 -- 0x04 GLOBAL */
3345 { 0x05, "Search" },
3346 { 0x07, "Store" },
3347 { 0x08, "Name" },
3348 { 0x09, "Query" },
3349 { 0x0A, "Options" },
3350 { 0x0B, "Range" },
3351 { 0x0C, "Status" },
3352 { 0x0D, "Response" },
3353 { 0x0E, "Result" },
3354 { 0x0F, "Properties" },
3355 { 0x10, "Total" },
3356 { 0x11, "EqualTo" },
3357 { 0x12, "Value" },
3358 { 0x13, "And" },
3359 { 0x14, "Or" },
3360 { 0x15, "FreeText" },
3361 { 0x17, "DeepTraversal" },
3362 { 0x18, "LongId" },
3363 { 0x19, "RebuildResults" },
3364 { 0x1A, "LessThan" },
3365 { 0x1B, "GreaterThan" },
3366 { 0x1E, "UserName" },
3367 { 0x1F, "Password" },
3368 { 0x20, "ConversationId" },
3369 { 0x21, "Picture" },
3370 { 0x22, "MaxSize" },
3371 { 0x23, "MaxPictures" },
3373 { 0x00, NULL }
3376 static const value_string wbxml_mssyncc10_tags_cp16[] = { /* ActiveSync 'Gal:' Page */
3377 /* 0x00 -- 0x04 GLOBAL */
3378 { 0x05, "DisplayName" },
3379 { 0x06, "Phone" },
3380 { 0x07, "Office" },
3381 { 0x08, "Title" },
3382 { 0x09, "Company" },
3383 { 0x0A, "Alias" },
3384 { 0x0B, "FirstName" },
3385 { 0x0C, "LastName" },
3386 { 0x0D, "HomePhone" },
3387 { 0x0E, "MobilePhone" },
3388 { 0x0F, "EmailAddress" },
3389 { 0x10, "Picture" },
3390 { 0x11, "Status" },
3391 { 0x12, "Data" },
3393 { 0x00, NULL }
3396 static const value_string wbxml_mssyncc10_tags_cp17[] = { /* ActiveSync 'AirSyncBase:' Page */
3397 /* 0x00 -- 0x04 GLOBAL */
3398 { 0x05, "BodyPreference" },
3399 { 0x06, "Type" },
3400 { 0x07, "TruncationSize" },
3401 { 0x08, "AllOrNone" },
3402 { 0x0A, "Body" },
3403 { 0x0B, "Data" },
3404 { 0x0C, "EstimatedDataSize" },
3405 { 0x0D, "Truncated" },
3406 { 0x0E, "Attachments" },
3407 { 0x0F, "Attachment" },
3408 { 0x10, "DisplayName" },
3409 { 0x11, "FileReference" },
3410 { 0x12, "Method" },
3411 { 0x13, "ContentId" },
3412 { 0x14, "ContentLocation" },
3413 { 0x15, "IsInline" },
3414 { 0x16, "NativeBodyType" },
3415 { 0x17, "ContentType" },
3416 { 0x18, "Preview" },
3417 { 0x19, "BodyPartReference" },
3418 { 0x1A, "BodyPart" },
3419 { 0x1B, "Status" },
3421 { 0x00, NULL }
3424 static const value_string wbxml_mssyncc10_tags_cp18[] = { /* ActiveSync 'Settings:' Page */
3425 /* 0x00 -- 0x04 GLOBAL */
3426 { 0x05, "Settings" },
3427 { 0x06, "Status" },
3428 { 0x07, "Get" },
3429 { 0x08, "Set" },
3430 { 0x09, "Oof" },
3431 { 0x0A, "OofState" },
3432 { 0x0B, "StartTime" },
3433 { 0x0C, "EndTime" },
3434 { 0x0D, "OofMessage" },
3435 { 0x0E, "AppliesToInteral" },
3436 { 0x0F, "AppliesToExternalKnown" },
3437 { 0x10, "AppliesToExternalUnknown" },
3438 { 0x11, "Enabled" },
3439 { 0x12, "ReplyMessage" },
3440 { 0x13, "BodyType" },
3441 { 0x14, "DevicePassword" },
3442 { 0x15, "Password" },
3443 { 0x16, "DeviceInformation" },
3444 { 0x17, "Model" },
3445 { 0x18, "IMEI" },
3446 { 0x19, "FriendlyName" },
3447 { 0x1A, "OS" },
3448 { 0x1B, "OSLanguage" },
3449 { 0x1C, "PhoneNumber" },
3450 { 0x1D, "UserInformation" },
3451 { 0x1E, "EmailAddresses" },
3452 { 0x1F, "SmtpAddress" },
3453 { 0x20, "UserAgent" },
3454 { 0x21, "EnableOutboundSMS" },
3455 { 0x22, "MobileOperator" },
3456 { 0x23, "PrimarySmtpAddress" },
3457 { 0x24, "Accounts" },
3458 { 0x25, "Account" },
3459 { 0x26, "AccountId" },
3460 { 0x27, "AccountName" },
3461 { 0x28, "UserDisplayName" },
3462 { 0x29, "SendDisabled" },
3463 { 0x2B, "RightsManagementInformation" },
3465 { 0x00, NULL }
3468 static const value_string wbxml_mssyncc10_tags_cp19[] = { /* ActiveSync 'DocumentLibrary:' Page */
3469 /* 0x00 -- 0x04 GLOBAL */
3470 { 0x05, "LinkId" },
3471 { 0x06, "DisplayName" },
3472 { 0x07, "IsFolder" },
3473 { 0x09, "CreationDate" },
3474 { 0x0A, "LastModifiedDate" },
3475 { 0x0B, "ContentLength" },
3476 { 0x0C, "ContentType" },
3478 { 0x00, NULL }
3481 static const value_string wbxml_mssyncc10_tags_cp20[] = { /* ActiveSync 'ItemOperations:' Page */
3482 /* 0x00 -- 0x04 GLOBAL */
3483 { 0x05, "ItemOperations" },
3484 { 0x06, "Fetch" },
3485 { 0x07, "Store" },
3486 { 0x08, "Options" },
3487 { 0x09, "Range" },
3488 { 0x0A, "Total" },
3489 { 0x0B, "Properties" },
3490 { 0x0C, "Data" },
3491 { 0x0D, "Status" },
3492 { 0x0E, "Response" },
3493 { 0x0F, "Version" },
3494 { 0x10, "Schema" },
3495 { 0x11, "Part" },
3496 { 0x12, "EmptyFolderContents" },
3497 { 0x13, "DeleteSubFolders" },
3498 { 0x14, "UserName" },
3499 { 0x15, "Password" },
3500 { 0x16, "Move" },
3501 { 0x17, "DstFldId" },
3502 { 0x18, "ConversationId" },
3503 { 0x19, "MoveAlways" },
3505 { 0x00, NULL }
3508 static const value_string wbxml_mssyncc10_tags_cp21[] = { /* ActiveSync 'ComposeMail:' Page */
3509 /* 0x00 -- 0x04 GLOBAL */
3510 { 0x05, "SendMail" },
3511 { 0x06, "SmartForward" },
3512 { 0x07, "SmartReply" },
3513 { 0x08, "SaveInSentItems" },
3514 { 0x09, "ReplaceMime" },
3515 { 0x0B, "Source" },
3516 { 0x0C, "FolderId" },
3517 { 0x0D, "ItemId" },
3518 { 0x0E, "LongId" },
3519 { 0x0F, "InstanceId" },
3520 { 0x10, "MIME" },
3521 { 0x11, "ClientId" },
3522 { 0x12, "Status" },
3523 { 0x13, "AccountId" },
3525 { 0x00, NULL }
3528 static const value_string wbxml_mssyncc10_tags_cp22[] = { /* ActiveSync 'Email2:' Page */
3529 /* 0x00 -- 0x04 GLOBAL */
3530 { 0x05, "UmCallerID" },
3531 { 0x06, "UmUserNotes" },
3532 { 0x07, "UmAttDuration" },
3533 { 0x08, "UmAttOrder" },
3534 { 0x09, "ConversationId" },
3535 { 0x0A, "ConversationIndex" },
3536 { 0x0B, "LastVerbExecuted" },
3537 { 0x0C, "LastVerbExecutionTime" },
3538 { 0x0D, "ReceivedAsBcc" },
3539 { 0x0E, "Sender" },
3540 { 0x0F, "CalendarType" },
3541 { 0x10, "IsLeapMonth" },
3542 { 0x11, "AccountId" },
3543 { 0x12, "FirstDayOfWeek" },
3544 { 0x13, "MeetingMessageType" },
3546 { 0x00, NULL }
3549 static const value_string wbxml_mssyncc10_tags_cp23[] = { /* ActiveSync 'Notes:' Page */
3550 /* 0x00 -- 0x04 GLOBAL */
3551 { 0x05, "Subject" },
3552 { 0x06, "MessageClass" },
3553 { 0x07, "LastModifiedDate" },
3554 { 0x08, "Categories" },
3555 { 0x09, "Category" },
3557 { 0x00, NULL }
3560 static const value_string wbxml_mssyncc10_tags_cp24[] = { /* ActiveSync 'RightsManagement:' Page */
3561 /* 0x00 -- 0x04 GLOBAL */
3562 { 0x05, "RightsManagementSupport" },
3563 { 0x06, "RightsManagementTemplates" },
3564 { 0x07, "RightsManagementTemplate" },
3565 { 0x08, "RightsManagementLicense" },
3566 { 0x09, "EditAllowed" },
3567 { 0x0A, "ReplyAllowed" },
3568 { 0x0B, "ReplyAllAllowed" },
3569 { 0x0C, "ForwardAllowed" },
3570 { 0x0D, "ModifyRecipientsAllowed" },
3571 { 0x0E, "ExtractAllowed" },
3572 { 0x0F, "PrintAllowed" },
3573 { 0x10, "ExportAllowed" },
3574 { 0x11, "ProgrammaticAccessAllowed" },
3575 { 0x12, "RMOwner" },
3576 { 0x13, "ContentExpiryDate" },
3577 { 0x14, "TemplateId" },
3578 { 0x15, "TemplateName" },
3579 { 0x16, "TemplateDescription" },
3580 { 0x17, "ContentOwner" },
3581 { 0x18, "RemoveRightsManagementDistribution" },
3583 { 0x00, NULL }
3587 /***** Attribute Start tokens *****/
3589 /***** Attribute Value tokens *****/
3591 /***** Token code page aggregation *****/
3592 static const value_valuestring wbxml_mssyncc10_tags[] = {
3593 { 0x00, wbxml_mssyncc10_tags_cp0 }, /* AirSync: */
3594 { 0x01, wbxml_mssyncc10_tags_cp1 }, /* Contacts: */
3595 { 0x02, wbxml_mssyncc10_tags_cp2 }, /* Email: */
3596 { 0x04, wbxml_mssyncc10_tags_cp4 }, /* Calendar: */
3597 { 0x05, wbxml_mssyncc10_tags_cp5 }, /* Move: */
3598 { 0x06, wbxml_mssyncc10_tags_cp6 }, /* GetItemEstimate: */
3599 { 0x07, wbxml_mssyncc10_tags_cp7 }, /* FolderHierarchy: */
3600 { 0x08, wbxml_mssyncc10_tags_cp8 }, /* MeetingResponse: */
3601 { 0x09, wbxml_mssyncc10_tags_cp9 }, /* Tasks: */
3602 { 0x0A, wbxml_mssyncc10_tags_cp10 }, /* ResolveRecipients: */
3603 { 0x0B, wbxml_mssyncc10_tags_cp11 }, /* ValidateCert: */
3604 { 0x0C, wbxml_mssyncc10_tags_cp12 }, /* Contacts2: */
3605 { 0x0D, wbxml_mssyncc10_tags_cp13 }, /* Ping: */
3606 { 0x0E, wbxml_mssyncc10_tags_cp14 }, /* Provision: */
3607 { 0x0F, wbxml_mssyncc10_tags_cp15 }, /* Search: */
3608 { 0x10, wbxml_mssyncc10_tags_cp16 }, /* Gal: */
3609 { 0x11, wbxml_mssyncc10_tags_cp17 }, /* AirSyncBase: */
3610 { 0x12, wbxml_mssyncc10_tags_cp18 }, /* Settings: */
3611 { 0x13, wbxml_mssyncc10_tags_cp19 }, /* DocumentLibrary: */
3612 { 0x14, wbxml_mssyncc10_tags_cp20 }, /* ItemOperations: */
3613 { 0x15, wbxml_mssyncc10_tags_cp21 }, /* ComposeMail: */
3614 { 0x16, wbxml_mssyncc10_tags_cp22 }, /* Email2: */
3615 { 0x17, wbxml_mssyncc10_tags_cp23 }, /* Notes: */
3616 { 0x18, wbxml_mssyncc10_tags_cp24 }, /* RightsManagement: */
3618 { 0x00, NULL }
3621 static const wbxml_decoding decode_mssync_10 = {
3622 "Microsoft ActiveSync",
3623 "ActiveSync",
3624 { NULL, NULL, NULL },
3625 default_opaque_binary_tag,
3626 default_opaque_literal_tag,
3627 default_opaque_binary_attr,
3628 default_opaque_literal_attr,
3629 NULL,
3630 wbxml_mssyncc10_tags,
3631 NULL,
3632 NULL
3638 /* CHANNEL 1.0
3640 * WTA Channel
3641 ***************************************/
3643 /***** Global extension tokens *****/
3645 /***** Tag tokens *****/
3646 static const value_string wbxml_channelc10_tags_cp0[] = {
3647 /* 0x00 -- 0x04 GLOBAL */
3648 { 0x05, "channel" },
3649 { 0x06, "title" },
3650 { 0x07, "abstract" },
3651 { 0x08, "resource" },
3653 { 0x00, NULL }
3656 /***** Attribute Start tokens *****/
3657 static const value_string wbxml_channelc10_attrStart_cp0[] = {
3658 /* 0x00 -- 0x04 GLOBAL */
3659 { 0x05, "maxspace=" },
3660 { 0x06, "base=" },
3661 { 0x07, "href=" },
3662 { 0x08, "href='http://'" },
3663 { 0x09, "href='https://'" },
3664 { 0x0A, "lastmod=" },
3665 { 0x0B, "etag=" },
3666 { 0x0C, "md5=" },
3667 { 0x0D, "success=" },
3668 { 0x0E, "success='http://'" },
3669 { 0x0F, "success='https://'" },
3670 { 0x10, "failure=" },
3671 { 0x11, "failure='http://'" },
3672 { 0x12, "failure='https://'" },
3673 { 0x13, "EventId=" },
3675 { 0x00, NULL }
3678 /***** Attribute Value tokens *****/
3680 /***** Token code page aggregation *****/
3681 static const value_valuestring wbxml_channelc10_tags[] = {
3682 { 0, wbxml_channelc10_tags_cp0 },
3683 { 0, NULL }
3686 static const value_valuestring wbxml_channelc10_attrStart[] = {
3687 { 0, wbxml_channelc10_attrStart_cp0 },
3688 { 0, NULL }
3691 static const wbxml_decoding decode_channelc_10 = {
3692 "Wireless Telephony Application (WTA) Channel 1.0",
3693 "CHANNEL 1.0",
3694 { NULL, NULL, NULL },
3695 default_opaque_binary_tag,
3696 default_opaque_literal_tag,
3697 default_opaque_binary_attr,
3698 default_opaque_literal_attr,
3699 NULL,
3700 wbxml_channelc10_tags,
3701 wbxml_channelc10_attrStart,
3702 NULL
3709 /* application/x-wap-prov.browser-settings
3710 * application/x-wap-prov.browser-bookmarks
3712 * Nokia OTA Provisioning document format
3713 ***************************************/
3715 /***** Global extension tokens *****/
3717 /***** Tag tokens *****/
3718 static const value_string wbxml_nokiaprovc70_tags_cp0[] = {
3719 /* 0x00 -- 0x04 GLOBAL */
3720 { 0x05, "CHARACTERISTIC-LIST" },
3721 { 0x06, "CHARACTERISTIC" },
3722 { 0x07, "PARM" },
3724 { 0x00, NULL }
3727 /***** Attribute Start tokens *****/
3728 static const value_string wbxml_nokiaprovc70_attrStart_cp0[] = {
3729 /* 0x00 -- 0x04 GLOBAL */
3730 { 0x06, "TYPE='ADDRESS'" },
3731 { 0x07, "TYPE='URL'" },
3732 { 0x08, "TYPE='NAME'" },
3733 { 0x10, "NAME=" },
3734 { 0x11, "VALUE=" },
3735 { 0x12, "NAME='BEARER'" },
3736 { 0x13, "NAME='PROXY'" },
3737 { 0x14, "NAME='PORT'" },
3738 { 0x15, "NAME='NAME'" },
3739 { 0x16, "NAME='PROXY_TYPE'" },
3740 { 0x17, "NAME='URL'" },
3741 { 0x18, "NAME='PROXY_AUTHNAME'" },
3742 { 0x19, "NAME='PROXY_AUTHSECRET'" },
3743 { 0x1A, "NAME='SMS_SMSC_ADDRESS'" },
3744 { 0x1B, "NAME='USSD_SERVICE_CODE'" },
3745 { 0x1C, "NAME='GPRS_ACCESSPOINTNAME'" },
3746 { 0x1D, "NAME='PPP_LOGINTYPE'" },
3747 { 0x1E, "NAME='PROXY_LOGINTYPE'" },
3748 { 0x21, "NAME='CSD_DIALSTRING'" },
3749 { 0x22, "NAME='PPP_AUTHTYPE'" },
3750 { 0x23, "NAME='PPP_AUTHNAME'" },
3751 { 0x24, "NAME='PPP_AUTHSECRET'" },
3752 { 0x28, "NAME='CSD_CALLTYPE'" },
3753 { 0x29, "NAME='CSD_CALLSPEED'" },
3754 { 0x45, "VALUE='GSM/CSD'" },
3755 { 0x46, "VALUE='GSM/SMS'" },
3756 { 0x47, "VALUE='GSM/USSD'" },
3757 { 0x48, "VALUE='IS-136/CSD'" },
3758 { 0x49, "VALUE='GPRS'" },
3759 { 0x60, "VALUE='9200'" },
3760 { 0x61, "VALUE='9201'" },
3761 { 0x62, "VALUE='9202'" },
3762 { 0x63, "VALUE='9203'" },
3763 { 0x64, "VALUE='AUTOMATIC'" },
3764 { 0x65, "VALUE='MANUAL'" },
3765 { 0x6A, "VALUE='AUTO'" },
3766 { 0x6B, "VALUE='9600'" },
3767 { 0x6C, "VALUE='14400'" },
3768 { 0x6D, "VALUE='19200'" },
3769 { 0x6E, "VALUE='28800'" },
3770 { 0x6F, "VALUE='38400'" },
3771 { 0x70, "VALUE='PAP'" },
3772 { 0x71, "VALUE='CHAP'" },
3773 { 0x72, "VALUE='ANALOGUE'" },
3774 { 0x73, "VALUE='ISDN'" },
3775 { 0x74, "VALUE='43200'" },
3776 { 0x75, "VALUE='57600'" },
3777 { 0x76, "VALUE='MSISDN_NO'" },
3778 { 0x77, "VALUE='IPV4'" },
3779 { 0x78, "VALUE='MS_CHAP'" },
3780 { 0x7C, "TYPE='MMSURL'" },
3781 { 0x7D, "TYPE='ID'" },
3782 { 0x7E, "NAME='ISP_NAME'" },
3783 { 0x7F, "TYPE='BOOKMARK'" },
3785 { 0x00, NULL }
3788 /***** Attribute Value tokens *****/
3790 /***** Token code page aggregation *****/
3791 static const value_valuestring wbxml_nokiaprovc70_tags[] = {
3792 { 0, wbxml_nokiaprovc70_tags_cp0 },
3793 { 0, NULL }
3796 static const value_valuestring wbxml_nokiaprovc70_attrStart[] = {
3797 { 0, wbxml_nokiaprovc70_attrStart_cp0 },
3798 { 0, NULL }
3801 static const wbxml_decoding decode_nokiaprovc_70 = {
3802 "Nokia Client Provisioning 7.0",
3803 "Nokia Client Provisioning 7.0",
3804 { NULL, NULL, NULL },
3805 default_opaque_binary_tag,
3806 default_opaque_literal_tag,
3807 default_opaque_binary_attr,
3808 default_opaque_literal_attr,
3809 NULL,
3810 wbxml_nokiaprovc70_tags,
3811 wbxml_nokiaprovc70_attrStart,
3812 NULL
3819 /* UAProf [WAP-248]
3821 * User-Agent Profile (used in profile-diff WSP header)
3822 ***************************************/
3824 /***** Global extension tokens *****/
3826 /***** Tag tokens *****/
3827 /* CodePage 0 RDF */
3828 static const value_string wbxml_uaprof_tags_cp0[] = {
3829 {0x05, "rdf:RDF"},
3830 {0x06, "rdf:Description"},
3831 {0x07, "rdf:Alt"},
3832 {0x08, "rdf:Bag"},
3833 {0x09, "rdf:Seq"},
3834 {0x0A, "rdf:li"},
3835 {0x0B, "rdf:type"},
3836 {0x0C, "rdf:value"},
3837 {0x0D, "rdf:subject"},
3838 {0x0E, "rdf:predicate"},
3839 {0x0F, "rdf:object"},
3841 { 0x00, NULL }
3844 /* CodePage 1 Core Vocabulary */
3845 static const value_string wbxml_uaprof_tags_cp1[] = {
3846 {0x06, "rdf:Description"},
3847 {0x07, "rdf:Alt"},
3848 {0x08, "rdf:Bag"},
3849 {0x09, "rdf:Seq"},
3850 {0x0A, "rdf:li"},
3851 {0x0B, "rdf:type"},
3852 {0x0C, "prf:component"},
3853 {0x0D, "prf:defaults"},
3854 {0x0E, "prf:BitsPerPixel"},
3855 {0x0F, "prf:ColorCapable"},
3856 {0x10, "prf:CPU"},
3857 {0x11, "prf:ImageCapable"},
3858 {0x12, "prf:InputCharSet"},
3859 {0x13, "prf:Keyboard"},
3860 {0x15, "prf:Model"},
3861 {0x16, "prf:OutputCharSet"},
3862 {0x17, "prf:PointingResolution"},
3863 {0x18, "prf:ScreenSize"},
3864 {0x19, "prf:ScreenSizeChar"},
3865 {0x1A, "prf:NumberOfSoftKeys"},
3866 {0x1B, "prf:SoundOutputCapable"},
3867 {0x1C, "prf:TextInputCapable"},
3868 {0x1D, "prf:Vendor"},
3869 {0x1E, "prf:VoiceInputCapable"},
3870 {0x1F, "prf:AcceptDownloadableSoftware"},
3871 {0x20, "prf:AudioInputEncoder"},
3872 {0x21, "prf:DownloadableSoftwareSupport"},
3873 {0x22, "prf:JavaEnabled"},
3874 {0x23, "prf:JVMVersion"},
3875 {0x24, "prf:MexeClassmark"},
3876 {0x25, "prf:MexeSpec"},
3877 {0x26, "prf:OSName"},
3878 {0x27, "prf:OSVendor"},
3879 {0x28, "prf:OSVersion"},
3880 {0x29, "prf:RecipientAppAgent"},
3881 {0x2A, "prf:SoftwareNumber"},
3882 {0x2B, "prf:VideoInputEncoder"},
3883 {0x2C, "prf:CurrentBearerService"},
3884 {0x2D, "prf:SecuritySupport"},
3885 {0x2E, "prf:SupportedBearers"},
3886 {0x2F, "prf:WapDeviceClass"},
3887 {0x30, "prf:WapPushMsgPriority"}, /* Deprecated */
3888 {0x31, "prf:WapPushMsgSize"}, /* Deprecated */
3889 {0x32, "prf:WapVersion"},
3890 {0x33, "prf:WmlDeckSize"},
3891 {0x34, "prf:WmlScriptLibraries"},
3892 {0x35, "prf:WmlScriptVersion"},
3893 {0x36, "prf:WmlVersion"},
3894 {0x37, "prf:WtaiLibraries"},
3895 {0x38, "prf:WtaVersion"},
3896 {0x39, "prf:PixelAspectRatio"},
3897 {0x3A, "prf:StandardFontProportional"},
3898 {0x3B, "prf:WapSupportedApplications"}, /* Deprecated */
3899 {0x3C, "prf:BluetoothProfile"},
3900 {0x3D, "prf:MexeClassmarks"},
3901 {0x3E, "prf:MexeSecureDomains"},
3903 { 0x00, NULL }
3906 /* CodePage 4 Core Vocabulary (continued) */
3907 static const value_string wbxml_uaprof_tags_cp4[] = {
3908 {0x10, "prf:SupportedBluetoothVersion"},
3909 {0x11, "prf:SupportedPictogramSet"},
3910 {0x12, "prf:CcppAccept"},
3911 {0x13, "prf:CcppAccept-Charset"},
3912 {0x14, "prf:CcppAccept-Encoding"},
3913 {0x15, "prf:CcppAccept-Language"},
3915 { 0x00, NULL }
3918 /* CodePage 2 BrowserUA */
3919 static const value_string wbxml_uaprof_tags_cp2[] = {
3920 {0x05, "rdf:Description"},
3921 {0x06, "rdf:Alt"},
3922 {0x07, "rdf:Bag"},
3923 {0x08, "rdf:Seq"},
3924 {0x09, "rdf:li"},
3925 {0x0A, "rdf:type"},
3926 {0x0B, "prf:component"},
3927 {0x0C, "prf:defaults"},
3928 {0x0D, "prf:BrowserName"},
3929 {0x0E, "prf:BrowserVersion"},
3930 {0x0F, "prf:CcppAccept"}, /* Deprecated */
3931 {0x10, "prf:CcppAccept-Charset"}, /* Deprecated */
3932 {0x11, "prf:CcppAccept-Encoding"}, /* Deprecated */
3933 {0x12, "prf:CcppAccept-Language"}, /* Deprecated */
3934 {0x13, "prf:DownloadableBrowserApps"},
3935 {0x14, "prf:FramesCapable"},
3936 {0x15, "prf:HtmlVersion"},
3937 {0x16, "prf:JavaAppletEnabled"},
3938 {0x17, "prf:JavaScriptEnabled"},
3939 {0x18, "prf:JavaScriptVersion"},
3940 {0x19, "prf:PreferenceForFrames"},
3941 {0x1A, "prf:TablesCapable"},
3942 {0x1B, "Prf:XhtmlVersion"},
3943 {0x1C, "prf:XhtmlModules"},
3945 { 0x00, NULL }
3948 /* CodePage 3 PushCharacteristics */
3949 static const value_string wbxml_uaprof_tags_cp3[] = {
3950 {0x05, "rdf:Description"},
3951 {0x06, "rdf:Alt"},
3952 {0x07, "rdf:Bag"},
3953 {0x08, "rdf:Seq"},
3954 {0x09, "rdf:li"},
3955 {0x0A, "rdf:type"},
3956 {0x0B, "prf:component"},
3957 {0x0C, "prf:defaults"},
3958 {0x0D, "prf:Push-Accept"},
3959 {0x0E, "prf:Push-Accept-Charset"},
3960 {0x0F, "prf:Push-Accept-Encoding"},
3961 {0x10, "prf:Push-Accept-Language"},
3962 {0x11, "prf:Push-Accept-AppID"},
3963 {0x12, "prf:Push-MsgSize"},
3964 {0x13, "prf:Push-MaxPushReq"},
3966 { 0x00, NULL }
3969 /***** Attribute Start tokens *****/
3970 /* CodePage 0 RDF */
3971 static const value_string wbxml_uaprof_attrStart_cp0[] = {
3972 {0x05, "ID"},
3973 {0x06, "rdf:about"},
3974 {0x07, "rdf:aboutEach"},
3975 {0x08, "rdf:aboutEachPrefix"},
3976 {0x09, "rdf:bagID"},
3977 {0x0A, "rdf:type"},
3978 {0x0B, "rdf:resource"},
3979 {0x0C, "rdf:parseType='Literal'"},
3980 {0x0D, "rdf:parseType='Resource'"},
3981 {0x0E, "xml:lang"},
3982 {0x0F, "xmlns:prf"},
3983 {0x10, "xmlns:rdf"},
3985 { 0x00, NULL }
3988 /* CodePage 1 Core Vocabulary */
3989 static const value_string wbxml_uaprof_attrStart_cp1[] = {
3990 {0x05, "rdf:resource"},
3991 {0x06, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
3992 "ccppschema-20010430#HardwarePlatform'"},
3993 {0x07, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
3994 "ccppschema-20010430#SoftwarePlatform'"},
3995 {0x08, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
3996 "ccppschema-20010430#NetworkCharacteristics'"},
3997 {0x09, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
3998 "ccppschema-20010430#WapCharacteristics'"},
3999 {0x0A, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
4000 "ccppschema-20010430#BrowserUA'"},
4001 {0x0B, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
4002 "ccppschema-20010430#PushCharacteristics'"},
4003 {0x10, "prf:BitsPerPixel"},
4004 {0x11, "prf:ColorCapable='Yes'"},
4005 {0x12, "prf:ColorCapable='No'"},
4006 {0x13, "prf:CPU"},
4007 {0x14, "prf:ImageCapable='Yes'"},
4008 {0x15, "prf:ImageCapable='No'"},
4009 {0x16, "prf:InputCharSet"},
4010 {0x17, "prf:Keyboard"},
4011 {0x19, "prf:Model"},
4012 {0x1A, "prf:OutputCharSet"},
4013 {0x1B, "prf:PointingResolution"},
4014 {0x1C, "prf:ScreenSize"},
4015 {0x1D, "prf:ScreenSizeChar"},
4016 {0x1E, "prf:NumberOfSoftKeys='Yes'"},
4017 {0x20, "prf:SoundOutputCapable='Yes'"},
4018 {0x21, "prf:SoundOutputCapable='No'"},
4019 {0x22, "prf:TextInputCapable='Yes'"},
4020 {0x23, "prf:TextInputCapable='No'"},
4021 {0x24, "prf:Vendor"},
4022 {0x25, "prf:VoiceInputCapable='Yes'"},
4023 {0x26, "prf:VoiceInputCapable='No'"},
4024 {0x27, "prf:PixelAspectRatio"},
4025 {0x28, "prf:StandardFontProportional='Yes'"},
4026 {0x29, "prf:StandardFontProportional='No'"},
4027 {0x30, "prf:AcceptDownloadableSoftware='Yes'"},
4028 {0x31, "prf:AcceptDownloadableSoftware='No'"},
4029 {0x32, "prf:AudioInputEncoder"},
4030 {0x33, "prf:DownloadableSoftwareSupport"},
4031 {0x35, "prf:JavaEnabled='Yes'"},
4032 {0x36, "prf:JavaEnabled='No'"},
4033 {0x37, "prf:JVMVersion"},
4034 {0x38, "prf:MexeClassmark"},
4035 {0x39, "prf:MexeSpec"},
4036 {0x3A, "prf:OSName"},
4037 {0x3B, "prf:OSVendor"},
4038 {0x3C, "prf:OSVersion"},
4039 {0x3D, "prf:RecipientAppAgent"},
4040 {0x3E, "prf:SoftwareNumber"},
4041 {0x21, "prf:SoundOutputCapable='No'"},
4042 {0x22, "prf:TextInputCapable='Yes'"},
4043 {0x23, "prf:TextInputCapable='No'"},
4044 {0x24, "prf:Vendor"},
4045 {0x25, "prf:VoiceInputCapable='Yes'"},
4046 {0x26, "prf:VoiceInputCapable='No'"},
4047 {0x27, "prf:PixelAspectRatio"},
4048 {0x28, "prf:StandardFontProportional='Yes'"},
4049 {0x29, "prf:StandardFontProportional='No'"},
4050 {0x30, "prf:AcceptDownloadableSoftware='Yes'"},
4051 {0x31, "prf:AcceptDownloadableSoftware='No'"},
4052 {0x32, "prf:AudioInputEncoder"},
4053 {0x33, "prf:DownloadableSoftwareSupport"},
4054 {0x35, "prf:JavaEnabled='Yes'"},
4055 {0x36, "prf:JavaEnabled='No'"},
4056 {0x37, "prf:JVMVersion"},
4057 {0x38, "prf:MexeClassmark"},
4058 {0x39, "prf:MexeSpec"},
4059 {0x3A, "prf:OSName"},
4060 {0x3B, "prf:OSVendor"},
4061 {0x3C, "prf:OSVersion"},
4062 {0x3D, "prf:RecipientAppAgent"},
4063 {0x3E, "prf:SoftwareNumber"},
4064 {0x3F, "prf:VideoInputEncoder"},
4065 {0x50, "prf:CurrentBearerService"},
4066 {0x51, "prf:SecuritySupport"},
4067 {0x52, "prf:SupportedBearers"},
4068 {0x60, "prf:WapDeviceClass"},
4069 {0x61, "prf:WapPushMsgPriority"}, /* Deprecated */
4070 {0x62, "prf:WapPushMsgSize"}, /* Deprecated */
4071 {0x63, "prf:WapVersion"},
4072 {0x64, "prf:WmlDeckSize"},
4073 {0x65, "prf:WmlScriptLibraries"},
4074 {0x66, "prf:WmlScriptVersion"},
4075 {0x67, "prf:WmlVersion"},
4076 {0x68, "prf:WtaiLibraries"},
4077 {0x69, "prf:WtaVersion"},
4078 {0x70, "prf:WapSupportedApplications"}, /* Deprecated */
4079 {0x71, "prf:BluetoothProfile"},
4080 {0x72, "prf:MexeClassmarks"},
4081 {0x73, "prf:MexeSecureDomains='YES'"},
4082 {0x74, "prf:MexeSecureDomains='NO'"},
4083 {0x75, "prf:SupportedBluetoothVersion"},
4084 {0x76, "prf:SupportedPictogramSet"},
4085 {0x77, "prf:CcppAccept"},
4086 {0x78, "prf:CcppAccept-Charset"},
4087 {0x79, "prf:CcppAccept-Encoding"},
4088 {0x7F, "prf:CcppAccept-Language"},
4090 { 0x00, NULL }
4093 /* CodePage 2 BrowserUA */
4094 static const value_string wbxml_uaprof_attrStart_cp2[] = {
4095 {0x05, "prf:CcppAccept"}, /* Deprecated */
4096 {0x06, "prf:CcppAccept-Charset"}, /* Deprecated */
4097 {0x07, "prf:CcppAccept-Encoding"}, /* Deprecated */
4098 {0x08, "prf:CcppAccept-Language"}, /* Deprecated */
4099 {0x09, "prf:DownloadableBrowserApps"},
4100 {0x0A, "prf:FramesCapable='Yes'"},
4101 {0x0B, "prf:FramesCapable='No'"},
4102 {0x0C, "prf:HtmlVersion='3.2'"},
4103 {0x0D, "prf:HtmlVersion='4.0'"},
4104 {0x0E, "prf:JavaAppletEnabled='Yes'"},
4105 {0x0F, "prf:JavaAppletEnabled='No'"},
4106 {0x10, "prf:JavaScriptEnabled='Yes'"},
4107 {0x11, "prf:JavaScriptEnabled='No'"},
4108 {0x12, "prf:JavaScriptVersion"},
4109 {0x13, "prf:PreferenceForFrames='Yes'"},
4110 {0x14, "prf:PreferenceForFrames='No'"},
4111 {0x15, "prf:TablesCapable='Yes'"},
4112 {0x16, "prf:TablesCapable='No'"},
4113 {0x17, "prf:XhtmlVersion"},
4114 {0x18, "prf:XhtmlModules"},
4115 {0x19, "prf:BrowserName"},
4116 {0x1A, "prf:BrowserVersion"},
4118 { 0x00, NULL }
4121 /* CodePage 3 PushCharacteristics */
4122 static const value_string wbxml_uaprof_attrStart_cp3[] = {
4123 {0x05, "prf:Push-Accept"},
4124 {0x06, "prf:Push-Accept-Charset"},
4125 {0x07, "prf:Push-Accept-Encoding"},
4126 {0x08, "prf:Push-Accept-Language"},
4127 {0x09, "prf:Push-Accept-AppID"},
4128 {0x0A, "prf:Push-MsgSize"},
4129 {0x0B, "prf:Push-MaxPushReq"},
4131 { 0x00, NULL }
4134 /***** Attribute Value tokens *****/
4135 /* CodePage 0 RDF */
4136 static const value_string wbxml_uaprof_attrValue_cp0[] = {
4137 {0x85, "rdf:Statement"},
4138 {0x86, "http://"},
4139 {0x87, "http://www."},
4140 {0x88, "https://"},
4141 {0x89, "https://www."},
4142 {0x8A, "www."},
4143 {0x8B, ".com/"},
4144 {0x8C, ".edu/"},
4145 {0x8D, ".net/"},
4146 {0x8E, ".org/"},
4148 { 0x00, NULL }
4151 /* CodePage 1 CoreVocabularyAttrValue */
4152 static const value_string wbxml_uaprof_attrValue_cp1[] = {
4153 {0x85, "No"},
4154 {0x86, "Yes"},
4156 { 0x00, NULL }
4159 /* CodePage 2 BrowserUAAttrValue */
4160 static const value_string wbxml_uaprof_attrValue_cp2[] = {
4161 {0x85, "No"},
4162 {0x86, "Yes"},
4164 { 0x00, NULL }
4167 /***** Token code page aggregation *****/
4168 static const value_valuestring wbxml_uaprof_tags[] = {
4169 { 0, wbxml_uaprof_tags_cp0 },
4170 { 1, wbxml_uaprof_tags_cp1 },
4171 { 2, wbxml_uaprof_tags_cp2 },
4172 { 3, wbxml_uaprof_tags_cp3 },
4173 { 4, wbxml_uaprof_tags_cp4 },
4174 { 0, NULL }
4177 static const value_valuestring wbxml_uaprof_attrStart[] = {
4178 { 0, wbxml_uaprof_attrStart_cp0 },
4179 { 1, wbxml_uaprof_attrStart_cp1 },
4180 { 2, wbxml_uaprof_attrStart_cp2 },
4181 { 3, wbxml_uaprof_attrStart_cp3 },
4182 { 0, NULL }
4185 static const value_valuestring wbxml_uaprof_attrValue[] = {
4186 { 0, wbxml_uaprof_attrValue_cp0 },
4187 { 1, wbxml_uaprof_attrValue_cp1 },
4188 { 2, wbxml_uaprof_attrValue_cp2 },
4189 { 0, NULL }
4192 static const wbxml_decoding decode_uaprof_wap_248 = {
4193 "User-Agent Profile (WAP-174, WAP-248)",
4194 "UAProf (WAP-174, WAP-248)",
4195 { NULL, NULL, NULL },
4196 default_opaque_binary_tag,
4197 default_opaque_literal_tag,
4198 default_opaque_binary_attr,
4199 default_opaque_literal_attr,
4200 NULL,
4201 wbxml_uaprof_tags,
4202 wbxml_uaprof_attrStart,
4203 wbxml_uaprof_attrValue
4210 /* WV-CSP 1.0
4212 * Wireless Village Client Server Protocol
4213 ***************************************/
4215 /***** Global extension tokens *****/
4217 /***** Tag tokens *****/
4218 /* Common code page (0x00) */
4219 static const value_string wbxml_wv_csp_10_tags_cp0[] = {
4220 /* 0x00 -- 0x04 GLOBAL */
4221 { 0x05, "Acceptance" },
4222 { 0x06, "AddList" },
4223 { 0x07, "AddNickList" },
4224 { 0x08, "Attribute" },
4225 { 0x09, "AttributeList" },
4226 { 0x0A, "ClientID" },
4227 { 0x0B, "Code" },
4228 { 0x0C, "ContactList" },
4229 { 0x0D, "ContentData" },
4230 { 0x0E, "ContentEncoding" },
4231 { 0x0F, "ContentSize" },
4232 { 0x10, "ContentType" },
4233 { 0x11, "DateTime" },
4234 { 0x12, "Description" },
4235 { 0x13, "DetailedResult" },
4236 { 0x14, "EntityList" },
4237 { 0x15, "Group" },
4238 { 0x16, "GroupID" },
4239 { 0x17, "GroupList" },
4240 { 0x18, "InUse" },
4241 { 0x19, "Logo" },
4242 { 0x1A, "MessageCount" },
4243 { 0x1B, "MessageID" },
4244 { 0x1C, "MessageURI" },
4245 { 0x1D, "MSISDN" },
4246 { 0x1E, "Name" },
4247 { 0x1F, "NickList" },
4248 { 0x20, "NickName" },
4249 { 0x21, "Poll" },
4250 { 0x22, "Presence" },
4251 { 0x23, "PresenceSubList" },
4252 { 0x24, "PresenceValue" },
4253 { 0x25, "Property" },
4254 { 0x26, "Qualifier" },
4255 { 0x27, "Recipient" },
4256 { 0x28, "RemoveList" },
4257 { 0x29, "RemoveNickList" },
4258 { 0x2A, "Result" },
4259 { 0x2B, "ScreenName" },
4260 { 0x2C, "Sender" },
4261 { 0x2D, "Session" },
4262 { 0x2E, "SessionDescriptor" },
4263 { 0x2F, "SessionID" },
4264 { 0x30, "SessionType" },
4265 { 0x31, "Status" },
4266 { 0x32, "Transaction" },
4267 { 0x33, "TransactionContent" },
4268 { 0x34, "TransactionDescriptor" },
4269 { 0x35, "TransactionID" },
4270 { 0x36, "TransactionMode" },
4271 { 0x37, "URL" },
4272 { 0x38, "URLList" },
4273 { 0x39, "User" },
4274 { 0x3A, "UserID" },
4275 { 0x3B, "UserList" },
4276 { 0x3C, "Validity" },
4277 { 0x3D, "Value" },
4278 { 0x3E, "WV-CSP-Message" },
4280 { 0x00, NULL }
4283 /* Access code page (0x01) */
4284 static const value_string wbxml_wv_csp_10_tags_cp1[] = {
4285 /* 0x00 -- 0x04 GLOBAL */
4286 { 0x05, "AllFunctions" },
4287 { 0x06, "AllFunctionsRequest" },
4288 { 0x07, "CancelInvite-Request" },
4289 { 0x08, "CancelInviteUser-Request" },
4290 { 0x09, "Capability" },
4291 { 0x0A, "CapabilityList" },
4292 { 0x0B, "CapabilityRequest" },
4293 { 0x0C, "ClientCapability-Request" },
4294 { 0x0D, "ClientCapability-Response" },
4295 { 0x0E, "DigestBytes" },
4296 { 0x0F, "DigestSchema" },
4297 { 0x10, "Disconnect" },
4298 { 0x11, "Functions" },
4299 { 0x12, "GetSPInfo-Request" },
4300 { 0x13, "GetSPInfo-Response" },
4301 { 0x14, "InviteID" },
4302 { 0x15, "InviteNote" },
4303 { 0x16, "Invite-Request" },
4304 { 0x17, "Invite-Response" },
4305 { 0x18, "InviteType" },
4306 { 0x19, "InviteUser-Request" },
4307 { 0x1A, "InviteUser-Response" },
4308 { 0x1B, "KeepAlive-Request" },
4309 { 0x1C, "KeepAliveTime" },
4310 { 0x1D, "Login-Request" },
4311 { 0x1E, "Login-Response" },
4312 { 0x1F, "Logout-Request" },
4313 { 0x20, "Nonce" },
4314 { 0x21, "Password" },
4315 { 0x22, "Polling-Request" },
4316 { 0x23, "ResponseNote" },
4317 { 0x24, "SearchElement" },
4318 { 0x25, "SearchFindings" },
4319 { 0x26, "SearchID" },
4320 { 0x27, "SearchIndex" },
4321 { 0x28, "SearchLimit" },
4322 { 0x29, "SearchOnlineStatus" },
4323 { 0x2A, "SearchPairList" },
4324 { 0x2B, "Search-Request" },
4325 { 0x2C, "Search-Response" },
4326 { 0x2D, "SearchResult" },
4327 { 0x2E, "Service-Request" },
4328 { 0x2F, "Service-Response" },
4329 { 0x30, "SessionCookie" },
4330 { 0x31, "StopSearch-Request" },
4331 { 0x32, "TimeToLive" },
4333 { 0x00, NULL }
4336 /* Service code page (0x02) */
4337 static const value_string wbxml_wv_csp_10_tags_cp2[] = {
4338 /* 0x00 -- 0x04 GLOBAL */
4339 { 0x05, "ADDGM" },
4340 { 0x06, "AttListFunc" },
4341 { 0x07, "BLENT" },
4342 { 0x08, "CAAUT" },
4343 { 0x09, "CAINV" },
4344 { 0x0A, "CALI" },
4345 { 0x0B, "CCLI" },
4346 { 0x0C, "ContListFunc" },
4347 { 0x0D, "CREAG" },
4348 { 0x0E, "DALI" },
4349 { 0x0F, "DCLI" },
4350 { 0x10, "DELGR" },
4351 { 0x11, "FundamentalFeat" },
4352 { 0x12, "FWMSG" },
4353 { 0x13, "GALS" },
4354 { 0x14, "GCLI" },
4355 { 0x15, "GETGM" },
4356 { 0x16, "GETGP" },
4357 { 0x17, "GETLM" },
4358 { 0x18, "GETM" },
4359 { 0x19, "GETPR" },
4360 { 0x1A, "GETSPI" },
4361 { 0x1B, "GETWL" },
4362 { 0x1C, "GLBLU" },
4363 { 0x1D, "GRCHN" },
4364 { 0x1E, "GroupAuthFunc" },
4365 { 0x1F, "GroupFeat" },
4366 { 0x20, "GroupMgmtFunc" },
4367 { 0x21, "GroupUseFunc" },
4368 { 0x22, "IMAuthFunc" },
4369 { 0x23, "IMFeat" },
4370 { 0x24, "IMReceiveFunc" },
4371 { 0x25, "IMSendFunc" },
4372 { 0x26, "INVIT" },
4373 { 0x27, "InviteFunc" },
4374 { 0x28, "MBRAC" },
4375 { 0x29, "MCLS" },
4376 { 0x2A, "MDELIV" },
4377 { 0x2B, "NEWM" },
4378 { 0x2C, "NOTIF" },
4379 { 0x2D, "PresenceAuthFunc" },
4380 { 0x2E, "PresenceDeliverFunc" },
4381 { 0x2F, "PresenceFeat" },
4382 { 0x30, "REACT" },
4383 { 0x31, "REJCM" },
4384 { 0x32, "REJEC" },
4385 { 0x33, "RMVGM" },
4386 { 0x34, "SearchFunc" },
4387 { 0x35, "ServiceFunc" },
4388 { 0x36, "SETD" },
4389 { 0x37, "SETGP" },
4390 { 0x38, "SRCH" },
4391 { 0x39, "STSRC" },
4392 { 0x3A, "SUBGCN" },
4393 { 0x3B, "UPDPR" },
4394 { 0x3C, "WVCSPFeat" },
4396 { 0x00, NULL }
4399 /* Client capability code page (0x03) */
4400 static const value_string wbxml_wv_csp_10_tags_cp3[] = {
4401 /* 0x00 -- 0x04 GLOBAL */
4402 { 0x05, "AcceptedCharset" },
4403 { 0x06, "AcceptedContentLength" },
4404 { 0x07, "AcceptedContentType" },
4405 { 0x08, "AcceptedTransferEncoding" },
4406 { 0x09, "AnyContent" },
4407 { 0x0A, "ClientType" },
4408 { 0x0B, "InitialDeliveryMethod" },
4409 { 0x0C, "MultiTrans" },
4410 { 0x0D, "ParserSize" },
4411 { 0x0E, "ServerPollMin" },
4412 { 0x0F, "SupportedBearer" },
4413 { 0x10, "SupportedCIRMethod" },
4414 { 0x11, "TCPAddress" },
4415 { 0x12, "TCPPort" },
4416 { 0x13, "UDPPort" },
4418 { 0x00, NULL }
4421 /* Presence primitive code page (0x04) */
4422 static const value_string wbxml_wv_csp_10_tags_cp4[] = {
4423 /* 0x00 -- 0x04 GLOBAL */
4424 { 0x05, "CancelAuth-Request" },
4425 { 0x06, "ContactListProperties" },
4426 { 0x07, "CreateAttributeList-Request" },
4427 { 0x08, "CreateList-Request" },
4428 { 0x09, "DefaultAttributeList" },
4429 { 0x0A, "DefaultContactList" },
4430 { 0x0B, "DefaultList" },
4431 { 0x0C, "DeleteAttributeList-Request" },
4432 { 0x0D, "DeleteList-Request" },
4433 { 0x0E, "GetAttributeList-Request" },
4434 { 0x0F, "GetAttributeList-Response" },
4435 { 0x10, "GetList-Request" },
4436 { 0x11, "GetList-Response" },
4437 { 0x12, "GetPresence-Request" },
4438 { 0x13, "GetPresence-Response" },
4439 { 0x14, "GetWatcherList-Request" },
4440 { 0x15, "GetWatcherList-Response" },
4441 { 0x16, "ListManage-Request" },
4442 { 0x17, "ListManage-Response" },
4443 { 0x18, "Presence" },
4444 { 0x19, "PresenceAuth-Request" },
4445 { 0x1A, "PresenceAuth-Response" },
4446 { 0x1B, "PresenceNotification-Request" },
4447 { 0x1C, "PresenceValueList" },
4448 { 0x1D, "SubscribePresence-Request" },
4449 { 0x1E, "UnsubscribePresence-Request" },
4450 { 0x1F, "UpdatePresence-Request" },
4452 { 0x00, NULL }
4455 /* Presence attribute code page (0x05) */
4456 static const value_string wbxml_wv_csp_10_tags_cp5[] = {
4457 /* 0x00 -- 0x04 GLOBAL */
4458 { 0x05, "Accuracy" },
4459 { 0x06, "Address" },
4460 { 0x07, "AddrPref" },
4461 { 0x08, "Alias" },
4462 { 0x09, "Altitude" },
4463 { 0x0A, "Building" },
4464 { 0x0B, "CAddr" },
4465 { 0x0C, "City" },
4466 { 0x0D, "ClientInfo" },
4467 { 0x0E, "ClientProducer" },
4468 { 0x0F, "ClientType" },
4469 { 0x10, "ClientVersion" },
4470 { 0x11, "CommC" },
4471 { 0x12, "CommCap" },
4472 { 0x13, "ContactInfo" },
4473 { 0x14, "ContainedvCard" },
4474 { 0x15, "Country" },
4475 { 0x16, "Crossing1" },
4476 { 0x17, "Crossing2" },
4477 { 0x18, "DevManufacturer" },
4478 { 0x19, "DirectContent" },
4479 { 0x1A, "FreeTextLocation" },
4480 { 0x1B, "GeoLocation" },
4481 { 0x1C, "Language" },
4482 { 0x1D, "Latitude" },
4483 { 0x1E, "Longitude" },
4484 { 0x1F, "Model" },
4485 { 0x20, "NamedArea" },
4486 { 0x21, "OnlineStatus" },
4487 { 0x22, "PLMN" },
4488 { 0x23, "PrefC" },
4489 { 0x24, "PreferredContacts" },
4490 { 0x25, "PreferredLanguage" },
4491 { 0x26, "ReferredContent" },
4492 { 0x27, "ReferredvCard" },
4493 { 0x28, "Registration" },
4494 { 0x29, "StatusContent" },
4495 { 0x2A, "StatusMood" },
4496 { 0x2B, "StatusText" },
4497 { 0x2C, "Street" },
4498 { 0x2D, "TimeZone" },
4499 { 0x2E, "UserAvailability" },
4501 { 0x00, NULL }
4504 /* Messaging code page (0x06) */
4505 static const value_string wbxml_wv_csp_10_tags_cp6[] = {
4506 /* 0x00 -- 0x04 GLOBAL */
4507 { 0x05, "BlockList" },
4508 { 0x06, "BlockUser-Request" },
4509 { 0x07, "DeliveryMethod" },
4510 { 0x08, "DeliveryReport" },
4511 { 0x09, "DeliveryReport-Request" },
4512 { 0x0A, "ForwardMessage-Request" },
4513 { 0x0B, "GetBlockedList-Request" },
4514 { 0x0C, "GetBlockedList-Response" },
4515 { 0x0D, "GetMessageList-Request" },
4516 { 0x0E, "GetMessageList-Response" },
4517 { 0x0F, "GetMessage-Request" },
4518 { 0x10, "GetMessage-Response" },
4519 { 0x11, "GrantList" },
4520 { 0x12, "MessageDelivered" },
4521 { 0x13, "MessageInfo" },
4522 { 0x14, "MessageNotification" },
4523 { 0x15, "NewMessage" },
4524 { 0x16, "RejectMessage-Request" },
4525 { 0x17, "SendMessage-Request" },
4526 { 0x18, "SendMessage-Response" },
4527 { 0x19, "SetDeliveryMethod-Request" },
4529 { 0x00, NULL }
4532 /* Group code page (0x07) */
4533 static const value_string wbxml_wv_csp_10_tags_cp7[] = {
4534 /* 0x00 -- 0x04 GLOBAL */
4535 { 0x05, "AddGroupMembers-Request" },
4536 { 0x06, "Admin" },
4537 { 0x07, "CreateGroup-Request" },
4538 { 0x08, "DeleteGroup-Request" },
4539 { 0x09, "GetGroupMembers-Request" },
4540 { 0x0A, "GetGroupMembers-Response" },
4541 { 0x0B, "GetGroupProps-Request" },
4542 { 0x0C, "GetGroupProps-Response" },
4543 { 0x0D, "GroupChangeNotice" },
4544 { 0x0E, "GroupProperties" },
4545 { 0x0F, "Joined" },
4546 { 0x10, "JoinedRequest" },
4547 { 0x11, "JoinGroup-Request" },
4548 { 0x12, "JoinGroup-Response" },
4549 { 0x13, "LeaveGroup-Request" },
4550 { 0x14, "LeaveGroup-Response" },
4551 { 0x15, "Left" },
4552 { 0x16, "MemberAccess-Request" },
4553 { 0x17, "Mod" },
4554 { 0x18, "OwnProperties" },
4555 { 0x19, "RejectList-Request" },
4556 { 0x1A, "RejectList-Response" },
4557 { 0x1B, "RemoveGroupMembers-Request" },
4558 { 0x1C, "SetGroupProps-Request" },
4559 { 0x1D, "SubscribeGroupNotice-Request" },
4560 { 0x1E, "SubscribeGroupNotice-Response" },
4561 { 0x1F, "Users" },
4562 { 0x20, "WelcomeNote" },
4564 { 0x00, NULL }
4568 * Attribute start tokens
4570 /* common code page (0x00) */
4571 static const value_string wbxml_wv_csp_10_attrStart_cp0[] = {
4572 /* 0x00 -- 0x04 GLOBAL */
4573 { 0x05, "xmlns='http://www.wireless-village.org/CSP'" },
4574 { 0x06, "xmlns='http://www.wireless-village.org/PA'" },
4575 { 0x07, "xmlns='http://www.wireless-village.org/TRC'" },
4577 { 0x00, NULL }
4581 * Attribute value tokens
4583 /* Common value tokens (0x00) */
4584 static const value_string wbxml_wv_csp_10_attrValue_cp0[] = {
4585 /* 0x80 -- 0x84 GLOBAL */
4586 { 0x85, "AccessType" },
4587 { 0x86, "ActiveUsers" },
4588 { 0x87, "Admin" },
4589 { 0x88, "application/" },
4590 { 0x89, "application/vnd.wap.mms-message" },
4591 { 0x8A, "application/x-sms" },
4592 { 0x8B, "BASE64" },
4593 { 0x8C, "Closed" },
4594 { 0x8D, "Default" },
4595 { 0x8E, "DisplayName" },
4596 { 0x8F, "False (No)" },
4597 { 0x90, "Get" },
4598 { 0x91, "Group (GR)" },
4599 { 0x92, "http://" },
4600 { 0x93, "https://" },
4601 { 0x94, "image/" },
4602 { 0x95, "Inband" },
4603 { 0x96, "Instant Messaging (IM)" },
4604 { 0x97, "MaxActiveUsers" },
4605 { 0x98, "Mod" },
4606 { 0x99, "Name" },
4607 { 0x9A, "None" },
4608 { 0x9B, "Notify/Get" },
4609 { 0x9C, "Open" },
4610 { 0x9D, "Outband" },
4611 { 0x9E, "Presence (PR)" },
4612 { 0x9F, "Private" },
4613 { 0xA0, "PrivateMessaging" },
4614 { 0xA1, "PrivilegeLevel" },
4615 { 0xA2, "Public" },
4616 { 0xA3, "Push" },
4617 { 0xA4, "Request" },
4618 { 0xA5, "Response" },
4619 { 0xA6, "ScreenName" },
4620 { 0xA7, "Searchable" },
4621 { 0xA8, "Set" },
4622 { 0xA9, "Shared Content (SC)" },
4623 { 0xAA, "text/" },
4624 { 0xAB, "text/plain" },
4625 { 0xAC, "text/x-vCalendar" },
4626 { 0xAD, "text/x-vCard" },
4627 { 0xAE, "Topic" },
4628 { 0xAF, "True (Yes)" },
4629 { 0xB0, "Type" },
4630 { 0xB1, "Unset" },
4631 { 0xB2, "User (US)" },
4632 { 0xB3, "www.wireless-village.org" },
4634 { 0x00, NULL }
4637 /* Access value tokens (0x01) */
4638 static const value_string wbxml_wv_csp_10_attrValue_cp1[] = {
4639 /* 0x80 -- 0x84 GLOBAL */
4640 { 0x85, "GROUP_ID" },
4641 { 0x86, "GROUP_NAME" },
4642 { 0x87, "GROUP_TOPIC" },
4643 { 0x88, "GROUP_USER_ID_JOINED" },
4644 { 0x89, "HTTP" },
4645 { 0x8A, "SMS" },
4646 { 0x8B, "STCP" },
4647 { 0x8C, "SUDP" },
4648 { 0x8D, "USER_ALIAS" },
4649 { 0x8E, "USER_EMAIL_ADDRESS" },
4650 { 0x8F, "USER_FIRST_NAME" },
4651 { 0x90, "USER_ID" },
4652 { 0x91, "USER_LAST_NAME" },
4653 { 0x92, "USER_MOBILE_NUMBER" },
4654 { 0x93, "WAPSMS" },
4655 { 0x94, "WAPUDP" },
4656 { 0x95, "WSP" },
4658 { 0x00, NULL }
4661 /* Presence value tokens (0x05) */
4662 static const value_string wbxml_wv_csp_10_attrValue_cp5[] = {
4663 /* 0x80 -- 0x84 GLOBAL */
4664 { 0x85, "ANGRY" },
4665 { 0x86, "ANXIOUS" },
4666 { 0x87, "ASHAMED" },
4667 { 0x88, "AUDIO_CALL" },
4668 { 0x89, "AVAILABLE" },
4669 { 0x8A, "BORED" },
4670 { 0x8B, "CALL" },
4671 { 0x8C, "CLI" },
4672 { 0x8D, "COMPUTER" },
4673 { 0x8E, "DISCREET" },
4674 { 0x8F, "EMAIL" },
4675 { 0x90, "EXCITED" },
4676 { 0x91, "HAPPY" },
4677 { 0x92, "IM" },
4678 { 0x93, "IM_OFFLINE" },
4679 { 0x94, "IM_ONLINE" },
4680 { 0x95, "IN_LOVE" },
4681 { 0x96, "INVINCIBLE" },
4682 { 0x97, "JEALOUS" },
4683 { 0x98, "MMS" },
4684 { 0x99, "MOBILE_PHONE" },
4685 { 0x9A, "NOT_AVAILABLE" },
4686 { 0x9B, "OTHER" },
4687 { 0x9C, "PDA" },
4688 { 0x9D, "SAD" },
4689 { 0x9E, "SLEEPY" },
4690 { 0x9F, "SMS" },
4691 { 0xA0, "VIDEO_CALL" },
4692 { 0xA1, "VIDEO_STREAM" },
4694 { 0x00, NULL }
4698 /***** Token code page aggregation *****/
4699 static const value_valuestring wbxml_wv_csp_10_tags[] = {
4700 { 0, wbxml_wv_csp_10_tags_cp0 },
4701 { 1, wbxml_wv_csp_10_tags_cp1 },
4702 { 2, wbxml_wv_csp_10_tags_cp2 },
4703 { 3, wbxml_wv_csp_10_tags_cp3 },
4704 { 4, wbxml_wv_csp_10_tags_cp4 },
4705 { 5, wbxml_wv_csp_10_tags_cp5 },
4706 { 6, wbxml_wv_csp_10_tags_cp6 },
4707 { 7, wbxml_wv_csp_10_tags_cp7 },
4708 { 0, NULL }
4711 static const value_valuestring wbxml_wv_csp_10_attrStart[] = {
4712 { 0, wbxml_wv_csp_10_attrStart_cp0 },
4713 { 0, NULL }
4716 static const value_valuestring wbxml_wv_csp_10_attrValue[] = {
4717 { 0, wbxml_wv_csp_10_attrValue_cp0 },
4718 { 1, wbxml_wv_csp_10_attrValue_cp1 },
4719 { 5, wbxml_wv_csp_10_attrValue_cp5 },
4720 { 0, NULL }
4723 static const wbxml_decoding decode_wv_cspc_10 = {
4724 "Wireless-Village Client-Server Protocol 1.0",
4725 "WV-CSP 1.0",
4726 { NULL, NULL, NULL },
4727 wv_csp10_opaque_binary_tag,
4728 wv_csp10_opaque_literal_tag,
4729 default_opaque_binary_attr,
4730 default_opaque_literal_attr,
4731 NULL,
4732 wbxml_wv_csp_10_tags,
4733 wbxml_wv_csp_10_attrStart,
4734 wbxml_wv_csp_10_attrValue
4741 /* WV-CSP 1.1
4743 * Wireless Village Client Server Protocol
4744 ***************************************/
4746 /***** Global extension tokens *****/
4747 static const value_string wbxml_wv_csp_11_global_cp0[] = {
4748 { 0x80, "Common Value" }, /* EXT_T_0 */
4750 { 0x00, NULL }
4753 /***** Tag tokens *****/
4754 /* Common code page */
4755 static const value_string wbxml_wv_csp_11_tags_cp0[] = {
4756 /* 0x00 -- 0x04 GLOBAL */
4757 { 0x05, "Acceptance" },
4758 { 0x06, "AddList" },
4759 { 0x07, "AddNickList" },
4760 { 0x08, "SName" }, /* Was: Attribute */
4761 { 0x09, "WV-CSP-Message" }, /* Was: AttributeList */
4762 { 0x0A, "ClientID" },
4763 { 0x0B, "Code" },
4764 { 0x0C, "ContactList" },
4765 { 0x0D, "ContentData" },
4766 { 0x0E, "ContentEncoding" },
4767 { 0x0F, "ContentSize" },
4768 { 0x10, "ContentType" },
4769 { 0x11, "DateTime" },
4770 { 0x12, "Description" },
4771 { 0x13, "DetailedResult" },
4772 { 0x14, "EntityList" },
4773 { 0x15, "Group" },
4774 { 0x16, "GroupID" },
4775 { 0x17, "GroupList" },
4776 { 0x18, "InUse" },
4777 { 0x19, "Logo" },
4778 { 0x1A, "MessageCount" },
4779 { 0x1B, "MessageID" },
4780 { 0x1C, "MessageURI" },
4781 { 0x1D, "MSISDN" },
4782 { 0x1E, "Name" },
4783 { 0x1F, "NickList" },
4784 { 0x20, "NickName" },
4785 { 0x21, "Poll" },
4786 { 0x22, "Presence" },
4787 { 0x23, "PresenceSubList" },
4788 { 0x24, "PresenceValue" },
4789 { 0x25, "Property" },
4790 { 0x26, "Qualifier" },
4791 { 0x27, "Recipient" },
4792 { 0x28, "RemoveList" },
4793 { 0x29, "RemoveNickList" },
4794 { 0x2A, "Result" },
4795 { 0x2B, "ScreenName" },
4796 { 0x2C, "Sender" },
4797 { 0x2D, "Session" },
4798 { 0x2E, "SessionDescriptor" },
4799 { 0x2F, "SessionID" },
4800 { 0x30, "SessionType" },
4801 { 0x31, "Status" },
4802 { 0x32, "Transaction" },
4803 { 0x33, "TransactionContent" },
4804 { 0x34, "TransactionDescriptor" },
4805 { 0x35, "TransactionID" },
4806 { 0x36, "TransactionMode" },
4807 { 0x37, "URL" },
4808 { 0x38, "URLList" },
4809 { 0x39, "User" },
4810 { 0x3A, "UserID" },
4811 { 0x3B, "UserList" },
4812 { 0x3C, "Validity" },
4813 { 0x3D, "Value" },
4814 /* 0x3E - Removed: WV-CSP-Message */
4816 { 0x00, NULL }
4819 /* Access code page */
4820 static const value_string wbxml_wv_csp_11_tags_cp1[] = {
4821 /* 0x00 -- 0x04 GLOBAL */
4822 { 0x05, "AllFunctions" },
4823 { 0x06, "AllFunctionsRequest" },
4824 { 0x07, "CancelInvite-Request" },
4825 { 0x08, "CancelInviteUser-Request" },
4826 { 0x09, "Capability" },
4827 { 0x0A, "CapabilityList" },
4828 { 0x0B, "CapabilityRequest" },
4829 { 0x0C, "ClientCapability-Request" },
4830 { 0x0D, "ClientCapability-Response" },
4831 { 0x0E, "DigestBytes" },
4832 { 0x0F, "DigestSchema" },
4833 { 0x10, "Disconnect" },
4834 { 0x11, "Functions" },
4835 { 0x12, "GetSPInfo-Request" },
4836 { 0x13, "GetSPInfo-Response" },
4837 { 0x14, "InviteID" },
4838 { 0x15, "InviteNote" },
4839 { 0x16, "Invite-Request" },
4840 { 0x17, "Invite-Response" },
4841 { 0x18, "InviteType" },
4842 { 0x19, "InviteUser-Request" },
4843 { 0x1A, "InviteUser-Response" },
4844 { 0x1B, "KeepAlive-Request" },
4845 { 0x1C, "KeepAliveTime" },
4846 { 0x1D, "Login-Request" },
4847 { 0x1E, "Login-Response" },
4848 { 0x1F, "Logout-Request" },
4849 { 0x20, "Nonce" },
4850 { 0x21, "Password" },
4851 { 0x22, "Polling-Request" },
4852 { 0x23, "ResponseNote" },
4853 { 0x24, "SearchElement" },
4854 { 0x25, "SearchFindings" },
4855 { 0x26, "SearchID" },
4856 { 0x27, "SearchIndex" },
4857 { 0x28, "SearchLimit" },
4858 { 0x29, "KeepAlive-Response" },
4859 { 0x2A, "SearchPairList" },
4860 { 0x2B, "Search-Request" },
4861 { 0x2C, "Search-Response" },
4862 { 0x2D, "SearchResult" },
4863 { 0x2E, "Service-Request" },
4864 { 0x2F, "Service-Response" },
4865 { 0x30, "SessionCookie" },
4866 { 0x31, "StopSearch-Request" },
4867 { 0x32, "TimeToLive" },
4868 /* New in WV-CSP 1.1 */
4869 { 0x33, "SearchString" },
4870 { 0x34, "CompletionFlag" },
4872 { 0x00, NULL }
4875 /* Service code page */
4876 /* Same as cp2 of WV-CSP 1.0 */
4877 #define wbxml_wv_csp_11_tags_cp2 wbxml_wv_csp_10_tags_cp2
4879 /* Client capability code page */
4880 static const value_string wbxml_wv_csp_11_tags_cp3[] = {
4881 /* 0x00 -- 0x04 GLOBAL */
4882 { 0x05, "AcceptedCharset" },
4883 { 0x06, "AcceptedContentLength" },
4884 { 0x07, "AcceptedContentType" },
4885 { 0x08, "AcceptedTransferEncoding" },
4886 { 0x09, "AnyContent" },
4887 { 0x0A, "DefaultLanguage" }, /* Was: ClientType */
4888 { 0x0B, "InitialDeliveryMethod" },
4889 { 0x0C, "MultiTrans" },
4890 { 0x0D, "ParserSize" },
4891 { 0x0E, "ServerPollMin" },
4892 { 0x0F, "SupportedBearer" },
4893 { 0x10, "SupportedCIRMethod" },
4894 { 0x11, "TCPAddress" },
4895 { 0x12, "TCPPort" },
4896 { 0x13, "UDPPort" },
4898 { 0x00, NULL }
4901 /* Presence primitive code page */
4902 static const value_string wbxml_wv_csp_11_tags_cp4[] = {
4903 /* 0x00 -- 0x04 GLOBAL */
4904 { 0x05, "CancelAuth-Request" },
4905 { 0x06, "ContactListProperties" },
4906 { 0x07, "CreateAttributeList-Request" },
4907 { 0x08, "CreateList-Request" },
4908 { 0x09, "DefaultAttributeList" },
4909 { 0x0A, "DefaultContactList" },
4910 { 0x0B, "DefaultList" },
4911 { 0x0C, "DeleteAttributeList-Request" },
4912 { 0x0D, "DeleteList-Request" },
4913 { 0x0E, "GetAttributeList-Request" },
4914 { 0x0F, "GetAttributeList-Response" },
4915 { 0x10, "GetList-Request" },
4916 { 0x11, "GetList-Response" },
4917 { 0x12, "GetPresence-Request" },
4918 { 0x13, "GetPresence-Response" },
4919 { 0x14, "GetWatcherList-Request" },
4920 { 0x15, "GetWatcherList-Response" },
4921 { 0x16, "ListManage-Request" },
4922 { 0x17, "ListManage-Response" },
4923 { 0x18, "UnsubscribePresence-Request" }, /* Was: Presence */
4924 { 0x19, "PresenceAuth-Request" },
4925 { 0x1A, "PresenceAuth-User" }, /* Was: PresenceAuth-Response */
4926 { 0x1B, "PresenceNotification-Request" },
4927 { 0x1C, "UpdatePresence-Request" }, /* Was: PresenceValueList */
4928 { 0x1D, "SubscribePresence-Request" },
4929 /* 0x1E - Removed: UnsubscribePresence-Request */
4930 /* 0x1F - Removed: UpdatePresence-Request */
4932 { 0x00, NULL }
4935 /* Presence attribute code page */
4936 static const value_string wbxml_wv_csp_11_tags_cp5[] = {
4937 /* 0x00 -- 0x04 GLOBAL */
4938 { 0x05, "Accuracy" },
4939 { 0x06, "Address" },
4940 { 0x07, "AddrPref" },
4941 { 0x08, "Alias" },
4942 { 0x09, "Altitude" },
4943 { 0x0A, "Building" },
4944 { 0x0B, "Caddr" },
4945 { 0x0C, "City" },
4946 { 0x0D, "ClientInfo" },
4947 { 0x0E, "ClientProducer" },
4948 { 0x0F, "ClientType" },
4949 { 0x10, "ClientVersion" },
4950 { 0x11, "CommC" },
4951 { 0x12, "CommCap" },
4952 { 0x13, "ContactInfo" },
4953 { 0x14, "ContainedvCard" },
4954 { 0x15, "Country" },
4955 { 0x16, "Crossing1" },
4956 { 0x17, "Crossing2" },
4957 { 0x18, "DevManufacturer" },
4958 { 0x19, "DirectContent" },
4959 { 0x1A, "FreeTextLocation" },
4960 { 0x1B, "GeoLocation" },
4961 { 0x1C, "Language" },
4962 { 0x1D, "Latitude" },
4963 { 0x1E, "Longitude" },
4964 { 0x1F, "Model" },
4965 { 0x20, "NamedArea" },
4966 { 0x21, "OnlineStatus" },
4967 { 0x22, "PLMN" },
4968 { 0x23, "PrefC" },
4969 { 0x24, "PreferredContacts" },
4970 { 0x25, "PreferredLanguage" },
4971 { 0x26, "ReferredContent" },
4972 { 0x27, "ReferredvCard" },
4973 { 0x28, "Registration" },
4974 { 0x29, "StatusContent" },
4975 { 0x2A, "StatusMood" },
4976 { 0x2B, "StatusText" },
4977 { 0x2C, "Street" },
4978 { 0x2D, "TimeZone" },
4979 { 0x2E, "UserAvailability" },
4980 /* New in WV-CSP 1.1 */
4981 { 0x2F, "Cap" },
4982 { 0x30, "Cname" },
4983 { 0x31, "Contact" },
4984 { 0x32, "Cpriority" },
4985 { 0x33, "Cstatus" },
4986 { 0x34, "Note" },
4987 { 0x35, "Zone" },
4989 { 0x00, NULL }
4992 /* Messaging code page */
4993 static const value_string wbxml_wv_csp_11_tags_cp6[] = {
4994 /* 0x00 -- 0x04 GLOBAL */
4995 { 0x05, "BlockList" },
4996 { 0x06, "BlockUser-Request" },
4997 { 0x07, "DeliveryMethod" },
4998 { 0x08, "DeliveryReport" },
4999 { 0x09, "DeliveryReport-Request" },
5000 { 0x0A, "ForwardMessage-Request" },
5001 { 0x0B, "GetBlockedList-Request" },
5002 { 0x0C, "GetBlockedList-Response" },
5003 { 0x0D, "GetMessageList-Request" },
5004 { 0x0E, "GetMessageList-Response" },
5005 { 0x0F, "GetMessage-Request" },
5006 { 0x10, "GetMessage-Response" },
5007 { 0x11, "GrantList" },
5008 { 0x12, "MessageDelivered" },
5009 { 0x13, "MessageInfo" },
5010 { 0x14, "MessageNotification" },
5011 { 0x15, "NewMessage" },
5012 { 0x16, "RejectMessage-Request" },
5013 { 0x17, "SendMessage-Request" },
5014 { 0x18, "SendMessage-Response" },
5015 { 0x19, "SetDeliveryMethod-Request" },
5016 /* New in WV-CSP 1.1 */
5017 { 0x1A, "DeliveryTime" },
5019 { 0x00, NULL }
5022 /* Group code page */
5023 static const value_string wbxml_wv_csp_11_tags_cp7[] = {
5024 /* 0x00 -- 0x04 GLOBAL */
5025 { 0x05, "AddGroupMembers-Request" },
5026 { 0x06, "Admin" },
5027 { 0x07, "CreateGroup-Request" },
5028 { 0x08, "DeleteGroup-Request" },
5029 { 0x09, "GetGroupMembers-Request" },
5030 { 0x0A, "GetGroupMembers-Response" },
5031 { 0x0B, "GetGroupProps-Request" },
5032 { 0x0C, "GetGroupProps-Response" },
5033 { 0x0D, "GroupChangeNotice" },
5034 { 0x0E, "GroupProperties" },
5035 { 0x0F, "Joined" },
5036 { 0x10, "JoinedRequest" },
5037 { 0x11, "JoinGroup-Request" },
5038 { 0x12, "JoinGroup-Response" },
5039 { 0x13, "LeaveGroup-Request" },
5040 { 0x14, "LeaveGroup-Response" },
5041 { 0x15, "Left" },
5042 { 0x16, "MemberAccess-Request" },
5043 { 0x17, "Mod" },
5044 { 0x18, "OwnProperties" },
5045 { 0x19, "RejectList-Request" },
5046 { 0x1A, "RejectList-Response" },
5047 { 0x1B, "RemoveGroupMembers-Request" },
5048 { 0x1C, "SetGroupProps-Request" },
5049 { 0x1D, "SubscribeGroupNotice-Request" },
5050 { 0x1E, "SubscribeGroupNotice-Response" },
5051 { 0x1F, "Users" },
5052 { 0x20, "WelcomeNote" },
5053 /* New in WV-CSP 1.1 */
5054 { 0x21, "JoinGroup" },
5055 { 0x22, "SubscribeNotification" },
5056 { 0x23, "SubscribeType" },
5058 { 0x00, NULL }
5061 /***** Attribute Start tokens *****/
5062 /* Common code page */
5063 /* Same as cp0 of WV-CSP 1.0 */
5064 #define wbxml_wv_csp_11_attrStart_cp0 wbxml_wv_csp_10_attrStart_cp0
5066 /***** Attribute Value tokens *****/
5068 * Element value tokens
5070 * NOTE - WV-CSP uses the EXT_T_0 token in a peculiar way: the mb_u_int32
5071 * does *not* reference an offset in the string table, but it refers to
5072 * the index in the following value_string.
5074 * Please note that:
5075 * - Values 'T' and 'F' are Boolean values representing "True" and "False"
5076 * (or "Yes" and "No" in some circumstances) respectively.
5077 * - Values 'GR', 'IM', 'PR', 'SC', 'GM' and 'US' are enumerated values
5078 * representing "Group", "Instant Messaging", "Presence", "Shared Content",
5079 * "Group membership" and "User" respectively.
5080 * - Values 'G', 'S' and 'U' are enumerated values representing "Get", "Set"
5081 * and "Unset" respectively.
5082 * - Values 'N' and 'P' are enumerated values representing "Notify/Get" and
5083 * "Push" respectively.
5085 * I repeat: this is NOT a attrValue[] array hence it is not called
5086 * wbxml_wv_XXX but vals_wv_XXX.
5088 * Result: the attribute value token definitions from WV-CSP 1.0 are dropped.
5090 static const value_string vals_wv_csp_11_element_value_tokens[] = {
5092 * Common value tokens
5094 { 0x00, "AccessType" },
5095 { 0x01, "ActiveUsers" },
5096 { 0x02, "Admin" },
5097 { 0x03, "application/" },
5098 { 0x04, "application/vnd.wap.mms-message" },
5099 { 0x05, "application/x-sms" },
5100 { 0x06, "AutoJoin" },
5101 { 0x07, "BASE64" },
5102 { 0x08, "Closed" },
5103 { 0x09, "Default" },
5104 { 0x0A, "DisplayName" },
5105 { 0x0B, "F" },
5106 { 0x0C, "G" },
5107 { 0x0D, "GR" },
5108 { 0x0E, "http://" },
5109 { 0x0F, "https://" },
5110 { 0x10, "image/" },
5111 { 0x11, "Inband" },
5112 { 0x12, "IM" },
5113 { 0x13, "MaxActiveUsers" },
5114 { 0x14, "Mod" },
5115 { 0x15, "Name" },
5116 { 0x16, "None" },
5117 { 0x17, "N" },
5118 { 0x18, "Open" },
5119 { 0x19, "Outband" },
5120 { 0x1A, "PR" },
5121 { 0x1B, "Private" },
5122 { 0x1C, "PrivateMessaging" },
5123 { 0x1D, "PrivilegeLevel" },
5124 { 0x1E, "Public" },
5125 { 0x1F, "P" },
5126 { 0x20, "Request" },
5127 { 0x21, "Response" },
5128 { 0x22, "Restricted" },
5129 { 0x23, "ScreenName" },
5130 { 0x24, "Searchable" },
5131 { 0x25, "S" },
5132 { 0x26, "SC" },
5133 { 0x27, "text/" },
5134 { 0x28, "text/plain" },
5135 { 0x29, "text/x-vCalendar" },
5136 { 0x2A, "text/x-vCard" },
5137 { 0x2B, "Topic" },
5138 { 0x2C, "T" },
5139 { 0x2D, "Type" },
5140 { 0x2E, "U" },
5141 { 0x2F, "US" },
5142 { 0x30, "www.wireless-village.org" },
5144 * Access value tokens
5146 { 0x3D, "GROUP_ID" },
5147 { 0x3E, "GROUP_NAME" },
5148 { 0x3F, "GROUP_TOPIC" },
5149 { 0x40, "GROUP_USER_ID_JOINED" },
5150 { 0x41, "GROUP_USER_ID_OWNER" },
5151 { 0x42, "HTTP" },
5152 { 0x43, "SMS" },
5153 { 0x44, "STCP" },
5154 { 0x45, "SUDP" },
5155 { 0x46, "USER_ALIAS" },
5156 { 0x47, "USER_EMAIL_ADDRESS" },
5157 { 0x48, "USER_FIRST_NAME" },
5158 { 0x49, "USER_ID" },
5159 { 0x4A, "USER_LAST_NAME" },
5160 { 0x4B, "USER_MOBILE_NUMBER" },
5161 { 0x4C, "USER_ONLINE_STATUS" },
5162 { 0x4D, "WAPSMS" },
5163 { 0x4E, "WAPUDP" },
5164 { 0x4F, "WSP" },
5166 * Presence value tokens
5168 { 0x5B, "ANGRY" },
5169 { 0x5C, "ANXIOUS" },
5170 { 0x5D, "ASHAMED" },
5171 { 0x5E, "AUDIO_CALL" },
5172 { 0x5F, "AVAILABLE" },
5173 { 0x60, "BORED" },
5174 { 0x61, "CALL" },
5175 { 0x62, "CLI" },
5176 { 0x63, "COMPUTER" },
5177 { 0x64, "DISCREET" },
5178 { 0x65, "EMAIL" },
5179 { 0x66, "EXCITED" },
5180 { 0x67, "HAPPY" },
5181 { 0x68, "IM" },
5182 { 0x69, "IM_OFFLINE" },
5183 { 0x6A, "IM_ONLINE" },
5184 { 0x6B, "IN_LOVE" },
5185 { 0x6C, "INVINCIBLE" },
5186 { 0x6D, "JEALOUS" },
5187 { 0x6E, "MMS" },
5188 { 0x6F, "MOBILE_PHONE" },
5189 { 0x70, "NOT_AVAILABLE" },
5190 { 0x71, "OTHER" },
5191 { 0x72, "PDA" },
5192 { 0x73, "SAD" },
5193 { 0x74, "SLEEPY" },
5194 { 0x75, "SMS" },
5195 { 0x76, "VIDEO_CALL" },
5196 { 0x77, "VIDEO_STREAM" },
5198 { 0x00, NULL }
5200 static value_string_ext vals_wv_csp_11_element_value_tokens_ext = VALUE_STRING_EXT_INIT(vals_wv_csp_11_element_value_tokens);
5203 /***** Token code page aggregation *****/
5205 static char *
5206 ext_t_0_wv_cspc_11(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_)
5208 char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'",
5209 val_to_str_ext(value, &vals_wv_csp_11_element_value_tokens_ext,
5210 "<Unknown WV-CSP 1.1 Common Value token 0x%X>"));
5211 return str;
5214 static const value_valuestring wbxml_wv_csp_11_global[] = {
5215 { 0, wbxml_wv_csp_11_global_cp0 },
5216 { 0, NULL }
5219 static const value_valuestring wbxml_wv_csp_11_tags[] = {
5220 { 0, wbxml_wv_csp_11_tags_cp0 },
5221 { 1, wbxml_wv_csp_11_tags_cp1 },
5222 { 2, wbxml_wv_csp_11_tags_cp2 },
5223 { 3, wbxml_wv_csp_11_tags_cp3 },
5224 { 4, wbxml_wv_csp_11_tags_cp4 },
5225 { 5, wbxml_wv_csp_11_tags_cp5 },
5226 { 6, wbxml_wv_csp_11_tags_cp6 },
5227 { 7, wbxml_wv_csp_11_tags_cp7 },
5228 { 0, NULL }
5231 static const value_valuestring wbxml_wv_csp_11_attrStart[] = {
5232 { 0, wbxml_wv_csp_11_attrStart_cp0 },
5233 { 0, NULL }
5236 static const wbxml_decoding decode_wv_cspc_11 = {
5237 "Wireless-Village Client-Server Protocol 1.1",
5238 "WV-CSP 1.1",
5239 { ext_t_0_wv_cspc_11, NULL, NULL },
5240 wv_csp11_opaque_binary_tag,
5241 wv_csp11_opaque_literal_tag,
5242 default_opaque_binary_attr,
5243 default_opaque_literal_attr,
5244 wbxml_wv_csp_11_global,
5245 wbxml_wv_csp_11_tags,
5246 wbxml_wv_csp_11_attrStart,
5247 NULL
5254 /* WV-CSP 1.2
5256 * Wireless Village Client Server Protocol
5257 ***************************************/
5259 /***** Global extension tokens *****/
5260 /* Same as WV-CSP 1.1 */
5262 /***** Tag tokens *****/
5263 /* Common code page */
5264 /* Same as cp0 of WV-CSP 1.1 */
5265 #define wbxml_wv_csp_12_tags_cp0 wbxml_wv_csp_11_tags_cp0
5266 /* Note that the table continues in code page 0x09 */
5268 /* Access code page (0x01) */
5269 static const value_string wbxml_wv_csp_12_tags_cp1[] = {
5270 /* 0x00 -- 0x04 GLOBAL */
5271 { 0x05, "AllFunctions" },
5272 { 0x06, "AllFunctionsRequest" },
5273 { 0x07, "CancelInvite-Request" },
5274 { 0x08, "CancelInviteUser-Request" },
5275 { 0x09, "Capability" },
5276 { 0x0A, "CapabilityList" },
5277 { 0x0B, "CapabilityRequest" },
5278 { 0x0C, "ClientCapability-Request" },
5279 { 0x0D, "ClientCapability-Response" },
5280 { 0x0E, "DigestBytes" },
5281 { 0x0F, "DigestSchema" },
5282 { 0x10, "Disconnect" },
5283 { 0x11, "Functions" },
5284 { 0x12, "GetSPInfo-Request" },
5285 { 0x13, "GetSPInfo-Response" },
5286 { 0x14, "InviteID" },
5287 { 0x15, "InviteNote" },
5288 { 0x16, "Invite-Request" },
5289 { 0x17, "Invite-Response" },
5290 { 0x18, "InviteType" },
5291 { 0x19, "InviteUser-Request" },
5292 { 0x1A, "InviteUser-Response" },
5293 { 0x1B, "KeepAlive-Request" },
5294 { 0x1C, "KeepAliveTime" },
5295 { 0x1D, "Login-Request" },
5296 { 0x1E, "Login-Response" },
5297 { 0x1F, "Logout-Request" },
5298 { 0x20, "Nonce" },
5299 { 0x21, "Password" },
5300 { 0x22, "Polling-Request" },
5301 { 0x23, "ResponseNote" },
5302 { 0x24, "SearchElement" },
5303 { 0x25, "SearchFindings" },
5304 { 0x26, "SearchID" },
5305 { 0x27, "SearchIndex" },
5306 { 0x28, "SearchLimit" },
5307 { 0x29, "KeepAlive-Response" },
5308 { 0x2A, "SearchPairList" },
5309 { 0x2B, "Search-Request" },
5310 { 0x2C, "Search-Response" },
5311 { 0x2D, "SearchResult" },
5312 { 0x2E, "Service-Request" },
5313 { 0x2F, "Service-Response" },
5314 { 0x30, "SessionCookie" },
5315 { 0x31, "StopSearch-Request" },
5316 { 0x32, "TimeToLive" },
5317 /* New in WV-CSP 1.1 */
5318 { 0x33, "SearchString" },
5319 { 0x34, "CompletionFlag" },
5320 /* New in WV-CSP 1.2 */
5321 { 0x36, "ReceiveList" },
5322 { 0x37, "VerifyID-Request" },
5323 { 0x38, "Extended-Request" },
5324 { 0x39, "Extended-Response" },
5325 { 0x3A, "AgreedCapabilityList" },
5326 { 0x3B, "ExtendedData" },
5327 { 0x3C, "OtherServer" },
5328 { 0x3D, "PresenceAttributeNSName" },
5329 { 0x3E, "SessionNSName" },
5330 { 0x3F, "TransactionNSName" },
5332 { 0x00, NULL }
5334 /* Note that the table continues in code page 0x0A */
5336 /* Service code page (0x02) */
5337 static const value_string wbxml_wv_csp_12_tags_cp2[] = {
5338 /* 0x00 -- 0x04 GLOBAL */
5339 { 0x05, "ADDGM" },
5340 { 0x06, "AttListFunc" },
5341 { 0x07, "BLENT" },
5342 { 0x08, "CAAUT" },
5343 { 0x09, "CAINV" },
5344 { 0x0A, "CALI" },
5345 { 0x0B, "CCLI" },
5346 { 0x0C, "ContListFunc" },
5347 { 0x0D, "CREAG" },
5348 { 0x0E, "DALI" },
5349 { 0x0F, "DCLI" },
5350 { 0x10, "DELGR" },
5351 { 0x11, "FundamentalFeat" },
5352 { 0x12, "FWMSG" },
5353 { 0x13, "GALS" },
5354 { 0x14, "GCLI" },
5355 { 0x15, "GETGM" },
5356 { 0x16, "GETGP" },
5357 { 0x17, "GETLM" },
5358 { 0x18, "GETM" },
5359 { 0x19, "GETPR" },
5360 { 0x1A, "GETSPI" },
5361 { 0x1B, "GETWL" },
5362 { 0x1C, "GLBLU" },
5363 { 0x1D, "GRCHN" },
5364 { 0x1E, "GroupAuthFunc" },
5365 { 0x1F, "GroupFeat" },
5366 { 0x20, "GroupMgmtFunc" },
5367 { 0x21, "GroupUseFunc" },
5368 { 0x22, "IMAuthFunc" },
5369 { 0x23, "IMFeat" },
5370 { 0x24, "IMReceiveFunc" },
5371 { 0x25, "IMSendFunc" },
5372 { 0x26, "INVIT" },
5373 { 0x27, "InviteFunc" },
5374 { 0x28, "MBRAC" },
5375 { 0x29, "MCLS" },
5376 { 0x2A, "MDELIV" },
5377 { 0x2B, "NEWM" },
5378 { 0x2C, "NOTIF" },
5379 { 0x2D, "PresenceAuthFunc" },
5380 { 0x2E, "PresenceDeliverFunc" },
5381 { 0x2F, "PresenceFeat" },
5382 { 0x30, "REACT" },
5383 { 0x31, "REJCM" },
5384 { 0x32, "REJEC" },
5385 { 0x33, "RMVGM" },
5386 { 0x34, "SearchFunc" },
5387 { 0x35, "ServiceFunc" },
5388 { 0x36, "SETD" },
5389 { 0x37, "SETGP" },
5390 { 0x38, "SRCH" },
5391 { 0x39, "STSRC" },
5392 { 0x3A, "SUBGCN" },
5393 { 0x3B, "UPDPR" },
5394 { 0x3C, "WVCSPFeat" },
5395 /* New in WV-CSP 1.2 */
5396 { 0x3D, "MF" },
5397 { 0x3E, "MG" },
5398 { 0x3F, "MM" },
5400 { 0x00, NULL }
5402 /* Note that the table continues in code page 0x08 */
5404 /* Client capability code page (0x03) */
5405 static const value_string wbxml_wv_csp_12_tags_cp3[] = {
5406 /* 0x00 -- 0x04 GLOBAL */
5407 { 0x05, "AcceptedCharset" },
5408 { 0x06, "AcceptedContentLength" },
5409 { 0x07, "AcceptedContentType" },
5410 { 0x08, "AcceptedTransferEncoding" },
5411 { 0x09, "AnyContent" },
5412 { 0x0A, "DefaultLanguage" },
5413 { 0x0B, "InitialDeliveryMethod" },
5414 { 0x0C, "MultiTrans" },
5415 { 0x0D, "ParserSize" },
5416 { 0x0E, "ServerPollMin" },
5417 { 0x0F, "SupportedBearer" },
5418 { 0x10, "SupportedCIRMethod" },
5419 { 0x11, "TCPAddress" },
5420 { 0x12, "TCPPort" },
5421 { 0x13, "UDPPort" },
5422 { 0x14, "CIRURL" },
5424 { 0x00, NULL }
5429 /* Presence primitive code page (0x04) */
5430 static const value_string wbxml_wv_csp_12_tags_cp4[] = {
5431 /* 0x00 -- 0x04 GLOBAL */
5432 { 0x05, "CancelAuth-Request" },
5433 { 0x06, "ContactListProperties" },
5434 { 0x07, "CreateAttributeList-Request" },
5435 { 0x08, "CreateList-Request" },
5436 { 0x09, "DefaultAttributeList" },
5437 { 0x0A, "DefaultContactList" },
5438 { 0x0B, "DefaultList" },
5439 { 0x0C, "DeleteAttributeList-Request" },
5440 { 0x0D, "DeleteList-Request" },
5441 { 0x0E, "GetAttributeList-Request" },
5442 { 0x0F, "GetAttributeList-Response" },
5443 { 0x10, "GetList-Request" },
5444 { 0x11, "GetList-Response" },
5445 { 0x12, "GetPresence-Request" },
5446 { 0x13, "GetPresence-Response" },
5447 { 0x14, "GetWatcherList-Request" },
5448 { 0x15, "GetWatcherList-Response" },
5449 { 0x16, "ListManage-Request" },
5450 { 0x17, "ListManage-Response" },
5451 { 0x18, "UnsubscribePresence-Request" },
5452 { 0x19, "PresenceAuth-Request" },
5453 { 0x1A, "PresenceAuth-User" },
5454 { 0x1B, "PresenceNotification-Request" },
5455 { 0x1C, "UpdatePresence-Request" },
5456 { 0x1D, "SubscribePresence-Request" },
5457 /* New in WV-CSP 1.2 */
5458 { 0x1E, "Auto-Subscribe" },
5459 /* 0x1E was defined in WV-CSP 1.0: UnsubscribePresence-Request */
5460 { 0x1F, "GetReactiveAuthStatus-Request" },
5461 /* 0x1F was defined in WV-CSP 1.0: UpdatePresence-Request */
5462 { 0x20, "GetReactiveAuthStatus-Response" },
5464 { 0x00, NULL }
5467 /* Presence attribute code page (0x05) */
5468 static const value_string wbxml_wv_csp_12_tags_cp5[] = {
5469 /* 0x00 -- 0x04 GLOBAL */
5470 { 0x05, "Accuracy" },
5471 { 0x06, "Address" },
5472 { 0x07, "AddrPref" },
5473 { 0x08, "Alias" },
5474 { 0x09, "Altitude" },
5475 { 0x0A, "Building" },
5476 { 0x0B, "Caddr" },
5477 { 0x0C, "City" },
5478 { 0x0D, "ClientInfo" },
5479 { 0x0E, "ClientProducer" },
5480 { 0x0F, "ClientType" },
5481 { 0x10, "ClientVersion" },
5482 { 0x11, "CommC" },
5483 { 0x12, "CommCap" },
5484 { 0x13, "ContactInfo" },
5485 { 0x14, "ContainedvCard" },
5486 { 0x15, "Country" },
5487 { 0x16, "Crossing1" },
5488 { 0x17, "Crossing2" },
5489 { 0x18, "DevManufacturer" },
5490 { 0x19, "DirectContent" },
5491 { 0x1A, "FreeTextLocation" },
5492 { 0x1B, "GeoLocation" },
5493 { 0x1C, "Language" },
5494 { 0x1D, "Latitude" },
5495 { 0x1E, "Longitude" },
5496 { 0x1F, "Model" },
5497 { 0x20, "NamedArea" },
5498 { 0x21, "OnlineStatus" },
5499 { 0x22, "PLMN" },
5500 { 0x23, "PrefC" },
5501 { 0x24, "PreferredContacts" },
5502 { 0x25, "PreferredLanguage" },
5503 { 0x26, "ReferredContent" },
5504 { 0x27, "ReferredvCard" },
5505 { 0x28, "Registration" },
5506 { 0x29, "StatusContent" },
5507 { 0x2A, "StatusMood" },
5508 { 0x2B, "StatusText" },
5509 { 0x2C, "Street" },
5510 { 0x2D, "TimeZone" },
5511 { 0x2E, "UserAvailability" },
5512 /* New in WV-CSP 1.1 */
5513 { 0x2F, "Cap" },
5514 { 0x30, "Cname" },
5515 { 0x31, "Contact" },
5516 { 0x32, "Cpriority" },
5517 { 0x33, "Cstatus" },
5518 { 0x34, "Note" },
5519 { 0x35, "Zone" },
5520 /* New in WV-CSP 1.2 */
5521 { 0x36, "ContentType" },
5522 { 0x37, "Inf_link" },
5523 { 0x38, "InfoLink" },
5524 { 0x39, "Link" },
5525 { 0x3A, "Text" },
5527 { 0x00, NULL }
5530 /* Messaging code page (0x06) */
5531 static const value_string wbxml_wv_csp_12_tags_cp6[] = {
5532 /* 0x00 -- 0x04 GLOBAL */
5533 { 0x05, "BlockList" },
5534 { 0x06, "BlockEntity-Request" }, /* Was: BlockUser-Request */
5535 { 0x07, "DeliveryMethod" },
5536 { 0x08, "DeliveryReport" },
5537 { 0x09, "DeliveryReport-Request" },
5538 { 0x0A, "ForwardMessage-Request" },
5539 { 0x0B, "GetBlockedList-Request" },
5540 { 0x0C, "GetBlockedList-Response" },
5541 { 0x0D, "GetMessageList-Request" },
5542 { 0x0E, "GetMessageList-Response" },
5543 { 0x0F, "GetMessage-Request" },
5544 { 0x10, "GetMessage-Response" },
5545 { 0x11, "GrantList" },
5546 { 0x12, "MessageDelivered" },
5547 { 0x13, "MessageInfo" },
5548 { 0x14, "MessageNotification" },
5549 { 0x15, "NewMessage" },
5550 { 0x16, "RejectMessage-Request" },
5551 { 0x17, "SendMessage-Request" },
5552 { 0x18, "SendMessage-Response" },
5553 { 0x19, "SetDeliveryMethod-Request" },
5554 { 0x1A, "DeliveryTime" },
5556 { 0x00, NULL }
5559 /* Group code page (0x07) */
5560 static const value_string wbxml_wv_csp_12_tags_cp7[] = {
5561 /* 0x00 -- 0x04 GLOBAL */
5562 { 0x05, "AddGroupMembers-Request" },
5563 { 0x06, "Admin" },
5564 { 0x07, "CreateGroup-Request" },
5565 { 0x08, "DeleteGroup-Request" },
5566 { 0x09, "GetGroupMembers-Request" },
5567 { 0x0A, "GetGroupMembers-Response" },
5568 { 0x0B, "GetGroupProps-Request" },
5569 { 0x0C, "GetGroupProps-Response" },
5570 { 0x0D, "GroupChangeNotice" },
5571 { 0x0E, "GroupProperties" },
5572 { 0x0F, "Joined" },
5573 { 0x10, "JoinedRequest" },
5574 { 0x11, "JoinGroup-Request" },
5575 { 0x12, "JoinGroup-Response" },
5576 { 0x13, "LeaveGroup-Request" },
5577 { 0x14, "LeaveGroup-Response" },
5578 { 0x15, "Left" },
5579 { 0x16, "MemberAccess-Request" },
5580 { 0x17, "Mod" },
5581 { 0x18, "OwnProperties" },
5582 { 0x19, "RejectList-Request" },
5583 { 0x1A, "RejectList-Response" },
5584 { 0x1B, "RemoveGroupMembers-Request" },
5585 { 0x1C, "SetGroupProps-Request" },
5586 { 0x1D, "SubscribeGroupNotice-Request" },
5587 { 0x1E, "SubscribeGroupNotice-Response" },
5588 { 0x1F, "Users" },
5589 { 0x20, "WelcomeNote" },
5590 /* New in WV-CSP 1.1 */
5591 { 0x21, "JoinGroup" },
5592 { 0x22, "SubscribeNotification" },
5593 { 0x23, "SubscribeType" },
5594 /* New in WV-CSP 1.2 */
5595 { 0x24, "GetJoinedUsers-Request" },
5596 { 0x25, "GetJoinedUsers-Response" },
5597 { 0x26, "AdminMapList" },
5598 { 0x27, "AdminMapping" },
5599 { 0x28, "Mapping" },
5600 { 0x29, "ModMapping" },
5601 { 0x2A, "UserMapList" },
5602 { 0x2B, "UserMapping" },
5604 { 0x00, NULL }
5607 /* Service negotiation code page - continued (0x08) */
5608 static const value_string wbxml_wv_csp_12_tags_cp8[] = {
5609 /* 0x00 -- 0x04 GLOBAL */
5610 { 0x05, "MP" },
5611 { 0x06, "GETAUT" },
5612 { 0x07, "GETJU" },
5613 { 0x08, "VRID" },
5614 { 0x09, "VerifyIDFunc" },
5616 { 0x00, NULL }
5619 /* Common code page - continued (0x09) */
5620 static const value_string wbxml_wv_csp_12_tags_cp9[] = {
5621 /* 0x00 -- 0x04 GLOBAL */
5622 { 0x05, "CIR" },
5623 { 0x06, "Domain" },
5624 { 0x07, "ExtBlock" },
5625 { 0x08, "HistoryPeriod" },
5626 { 0x09, "IDList" },
5627 { 0x0A, "MaxWatcherList" },
5628 { 0x0B, "ReactiveAuthState" },
5629 { 0x0C, "ReactiveAuthStatus" },
5630 { 0x0D, "ReactiveAuthStatusList" },
5631 { 0x0E, "Watcher" },
5632 { 0x0F, "WatcherStatus" },
5634 { 0x00, NULL }
5637 /* Access code page - continued (0x0A) */
5638 static const value_string wbxml_wv_csp_12_tags_cp10[] = {
5639 /* 0x00 -- 0x04 GLOBAL */
5640 { 0x05, "WV-CSP-NSDiscovery-Request" },
5641 { 0x06, "WV-CSP-NSDiscovery-Response" },
5642 { 0x07, "VersionList" },
5644 { 0x00, NULL }
5647 /***** Attribute Start tokens *****/
5648 /* Common code page (0x00) */
5649 static const value_string wbxml_wv_csp_12_attrStart_cp0[] = {
5650 /* 0x00 -- 0x04 GLOBAL */
5651 { 0x05, "xmlns='http://www.wireless-village.org/CSP'" },
5652 { 0x06, "xmlns='http://www.wireless-village.org/PA'" },
5653 { 0x07, "xmlns='http://www.wireless-village.org/TRC'" },
5654 /* New in WV-CSP 1.2 */
5655 { 0x08, "xmlns='http://www.openmobilealliance.org/DTD/WV-CSP'" },
5656 { 0x09, "xmlns='http://www.openmobilealliance.org/DTD/WV-PA'" },
5657 { 0x0A, "xmlns http://www.openmobilealliance.org/DTD/WV-TRC'" },
5659 { 0x00, NULL }
5662 /***** Attribute Value tokens *****/
5664 * Element value tokens
5666 * NOTE - WV-CSP uses the EXT_T_0 token in a peculiar way: the mb_u_int32
5667 * does *not* reference an offset in the string table, but it refers to
5668 * the index in the following value_string.
5670 * Please note that:
5671 * - Values 'T' and 'F' are Boolean values representing "True" and "False"
5672 * (or "Yes" and "No" in some circumstances) respectively.
5673 * - Values 'GR', 'IM', 'PR', 'SC', 'GM' and 'US' are enumerated values
5674 * representing "Group", "Instant Messaging", "Presence", "Shared Content",
5675 * "Group membership" and "User" respectively.
5676 * - Values 'G', 'S' and 'U' are enumerated values representing "Get", "Set"
5677 * and "Unset" respectively.
5678 * - Values 'N' and 'P' are enumerated values representing "Notify/Get" and
5679 * "Push" respectively.
5681 * I repeat: this is NOT a attrValue[] array hence it is not called
5682 * wbxml_wv_XXX but vals_wv_XXX.
5684 static const value_string vals_wv_csp_12_element_value_tokens[] = {
5686 * Common value tokens
5688 { 0x00, "AccessType" },
5689 { 0x01, "ActiveUsers" },
5690 { 0x02, "Admin" },
5691 { 0x03, "application/" },
5692 { 0x04, "application/vnd.wap.mms-message" },
5693 { 0x05, "application/x-sms" },
5694 { 0x06, "AutoJoin" },
5695 { 0x07, "BASE64" },
5696 { 0x08, "Closed" },
5697 { 0x09, "Default" },
5698 { 0x0A, "DisplayName" },
5699 { 0x0B, "F" },
5700 { 0x0C, "G" },
5701 { 0x0D, "GR" },
5702 { 0x0E, "http://" },
5703 { 0x0F, "https://" },
5704 { 0x10, "image/" },
5705 { 0x11, "Inband" },
5706 { 0x12, "IM" },
5707 { 0x13, "MaxActiveUsers" },
5708 { 0x14, "Mod" },
5709 { 0x15, "Name" },
5710 { 0x16, "None" },
5711 { 0x17, "N" },
5712 { 0x18, "Open" },
5713 { 0x19, "Outband" },
5714 { 0x1A, "PR" },
5715 { 0x1B, "Private" },
5716 { 0x1C, "PrivateMessaging" },
5717 { 0x1D, "PrivilegeLevel" },
5718 { 0x1E, "Public" },
5719 { 0x1F, "P" },
5720 { 0x20, "Request" },
5721 { 0x21, "Response" },
5722 { 0x22, "Restricted" },
5723 { 0x23, "ScreenName" },
5724 { 0x24, "Searchable" },
5725 { 0x25, "S" },
5726 { 0x26, "SC" },
5727 { 0x27, "text/" },
5728 { 0x28, "text/plain" },
5729 { 0x29, "text/x-vCalendar" },
5730 { 0x2A, "text/x-vCard" },
5731 { 0x2B, "Topic" },
5732 { 0x2C, "T" },
5733 { 0x2D, "Type" },
5734 { 0x2E, "U" },
5735 { 0x2F, "US" },
5736 { 0x30, "www.wireless-village.org" },
5737 /* New in WV-CSP 1.2 */
5738 { 0x31, "AutoDelete" },
5739 { 0x32, "GM" },
5740 { 0x33, "Validity" },
5741 { 0x34, "DENIED" },
5742 { 0x35, "GRANTED" },
5743 { 0x36, "PENDING" },
5744 { 0x37, "ShowID" },
5747 * Access value tokens
5749 { 0x3D, "GROUP_ID" },
5750 { 0x3E, "GROUP_NAME" },
5751 { 0x3F, "GROUP_TOPIC" },
5752 { 0x40, "GROUP_USER_ID_JOINED" },
5753 { 0x41, "GROUP_USER_ID_OWNER" },
5754 { 0x42, "HTTP" },
5755 { 0x43, "SMS" },
5756 { 0x44, "STCP" },
5757 { 0x45, "SUDP" },
5758 { 0x46, "USER_ALIAS" },
5759 { 0x47, "USER_EMAIL_ADDRESS" },
5760 { 0x48, "USER_FIRST_NAME" },
5761 { 0x49, "USER_ID" },
5762 { 0x4A, "USER_LAST_NAME" },
5763 { 0x4B, "USER_MOBILE_NUMBER" },
5764 { 0x4C, "USER_ONLINE_STATUS" },
5765 { 0x4D, "WAPSMS" },
5766 { 0x4E, "WAPUDP" },
5767 { 0x4F, "WSP" },
5768 /* New in WV-CSP 1.2 */
5769 { 0x50, "GROUP_USER_ID_AUTOJOIN" },
5771 * Presence value tokens
5773 { 0x5B, "ANGRY" },
5774 { 0x5C, "ANXIOUS" },
5775 { 0x5D, "ASHAMED" },
5776 { 0x5E, "AUDIO_CALL" },
5777 { 0x5F, "AVAILABLE" },
5778 { 0x60, "BORED" },
5779 { 0x61, "CALL" },
5780 { 0x62, "CLI" },
5781 { 0x63, "COMPUTER" },
5782 { 0x64, "DISCREET" },
5783 { 0x65, "EMAIL" },
5784 { 0x66, "EXCITED" },
5785 { 0x67, "HAPPY" },
5786 /* { 0x68, "IM" }, Obsolete */
5787 { 0x69, "IM_OFFLINE" },
5788 { 0x6A, "IM_ONLINE" },
5789 { 0x6B, "IN_LOVE" },
5790 { 0x6C, "INVINCIBLE" },
5791 { 0x6D, "JEALOUS" },
5792 { 0x6E, "MMS" },
5793 { 0x6F, "MOBILE_PHONE" },
5794 { 0x70, "NOT_AVAILABLE" },
5795 { 0x71, "OTHER" },
5796 { 0x72, "PDA" },
5797 { 0x73, "SAD" },
5798 { 0x74, "SLEEPY" },
5799 { 0x75, "SMS" },
5800 { 0x76, "VIDEO_CALL" },
5801 { 0x77, "VIDEO_STREAM" },
5804 * Access value tokens - continued
5806 { 0xA4, "SSMS" },
5807 { 0xA5, "SHTTP" },
5809 { 0x00, NULL }
5814 /***** Token code page aggregation *****/
5816 static char *
5817 ext_t_0_wv_cspc_12(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_)
5819 char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'",
5820 val_to_str(value, vals_wv_csp_12_element_value_tokens,
5821 "<Unknown WV-CSP 1.2 Common Value token 0x%X>"));
5822 return str;
5825 #define wbxml_wv_csp_12_global wbxml_wv_csp_11_global
5827 static const value_valuestring wbxml_wv_csp_12_tags[] = {
5828 { 0, wbxml_wv_csp_12_tags_cp0 },
5829 { 1, wbxml_wv_csp_12_tags_cp1 },
5830 { 2, wbxml_wv_csp_12_tags_cp2 },
5831 { 3, wbxml_wv_csp_12_tags_cp3 },
5832 { 4, wbxml_wv_csp_12_tags_cp4 },
5833 { 5, wbxml_wv_csp_12_tags_cp5 },
5834 { 6, wbxml_wv_csp_12_tags_cp6 },
5835 { 7, wbxml_wv_csp_12_tags_cp7 },
5836 { 8, wbxml_wv_csp_12_tags_cp8 },
5837 { 9, wbxml_wv_csp_12_tags_cp9 },
5838 { 10, wbxml_wv_csp_12_tags_cp10 },
5839 { 0, NULL }
5842 static const value_valuestring wbxml_wv_csp_12_attrStart[] = {
5843 { 0, wbxml_wv_csp_12_attrStart_cp0 },
5844 { 0, NULL }
5847 static const wbxml_decoding decode_wv_cspc_12 = {
5848 "Wireless-Village Client-Server Protocol 1.2",
5849 "WV-CSP 1.2",
5850 { ext_t_0_wv_cspc_12, NULL, NULL },
5851 wv_csp12_opaque_binary_tag,
5852 wv_csp12_opaque_literal_tag,
5853 default_opaque_binary_attr,
5854 default_opaque_literal_attr,
5855 wbxml_wv_csp_12_global,
5856 wbxml_wv_csp_12_tags,
5857 wbxml_wv_csp_12_attrStart,
5858 NULL
5862 /* WV-CSP 1.3
5864 * Wireless Village Client Server Protocol
5865 ***************************************/
5867 /***** Global extension tokens *****/
5868 /* Same as WV-CSP 1.1 */
5870 /***** Tag tokens *****/
5871 /* Common code page */
5872 static const value_string wbxml_wv_csp_13_tags_cp0[] = {
5873 /* 0x00 -- 0x04 GLOBAL */
5874 { 0x05, "Acceptance"},
5875 { 0x06, "AddList" },
5876 { 0x07, "AddNickList"},
5877 { 0x09, "WV-CSP-Message"},
5878 { 0x0A, "ClientID"},
5879 { 0x0B, "Code"},
5880 { 0x0C, "ContactList"},
5881 { 0x0D, "ContentData"},
5882 { 0x0E, "ContentEncoding"},
5883 { 0x0F, "ContentSize" },
5884 { 0x10, "ContentType"},
5885 { 0x11, "DateTime" },
5886 { 0x12, "Description" },
5887 { 0x13, "DetailedResult"},
5888 { 0x14, "EntityList"},
5889 { 0x15, "Group" },
5890 { 0x16, "GroupID"},
5891 { 0x17, "GroupList"},
5892 { 0x19, "Logo"},
5893 { 0x1A, "MessageCount" },
5894 { 0x1B, "MessageID" },
5895 { 0x1C, "MessageURI"},
5896 { 0x1D, "MSISDN" },
5897 { 0x1E, "Name"},
5898 { 0x1F, "NickList"},
5899 { 0x20, "NickName"},
5900 { 0x21, "Poll"},
5901 { 0x22, "Presence"},
5902 { 0x23, "PresenceSubList" },
5903 { 0x24, "PresenceValue"},
5904 { 0x25, "Property" },
5905 { 0x26, "Qualifier" },
5906 { 0x27, "Recipient" },
5907 { 0x28, "RemoveList"},
5908 { 0x29, "RemoveNickList" },
5909 { 0x2A, "Result" },
5910 { 0x2B, "ScreenName"},
5911 { 0x2C, "Sender" },
5912 { 0x2D, "Session"},
5913 { 0x2E, "SessionDescriptor" },
5914 { 0x2F, "SessionID"},
5915 { 0x30, "SessionType" },
5916 { 0x08, "SName" },
5917 { 0x31, "Status"},
5918 { 0x32, "Transaction" },
5919 { 0x33, "TransactionContent" },
5920 { 0x34, "TransactionDescriptor"},
5921 { 0x35, "TransactionID"},
5922 { 0x36, "TransactionMode" },
5923 { 0x37, "URL" },
5924 { 0x38, "URLList"},
5925 { 0x39, "User"},
5926 { 0x3A, "UserID" },
5927 { 0x3B, "UserList" },
5928 { 0x3C, "Validity" },
5929 { 0x3D, "Value" },
5931 { 0x00, NULL }
5933 /* Note that the table continues in code page 0x09 */
5935 /* Access code page (0x01) */
5936 static const value_string wbxml_wv_csp_13_tags_cp1[] = {
5937 /* 0x00 -- 0x04 GLOBAL */
5938 { 0x05, "AllFunctions" },
5939 { 0x06, "AllFunctionsRequest" },
5940 { 0x07, "CancelInvite-Request" },
5941 { 0x08, "CancelInviteUser-Request" },
5942 /* { 0x09, "Capability" }, - removed in WV 1.3*/
5943 { 0x0A, "CapabilityList" },
5944 { 0x0B, "CapabilityRequest" },
5945 { 0x0C, "ClientCapability-Request" },
5946 { 0x0D, "ClientCapability-Response" },
5947 { 0x0E, "DigestBytes" },
5948 { 0x0F, "DigestSchema" },
5949 { 0x10, "Disconnect" },
5950 { 0x11, "Functions" },
5951 { 0x12, "GetSPInfo-Request" },
5952 { 0x13, "GetSPInfo-Response" },
5953 { 0x14, "InviteID" },
5954 { 0x15, "InviteNote" },
5955 { 0x16, "Invite-Request" },
5956 { 0x17, "Invite-Response" },
5957 { 0x18, "InviteType" },
5958 { 0x19, "InviteUser-Request" },
5959 { 0x1A, "InviteUser-Response" },
5960 { 0x1B, "KeepAlive-Request" },
5961 { 0x1C, "KeepAliveTime" },
5962 { 0x1D, "Login-Request" },
5963 { 0x1E, "Login-Response" },
5964 { 0x1F, "Logout-Request" },
5965 { 0x20, "Nonce" },
5966 { 0x21, "Password" },
5967 { 0x22, "Polling-Request" },
5968 { 0x23, "ResponseNote" },
5969 { 0x24, "SearchElement" },
5970 { 0x25, "SearchFindings" },
5971 { 0x26, "SearchID" },
5972 { 0x27, "SearchIndex" },
5973 { 0x28, "SearchLimit" },
5974 { 0x29, "KeepAlive-Response" },
5975 { 0x2A, "SearchPairList" },
5976 { 0x2B, "Search-Request" },
5977 { 0x2C, "Search-Response" },
5978 { 0x2D, "SearchResult" },
5979 { 0x2E, "Service-Request" },
5980 { 0x2F, "Service-Response" },
5981 { 0x30, "SessionCookie" },
5982 { 0x31, "StopSearch-Request" },
5983 { 0x32, "TimeToLive" },
5984 /* New in WV-CSP 1.1 */
5985 { 0x33, "SearchString" },
5986 { 0x34, "CompletionFlag" },
5987 /* New in WV-CSP 1.2 */
5988 { 0x36, "ReceiveList" },
5989 { 0x37, "VerifyID-Request" },
5990 { 0x38, "Extended-Request" },
5991 { 0x39, "Extended-Response" },
5992 { 0x3A, "AgreedCapabilityList" },
5993 { 0x3B, "ExtendedData" },
5994 { 0x3C, "OtherServer" },
5995 { 0x3D, "PresenceAttributeNSName" },
5996 { 0x3E, "SessionNSName" },
5997 { 0x3F, "TransactionNSName" },
5999 { 0x00, NULL }
6001 /* Note that the table continues in code page 0x0A */
6003 /* Service code page (0x02) */
6004 static const value_string wbxml_wv_csp_13_tags_cp2[] = {
6005 /* 0x00 -- 0x04 GLOBAL */
6006 { 0x05, "ADDGM" },
6007 /* { 0x06, "AttListFunc" }, removed in WV 1.3 */
6008 { 0x07, "BLENT" },
6009 /* { 0x08, "CAAUT" }, removed in WV 1.3 */
6010 { 0x09, "CAINV" },
6011 /* { 0x0A, "CALI" }, removed in WV 1.3 */
6012 { 0x0B, "CCLI" },
6013 { 0x0C, "ContListFunc" },
6014 { 0x0D, "CREAG" },
6015 { 0x0E, "DALI" },
6016 { 0x0F, "DCLI" },
6017 { 0x10, "DELGR" },
6018 { 0x11, "FundamentalFeat" },
6019 { 0x12, "FWMSG" },
6020 /* { 0x13, "GALS" }, removed in WV 1.3 */
6021 { 0x14, "GCLI" },
6022 { 0x15, "GETGM" },
6023 { 0x16, "GETGP" },
6024 { 0x17, "GETLM" },
6025 { 0x18, "GETM" },
6026 { 0x19, "GETPR" },
6027 { 0x1A, "GETSPI" },
6028 { 0x1B, "GETWL" },
6029 { 0x1C, "GLBLU" },
6030 { 0x1D, "GRCHN" },
6031 { 0x1E, "GroupAuthFunc" },
6032 { 0x1F, "GroupFeat" },
6033 { 0x20, "GroupMgmtFunc" },
6034 { 0x21, "GroupUseFunc" },
6035 { 0x22, "IMAuthFunc" },
6036 { 0x23, "IMFeat" },
6037 { 0x24, "IMReceiveFunc" },
6038 { 0x25, "IMSendFunc" },
6039 { 0x26, "INVIT" },
6040 { 0x27, "InviteFunc" },
6041 { 0x28, "MBRAC" },
6042 { 0x29, "MCLS" },
6043 { 0x2A, "MDELIV" },
6044 { 0x2B, "NEWM" },
6045 { 0x2C, "NOTIF" },
6046 { 0x2D, "PresenceAuthFunc" },
6047 { 0x2E, "PresenceDeliverFunc"},
6048 { 0x2F, "PresenceFeat" },
6049 /* { 0x30, "REACT" }, removed in WV 1.3 */
6050 { 0x31, "REJCM" },
6051 { 0x32, "REJEC" },
6052 { 0x33, "RMVGM" },
6053 { 0x34, "SearchFunc" },
6054 { 0x35, "ServiceFunc" },
6055 { 0x36, "SETD" },
6056 { 0x37, "SETGP" },
6057 { 0x38, "SRCH" },
6058 { 0x39, "STSRC" },
6059 { 0x3A, "SUBGCN" },
6060 { 0x3B, "UPDPR" },
6061 { 0x3C, "WVCSPFeat" },
6062 /* New in WV-CSP 1.2 */
6063 { 0x3D, "MF" },
6064 { 0x3E, "MG" },
6065 { 0x3F, "MM" },
6067 { 0x00, NULL }
6069 /* Note that the table continues in code page 0x08 */
6071 /* Client capability code page (0x03) */
6072 static const value_string wbxml_wv_csp_13_tags_cp3[] = {
6073 /* 0x00 -- 0x04 GLOBAL */
6074 /* {0x05, "AcceptedCharset"}, - removed in WV 1.3 */
6075 /* { 0x06, "AcceptedContentLength"}, - removed in WV 1.3 */
6076 { 0x07, "AcceptedContentType"},
6077 { 0x08, "AcceptedTransferEncoding"},
6078 { 0x09, "AnyContent"},
6079 { 0x0A, "DefaultLanguage"},
6080 { 0x0B, "InitialDeliveryMethod"},
6081 { 0x0C, "MultiTrans"},
6082 { 0x0D, "ParserSize"},
6083 { 0x0E, "ServerPollMin"},
6084 { 0x0F, "SupportedBearer"},
6085 { 0x10, "SupportedCIRMethod"},
6086 { 0x11, "TCPAddress"},
6087 { 0x12, "TCPPort"},
6088 { 0x13, "UDPPort"},
6089 /* New in WV-CSP 1.3*/
6090 { 0x14, "CIRHTTPAddress"},
6091 { 0x15, "UDPAddress"},
6092 { 0x16, "AcceptedPullLength"},
6093 { 0x17, "AcceptedPushLength"},
6094 { 0x18, "AcceptedRichContentLength"},
6095 { 0x19, "AcceptedTextContentLength"},
6096 { 0x1A, "OfflineETEMHandling"},
6097 { 0x1B, "PlainTextCharset"},
6098 { 0x1C, "SessionPriority"},
6099 { 0x1D, "SupportedOfflineBearer"},
6100 { 0x1F, "UserSessionLimit"},
6101 { 0x20, "CIRSMSAddress"},
6102 { 0x21, "MultiTransPerMessage"},
6103 { 0x22, "OnlineETEMHandling"},
6104 { 0x23,"ContentPolicy"},
6105 { 0x24, "ContentPolicyLimit"},
6107 { 0x00, NULL }
6110 /* Presence primitive code page (0x04) */
6111 static const value_string wbxml_wv_csp_13_tags_cp4[] = {
6112 /* 0x00 -- 0x04 GLOBAL */
6113 /* { 0x05, "CancelAuth-Request" }, - removed in WV 1.3 */
6114 { 0x06, "ContactListProperties" },
6115 { 0x07, "CreateAttributeList-Request" },
6116 { 0x08, "CreateList-Request" },
6117 { 0x09, "DefaultAttributeList" },
6118 { 0x0A, "DefaultContactList" },
6119 { 0x0B, "DefaultList" },
6120 { 0x0C, "DeleteAttributeList-Request" },
6121 { 0x0D, "DeleteList-Request" },
6122 { 0x0E, "GetAttributeList-Request" },
6123 { 0x0F, "GetAttributeList-Response" },
6124 { 0x10, "GetList-Request" },
6125 { 0x11, "GetList-Response" },
6126 { 0x12, "GetPresence-Request" },
6127 { 0x13, "GetPresence-Response" },
6128 { 0x14, "GetWatcherList-Request" },
6129 { 0x15, "GetWatcherList-Response" },
6130 { 0x16, "ListManage-Request" },
6131 { 0x17, "ListManage-Response" },
6132 { 0x18, "UnsubscribePresence-Request" },
6133 { 0x19, "PresenceAuth-Request" },
6134 { 0x1A, "PresenceAuth-User" },
6135 { 0x1B, "PresenceNotification-Request" },
6136 { 0x1C, "UpdatePresence-Request" },
6137 { 0x1D, "SubscribePresence-Request" },
6138 /* New in WV-CSP 1.2 */
6139 /* { 0x1E, "Auto-Subscribe" }, - removed in WV 1.3 */
6140 /* { 0x1F, "GetReactiveAuthStatus-Request" }, */
6141 /* { 0x20, "GetReactiveAuthStatus-Response" }, */
6142 /* New in WV-CSP 1.3 */
6143 { 0x21, "CreateList-Response"},
6145 { 0x00, NULL }
6148 /* Presence attribute code page (0x05) */
6149 static const value_string wbxml_wv_csp_13_tags_cp5[] = {
6150 /* 0x00 -- 0x04 GLOBAL */
6151 { 0x05, "Accuracy" },
6152 { 0x06, "Address" },
6153 { 0x07, "AddrPref" },
6154 { 0x08, "Alias" },
6155 { 0x09, "Altitude" },
6156 { 0x0A, "Building" },
6157 { 0x0B, "Caddr" },
6158 { 0x0C, "City" },
6159 { 0x0D, "ClientInfo" },
6160 { 0x0E, "ClientProducer" },
6161 { 0x0F, "ClientType" },
6162 { 0x10, "ClientVersion" },
6163 { 0x11, "CommC" },
6164 { 0x12, "CommCap" },
6165 { 0x13, "ContactInfo" },
6166 { 0x14, "ContainedvCard" },
6167 { 0x15, "Country" },
6168 { 0x16, "Crossing1" },
6169 { 0x17, "Crossing2" },
6170 { 0x18, "DevManufacturer" },
6171 { 0x19, "DirectContent" },
6172 { 0x1A, "FreeTextLocation" },
6173 { 0x1B, "GeoLocation" },
6174 { 0x1C, "Language" },
6175 { 0x1D, "Latitude" },
6176 { 0x1E, "Longitude" },
6177 { 0x1F, "Model" },
6178 { 0x20, "NamedArea" },
6179 { 0x21, "OnlineStatus" },
6180 { 0x22, "PLMN" },
6181 { 0x23, "PrefC" },
6182 { 0x24, "PreferredContacts" },
6183 { 0x25, "PreferredLanguage" },
6184 { 0x26, "ReferredContent" },
6185 { 0x27, "ReferredvCard" },
6186 { 0x28, "Registration" },
6187 { 0x29, "StatusContent" },
6188 { 0x2A, "StatusMood" },
6189 { 0x2B, "StatusText" },
6190 { 0x2C, "Street" },
6191 { 0x2D, "TimeZone" },
6192 { 0x2E, "UserAvailability" },
6193 /* New in WV-CSP 1.1 */
6194 { 0x2F, "Cap" },
6195 { 0x30, "Cname" },
6196 { 0x31, "Contact" },
6197 { 0x32, "Cpriority" },
6198 { 0x33, "Cstatus" },
6199 { 0x34, "Note" },
6200 { 0x35, "Zone" },
6201 /* New in WV-CSP 1.2 */
6202 { 0x36, "ContentType" },
6203 { 0x37, "Inf_link" },
6204 { 0x38, "InfoLink" },
6205 { 0x39, "Link" },
6206 { 0x3A, "Text" },
6207 /* New in WV-CSP 1.3 */
6208 { 0x3B, "ClientContentLimit"},
6209 { 0x3C, "ClientIMPriority"},
6210 { 0x3D, "MaxPullLength"},
6211 { 0x3E, "MaxPushLength"},
6213 { 0x00, NULL }
6216 /* Messaging code page (0x06) */
6217 static const value_string wbxml_wv_csp_13_tags_cp6[] = {
6218 /* 0x00 -- 0x04 GLOBAL */
6219 { 0x05, "BlockList" },
6220 { 0x06, "BlockEntity-Request" }, /* Was: BlockUser-Request */
6221 { 0x07, "DeliveryMethod" },
6222 { 0x08, "DeliveryReport" },
6223 { 0x09, "DeliveryReport-Request" },
6224 { 0x0A, "ForwardMessage-Request" },
6225 { 0x0B, "GetBlockedList-Request" },
6226 { 0x0C, "GetBlockedList-Response" },
6227 { 0x0D, "GetMessageList-Request" },
6228 { 0x0E, "GetMessageList-Response" },
6229 { 0x0F, "GetMessage-Request" },
6230 { 0x10, "GetMessage-Response" },
6231 { 0x11, "GrantList" },
6232 { 0x12, "MessageDelivered" },
6233 { 0x13, "MessageInfo" },
6234 { 0x14, "MessageNotification" },
6235 { 0x15, "NewMessage" },
6236 { 0x16, "RejectMessage-Request" },
6237 { 0x17, "SendMessage-Request" },
6238 { 0x18, "SendMessage-Response" },
6239 { 0x19, "SetDeliveryMethod-Request" },
6240 { 0x1A, "DeliveryTime" },
6241 /* New in WV-CSP 1.3 */
6242 { 0x20, "MessageInfoList"},
6243 { 0x21, "ForwardMessage-Response"},
6245 { 0x00, NULL }
6248 /* Group code page (0x07) */
6249 static const value_string wbxml_wv_csp_13_tags_cp7[] = {
6250 /* 0x00 -- 0x04 GLOBAL */
6251 { 0x05, "AddGroupMembers-Request" },
6252 { 0x06, "Admin" },
6253 { 0x07, "CreateGroup-Request" },
6254 { 0x08, "DeleteGroup-Request" },
6255 { 0x09, "GetGroupMembers-Request" },
6256 { 0x0A, "GetGroupMembers-Response" },
6257 { 0x0B, "GetGroupProps-Request" },
6258 { 0x0C, "GetGroupProps-Response" },
6259 { 0x0D, "GroupChangeNotice" },
6260 { 0x0E, "GroupProperties" },
6261 { 0x0F, "Joined" },
6262 { 0x10, "JoinedRequest" },
6263 { 0x11, "JoinGroup-Request" },
6264 { 0x12, "JoinGroup-Response" },
6265 { 0x13, "LeaveGroup-Request" },
6266 { 0x14, "LeaveGroup-Response" },
6267 { 0x15, "Left" },
6268 { 0x16, "MemberAccess-Request" },
6269 { 0x17, "Mod" },
6270 { 0x18, "OwnProperties" },
6271 { 0x19, "RejectList-Request" },
6272 { 0x1A, "RejectList-Response" },
6273 { 0x1B, "RemoveGroupMembers-Request" },
6274 { 0x1C, "SetGroupProps-Request" },
6275 { 0x1D, "SubscribeGroupNotice-Request" },
6276 { 0x1E, "SubscribeGroupNotice-Response" },
6277 /* { 0x1F, "Users" }, - removed in WV 1.3 */
6278 { 0x20, "WelcomeNote" },
6279 /* New in WV-CSP 1.1 */
6280 { 0x21, "JoinGroup" },
6281 { 0x22, "SubscribeNotification" },
6282 { 0x23, "SubscribeType" },
6283 /* New in WV-CSP 1.2 */
6284 { 0x24, "GetJoinedUsers-Request" },
6285 { 0x25, "GetJoinedUsers-Response" },
6286 { 0x26, "AdminMapList" },
6287 { 0x27, "AdminMapping" },
6288 { 0x28, "Mapping" },
6289 { 0x29, "ModMapping" },
6290 { 0x2A, "UserMapList" },
6291 { 0x2B, "UserMapping" },
6292 /* New in WV-CSP 1.3 */
6293 { 0x2C, "JoinedBlocked" },
6294 { 0x2D, "LeftBlocked" },
6296 { 0x00, NULL }
6299 /* Service negotiation code page - continued (0x08) */
6300 static const value_string wbxml_wv_csp_13_tags_cp8[] = {
6301 /* 0x00 -- 0x04 GLOBAL */
6302 /* New in WV-CSP 1.2 */
6303 { 0x05, "MP" },
6304 { 0x06, "GETAUT" },
6305 { 0x07, "GETJU" },
6306 { 0x08, "VRID" },
6307 { 0x09, "VerifyIDFunc" },
6308 /* New in WV-CSP 1.3 */
6309 { 0x0A, "GETMAP" },
6310 { 0x0B, "SGMNT" },
6311 { 0x0C, "EXCON" },
6312 { 0x0D, "OFFNOTIF" },
6313 { 0x0E, "ADVSR" },
6315 { 0x00, NULL }
6318 /* Common code page - continued (0x09) */
6319 static const value_string wbxml_wv_csp_13_tags_cp9[] = {
6320 /* 0x00 -- 0x04 GLOBAL */
6321 /* New in WV-CSP 1.2 */
6322 { 0x05, "CIR" },
6323 { 0x06, "Domain" },
6324 { 0x07, "ExtBlock" },
6325 { 0x08, "HistoryPeriod" },
6326 { 0x09, "IDList" },
6327 { 0x0A, "MaxWatcherList" },
6328 /* { 0x0B, "ReactiveAuthState" }, - removed in WV 1.3 */
6329 /* { 0x0C, "ReactiveAuthStatus" }, - removed in WV 1.3 */
6330 /* { 0x0D, "ReactiveAuthStatusList" }, - removed in WV 1.3 */
6331 { 0x0E, "Watcher" },
6332 { 0x0F, "WatcherStatus" },
6333 /* New in WV-CSP 1.3 */
6334 { 0x1B, "AnswerOption"},
6335 { 0x1C, "AnswerOptionID" },
6336 { 0x1D, "AnswerOptions"},
6337 { 0x0B, "AnswerOptionText"},
6338 { 0x1E, "ApplicationID"},
6339 { 0x1F, "AuthorizeAndGrant"},
6340 { 0x20, "ChosenOptionID"},
6341 { 0x19, "ClearPublicProfile"},
6342 { 0x13, "Color"},
6343 { 0x21, "ContactListNotify"},
6344 { 0x14, "ContentName"},
6345 { 0x22, "DefaultNotify"},
6346 { 0x39, "ExtBlockETEM"},
6347 { 0x36, "ExtendConversationID"},
6348 { 0x23, "ExtendConversationUser"},
6349 { 0x10, "Font"},
6350 { 0x18, "FriendlyName"},
6351 { 0x34 , "GetMap-Request"},
6352 { 0x35, "GetMap-Response"},
6353 { 0x3A, "GroupContentLimit" },
6354 { 0x24, "InText"},
6355 { 0x15, "Map"},
6356 { 0x3B, "MessageTotalCount"},
6357 { 0x16, "NotificationType"},
6358 { 0x17, "NotificationTypeList"},
6359 { 0x1A, "PublicProfile"},
6360 { 0x38, "RequiresResponse"},
6361 { 0x25, "SegmentCount"},
6362 { 0x26, "SegmentID" },
6363 { 0x27, "SegmentInfo"},
6364 { 0x28, "SegmentReference"},
6365 { 0x11, "Size"},
6366 { 0x12, "Style" },
6367 { 0x29, "SystemMessage"},
6368 { 0x2A, "SystemMessageID"},
6369 { 0x2B, "SystemMessageList"},
6370 { 0x2C, "SystemMessageResponse"},
6371 { 0x2D, "SystemMessageResponseList" },
6372 { 0x2F, "SystemMessageText"},
6373 { 0x30, "TryAgainTimeout"},
6374 { 0x3C, "UnrecognizedUserID"},
6375 { 0x3F , "UserIDList"},
6376 { 0x3D, "UserIDPair"},
6377 { 0x31, "UserNotify"},
6378 { 0x3E, "ValidUserID"},
6379 { 0x32, "VerificationKey"},
6380 { 0x33, "VerificationMechanism"},
6381 { 0x37, "WatcherCount"},
6383 { 0x00, NULL }
6386 /* Access code page - continued (0x0A) */
6387 static const value_string wbxml_wv_csp_13_tags_cp10[] = {
6388 /* 0x00 -- 0x04 GLOBAL */
6389 /* New in WV-CSP 1.2 */
6390 { 0x05, "WV-CSP-NSDiscovery-Request" },
6391 { 0x06, "WV-CSP-NSDiscovery-Response" },
6392 { 0x07, "VersionList"},
6393 /* New in WV-CSP 1.3 */
6394 { 0x08, "SubscribeNotification-Request" },
6395 { 0x09, "UnsubscribeNotification-Request" },
6396 { 0x0A, "Notification-Request" },
6397 { 0x0B, "AdvancedCriteria" },
6398 { 0x0C, "PairID" },
6399 { 0x0D, "GetPublicProfile-Request" },
6400 { 0x0E, "GetPublicProfile-Response" },
6401 { 0x0F, "UpdatePublicProfile-Request" },
6402 { 0x10, "DropSegment-Request" },
6403 { 0x11, "ExtendConversation-Response" },
6404 { 0x12, "ExtendConversation-Request" },
6405 { 0x13, "GetSegment-Request" },
6406 { 0x14, "GetSegment-Response" },
6407 { 0x15, "SystemMessage-Request" },
6408 { 0x16, "SystemMessage-User" },
6409 { 0x17, "SearchPair" },
6410 { 0x18, "SegmentContent" },
6412 { 0x00, NULL }
6415 /* Common code page - continued (0x0B) */
6416 static const value_string wbxml_wv_csp_13_tags_cp11[] = {
6417 /* 0x00 -- 0x04 GLOBAL */
6418 /* New in WV-CSP 1.3 */
6419 { 0x05, "GrantListInUse" },
6420 { 0x06, "BlockListInUse" },
6421 { 0x07, "ContactListIDList" },
6422 { 0x08, "AnswerOptionsText" },
6424 { 0x00, NULL }
6428 /***** Attribute Start tokens *****/
6429 /* Common code page (0x00) */
6430 static const value_string wbxml_wv_csp_13_attrStart_cp0[] = {
6431 /* 0x00 -- 0x04 GLOBAL */
6432 { 0x05, "xmlns='http://www.wireless-village.org/CSP'" },
6433 { 0x06, "xmlns='http://www.wireless-village.org/PA'" },
6434 { 0x07, "xmlns='http://www.wireless-village.org/TRC'" },
6435 /* New in WV-CSP 1.2 */
6436 { 0x08, "xmlns='http://www.openmobilealliance.org/DTD/WV-CSP'" },
6437 { 0x09, "xmlns='http://www.openmobilealliance.org/DTD/WV-PA'" },
6438 { 0x0A, "xmlns='http://www.openmobilealliance.org/DTD/WV-TRC'" },
6439 /* New in WV-CSP 1.3 */
6440 { 0x0B, "xmlns='http://www.openmobilealliance.org/DTD/IMPS-CSP'" },
6441 { 0x0C, "xmlns='http://www.openmobilealliance.org/DTD/IMPS-PA'" },
6442 { 0x0D, "xmlns='http://www.openmobilealliance.org/DTD/IMPS-TRC'" },
6444 { 0x00, NULL }
6447 /***** Attribute Value tokens *****/
6449 * Element value tokens
6451 static const value_string vals_wv_csp_13_element_value_tokens[] = {
6453 * Common value tokens
6455 { 0x52, "AC" },
6456 { 0x00, "AccessType" },
6457 { 0x01, "ActiveUsers" },
6458 { 0x02, "Admin" },
6459 { 0x3C, "ANC" },
6460 { 0x51, "AND" },
6461 { 0x5A, "ANU" },
6462 { 0x68, "AP" },
6463 { 0x03, "application/" },
6464 { 0x04, "application/vnd.wap.mms-message" },
6465 { 0x05, "application/x-sms" },
6466 { 0x8F, "Aqua" },
6467 { 0x90, "ATCL" },
6468 { 0x31, "AutoDelete" },
6469 { 0x06, "AutoJoin" },
6470 { 0x07, "BASE64" },
6471 { 0x7B, "Big" },
6472 { 0x80, "Black" },
6473 { 0x53, "BLC" },
6474 { 0x54, "BLUC" },
6475 { 0x8D, "Blue" },
6476 { 0x7D, "Bold" },
6477 { 0xBC, "C" },
6478 { 0x91, "CLC" },
6479 { 0x55, "CLCR" },
6480 { 0x56, "CLD" },
6481 { 0x08, "Closed" },
6482 { 0xBD, "CURRENT_SUBSCRIBER" },
6483 { 0x09, "Default" },
6484 { 0x34, "DENIED" },
6485 { 0xAB, "DETECT" },
6486 { 0x0A, "DisplayName" },
6487 { 0xA6, "DoNotNotify" },
6488 { 0xA0, "EC" },
6489 { 0xBA, "EG" },
6490 { 0x0B, "F" },
6491 { 0xAC, "FORKALL" },
6492 { 0xBE, "FORMER_SUBSCRIBER" },
6493 { 0x87, "Fuchsia" },
6494 { 0x0C, "G" },
6495 { 0x57, "GC" },
6496 { 0x58, "GD" },
6497 { 0x59, "GLC" },
6498 { 0xA1, "GLUC" },
6499 { 0x32, "GM" },
6500 { 0xA7, "GMAU" },
6501 { 0xA8, "GMG" },
6502 { 0xA9, "GMR" },
6503 { 0xAA, "GMU" },
6504 { 0x0D, "GR" },
6505 { 0x35, "GRANTED" },
6506 { 0x82, "Gray" },
6507 { 0x88, "Green" },
6508 { 0x3D, "History" },
6509 { 0x0E, "http://" },
6510 { 0x0F, "https://" },
6511 { 0x7C, "Huge" },
6512 { 0xA2, "IA" },
6513 { 0xA3, "IC" },
6514 { 0x10, "image/" },
6515 { 0x11, "Inband" },
6516 { 0x12, "IM" },
6517 { 0x9F, "IR" },
6518 { 0x7E, "Italic" },
6519 { 0x89, "Lime" },
6520 { 0x84, "Maroon" },
6521 { 0x13, "MaxActiveUsers" },
6522 { 0x7A, "Medium" },
6523 { 0xBB, "MinimumAge" },
6524 { 0x14, "Mod" },
6525 { 0x15, "Name" },
6526 { 0x8C, "Navy" },
6527 { 0x16, "None" },
6528 { 0x17, "N" },
6529 { 0xAD, "OEU" },
6530 { 0x8A, "Olive" },
6531 { 0x18, "Open" },
6532 { 0x19, "Outband" },
6533 { 0x36, "PENDING" },
6534 { 0x3A, "PPU" },
6535 { 0x1A, "PR" },
6536 { 0xBF, "PRESENCE_ACCESS" },
6537 { 0x1B, "Private" },
6538 { 0x1C, "PrivateMessaging" },
6539 { 0x1D, "PrivilegeLevel" },
6540 { 0x1E, "Public" },
6541 { 0x86, "Purple" },
6542 { 0x1F, "P" },
6543 { 0xC0, "R" },
6544 { 0x85, "Red" },
6545 { 0x20, "Request" },
6546 { 0x21, "Response" },
6547 { 0x22, "Restricted" },
6548 { 0x38, "RequireInvitation" },
6549 { 0x23, "ScreenName" },
6550 { 0x24, "Searchable" },
6551 { 0x25, "S" },
6552 { 0x26, "SC" },
6553 { 0xAE, "SERVERLOGIC" },
6554 { 0x37, "ShowID" },
6555 { 0x81, "Silver" },
6556 { 0x79, "Small" },
6557 { 0x3B, "SPA" },
6558 { 0x8E, "Teal" },
6559 { 0x27, "text/" },
6560 { 0x28, "text/plain" },
6561 { 0x29, "text/x-vCalendar" },
6562 { 0x2A, "text/x-vCard" },
6563 { 0x39, "Tiny" },
6564 { 0x2B, "Topic" },
6565 { 0x2C, "T" },
6566 { 0x2D, "Type" },
6567 { 0x2E, "U" },
6568 { 0x7F, "Underline" },
6569 { 0x2F, "US" },
6570 { 0x33, "Validity" },
6571 { 0x83, "White" },
6572 { 0x78, "www.openmobilealliance.org" },
6573 { 0x30, "www.wireless-village.org" },
6574 { 0x8B, "Yellow" },
6576 * Access value tokens
6578 { 0x3D, "GROUP_ID" },
6579 { 0x3E, "GROUP_NAME" },
6580 { 0x3F, "GROUP_TOPIC" },
6581 { 0x40, "GROUP_USER_ID_JOINED" },
6582 { 0x41, "GROUP_USER_ID_OWNER" },
6583 { 0x42, "HTTP" },
6584 { 0x43, "SMS" },
6585 { 0x44, "STCP" },
6586 { 0x45, "SUDP" },
6587 { 0x46, "USER_ALIAS" },
6588 { 0x47, "USER_EMAIL_ADDRESS" },
6589 { 0x48, "USER_FIRST_NAME" },
6590 { 0x49, "USER_ID" },
6591 { 0x4A, "USER_LAST_NAME" },
6592 { 0x4B, "USER_MOBILE_NUMBER" },
6593 { 0x4C, "USER_ONLINE_STATUS" },
6594 { 0x4D, "WAPSMS" },
6595 { 0x4E, "WAPUDP" },
6596 { 0x4F, "WSP" },
6597 { 0x50, "GROUP_USER_ID_AUTOJOIN" },
6599 * Presence value tokens
6601 { 0x5B, "ANGRY" },
6602 { 0x5C, "ANXIOUS" },
6603 { 0x5D, "ASHAMED" },
6604 { 0x5F, "AVAILABLE" },
6605 { 0x60, "BORED" },
6606 { 0x61, "CALL" },
6607 { 0x62, "CLI" },
6608 { 0x63, "COMPUTER" },
6609 { 0x64, "DISCREET" },
6610 { 0x65, "EMAIL" },
6611 { 0x66, "EXCITED" },
6612 { 0x67, "HAPPY" },
6613 { 0x6B, "IN_LOVE" },
6614 { 0x6C, "INVINCIBLE" },
6615 { 0x6D, "JEALOUS" },
6616 { 0x6E, "MMS" },
6617 { 0x6F, "MOBILE_PHONE" },
6618 { 0x70, "NOT_AVAILABLE" },
6619 { 0x71, "OTHER" },
6620 { 0x72, "PDA" },
6621 { 0x73, "SAD" },
6622 { 0x74, "SLEEPY" },
6623 { 0x75, "SMS" },
6625 * Access value tokens - continued
6627 { 0x93, "USER_CITY" },
6628 { 0x94, "USER_COUNTRY" },
6629 { 0x95, "USER_FRIENDLY_NAME" },
6630 { 0x96, "USER_GENDER" },
6631 { 0x97, "USER_INTENTION" },
6632 { 0x98, "USER_INTERESTS_HOBBIES" },
6633 { 0x99, "USER_MARITAL_STATUS" },
6634 { 0x9A, "PRIORITYREJECT" },
6635 { 0x9B, "PRIORITYSTORE" },
6636 { 0x9C, "REJECT" },
6637 { 0x9D, "SENDREJECT" },
6638 { 0x9E, "SENDSTORE" },
6639 { 0xA4, "SSMS" },
6640 { 0xA5, "SHTTP" },
6641 { 0xAF, "PP_AGE" },
6642 { 0xB0, "PP_CITY" },
6643 { 0xB1, "PP_COUNTRY" },
6644 { 0xB2, "PP_FRIENDLY_NAME" },
6645 { 0xB3, "PP_FREE_TEXT" },
6646 { 0xB4, "PP_GENDER" },
6647 { 0xB5, "PP_INTENTION" },
6648 { 0xB6, "PP_INTERESTS" },
6649 { 0xB7, "PP_MARITAL_STATUS" },
6650 { 0xB8, "USER_AGE_MAX" },
6651 { 0xB9, "USER_AGE_MIN" },
6653 { 0x00, NULL }
6656 /***** Token code page aggregation *****/
6657 static char *
6658 ext_t_0_wv_cspc_13(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_)
6660 char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'",
6661 val_to_str(value, vals_wv_csp_13_element_value_tokens,
6662 "<Unknown WV-CSP 1.3 Common Value token 0x%X>"));
6663 return str;
6666 #define wbxml_wv_csp_13_global wbxml_wv_csp_12_global /*TODO*/
6668 static const value_valuestring wbxml_wv_csp_13_tags[] = {
6669 { 0, wbxml_wv_csp_13_tags_cp0 },
6670 { 1, wbxml_wv_csp_13_tags_cp1 },
6671 { 2, wbxml_wv_csp_13_tags_cp2 },
6672 { 3, wbxml_wv_csp_13_tags_cp3 },
6673 { 4, wbxml_wv_csp_13_tags_cp4 },
6674 { 5, wbxml_wv_csp_13_tags_cp5 },
6675 { 6, wbxml_wv_csp_13_tags_cp6 },
6676 { 7, wbxml_wv_csp_13_tags_cp7 },
6677 { 8, wbxml_wv_csp_13_tags_cp8 },
6678 { 9, wbxml_wv_csp_13_tags_cp9 },
6679 { 10, wbxml_wv_csp_13_tags_cp10 },
6680 { 11, wbxml_wv_csp_13_tags_cp11 },
6681 { 0, NULL }
6684 static const value_valuestring wbxml_wv_csp_13_attrStart[] = {
6685 { 0, wbxml_wv_csp_13_attrStart_cp0 },
6686 { 0, NULL }
6689 static const wbxml_decoding decode_wv_cspc_13 = {
6690 "Wireless-Village Client-Server Protocol 1.3",
6691 "WV-CSP 1.3",
6692 { ext_t_0_wv_cspc_13, NULL, NULL },
6693 wv_csp13_opaque_binary_tag,
6694 wv_csp13_opaque_literal_tag,
6695 default_opaque_binary_attr,
6696 default_opaque_literal_attr,
6697 wbxml_wv_csp_13_global,
6698 wbxml_wv_csp_13_tags,
6699 wbxml_wv_csp_13_attrStart,
6700 NULL
6707 /****************************** Discriminators ******************************/
6708 /* Discriminator for WV-CSP; allows version detection based on parsing parts
6709 * of the start of the WBXML body.
6711 static const wbxml_decoding *
6712 wv_csp_discriminator(tvbuff_t *tvb, guint32 offset)
6714 guint32 magic_1 = tvb_get_ntohl(tvb, offset + 0);
6715 guint16 magic_2 = tvb_get_ntohs(tvb, offset + 4);
6717 if (magic_1 == 0xFE050331 && magic_2 == 0x2e30)
6719 /* FE 05 03 31 2E 30 --> WV-CSP 1.0 */
6720 return &decode_wv_cspc_10;
6722 else if (magic_1 == 0xC9050331 && magic_2 == 0x2e31)
6724 /* C9 05 03 31 2E 31 --> WV-CSP 1.1 */
6725 return &decode_wv_cspc_11;
6727 else if (magic_1 == 0xC9080331 && magic_2 == 0x2e32)
6729 /* C9 08 03 31 2E 32 --> WV-CSP 1.2 */
6730 return &decode_wv_cspc_12;
6732 else if ( magic_1 == 0xC90B0331 && magic_2 == 0x2E33)
6734 /* C9 0B 03 31 2E 33 --> WV-CSP 1.3 */
6735 return &decode_wv_cspc_13;
6739 /* Default: WV-CSP 1.2 */
6740 return &decode_wv_cspc_12;
6743 /********************** WBXML token mapping aggregation **********************/
6745 static const wbxml_decoding *get_wbxml_decoding_from_public_id (guint32 publicid);
6746 static const wbxml_decoding *get_wbxml_decoding_from_content_type (
6747 const char *content_type, tvbuff_t *tvb, guint32 offset);
6751 ** Aggregation of content type and aggregated code pages
6752 ** Content type map lookup will stop at the 1st entry with 3rd member = FALSE
6756 * The following map contains entries registered with a registered WBXML
6757 * public ID. See WAP WINA or OMA OMNA for registered values:
6758 * http://www.openmobilealliance.org/tech/omna/ */
6759 static const wbxml_integer_list well_known_public_id_list[] = {
6760 /* 0x00 - Unknown or missing Public ID */
6761 /* 0x01 - LITERAL PublicID - see String Table */
6762 { 0x02, &decode_wmlc_10 }, /* WML 1.0 */
6763 /* 0x03 - WTA 1.0 */
6764 { 0x04, &decode_wmlc_11 }, /* WML 1.1 */
6765 { 0x05, &decode_sic_10 }, /* SI 1.0 */
6766 { 0x06, &decode_slc_10 }, /* SL 1.0 */
6767 { 0x07, &decode_coc_10 }, /* CO 1.0 */
6768 { 0x08, &decode_channelc_10 }, /* CHANNEL 1.0 */
6769 { 0x09, &decode_wmlc_12 }, /* WML 1.2 */
6770 { 0x0A, &decode_wmlc_13 }, /* WML 1.3 */
6771 { 0x0B, &decode_provc_10 }, /* PROV 1.0 */
6772 /* 0x0C - WTA-WML 1.2 */
6773 { 0x0D, &decode_emnc_10 }, /* EMN 1.0 */
6774 /* 0x0E - DRMREL 1.0 */
6775 { 0x0F, &decode_wv_cspc_10 }, /* WV-CSP 1.0 */
6776 { 0x10, &decode_wv_cspc_11 }, /* WV-CSP 1.1 */
6777 /*See http://www.openmobilealliance.org/tech/omna/omna-wbxml-public-docid.htm */
6778 { 0x11, &decode_wv_cspc_12 }, /* OMA IMPS - CSP protocol DTD v1.2 */
6779 { 0x12, &decode_wv_cspc_13 }, /* OMA IMPS - CSP protocol DTD v1.3 */
6780 { 0x020B, &decode_nokiaprovc_70 },/* Nokia OTA Provisioning 7.0 */
6781 { 0x0FD1, &decode_syncmlc_10 }, /* SyncML 1.0 */
6782 { 0x0FD3, &decode_syncmlc_11 }, /* SyncML 1.1 */
6783 /* Note: I assumed WML+ 1.x would be not that different from WML 1.x,
6784 * the real mapping should come from Phone.com (OpenWave)! */
6785 { 0x1108, &decode_wmlc_11 }, /* Phone.com WMLC+ 1.1 - not 100% correct */
6786 { 0x110D, &decode_wmlc_13 }, /* Phone.com WMLC+ 1.3 - not 100% correct */
6788 { 0x1201, &decode_syncmlc_12 }, /* SyncML 1.2 */
6790 { 0x00, NULL }
6793 /* The following map contains entries only registered with a literal media
6794 * type. */
6795 static const wbxml_literal_list content_type_list[] = {
6796 { "application/x-wap-prov.browser-settings",
6797 NULL,
6798 &decode_nokiaprovc_70
6800 { "application/x-wap-prov.browser-bookmarks",
6801 NULL,
6802 &decode_nokiaprovc_70
6804 { "application/vnd.wv.csp.wbxml",
6805 wv_csp_discriminator,
6806 &decode_wv_cspc_11
6808 { "application/vnd.ms-sync.wbxml",
6809 NULL,
6810 &decode_mssync_10
6812 { "application/vnd.ms-sync",
6813 NULL,
6814 &decode_mssync_10
6816 { NULL, NULL, NULL }
6820 /* Returns a pointer to the WBXML token map for the given WBXML public
6821 * identifier value (see WINA for a table with defined identifiers). */
6822 static const wbxml_decoding *get_wbxml_decoding_from_public_id (guint32 public_id)
6824 const wbxml_decoding *map = NULL;
6826 DebugLog(("get_wbxml_decoding_from_public_id: public_id = %u\n",
6827 public_id));
6828 if (public_id >= 2) {
6829 const wbxml_integer_list *item = well_known_public_id_list;
6831 while (item && item->public_id && item->map) {
6832 if (item->public_id == public_id) {
6833 map = item->map;
6834 break;
6836 item++;
6839 return map;
6842 static const wbxml_decoding *get_wbxml_decoding_from_content_type (
6843 const char *content_type, tvbuff_t *tvb, guint32 offset)
6845 const wbxml_decoding *map = NULL;
6847 DebugLog(("get_wbxml_decoding_from_content_type: content_type = [%s]\n",
6848 content_type));
6849 if (content_type && content_type[0]) {
6850 const wbxml_literal_list *item = content_type_list;
6852 while (item && item->content_type) {
6853 if (g_ascii_strcasecmp(content_type, item->content_type) == 0) {
6854 /* Try the discriminator */
6855 if (item->discriminator != NULL) {
6856 map = item->discriminator(tvb, offset);
6858 if (map == NULL) {
6859 map = item->map;
6861 break;
6863 item++;
6866 return map;
6870 /* WBXML content token mapping depends on the following parameters:
6871 * - Content type (guint32)
6872 * - Token type (global, tags, attrStart, attrValue)
6873 * - Code page for tag and attribute
6875 * This results in the following steps:
6876 * 1. Retrieve content type mapping
6877 * 2. If exists, retrieve token type mapping
6878 * 3. If exists, retrieve required code page
6879 * 4. If exists, retrieve token mapping
6882 #define wbxml_UNDEFINED_TOKEN \
6883 "(Requested token not defined for this content type)"
6884 #define wbxml_UNDEFINED_TOKEN_CODE_PAGE \
6885 "(Requested token code page not defined for this content type)"
6886 #define wbxml_UNDEFINED_TOKEN_MAP \
6887 "(Requested token map not defined for this content type)"
6888 /* Return token mapping for a given content mapping entry. */
6889 static const char *
6890 map_token (const value_valuestring *token_map, guint8 codepage, guint8 token) {
6891 const value_string *vs;
6892 const char *s;
6894 if (token_map) { /* Found map */
6895 if ((vs = val_to_valstr (codepage, token_map))) {
6896 /* Found codepage map */
6897 s = try_val_to_str (token, vs);
6898 if (s) { /* Found valid token */
6899 DebugLog(("map_token(codepage = %u, token = %u: [%s]\n", codepage, token, s));
6900 return s;
6902 /* No valid token mapping in specified code page of token map */
6903 DebugLog(("map_token(codepage = %u, token = %u: "
6904 wbxml_UNDEFINED_TOKEN "\n", codepage, token));
6905 return wbxml_UNDEFINED_TOKEN;
6907 /* There is no token map entry for the requested code page */
6908 DebugLog(("map_token(codepage = %u, token = %u: "
6909 wbxml_UNDEFINED_TOKEN_CODE_PAGE "\n", codepage, token));
6910 return wbxml_UNDEFINED_TOKEN_CODE_PAGE;
6912 /* The token map does not exist */
6913 DebugLog(("map_token(codepage = %u, token = %u: "
6914 wbxml_UNDEFINED_TOKEN_MAP "\n", codepage, token));
6915 return wbxml_UNDEFINED_TOKEN_MAP;
6922 /************************** Function prototypes **************************/
6925 static void
6926 dissect_wbxml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
6928 static void
6929 dissect_uaprof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
6931 static void
6932 dissect_wbxml_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
6933 const wbxml_decoding *override_content_map);
6935 void
6936 proto_register_wbxml(void);
6938 /* Parse and display the WBXML string table */
6939 static void
6940 show_wbxml_string_table (proto_tree *tree, tvbuff_t *tvb, guint32 str_tbl,
6941 guint32 str_tbl_len);
6943 /* Parse data while in STAG state */
6944 static guint32
6945 parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
6946 guint32 str_tbl, guint8 *level, guint8 *codepage_stag, guint8 *codepage_attr);
6948 /* Parse data while in STAG state;
6949 * interpret tokens as defined by content type */
6950 static guint32
6951 parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
6952 guint32 str_tbl, guint8 *level, guint8 *codepage_stag, guint8 *codepage_attr,
6953 const wbxml_decoding *map);
6955 /* Parse data while in ATTR state */
6956 static guint32
6957 parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
6958 guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr);
6960 /* Parse data while in ATTR state;
6961 * interpret tokens as defined by content type */
6962 static guint32
6963 parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
6964 guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr,
6965 const wbxml_decoding *map);
6968 /****************** WBXML protocol dissection functions ******************/
6971 static void
6972 dissect_wbxml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
6974 dissect_wbxml_common(tvb, pinfo, tree, NULL);
6977 static void
6978 dissect_uaprof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
6980 dissect_wbxml_common(tvb, pinfo, tree, &decode_uaprof_wap_248);
6983 /* Code to actually dissect the packets */
6984 static void
6985 dissect_wbxml_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
6986 const wbxml_decoding *override_content_map)
6988 /* Set up structures needed to add the protocol subtree and manage it */
6989 proto_item *ti;
6990 proto_tree *wbxml_tree; /* Main WBXML tree */
6991 proto_tree *wbxml_str_tbl_tree; /* String table subtree */
6992 proto_tree *wbxml_content_tree; /* Content subtree */
6993 guint8 version;
6994 guint offset = 0;
6995 guint32 len;
6996 guint32 charset = 0;
6997 guint32 charset_len = 0;
6998 guint32 publicid;
6999 guint32 publicid_index = 0;
7000 guint32 publicid_len;
7001 guint32 str_tbl;
7002 guint32 str_tbl_len;
7003 guint32 str_tbl_len_len = 0;
7004 guint8 level = 0; /* WBXML recursion level */
7005 const wbxml_decoding *content_map = NULL;
7006 gchar *summary = NULL;
7007 guint8 codepage_stag = 0;
7008 guint8 codepage_attr = 0;
7010 DebugLog(("dissect_wbxml: Dissecting packet %u\n", pinfo->fd->num));
7011 /* WBXML format
7013 * Version 1.0: version publicid strtbl BODY
7014 * Version 1.x: version publicid charset strtbl BODY
7016 * Last valid format: WBXML 1.3
7018 switch ( version = tvb_get_guint8 (tvb, 0) ) {
7019 case 0x00: /* WBXML/1.0 */
7020 break;
7022 case 0x01: /* WBXML/1.1 */
7023 case 0x02: /* WBXML/1.2 */
7024 case 0x03: /* WBXML/1.3 */
7025 break;
7027 default:
7028 /* Put some information here, so that the user knows what's going on. */
7030 /* Add summary to INFO column if it is enabled */
7031 col_append_fstr(pinfo->cinfo, COL_INFO, " (Unknown WBXML version 0x%02x)", version);
7032 ti = proto_tree_add_item (tree, proto_wbxml, tvb, 0, -1, ENC_NA);
7033 proto_item_append_text(ti, ", Unknown version 0x%02x", version);
7034 return;
7037 /* In order to properly construct the packet summary,
7038 * I need to read the entire WBXML header
7039 * up to the string table length.
7042 /* Public ID */
7043 publicid = tvb_get_guintvar(tvb, 1, &publicid_len);
7044 if (! publicid) {
7045 /* Public identifier in string table */
7046 publicid_index = tvb_get_guintvar (tvb, 1+publicid_len, &len);
7047 publicid_len += len;
7049 offset = 1 + publicid_len;
7051 /* Version-specific handling of Charset */
7052 switch ( version ) {
7053 case 0x00: /* WBXML/1.0 */
7054 /* No charset */
7055 break;
7057 case 0x01: /* WBXML/1.1 */
7058 case 0x02: /* WBXML/1.2 */
7059 case 0x03: /* WBXML/1.3 */
7060 /* Get charset */
7061 charset = tvb_get_guintvar (tvb, offset, &charset_len);
7062 offset += charset_len;
7063 break;
7065 default: /* Impossible since we returned already earlier */
7066 DISSECTOR_ASSERT_NOT_REACHED();
7067 break;
7070 /* String table: read string table length in bytes */
7071 tvb_get_guintvar (tvb, offset, &str_tbl_len_len);
7072 str_tbl = offset + str_tbl_len_len; /* Start of 1st string in string table */
7074 /* Compose the summary line */
7075 if ( publicid ) {
7076 summary = wmem_strdup_printf(wmem_packet_scope(), "%s, Public ID: \"%s\"",
7077 val_to_str_ext (version, &vals_wbxml_versions_ext, "(unknown 0x%x)"),
7078 val_to_str_ext (publicid, &vals_wbxml_public_ids_ext, "(unknown 0x%x)"));
7079 } else {
7080 /* Read length of Public ID from string table */
7081 len = tvb_strsize (tvb, str_tbl + publicid_index);
7082 summary = wmem_strdup_printf(wmem_packet_scope(), "%s, Public ID: \"%s\"",
7083 val_to_str_ext (version, &vals_wbxml_versions_ext, "(unknown 0x%x)"),
7084 tvb_format_text (tvb, str_tbl + publicid_index, len - 1));
7087 /* Add summary to INFO column if it is enabled */
7088 col_append_fstr(pinfo->cinfo, COL_INFO, " (WBXML %s)", summary);
7090 /* create display subtree for the protocol */
7091 ti = proto_tree_add_item (tree, proto_wbxml, tvb, 0, -1, ENC_NA);
7092 proto_item_append_text(ti, ", Version: %s", summary);
7095 * Now show the protocol subtree, if tree is set.
7097 if ( tree ) {
7098 wbxml_tree = proto_item_add_subtree(ti, ett_wbxml);
7100 /* WBXML Version */
7101 proto_tree_add_uint (wbxml_tree, hf_wbxml_version,
7102 tvb, 0, 1, version);
7104 /* Public ID */
7105 if (publicid) { /* Known Public ID */
7106 proto_tree_add_uint(wbxml_tree, hf_wbxml_public_id_known,
7107 tvb, 1, publicid_len, publicid);
7108 } else { /* Public identifier in string table */
7109 proto_tree_add_item (wbxml_tree, hf_wbxml_public_id_literal,
7110 tvb, 1, publicid_len, ENC_ASCII|ENC_NA);
7112 offset = 1 + publicid_len;
7114 if ( version ) { /* Charset */
7115 proto_tree_add_uint (wbxml_tree, hf_wbxml_charset,
7116 tvb, 1 + publicid_len, charset_len, charset);
7117 offset += charset_len;
7120 str_tbl_len = tvb_get_guintvar (tvb, offset, &len);
7121 str_tbl = offset + len; /* Start of 1st string in string table */
7123 /* String Table */
7124 ti = proto_tree_add_text(wbxml_tree,
7125 tvb, offset, len + str_tbl_len, "String table: %u bytes",
7126 str_tbl_len);
7128 if (wbxml_tree && str_tbl_len) { /* Display string table as subtree */
7129 wbxml_str_tbl_tree = proto_item_add_subtree (ti,
7130 ett_wbxml_str_tbl);
7131 show_wbxml_string_table (wbxml_str_tbl_tree, tvb,
7132 str_tbl, str_tbl_len);
7135 /* Data starts HERE */
7136 offset += len + str_tbl_len;
7138 /* The WBXML BODY starts here */
7139 if (disable_wbxml_token_parsing) {
7140 proto_tree_add_text (wbxml_tree, tvb, offset, -1,
7141 "Data representation not shown "
7142 "(edit WBXML preferences to show)");
7143 return;
7144 } /* Else: render the WBXML tokens */
7145 ti = proto_tree_add_text (wbxml_tree, tvb, offset, -1,
7146 "Data representation");
7147 wbxml_content_tree = proto_item_add_subtree (ti, ett_wbxml_content);
7149 /* The parse_wbxml_X() functions will process the content correctly,
7150 * irrespective of the WBXML version used. For the WBXML body, this
7151 * means that there is a different processing for the global token
7152 * RESERVED_2 (WBXML 1.0) or OPAQUE (WBXML 1.x with x > 0). */
7153 if (wbxml_tree) { /* Show only if visible */
7154 if (override_content_map != NULL) {
7155 content_map = override_content_map;
7156 proto_item_append_text(ti,
7157 " is based on: %s",
7158 content_map->name);
7159 } else {
7160 /* Retrieve the content token mapping if available */
7161 content_map = get_wbxml_decoding_from_public_id (publicid);
7162 if (! content_map) {
7163 content_map = get_wbxml_decoding_from_content_type(
7164 pinfo->match_string, tvb, offset);
7165 if (! content_map) {
7166 proto_tree_add_text (wbxml_content_tree,
7167 tvb, offset, -1,
7168 "[Rendering of this content type"
7169 " not (yet) supported]");
7170 } else {
7171 proto_item_append_text(ti,
7172 " is based on Content-Type: %s "
7173 "(chosen decoding: %s)",
7174 pinfo->match_string, content_map->name);
7178 if (content_map && skip_wbxml_token_mapping) {
7179 proto_tree_add_text (wbxml_content_tree,
7180 tvb, offset, -1,
7181 "[Rendering of this content type"
7182 " has been disabled "
7183 "(edit WBXML preferences to enable)]");
7184 content_map = NULL;
7186 proto_tree_add_text (wbxml_content_tree, tvb,
7187 offset, -1,
7188 "Level | State | Codepage "
7189 "| WBXML Token Description "
7190 "| Rendering");
7191 if (content_map) {
7192 len = parse_wbxml_tag_defined (wbxml_content_tree,
7193 tvb, offset, str_tbl, &level, &codepage_stag,
7194 &codepage_attr, content_map);
7195 } else {
7196 /* Default: WBXML only, no interpretation of the content */
7197 len = parse_wbxml_tag (wbxml_content_tree, tvb, offset,
7198 str_tbl, &level, &codepage_stag, &codepage_attr);
7201 return;
7206 /* Parse and display the WBXML string table (in a 3-column table format).
7207 * This function displays:
7208 * - the offset in the string table,
7209 * - the length of the string
7210 * - the string.
7212 static void
7213 show_wbxml_string_table (proto_tree *tree, tvbuff_t *tvb, guint32 str_tbl,
7214 guint32 str_tbl_len)
7216 guint32 off = str_tbl;
7217 guint32 len = 0;
7218 guint32 end = str_tbl + str_tbl_len;
7220 proto_tree_add_text (tree, tvb, off, end,
7221 "Start | Length | String");
7222 while (off < end) {
7223 len = tvb_strsize (tvb, off);
7224 proto_tree_add_text (tree, tvb, off, len,
7225 "%6d | %6d | '%s'",
7226 off - str_tbl, len,
7227 tvb_format_text (tvb, off, len-1));
7228 off += len;
7233 /* Indentation code is based on a static const array of space characters.
7234 * At least one single space is returned */
7235 static const char indent_buffer[514] = " "
7244 ; /* Generate XML indentation (length = 1 + 2 * 256 + 1 for '\0') */
7246 static const char * Indent (guint8 level) {
7247 return indent_buffer + (512 - 2 * (level));
7251 /********************
7252 * WBXML tag tokens *
7253 ********************
7255 * Bit Mask : Example
7256 * -------------------
7257 * 00.. .... : <tag />
7259 * 01.. .... : <tag>
7260 * CONTENT
7261 * </tag>
7263 * 10.. .... : <tag
7264 * atrtribute1="value1"
7265 * atrtribute2="value2"
7266 * />
7268 * 11.. .... : <tag
7269 * atrtribute1="value1"
7270 * atrtribute2="value2"
7272 * CONTENT
7273 * </tag>
7275 * NOTES
7276 * - An XML PI is parsed as an attribute list (same syntax).
7277 * - A code page switch only applies to the single token that follows.
7281 /* This function parses the WBXML and maps known token interpretations
7282 * to the WBXML tokens. As a result, the original XML document can be
7283 * recreated. Indentation is generated in order to ease reading.
7285 * Attribute parsing is done in parse_wbxml_attribute_list_defined().
7287 * The wbxml_decoding entry *map contains the actual token mapping.
7289 * NOTE: In order to parse the content, some recursion is required.
7290 * However, for performance reasons, recursion has been avoided
7291 * where possible (tags without content within tags with content).
7292 * This is achieved by means of the parsing_tag_content and tag_save*
7293 * variables.
7295 * NOTE: See above for known token mappings.
7297 * NOTE: As tags can be opened and closed, a tag representation lookup
7298 * may happen once or twice for a given tag. For efficiency reasons,
7299 * the literal tag value is stored and used throughout the code.
7300 * With the introduction of code page support, this solution is robust
7301 * as the lookup only occurs once, removing the need for storage of
7302 * the used code page.
7304 static guint32
7305 parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
7306 guint32 str_tbl, guint8 *level, guint8 *codepage_stag, guint8 *codepage_attr,
7307 const wbxml_decoding *map)
7309 guint32 tvb_len = tvb_reported_length (tvb);
7310 guint32 off = offset;
7311 guint32 len;
7312 guint str_len;
7313 guint32 ent;
7314 guint32 idx;
7315 guint8 peek;
7316 guint32 tag_len; /* Length of the index (uintvar) from a LITERAL tag */
7317 guint8 tag_save_known = 0; /* Will contain peek & 0x3F (tag identity) */
7318 guint8 tag_new_known = 0; /* Will contain peek & 0x3F (tag identity) */
7319 const char *tag_save_literal; /* Will contain the LITERAL tag identity */
7320 const char *tag_new_literal; /* Will contain the LITERAL tag identity */
7321 guint8 parsing_tag_content = FALSE; /* Are we parsing content from a
7322 tag with content: <x>Content</x>
7324 The initial state is FALSE.
7325 This state will trigger recursion. */
7326 tag_save_literal = NULL; /* Prevents compiler warning */
7328 DebugLog(("parse_wbxml_tag_defined (level = %u, offset = %u)\n", *level, offset));
7329 while (off < tvb_len) {
7330 peek = tvb_get_guint8 (tvb, off);
7331 DebugLog(("STAG: (top of while) level = %3u, peek = 0x%02X, off = %u, tvb_len = %u\n", *level, peek, off, tvb_len));
7332 if ((peek & 0x3F) < 4) switch (peek) { /* Global tokens in state = STAG
7333 but not the LITERAL tokens */
7334 case 0x00: /* SWITCH_PAGE */
7335 *codepage_stag = tvb_get_guint8 (tvb, off+1);
7336 proto_tree_add_text (tree, tvb, off, 2,
7337 " | Tag | T -->%3d "
7338 "| SWITCH_PAGE (Tag code page) "
7339 "|",
7340 *codepage_stag);
7341 off += 2;
7342 break;
7343 case 0x01: /* END: only possible for Tag with Content */
7344 if (tag_save_known) { /* Known TAG */
7345 proto_tree_add_text (tree, tvb, off, 1,
7346 " %3d | Tag | T %3d "
7347 "| END (Known Tag 0x%02X) "
7348 "| %s</%s>",
7349 *level, *codepage_stag,
7350 tag_save_known, Indent (*level),
7351 tag_save_literal); /* We already looked it up! */
7352 } else { /* Literal TAG */
7353 proto_tree_add_text (tree, tvb, off, 1,
7354 " %3d | Tag | T %3d "
7355 "| END (Literal Tag) "
7356 "| %s</%s>",
7357 *level, *codepage_stag, Indent (*level),
7358 tag_save_literal ? tag_save_literal : "");
7360 (*level)--;
7361 off++;
7362 /* Reset code page: not needed as return from recursion */
7363 DebugLog(("STAG: level = %u, Return: len = %u\n", *level, off - offset));
7364 return (off - offset);
7365 case 0x02: /* ENTITY */
7366 ent = tvb_get_guintvar (tvb, off+1, &len);
7367 proto_tree_add_text (tree, tvb, off, 1+len,
7368 " %3d | Tag | T %3d "
7369 "| ENTITY "
7370 "| %s'&#%u;'",
7371 *level, *codepage_stag, Indent (*level), ent);
7372 off += 1+len;
7373 break;
7374 case 0x03: /* STR_I */
7375 len = tvb_strsize (tvb, off+1);
7376 proto_tree_add_text (tree, tvb, off, 1+len,
7377 " %3d | Tag | T %3d "
7378 "| STR_I (Inline string) "
7379 "| %s\'%s\'",
7380 *level, *codepage_stag, Indent(*level),
7381 tvb_format_text (tvb, off+1, len-1));
7382 off += 1+len;
7383 break;
7384 case 0x40: /* EXT_I_0 */
7385 case 0x41: /* EXT_I_1 */
7386 case 0x42: /* EXT_I_2 */
7387 /* Extension tokens */
7388 len = tvb_strsize (tvb, off+1);
7389 proto_tree_add_text (tree, tvb, off, 1+len,
7390 " %3d | Tag | T %3d "
7391 "| EXT_I_%1x (Extension Token) "
7392 "| %s(%s: \'%s\')",
7393 *level, *codepage_stag,
7394 peek & 0x0f, Indent (*level),
7395 map_token (map->global, 0, peek),
7396 tvb_format_text (tvb, off+1, len-1));
7397 off += 1+len;
7398 break;
7399 case 0x43: /* PI */
7400 proto_tree_add_text (tree, tvb, off, 1,
7401 " %3d | Tag | T %3d "
7402 "| PI (XML Processing Instruction) "
7403 "| %s<?xml",
7404 *level, *codepage_stag, Indent (*level));
7405 len = parse_wbxml_attribute_list_defined (tree, tvb, off,
7406 str_tbl, *level, codepage_attr, map);
7407 /* Check that there is still room in packet */
7408 off += len;
7409 if (off >= tvb_len) {
7410 DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
7412 * TODO - Do we need to free g_malloc()ed memory?
7414 THROW(ReportedBoundsError);
7416 proto_tree_add_text (tree, tvb, off-1, 1,
7417 " %3d | Tag | T %3d "
7418 "| END (PI) "
7419 "| %s?>",
7420 *level, *codepage_stag, Indent (*level));
7421 break;
7422 case 0x80: /* EXT_T_0 */
7423 case 0x81: /* EXT_T_1 */
7424 case 0x82: /* EXT_T_2 */
7425 /* Extension tokens */
7426 idx = tvb_get_guintvar (tvb, off+1, &len);
7427 { char *s;
7428 if (map->ext_t[peek & 0x03])
7429 s = (map->ext_t[peek & 0x03])(tvb, idx, str_tbl);
7430 else
7431 s = wmem_strdup_printf(wmem_packet_scope(), "EXT_T_%1x (%s)", peek & 0x03,
7432 map_token (map->global, 0, peek));
7433 proto_tree_add_text (tree, tvb, off, 1+len,
7434 " %3d | Tag | T %3d "
7435 "| EXT_T_%1x (Extension Token) "
7436 "| %s%s",
7437 *level, *codepage_stag, peek & 0x0f, Indent (*level),
7440 off += 1+len;
7441 break;
7442 case 0x83: /* STR_T */
7443 idx = tvb_get_guintvar (tvb, off+1, &len);
7444 str_len = tvb_strsize (tvb, str_tbl+idx);
7445 proto_tree_add_text (tree, tvb, off, 1+len,
7446 " %3d | Tag | T %3d "
7447 "| STR_T (Tableref string) "
7448 "| %s\'%s\'",
7449 *level, *codepage_stag, Indent (*level),
7450 tvb_format_text (tvb, str_tbl+idx, str_len-1));
7451 off += 1+len;
7452 break;
7453 case 0xC0: /* EXT_0 */
7454 case 0xC1: /* EXT_1 */
7455 case 0xC2: /* EXT_2 */
7456 /* Extension tokens */
7457 proto_tree_add_text (tree, tvb, off, 1,
7458 " %3d | Tag | T %3d "
7459 "| EXT_%1x (Extension Token) "
7460 "| %s(%s)",
7461 *level, *codepage_stag, peek & 0x0f, Indent (*level),
7462 map_token (map->global, 0, peek));
7463 off++;
7464 break;
7465 case 0xC3: /* OPAQUE - WBXML 1.1 and newer */
7466 if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */
7467 char *str;
7468 if (tag_save_known) { /* Knwon tag */
7469 if (map->opaque_binary_tag) {
7470 str = map->opaque_binary_tag(tvb, off + 1,
7471 tag_save_known, *codepage_stag, &len);
7472 } else {
7473 str = default_opaque_binary_tag(tvb, off + 1,
7474 tag_save_known, *codepage_stag, &len);
7476 } else { /* lITERAL tag */
7477 if (map->opaque_literal_tag) {
7478 str = map->opaque_literal_tag(tvb, off + 1,
7479 tag_save_literal, *codepage_stag, &len);
7480 } else {
7481 str = default_opaque_literal_tag(tvb, off + 1,
7482 tag_save_literal, *codepage_stag, &len);
7485 proto_tree_add_text (tree, tvb, off, 1 + len,
7486 " %3d | Tag | T %3d "
7487 "| OPAQUE (Opaque data) "
7488 "| %s%s",
7489 *level, *codepage_stag, Indent (*level), str);
7490 off += 1 + len;
7491 } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */
7492 proto_tree_add_text (tree, tvb, off, 1,
7493 " %3d | Tag | T %3d "
7494 "| RESERVED_2 (Invalid Token!) "
7495 "| WBXML 1.0 parsing stops here.",
7496 *level, *codepage_stag);
7497 /* Stop processing as it is impossible to parse now */
7498 off = tvb_len;
7499 DebugLog(("STAG: level = %u, Return: len = %u\n", *level, off - offset));
7500 return (off - offset);
7502 break;
7504 /* No default clause, as all cases have been treated */
7505 } else { /* LITERAL or Known TAG */
7506 /* We must store the initial tag, and also retrieve the new tag.
7507 * For efficiency reasons, we store the literal tag representation
7508 * for known tags too, so we can easily close the tag without the
7509 * need of a new lookup and avoiding storage of token codepage.
7511 * There are 4 possibilities:
7513 * 1. Known tag followed by a known tag
7514 * 2. Known tag followed by a LITERAL tag
7515 * 3. LITERAL tag followed by Known tag
7516 * 4. LITERAL tag followed by LITERAL tag
7519 /* Store the new tag */
7520 tag_len = 0;
7521 if ((peek & 0x3F) == 4) { /* LITERAL */
7522 DebugLog(("STAG: LITERAL tag (peek = 0x%02X, off = %u) - TableRef follows!\n", peek, off));
7523 idx = tvb_get_guintvar (tvb, off+1, &tag_len);
7524 str_len = tvb_strsize (tvb, str_tbl+idx);
7525 tag_new_literal = (gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
7526 tag_new_known = 0; /* invalidate known tag_new */
7527 } else { /* Known tag */
7528 tag_new_known = peek & 0x3F;
7529 tag_new_literal = map_token (map->tags, *codepage_stag,
7530 tag_new_known);
7531 /* Stored looked up tag name string */
7534 /* Parsing of TAG starts HERE */
7535 if (peek & 0x40) { /* Content present */
7536 /* Content follows
7537 * [!] An explicit END token is expected in these cases!
7538 * ==> Recursion possible if we encounter a tag with content;
7539 * recursion will return at the explicit END token.
7541 if (parsing_tag_content) { /* Recurse */
7542 DebugLog(("STAG: Tag in Tag - RECURSE! (off = %u)\n", off));
7543 /* Do not process the attribute list:
7544 * recursion will take care of it */
7545 (*level)++;
7546 len = parse_wbxml_tag_defined (tree, tvb, off, str_tbl,
7547 level, codepage_stag, codepage_attr, map);
7548 off += len;
7549 } else { /* Now we will have content to parse */
7550 /* Save the start tag so we can properly close it later. */
7551 if ((peek & 0x3F) == 4) { /* Literal tag */
7552 tag_save_literal = tag_new_literal;
7553 tag_save_known = 0;
7554 } else { /* Known tag */
7555 tag_save_known = tag_new_known;
7556 tag_save_literal = tag_new_literal;
7557 /* The last statement avoids needless lookups */
7559 /* Process the attribute list if present */
7560 if (peek & 0x80) { /* Content and Attribute list present */
7561 if (tag_new_known) { /* Known tag */
7562 proto_tree_add_text (tree, tvb, off, 1,
7563 " %3d | Tag | T %3d "
7564 "| Known Tag 0x%02X (AC) "
7565 "| %s<%s",
7566 *level, *codepage_stag, tag_new_known,
7567 Indent (*level), tag_new_literal);
7568 /* Tag string already looked up earlier! */
7569 off++;
7570 } else { /* LITERAL tag */
7571 proto_tree_add_text (tree, tvb, off, 1,
7572 " %3d | Tag | T %3d "
7573 "| LITERAL_AC (Literal tag) (AC) "
7574 "| %s<%s",
7575 *level, *codepage_stag, Indent (*level), tag_new_literal);
7576 off += 1 + tag_len;
7578 len = parse_wbxml_attribute_list_defined (tree, tvb,
7579 off, str_tbl, *level, codepage_attr, map);
7580 /* Check that there is still room in packet */
7581 off += len;
7582 if (off >= tvb_len) {
7583 DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n",
7584 *level, off - offset));
7586 * TODO - Do we need to free g_malloc()ed memory?
7588 THROW(ReportedBoundsError);
7590 proto_tree_add_text (tree, tvb, off-1, 1,
7591 " %3d | Tag | T %3d "
7592 "| END (attribute list) "
7593 "| %s>",
7594 *level, *codepage_stag, Indent (*level));
7595 } else { /* Content, no Attribute list */
7596 if (tag_new_known) { /* Known tag */
7597 proto_tree_add_text (tree, tvb, off, 1,
7598 " %3d | Tag | T %3d "
7599 "| Known Tag 0x%02X (.C) "
7600 "| %s<%s>",
7601 *level, *codepage_stag, tag_new_known,
7602 Indent (*level), tag_new_literal);
7603 /* Tag string already looked up earlier! */
7604 off++;
7605 } else { /* LITERAL tag */
7606 proto_tree_add_text (tree, tvb, off, 1,
7607 " %3d | Tag | T %3d "
7608 "| LITERAL_C (Literal Tag) (.C) "
7609 "| %s<%s>",
7610 *level, *codepage_stag, Indent (*level),
7611 tag_new_literal);
7612 off += 1 + tag_len;
7615 /* The data that follows in the parsing process
7616 * represents content for the opening tag
7617 * we've just processed in the lines above.
7618 * Next time we encounter a tag with content: recurse
7620 parsing_tag_content = TRUE;
7621 DebugLog(("Tag in Tag - No recursion this time! (off = %u)\n", off));
7623 } else { /* No Content */
7624 DebugLog(("<Tag/> in Tag - No recursion! (off = %u)\n", off));
7625 (*level)++;
7626 if (peek & 0x80) { /* No Content, Attribute list present */
7627 if (tag_new_known) { /* Known tag */
7628 proto_tree_add_text (tree, tvb, off, 1,
7629 " %3d | Tag | T %3d "
7630 "| Known Tag 0x%02X (A.) "
7631 "| %s<%s",
7632 *level, *codepage_stag, tag_new_known,
7633 Indent (*level), tag_new_literal);
7634 /* Tag string already looked up earlier! */
7635 off++;
7636 len = parse_wbxml_attribute_list_defined (tree, tvb,
7637 off, str_tbl, *level, codepage_attr, map);
7638 /* Check that there is still room in packet */
7639 off += len;
7640 if (off > tvb_len) {
7641 DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
7643 * TODO - Do we need to free g_malloc()ed memory?
7645 THROW(ReportedBoundsError);
7647 proto_tree_add_text (tree, tvb, off-1, 1,
7648 " %3d | Tag | T %3d "
7649 "| END (Known Tag) "
7650 "| %s/>",
7651 *level, *codepage_stag, Indent (*level));
7652 } else { /* LITERAL tag */
7653 proto_tree_add_text (tree, tvb, off, 1,
7654 " %3d | Tag | T %3d "
7655 "| LITERAL_A (Literal Tag) (A.) "
7656 "| %s<%s",
7657 *level, *codepage_stag, Indent (*level), tag_new_literal);
7658 off += 1 + tag_len;
7659 len = parse_wbxml_attribute_list_defined (tree, tvb,
7660 off, str_tbl, *level, codepage_attr, map);
7661 /* Check that there is still room in packet */
7662 off += len;
7663 if (off >= tvb_len) {
7664 DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
7666 * TODO - Do we need to free g_malloc()ed memory?
7668 THROW(ReportedBoundsError);
7670 proto_tree_add_text (tree, tvb, off-1, 1,
7671 " %3d | Tag | T %3d "
7672 "| END (Literal Tag) "
7673 "| %s/>",
7674 *level, *codepage_stag, Indent (*level));
7676 } else { /* No Content, No Attribute list */
7677 if (tag_new_known) { /* Known tag */
7678 proto_tree_add_text (tree, tvb, off, 1,
7679 " %3d | Tag | T %3d "
7680 "| Known Tag 0x%02x (..) "
7681 "| %s<%s />",
7682 *level, *codepage_stag, tag_new_known,
7683 Indent (*level), tag_new_literal);
7684 /* Tag string already looked up earlier! */
7685 off++;
7686 } else { /* LITERAL tag */
7687 proto_tree_add_text (tree, tvb, off, 1,
7688 " %3d | Tag | T %3d "
7689 "| LITERAL (Literal Tag) (..) "
7690 "| %s<%s />",
7691 *level, *codepage_stag, Indent (*level),
7692 tag_new_literal);
7693 off += 1 + tag_len;
7696 (*level)--;
7697 /* TODO: Do I have to reset code page here? */
7699 } /* if (tag & 0x3F) >= 5 */
7700 } /* while */
7701 DebugLog(("STAG: level = %u, Return: len = %u (end of function body)\n", *level, off - offset));
7702 return (off - offset);
7706 /* This function performs the WBXML decoding as in parse_wbxml_tag_defined()
7707 * but this time no WBXML mapping is performed.
7709 * Attribute parsing is done in parse_wbxml_attribute_list().
7711 static guint32
7712 parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
7713 guint32 str_tbl, guint8 *level,
7714 guint8 *codepage_stag, guint8 *codepage_attr)
7716 guint32 tvb_len = tvb_reported_length (tvb);
7717 guint32 off = offset;
7718 guint32 len;
7719 guint str_len;
7720 guint32 ent;
7721 guint32 idx;
7722 guint8 peek;
7723 guint32 tag_len; /* Length of the idx (uintvar) from a LITERAL tag */
7724 guint8 tag_save_known = 0; /* Will contain peek & 0x3F (tag identity) */
7725 guint8 tag_new_known = 0; /* Will contain peek & 0x3F (tag identity) */
7726 const char *tag_save_literal; /* Will contain the LITERAL tag identity */
7727 const char *tag_new_literal; /* Will contain the LITERAL tag identity */
7728 char *tag_save_buf = NULL; /* Will contain "tag_0x%02X" */
7729 char *tag_new_buf = NULL; /* Will contain "tag_0x%02X" */
7730 guint8 parsing_tag_content = FALSE; /* Are we parsing content from a
7731 tag with content: <x>Content</x>
7733 The initial state is FALSE.
7734 This state will trigger recursion. */
7735 tag_save_literal = NULL; /* Prevents compiler warning */
7737 DebugLog(("parse_wbxml_tag (level = %u, offset = %u)\n", *level, offset));
7738 while (off < tvb_len) {
7739 peek = tvb_get_guint8 (tvb, off);
7740 DebugLog(("STAG: (top of while) level = %3u, peek = 0x%02X, off = %u, tvb_len = %u\n", *level, peek, off, tvb_len));
7741 if ((peek & 0x3F) < 4) switch (peek) { /* Global tokens in state = STAG
7742 but not the LITERAL tokens */
7743 case 0x00: /* SWITCH_PAGE */
7744 *codepage_stag = tvb_get_guint8 (tvb, off+1);
7745 proto_tree_add_text (tree, tvb, off, 2,
7746 " | Tag | T -->%3d "
7747 "| SWITCH_PAGE (Tag code page) "
7748 "|",
7749 *codepage_stag);
7750 off += 2;
7751 break;
7752 case 0x01: /* END: only possible for Tag with Content */
7753 if (tag_save_known) { /* Known TAG */
7754 proto_tree_add_text (tree, tvb, off, 1,
7755 " %3d | Tag | T %3d "
7756 "| END (Known Tag 0x%02X) "
7757 "| %s</%s>",
7758 *level, *codepage_stag, tag_save_known,
7759 Indent (*level),
7760 tag_save_literal); /* We already looked it up! */
7761 } else { /* Literal TAG */
7762 proto_tree_add_text (tree, tvb, off, 1,
7763 " %3d | Tag | T %3d "
7764 "| END (Literal Tag) "
7765 "| %s</%s>",
7766 *level, *codepage_stag, Indent (*level),
7767 tag_save_literal ? tag_save_literal : "");
7769 (*level)--;
7770 off++;
7771 /* Reset code page: not needed as return from recursion */
7772 DebugLog(("STAG: level = %u, Return: len = %u\n",
7773 *level, off - offset));
7774 return (off - offset);
7775 case 0x02: /* ENTITY */
7776 ent = tvb_get_guintvar (tvb, off+1, &len);
7777 proto_tree_add_text (tree, tvb, off, 1+len,
7778 " %3d | Tag | T %3d "
7779 "| ENTITY "
7780 "| %s'&#%u;'",
7781 *level, *codepage_stag, Indent (*level), ent);
7782 off += 1+len;
7783 break;
7784 case 0x03: /* STR_I */
7785 len = tvb_strsize (tvb, off+1);
7786 proto_tree_add_text (tree, tvb, off, 1+len,
7787 " %3d | Tag | T %3d "
7788 "| STR_I (Inline string) "
7789 "| %s\'%s\'",
7790 *level, *codepage_stag, Indent(*level),
7791 tvb_format_text (tvb, off+1, len-1));
7792 off += 1+len;
7793 break;
7794 case 0x40: /* EXT_I_0 */
7795 case 0x41: /* EXT_I_1 */
7796 case 0x42: /* EXT_I_2 */
7797 /* Extension tokens */
7798 len = tvb_strsize (tvb, off+1);
7799 proto_tree_add_text (tree, tvb, off, 1+len,
7800 " %3d | Tag | T %3d "
7801 "| EXT_I_%1x (Extension Token) "
7802 "| %s(Inline string extension: \'%s\')",
7803 *level, *codepage_stag, peek & 0x0f, Indent (*level),
7804 tvb_format_text (tvb, off+1, len-1));
7805 off += 1+len;
7806 break;
7807 case 0x43: /* PI */
7808 proto_tree_add_text (tree, tvb, off, 1,
7809 " %3d | Tag | T %3d "
7810 "| PI (XML Processing Instruction) "
7811 "| %s<?xml",
7812 *level, *codepage_stag, Indent (*level));
7813 len = parse_wbxml_attribute_list (tree, tvb, off, str_tbl,
7814 *level, codepage_attr);
7815 /* Check that there is still room in packet */
7816 off += len;
7817 if (off >= tvb_len) {
7818 DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n",
7819 *level, off - offset));
7821 * TODO - Do we need to free g_malloc()ed memory?
7823 THROW(ReportedBoundsError);
7825 proto_tree_add_text (tree, tvb, off-1, 1,
7826 " %3d | Tag | T %3d "
7827 "| END (PI) "
7828 "| %s?>",
7829 *level, *codepage_stag, Indent (*level));
7830 break;
7831 case 0x80: /* EXT_T_0 */
7832 case 0x81: /* EXT_T_1 */
7833 case 0x82: /* EXT_T_2 */
7834 /* Extension tokens */
7835 idx = tvb_get_guintvar (tvb, off+1, &len);
7836 proto_tree_add_text (tree, tvb, off, 1+len,
7837 " %3d | Tag | T %3d "
7838 "| EXT_T_%1x (Extension Token) "
7839 "| %s(Extension Token, integer value: %u)",
7840 *level, *codepage_stag, peek & 0x0f, Indent (*level),
7841 idx);
7842 off += 1+len;
7843 break;
7844 case 0x83: /* STR_T */
7845 idx = tvb_get_guintvar (tvb, off+1, &len);
7846 str_len = tvb_strsize (tvb, str_tbl+idx);
7847 proto_tree_add_text (tree, tvb, off, 1+len,
7848 " %3d | Tag | T %3d "
7849 "| STR_T (Tableref string) "
7850 "| %s\'%s\'",
7851 *level, *codepage_stag, Indent (*level),
7852 tvb_format_text (tvb, str_tbl+idx, str_len-1));
7853 off += 1+len;
7854 break;
7855 case 0xC0: /* EXT_0 */
7856 case 0xC1: /* EXT_1 */
7857 case 0xC2: /* EXT_2 */
7858 /* Extension tokens */
7859 proto_tree_add_text (tree, tvb, off, 1,
7860 " %3d | Tag | T %3d "
7861 "| EXT_%1x (Extension Token) "
7862 "| %s(Single-byte extension)",
7863 *level, *codepage_stag, peek & 0x0f, Indent (*level));
7864 off++;
7865 break;
7866 case 0xC3: /* OPAQUE - WBXML 1.1 and newer */
7867 if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */
7868 idx = tvb_get_guintvar (tvb, off+1, &len);
7869 proto_tree_add_text (tree, tvb, off, 1 + len + idx,
7870 " %3d | Tag | T %3d "
7871 "| OPAQUE (Opaque data) "
7872 "| %s(%d bytes of opaque data)",
7873 *level, *codepage_stag, Indent (*level), idx);
7874 off += 1+len+idx;
7875 } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */
7876 proto_tree_add_text (tree, tvb, off, 1,
7877 " %3d | Tag | T %3d "
7878 "| RESERVED_2 (Invalid Token!) "
7879 "| WBXML 1.0 parsing stops here.",
7880 *level, *codepage_stag);
7881 /* Stop processing as it is impossible to parse now */
7882 off = tvb_len;
7883 DebugLog(("STAG: level = %u, Return: len = %u\n",
7884 *level, off - offset));
7885 return (off - offset);
7887 break;
7889 /* No default clause, as all cases have been treated */
7890 } else { /* LITERAL or Known TAG */
7891 /* We must store the initial tag, and also retrieve the new tag.
7892 * For efficiency reasons, we store the literal tag representation
7893 * for known tags too, so we can easily close the tag without the
7894 * need of a new lookup and avoiding storage of token codepage.
7896 * There are 4 possibilities:
7898 * 1. Known tag followed by a known tag
7899 * 2. Known tag followed by a LITERAL tag
7900 * 3. LITERAL tag followed by Known tag
7901 * 4. LITERAL tag followed by LITERAL tag
7904 /* Store the new tag */
7905 tag_len = 0;
7906 if ((peek & 0x3F) == 4) { /* LITERAL */
7907 DebugLog(("STAG: LITERAL tag (peek = 0x%02X, off = %u)"
7908 " - TableRef follows!\n", peek, off));
7909 idx = tvb_get_guintvar (tvb, off+1, &tag_len);
7910 str_len = tvb_strsize (tvb, str_tbl+idx);
7911 tag_new_literal = (gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
7912 tag_new_known = 0; /* invalidate known tag_new */
7913 } else { /* Known tag */
7914 tag_new_known = peek & 0x3F;
7915 tag_new_buf=wmem_strdup_printf(wmem_packet_scope(), "Tag_0x%02X",
7916 tag_new_known);
7917 tag_new_literal = tag_new_buf;
7918 /* Stored looked up tag name string */
7921 /* Parsing of TAG starts HERE */
7922 if (peek & 0x40) { /* Content present */
7923 /* Content follows
7924 * [!] An explicit END token is expected in these cases!
7925 * ==> Recursion possible if we encounter a tag with content;
7926 * recursion will return at the explicit END token.
7928 if (parsing_tag_content) { /* Recurse */
7929 DebugLog(("STAG: Tag in Tag - RECURSE! (off = %u)\n", off));
7930 /* Do not process the attribute list:
7931 * recursion will take care of it */
7932 (*level)++;
7933 len = parse_wbxml_tag (tree, tvb, off, str_tbl, level,
7934 codepage_stag, codepage_attr);
7935 off += len;
7936 } else { /* Now we will have content to parse */
7937 /* Save the start tag so we can properly close it later. */
7938 if ((peek & 0x3F) == 4) { /* Literal tag */
7939 tag_save_literal = tag_new_literal;
7940 tag_save_known = 0;
7941 } else { /* Known tag */
7942 tag_save_known = tag_new_known;
7943 tag_save_buf=wmem_strdup_printf(wmem_packet_scope(), "Tag_0x%02X",
7944 tag_new_known);
7945 tag_save_literal = tag_save_buf;
7946 /* The last statement avoids needless lookups */
7948 /* Process the attribute list if present */
7949 if (peek & 0x80) { /* Content and Attribute list present */
7950 if (tag_new_known) { /* Known tag */
7951 proto_tree_add_text (tree, tvb, off, 1,
7952 " %3d | Tag | T %3d "
7953 "| Known Tag 0x%02X (AC) "
7954 "| %s<%s",
7955 *level, *codepage_stag, tag_new_known,
7956 Indent (*level), tag_new_literal);
7957 /* Tag string already looked up earlier! */
7958 off++;
7959 } else { /* LITERAL tag */
7960 proto_tree_add_text (tree, tvb, off, 1,
7961 " %3d | Tag | T %3d "
7962 "| LITERAL_AC (Literal tag) (AC) "
7963 "| %s<%s",
7964 *level, *codepage_stag, Indent (*level),
7965 tag_new_literal);
7966 off += 1 + tag_len;
7968 len = parse_wbxml_attribute_list (tree, tvb,
7969 off, str_tbl, *level, codepage_attr);
7970 /* Check that there is still room in packet */
7971 off += len;
7972 if (off >= tvb_len) {
7973 DebugLog(("STAG: level = %u, ThrowException: "
7974 "len = %u (short frame)\n",
7975 *level, off - offset));
7977 * TODO - Do we need to free g_malloc()ed memory?
7979 THROW(ReportedBoundsError);
7981 proto_tree_add_text (tree, tvb, off-1, 1,
7982 " %3d | Tag | T %3d "
7983 "| END (attribute list) "
7984 "| %s>",
7985 *level, *codepage_stag, Indent (*level));
7986 } else { /* Content, no Attribute list */
7987 if (tag_new_known) { /* Known tag */
7988 proto_tree_add_text (tree, tvb, off, 1,
7989 " %3d | Tag | T %3d "
7990 "| Known Tag 0x%02X (.C) "
7991 "| %s<%s>",
7992 *level, *codepage_stag, tag_new_known,
7993 Indent (*level), tag_new_literal);
7994 /* Tag string already looked up earlier! */
7995 off++;
7996 } else { /* LITERAL tag */
7997 proto_tree_add_text (tree, tvb, off, 1,
7998 " %3d | Tag | T %3d "
7999 "| LITERAL_C (Literal Tag) (.C) "
8000 "| %s<%s>",
8001 *level, *codepage_stag, Indent (*level),
8002 tag_new_literal);
8003 off += 1 + tag_len;
8006 /* The data that follows in the parsing process
8007 * represents content for the opening tag
8008 * we've just processed in the lines above.
8009 * Next time we encounter a tag with content: recurse
8011 parsing_tag_content = TRUE;
8012 DebugLog(("Tag in Tag - No recursion this time! "
8013 "(off = %u)\n", off));
8015 } else { /* No Content */
8016 DebugLog(("<Tag/> in Tag - No recursion! (off = %u)\n", off));
8017 (*level)++;
8018 if (peek & 0x80) { /* No Content, Attribute list present */
8019 if (tag_new_known) { /* Known tag */
8020 proto_tree_add_text (tree, tvb, off, 1,
8021 " %3d | Tag | T %3d "
8022 "| Known Tag 0x%02X (A.) "
8023 "| %s<%s",
8024 *level, *codepage_stag, tag_new_known,
8025 Indent (*level), tag_new_literal);
8026 /* Tag string already looked up earlier! */
8027 off++;
8028 len = parse_wbxml_attribute_list (tree, tvb,
8029 off, str_tbl, *level, codepage_attr);
8030 /* Check that there is still room in packet */
8031 off += len;
8032 if (off >= tvb_len) {
8033 DebugLog(("STAG: level = %u, ThrowException: "
8034 "len = %u (short frame)\n",
8035 *level, off - offset));
8037 * TODO - Do we need to free g_malloc()ed memory?
8039 THROW(ReportedBoundsError);
8041 proto_tree_add_text (tree, tvb, off-1, 1,
8042 " %3d | Tag | T %3d "
8043 "| END (Known Tag) "
8044 "| %s/>",
8045 *level, *codepage_stag, Indent (*level));
8046 } else { /* LITERAL tag */
8047 proto_tree_add_text (tree, tvb, off, 1,
8048 " %3d | Tag | T %3d "
8049 "| LITERAL_A (Literal Tag) (A.) "
8050 "| %s<%s",
8051 *level, *codepage_stag, Indent (*level),
8052 tag_new_literal);
8053 off += 1 + tag_len;
8054 len = parse_wbxml_attribute_list (tree, tvb,
8055 off, str_tbl, *level, codepage_attr);
8056 /* Check that there is still room in packet */
8057 off += len;
8058 if (off >= tvb_len) {
8059 DebugLog(("STAG: level = %u, ThrowException: "
8060 "len = %u (short frame)\n",
8061 *level, off - offset));
8063 * TODO - Do we need to free g_malloc()ed memory?
8065 THROW(ReportedBoundsError);
8067 proto_tree_add_text (tree, tvb, off-1, 1,
8068 " %3d | Tag | T %3d "
8069 "| END (Literal Tag) "
8070 "| %s/>",
8071 *level, *codepage_stag, Indent (*level));
8073 } else { /* No Content, No Attribute list */
8074 if (tag_new_known) { /* Known tag */
8075 proto_tree_add_text (tree, tvb, off, 1,
8076 " %3d | Tag | T %3d "
8077 "| Known Tag 0x%02x (..) "
8078 "| %s<%s />",
8079 *level, *codepage_stag, tag_new_known,
8080 Indent (*level), tag_new_literal);
8081 /* Tag string already looked up earlier! */
8082 off++;
8083 } else { /* LITERAL tag */
8084 proto_tree_add_text (tree, tvb, off, 1,
8085 " %3d | Tag | T %3d "
8086 "| LITERAL (Literal Tag) (..) "
8087 "| %s<%s />",
8088 *level, *codepage_stag, Indent (*level),
8089 tag_new_literal);
8090 off += 1 + tag_len;
8093 (*level)--;
8094 /* TODO: Do I have to reset code page here? */
8096 } /* if (tag & 0x3F) >= 5 */
8097 } /* while */
8098 DebugLog(("STAG: level = %u, Return: len = %u (end of function body)\n",
8099 *level, off - offset));
8100 return (off - offset);
8104 /**************************
8105 * WBXML Attribute tokens *
8106 **************************
8107 * Bit Mask : Example
8108 * -------------------
8109 * 0... .... : attr= (attribute name)
8110 * href='http://' (attribute name with start of attribute value)
8111 * 1... .... : 'www.' (attribute value, or part of it)
8116 /* This function parses the WBXML and maps known token interpretations
8117 * to the WBXML tokens. As a result, the original XML document can be
8118 * recreated. Indentation is generated in order to ease reading.
8120 * This function performs attribute list parsing.
8122 * The wbxml_decoding entry *map contains the actual token mapping.
8124 * NOTE: See above for known token mappings.
8126 static guint32
8127 parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
8128 guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr,
8129 const wbxml_decoding *map)
8131 guint32 tvb_len = tvb_reported_length (tvb);
8132 guint32 off = offset;
8133 guint32 len;
8134 guint str_len;
8135 guint32 ent;
8136 guint32 idx;
8137 guint8 peek;
8138 guint8 attr_save_known = 0; /* Will contain peek & 0x3F (attr identity) */
8139 const char *attr_save_literal = NULL; /* Will contain the LITERAL attr identity */
8141 DebugLog(("parse_wbxml_attr_defined (level = %u, offset = %u)\n",
8142 level, offset));
8143 /* Parse attributes */
8144 while (off < tvb_len) {
8145 peek = tvb_get_guint8 (tvb, off);
8146 DebugLog(("ATTR: (top of while) level = %3u, peek = 0x%02X, "
8147 "off = %u, tvb_len = %u\n", level, peek, off, tvb_len));
8148 if ((peek & 0x3F) < 5) switch (peek) { /* Global tokens
8149 in state = ATTR */
8150 case 0x00: /* SWITCH_PAGE */
8151 *codepage_attr = tvb_get_guint8 (tvb, off+1);
8152 proto_tree_add_text (tree, tvb, off, 2,
8153 " | Attr | A -->%3d "
8154 "| SWITCH_PAGE (Attr code page) |",
8155 *codepage_attr);
8156 off += 2;
8157 break;
8158 case 0x01: /* END */
8159 /* BEWARE
8160 * The Attribute END token means either ">" or "/>"
8161 * and as a consequence both must be treated separately.
8162 * This is done in the TAG state parser.
8164 off++;
8165 DebugLog(("ATTR: level = %u, Return: len = %u\n",
8166 level, off - offset));
8167 return (off - offset);
8168 case 0x02: /* ENTITY */
8169 ent = tvb_get_guintvar (tvb, off+1, &len);
8170 proto_tree_add_text (tree, tvb, off, 1+len,
8171 " %3d | Attr | A %3d "
8172 "| ENTITY "
8173 "| %s'&#%u;'",
8174 level, *codepage_attr, Indent (level), ent);
8175 off += 1+len;
8176 break;
8177 case 0x03: /* STR_I */
8178 len = tvb_strsize (tvb, off+1);
8179 proto_tree_add_text (tree, tvb, off, 1+len,
8180 " %3d | Attr | A %3d "
8181 "| STR_I (Inline string) "
8182 "| %s\'%s\'",
8183 level, *codepage_attr, Indent (level),
8184 tvb_format_text (tvb, off+1, len-1));
8185 off += 1+len;
8186 break;
8187 case 0x04: /* LITERAL */
8188 /* ALWAYS means the start of a new attribute,
8189 * and may only contain the NAME of the attribute.
8191 idx = tvb_get_guintvar (tvb, off+1, &len);
8192 str_len = tvb_strsize (tvb, str_tbl+idx);
8193 attr_save_known = 0;
8194 attr_save_literal = tvb_format_text (tvb,
8195 str_tbl+idx, str_len-1);
8196 proto_tree_add_text (tree, tvb, off, 1+len,
8197 " %3d | Attr | A %3d "
8198 "| LITERAL (Literal Attribute) "
8199 "| %s<%s />",
8200 level, *codepage_attr, Indent (level),
8201 attr_save_literal);
8202 off += 1+len;
8203 break;
8204 case 0x40: /* EXT_I_0 */
8205 case 0x41: /* EXT_I_1 */
8206 case 0x42: /* EXT_I_2 */
8207 /* Extension tokens */
8208 len = tvb_strsize (tvb, off+1);
8209 proto_tree_add_text (tree, tvb, off, 1+len,
8210 " %3d | Attr | A %3d "
8211 "| EXT_I_%1x (Extension Token) "
8212 "| %s(%s: \'%s\')",
8213 level, *codepage_attr, peek & 0x0f, Indent (level),
8214 map_token (map->global, 0, peek),
8215 tvb_format_text (tvb, off+1, len-1));
8216 off += 1+len;
8217 break;
8218 /* 0x43 impossible in ATTR state */
8219 /* 0x44 impossible in ATTR state */
8220 case 0x80: /* EXT_T_0 */
8221 case 0x81: /* EXT_T_1 */
8222 case 0x82: /* EXT_T_2 */
8223 /* Extension tokens */
8224 idx = tvb_get_guintvar (tvb, off+1, &len);
8225 { char *s;
8227 if (map->ext_t[peek & 0x03])
8228 s = (map->ext_t[peek & 0x03])(tvb, idx, str_tbl);
8229 else
8230 s = wmem_strdup_printf(wmem_packet_scope(), "EXT_T_%1x (%s)", peek & 0x03,
8231 map_token (map->global, 0, peek));
8233 proto_tree_add_text (tree, tvb, off, 1+len,
8234 " %3d | Tag | T %3d "
8235 "| EXT_T_%1x (Extension Token) "
8236 "| %s%s)",
8237 level, *codepage_attr, peek & 0x0f, Indent (level),
8240 off += 1+len;
8241 break;
8242 case 0x83: /* STR_T */
8243 idx = tvb_get_guintvar (tvb, off+1, &len);
8244 str_len = tvb_strsize (tvb, str_tbl+idx);
8245 proto_tree_add_text (tree, tvb, off, 1+len,
8246 " %3d | Attr | A %3d "
8247 "| STR_T (Tableref string) "
8248 "| %s\'%s\'",
8249 level, *codepage_attr, Indent (level),
8250 tvb_format_text (tvb, str_tbl+idx, str_len-1));
8251 off += 1+len;
8252 break;
8253 /* 0x84 impossible in ATTR state */
8254 case 0xC0: /* EXT_0 */
8255 case 0xC1: /* EXT_1 */
8256 case 0xC2: /* EXT_2 */
8257 /* Extension tokens */
8258 proto_tree_add_text (tree, tvb, off, 1,
8259 " %3d | Attr | A %3d "
8260 "| EXT_%1x (Extension Token) "
8261 "| %s(%s)",
8262 level, *codepage_attr, peek & 0x0f, Indent (level),
8263 map_token (map->global, 0, peek));
8264 off++;
8265 break;
8266 case 0xC3: /* OPAQUE - WBXML 1.1 and newer */
8267 if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */
8268 char *str;
8269 if (attr_save_known) { /* Knwon attribute */
8270 if (map->opaque_binary_attr) {
8271 str = map->opaque_binary_attr(tvb, off + 1,
8272 attr_save_known, *codepage_attr, &len);
8273 } else {
8274 str = default_opaque_binary_attr(tvb, off + 1,
8275 attr_save_known, *codepage_attr, &len);
8277 } else { /* lITERAL attribute */
8278 if (map->opaque_literal_tag) {
8279 str = map->opaque_literal_attr(tvb, off + 1,
8280 attr_save_literal, *codepage_attr, &len);
8281 } else {
8282 str = default_opaque_literal_attr(tvb, off + 1,
8283 attr_save_literal, *codepage_attr, &len);
8286 proto_tree_add_text (tree, tvb, off, 1 + len,
8287 " %3d | Attr | A %3d "
8288 "| OPAQUE (Opaque data) "
8289 "| %s%s",
8290 level, *codepage_attr, Indent (level), str);
8291 off += 1 + len;
8292 } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */
8293 proto_tree_add_text (tree, tvb, off, 1,
8294 " %3d | Attr | A %3d "
8295 "| RESERVED_2 (Invalid Token!) "
8296 "| WBXML 1.0 parsing stops here.",
8297 level, *codepage_attr);
8298 /* Stop processing as it is impossible to parse now */
8299 off = tvb_len;
8300 DebugLog(("ATTR: level = %u, Return: len = %u\n",
8301 level, off - offset));
8302 return (off - offset);
8304 break;
8305 /* 0xC4 impossible in ATTR state */
8306 default:
8307 proto_tree_add_text (tree, tvb, off, 1,
8308 " %3d | Attr | A %3d "
8309 "| %-10s (Invalid Token!) "
8310 "| WBXML parsing stops here.",
8311 level, *codepage_attr,
8312 val_to_str_ext (peek, &vals_wbxml1x_global_tokens_ext, "(unknown 0x%x)"));
8313 /* Move to end of buffer */
8314 off = tvb_len;
8315 break;
8316 } else { /* Known atribute token */
8317 if (peek & 0x80) { /* attrValue */
8318 proto_tree_add_text (tree, tvb, off, 1,
8319 " %3d | Attr | A %3d "
8320 "| Known attrValue 0x%02X "
8321 "| %s%s",
8322 level, *codepage_attr, peek & 0x7f, Indent (level),
8323 map_token (map->attrValue, *codepage_attr, peek));
8324 off++;
8325 } else { /* attrStart */
8326 attr_save_known = peek & 0x7f;
8327 proto_tree_add_text (tree, tvb, off, 1,
8328 " %3d | Attr | A %3d "
8329 "| Known attrStart 0x%02X "
8330 "| %s%s",
8331 level, *codepage_attr, attr_save_known, Indent (level),
8332 map_token (map->attrStart, *codepage_attr, peek));
8333 off++;
8336 } /* End WHILE */
8337 DebugLog(("ATTR: level = %u, Return: len = %u (end of function body)\n",
8338 level, off - offset));
8339 return (off - offset);
8343 /* This function performs the WBXML attribute decoding as in
8344 * parse_wbxml_attribute_list_defined() but this time no WBXML mapping
8345 * is performed.
8347 * This function performs attribute list parsing.
8349 * NOTE: Code page switches not yet processed in the code!
8351 static guint32
8352 parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
8353 guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr)
8355 guint32 tvb_len = tvb_reported_length (tvb);
8356 guint32 off = offset;
8357 guint32 len;
8358 guint str_len;
8359 guint32 ent;
8360 guint32 idx;
8361 guint8 peek;
8363 DebugLog(("parse_wbxml_attr (level = %u, offset = %u)\n", level, offset));
8364 /* Parse attributes */
8365 while (off < tvb_len) {
8366 peek = tvb_get_guint8 (tvb, off);
8367 DebugLog(("ATTR: (top of while) level = %3u, peek = 0x%02X, "
8368 "off = %u, tvb_len = %u\n", level, peek, off, tvb_len));
8369 if ((peek & 0x3F) < 5) switch (peek) { /* Global tokens
8370 in state = ATTR */
8371 case 0x00: /* SWITCH_PAGE */
8372 *codepage_attr = tvb_get_guint8 (tvb, off+1);
8373 proto_tree_add_text (tree, tvb, off, 2,
8374 " | Attr | A -->%3d "
8375 "| SWITCH_PAGE (Attr code page) |",
8376 *codepage_attr);
8377 off += 2;
8378 break;
8379 case 0x01: /* END */
8380 /* BEWARE
8381 * The Attribute END token means either ">" or "/>"
8382 * and as a consequence both must be treated separately.
8383 * This is done in the TAG state parser.
8385 off++;
8386 DebugLog(("ATTR: level = %u, Return: len = %u\n",
8387 level, off - offset));
8388 return (off - offset);
8389 case 0x02: /* ENTITY */
8390 ent = tvb_get_guintvar (tvb, off+1, &len);
8391 proto_tree_add_text (tree, tvb, off, 1+len,
8392 " %3d | Attr | A %3d "
8393 "| ENTITY "
8394 "| %s'&#%u;'",
8395 level, *codepage_attr, Indent (level), ent);
8396 off += 1+len;
8397 break;
8398 case 0x03: /* STR_I */
8399 len = tvb_strsize (tvb, off+1);
8400 proto_tree_add_text (tree, tvb, off, 1+len,
8401 " %3d | Attr | A %3d "
8402 "| STR_I (Inline string) "
8403 "| %s\'%s\'",
8404 level, *codepage_attr, Indent (level),
8405 tvb_format_text (tvb, off+1, len-1));
8406 off += 1+len;
8407 break;
8408 case 0x04: /* LITERAL */
8409 idx = tvb_get_guintvar (tvb, off+1, &len);
8410 str_len = tvb_strsize (tvb, str_tbl+idx);
8411 proto_tree_add_text (tree, tvb, off, 1+len,
8412 " %3d | Attr | A %3d "
8413 "| LITERAL (Literal Attribute) "
8414 "| %s<%s />",
8415 level, *codepage_attr, Indent (level),
8416 tvb_format_text (tvb, str_tbl+idx, str_len-1));
8417 off += 1+len;
8418 break;
8419 case 0x40: /* EXT_I_0 */
8420 case 0x41: /* EXT_I_1 */
8421 case 0x42: /* EXT_I_2 */
8422 /* Extension tokens */
8423 len = tvb_strsize (tvb, off+1);
8424 proto_tree_add_text (tree, tvb, off, 1+len,
8425 " %3d | Attr | A %3d "
8426 "| EXT_I_%1x (Extension Token) "
8427 "| %s(Inline string extension: \'%s\')",
8428 level, *codepage_attr, peek & 0x0f, Indent (level),
8429 tvb_format_text (tvb, off+1, len-1));
8430 off += 1+len;
8431 break;
8432 /* 0x43 impossible in ATTR state */
8433 /* 0x44 impossible in ATTR state */
8434 case 0x80: /* EXT_T_0 */
8435 case 0x81: /* EXT_T_1 */
8436 case 0x82: /* EXT_T_2 */
8437 /* Extension tokens */
8438 idx = tvb_get_guintvar (tvb, off+1, &len);
8439 proto_tree_add_text (tree, tvb, off, 1+len,
8440 " %3d | Attr | A %3d "
8441 "| EXT_T_%1x (Extension Token) "
8442 "| %s(Extension Token, integer value: %u)",
8443 level, *codepage_attr, peek & 0x0f, Indent (level),
8444 idx);
8445 off += 1+len;
8446 break;
8447 case 0x83: /* STR_T */
8448 idx = tvb_get_guintvar (tvb, off+1, &len);
8449 str_len = tvb_strsize (tvb, str_tbl+idx);
8450 proto_tree_add_text (tree, tvb, off, 1+len,
8451 " %3d | Attr | A %3d "
8452 "| STR_T (Tableref string) "
8453 "| %s\'%s\'",
8454 level, *codepage_attr, Indent (level),
8455 tvb_format_text (tvb, str_tbl+idx, str_len-1));
8456 off += 1+len;
8457 break;
8458 /* 0x84 impossible in ATTR state */
8459 case 0xC0: /* EXT_0 */
8460 case 0xC1: /* EXT_1 */
8461 case 0xC2: /* EXT_2 */
8462 /* Extension tokens */
8463 proto_tree_add_text (tree, tvb, off, 1,
8464 " %3d | Attr | A %3d "
8465 "| EXT_%1x (Extension Token) "
8466 "| %s(Single-byte extension)",
8467 level, *codepage_attr, peek & 0x0f, Indent (level));
8468 off++;
8469 break;
8470 case 0xC3: /* OPAQUE - WBXML 1.1 and newer */
8471 if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */
8472 idx = tvb_get_guintvar (tvb, off+1, &len);
8473 proto_tree_add_text (tree, tvb, off, 1 + len + idx,
8474 " %3d | Attr | A %3d "
8475 "| OPAQUE (Opaque data) "
8476 "| %s(%d bytes of opaque data)",
8477 level, *codepage_attr, Indent (level), idx);
8478 off += 1+len+idx;
8479 } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */
8480 proto_tree_add_text (tree, tvb, off, 1,
8481 " %3d | Attr | A %3d "
8482 "| RESERVED_2 (Invalid Token!) "
8483 "| WBXML 1.0 parsing stops here.",
8484 level, *codepage_attr);
8485 /* Stop processing as it is impossible to parse now */
8486 off = tvb_len;
8487 DebugLog(("ATTR: level = %u, Return: len = %u\n",
8488 level, off - offset));
8489 return (off - offset);
8491 break;
8492 /* 0xC4 impossible in ATTR state */
8493 default:
8494 proto_tree_add_text (tree, tvb, off, 1,
8495 " %3d | Attr | A %3d "
8496 "| %-10s (Invalid Token!) "
8497 "| WBXML parsing stops here.",
8498 level, *codepage_attr,
8499 val_to_str_ext (peek, &vals_wbxml1x_global_tokens_ext, "(unknown 0x%x)"));
8500 /* Move to end of buffer */
8501 off = tvb_len;
8502 break;
8503 } else { /* Known atribute token */
8504 if (peek & 0x80) { /* attrValue */
8505 proto_tree_add_text (tree, tvb, off, 1,
8506 " %3d | Attr | A %3d "
8507 "| Known attrValue 0x%02X "
8508 "| %sattrValue_0x%02X",
8509 level, *codepage_attr, peek & 0x7f, Indent (level),
8510 peek);
8511 off++;
8512 } else { /* attrStart */
8513 proto_tree_add_text (tree, tvb, off, 1,
8514 " %3d | Attr | A %3d "
8515 "| Known attrStart 0x%02X "
8516 "| %sattrStart_0x%02X",
8517 level, *codepage_attr, peek & 0x7f, Indent (level),
8518 peek);
8519 off++;
8522 } /* End WHILE */
8523 DebugLog(("ATTR: level = %u, Return: len = %u (end of function body)\n",
8524 level, off - offset));
8525 return (off - offset);
8529 /****************** Register the protocol with Wireshark ******************/
8532 /* This format is required because a script is used to build the C function
8533 * that calls the protocol registration. */
8535 void
8536 proto_register_wbxml(void)
8538 module_t *wbxml_module; /* WBXML Preferences */
8540 /* Setup list of header fields. */
8541 static hf_register_info hf[] = {
8542 { &hf_wbxml_version,
8543 { "Version",
8544 "wbxml.version",
8545 FT_UINT8, BASE_HEX|BASE_EXT_STRING,
8546 &vals_wbxml_versions_ext, 0x00,
8547 "WBXML Version", HFILL }
8549 { &hf_wbxml_public_id_known,
8550 { "Public Identifier (known)",
8551 "wbxml.public_id.known",
8552 FT_UINT32, BASE_HEX|BASE_EXT_STRING,
8553 &vals_wbxml_public_ids_ext, 0x00,
8554 "WBXML Known Public Identifier (integer)", HFILL }
8556 { &hf_wbxml_public_id_literal,
8557 { "Public Identifier (literal)",
8558 "wbxml.public_id.literal",
8559 FT_STRING, BASE_NONE,
8560 NULL, 0x00,
8561 "WBXML Literal Public Identifier (text string)", HFILL }
8563 { &hf_wbxml_charset,
8564 { "Character Set",
8565 "wbxml.charset",
8566 FT_UINT32, BASE_HEX|BASE_EXT_STRING,
8567 &wap_mib_enum_vals_character_sets_ext, 0x00,
8568 "WBXML Character Set", HFILL }
8572 /* Setup protocol subtree array */
8573 static gint *ett[] = {
8574 &ett_wbxml,
8575 &ett_wbxml_str_tbl,
8576 &ett_wbxml_content,
8579 /* Register the protocol name and description */
8580 proto_wbxml = proto_register_protocol(
8581 "WAP Binary XML",
8582 "WBXML",
8583 "wbxml"
8586 /* Required function calls to register the header fields
8587 * and subtrees used */
8588 proto_register_field_array(proto_wbxml, hf, array_length(hf));
8589 proto_register_subtree_array(ett, array_length(ett));
8591 /* Preferences */
8592 wbxml_module = prefs_register_protocol(proto_wbxml, NULL);
8593 prefs_register_bool_preference(wbxml_module,
8594 "skip_wbxml_token_mapping",
8595 "Skip the mapping of WBXML tokens to media type tokens.",
8596 "Enable this preference if you want to view the WBXML "
8597 "tokens without the representation in a media type "
8598 "(e.g., WML). Tokens will show up as Tag_0x12, "
8599 "attrStart_0x08 or attrValue_0x0B for example.",
8600 &skip_wbxml_token_mapping);
8601 prefs_register_bool_preference(wbxml_module,
8602 "disable_wbxml_token_parsing",
8603 "Disable the parsing of the WBXML tokens.",
8604 "Enable this preference if you want to skip the "
8605 "parsing of the WBXML tokens that constitute the body "
8606 "of the WBXML document. Only the WBXML header will be "
8607 "dissected (and visualized) then.",
8608 &disable_wbxml_token_parsing);
8610 register_dissector("wbxml", dissect_wbxml, proto_wbxml);
8611 register_dissector("wbxml-uaprof", dissect_uaprof, proto_wbxml);
8615 void
8616 proto_reg_handoff_wbxml(void)
8618 dissector_handle_t wbxml_handle;
8620 /* Heuristic dissectors would be declared by means of:
8621 * heur_dissector_add("wsp", dissect_wbxml_heur, proto_wbxml);
8624 wbxml_handle = find_dissector("wbxml");
8626 /* Register the WSP content types (defined as protocol port)
8627 * for WBXML dissection.
8629 * See http://www.wapforum.org/wina/wsp-content-type.htm
8631 * As the media types for WSP and HTTP are the same, the WSP dissector
8632 * uses the same string dissector table as the HTTP protocol.
8635 /**** Well-known WBXML WSP Content-Type values ****/
8637 dissector_add_string("media_type",
8638 "application/vnd.wap.wmlc", wbxml_handle);
8639 dissector_add_string("media_type",
8640 "application/vnd.wap.wta-eventc", wbxml_handle);
8641 dissector_add_string("media_type",
8642 "application/vnd.wap.wbxml", wbxml_handle);
8643 dissector_add_string("media_type",
8644 "application/vnd.wap.sic", wbxml_handle);
8645 dissector_add_string("media_type",
8646 "application/vnd.wap.slc", wbxml_handle);
8647 dissector_add_string("media_type",
8648 "application/vnd.wap.coc", wbxml_handle);
8649 dissector_add_string("media_type",
8650 "application/vnd.wap.connectivity-wbxml", wbxml_handle);
8651 dissector_add_string("media_type",
8652 "application/vnd.wap.locc+wbxml", wbxml_handle);
8653 dissector_add_string("media_type",
8654 "application/vnd.syncml+wbxml", wbxml_handle);
8655 dissector_add_string("media_type",
8656 "application/vnd.syncml.dm+wbxml", wbxml_handle);
8657 dissector_add_string("media_type",
8658 "application/vnd.oma.drm.rights+wbxml", wbxml_handle);
8659 dissector_add_string("media_type",
8660 "application/vnd.wv.csp.wbxml", wbxml_handle);
8661 dissector_add_string("media_type",
8662 "application/vnd.ms-sync.wbxml", wbxml_handle);
8663 dissector_add_string("media_type",
8664 "application/vnd.ms-sync", wbxml_handle);
8666 /**** Registered WBXML WSP Content-Type values ****/
8668 dissector_add_string("media_type",
8669 "application/vnd.uplanet.cacheop-wbxml", wbxml_handle);
8670 dissector_add_string("media_type",
8671 "application/vnd.uplanet.alert-wbxml", wbxml_handle);
8672 dissector_add_string("media_type",
8673 "application/vnd.uplanet.list-wbxml", wbxml_handle);
8674 dissector_add_string("media_type",
8675 "application/vnd.uplanet.listcmd-wbxml", wbxml_handle);
8676 dissector_add_string("media_type",
8677 "application/vnd.uplanet.channel-wbxml", wbxml_handle);
8678 dissector_add_string("media_type",
8679 "application/vnd.uplanet.bearer-choice-wbxml", wbxml_handle);
8680 dissector_add_string("media_type",
8681 "application/vnd.phonecom.mmc-wbxml", wbxml_handle);
8682 dissector_add_string("media_type",
8683 "application/vnd.nokia.syncset+wbxml", wbxml_handle);
8685 /***** Content types that only have a textual representation *****/
8686 dissector_add_string("media_type",
8687 "application/x-wap-prov.browser-bookmarks", wbxml_handle);
8688 dissector_add_string("media_type",
8689 "application/x-wap-prov.browser-settings", wbxml_handle);
8690 /* Same as application/vnd.nokia.syncset+wbxml */
8691 dissector_add_string("media_type",
8692 "application/x-prov.syncset+wbxml", wbxml_handle);
8696 * Editor modelines
8698 * Local Variables:
8699 * c-basic-offset: 8
8700 * tab-width: 8
8701 * indent-tabs-mode: t
8702 * End:
8704 * ex: set shiftwidth=8 tabstop=8 noexpandtab:
8705 * :indentSize=8:tabSize=8:noTabs=false: