From Stephen Fisher
[obnox/wireshark/wip.git] / epan / dissectors / packet-wbxml.c
1 /* packet-wbxml.c
2  *
3  * Routines for WAP Binary XML dissection
4  * Copyright 2003, 2004, Olivier Biot.
5  *
6  * $Id$
7  *
8  * Refer to the AUTHORS file or the AUTHORS section in the man page
9  * for contacting the author(s) of this file.
10  *
11  * Wireshark - Network traffic analyzer
12  * By Gerald Combs <gerald@wireshark.org>
13  * Copyright 1998 Gerald Combs
14  *
15  * WAP Binary XML decoding functionality provided by Olivier Biot.
16  *
17  * The WAP specifications used to be found at the WAP Forum:
18  *      <http://www.wapforum.org/what/Technical.htm>
19  * But now the correct link is at the Open Mobile Alliance:
20  *      <http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html>
21  * Media types defined by OMA affiliates will have their standards at:
22  *      <http://www.openmobilealliance.org/tech/affiliates/index.html>
23  *      <http://www.openmobilealliance.org/release_program/index.html>
24  *
25  * This program is free software; you can redistribute it and/or
26  * modify it under the terms of the GNU General Public License
27  * as published by the Free Software Foundation; either version 2
28  * of the License, or (at your option) any later version.
29  *
30  * This program is distributed in the hope that it will be useful,
31  * but WITHOUT ANY WARRANTY; without even the implied warranty of
32  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33  * GNU General Public License for more details.
34  *
35  * You should have received a copy of the GNU General Public License
36  * along with this program; if not, write to the Free Software
37  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38  */
39
40 /* Edit this file with 4-space tabulation */
41
42 #ifdef HAVE_CONFIG_H
43 # include "config.h"
44 #endif
45
46 #include <stdio.h>
47 #include <stdlib.h>
48 #include <string.h>
49
50 #include <glib.h>
51
52 #include <epan/packet.h>
53
54 #include <epan/prefs.h>
55 #include <epan/emem.h>
56
57 /* We need the function tvb_get_guintvar() */
58 #include "packet-wap.h"
59
60 /* General-purpose debug logger.
61  * Requires double parentheses because of variable arguments of printf().
62  *
63  * Enable debug logging for WBXML by defining AM_FLAGS
64  * so that it contains "-DDEBUG_wbxml"
65  */
66 #ifdef DEBUG_wbxml
67 #define DebugLog(x) \
68         g_print("%s:%u: ", __FILE__, __LINE__); \
69         g_print x
70 #else
71 #define DebugLog(x) ;
72 #endif
73
74 /* The code in this source file dissects the WAP Binary XML content,
75  * and if possible renders it. WBXML mappings are defined in the
76  * "wbxml_decoding" structure.
77  *
78  * NOTES:
79  *
80  *  - Some WBXML content is *not* backwards compatible across minor versions.
81  *    This painful remark is true for:
82  *      o  WMLC 1.0 with respect to later WMLC 1.x
83  *      o  All WV-CSP versions (never backwards compatible)
84  *    The only way of correctly rendering the WBXML is to let the end-user
85  *    choose from the possible renderings. This only applies to the case when
86  *    the WBXML DocType is not included in the WBXML header (unknown/missing).
87  *
88  *  - Some WBXML content uses EXT_T_* in a non-tableref manner. This is the
89  *    case with WV-CSP 1.1 and up, where the index points to a value_string
90  *    containing WV-CSP specific token values. This is allowed as it is not
91  *    explicitly forbidden in the WBXML specifications. Hence the global token
92  *    map for content must also contain a function pointer if no tableref
93  *    string is used.
94  *
95  *  - Code page switches apply until a new code page switch. In the WBXML/1.x
96  *    ABNF notation, it can be proven that the switch_page can only precede
97  *    the following tokens:
98  *      o  stag      : TAG | LITERAL | LITERAL_A | LITERAL_C | LITERAL_AC
99  *      o  attr      : ATTRSTART | ATTRVALUE
100  *      o  extension : EXT_I | EXT_T | EXT
101  *    Code page switches are displayed in a separate column.
102  *
103  *  - The WBXML spec states that code pages are static to both the tag and the
104  *    attribute state parser. A SWITCH_PAGE within a state switches the code
105  *    page of the active state only. Note that code page 255 is reserved for
106  *    application-specific (read: testing) purposes.
107  *
108  *  - In order to render the XML content, recursion is inevitable at some
109  *    point (when a tag with content occurs in the content of a tag with
110  *    content). The code will however not recurse if this is not strictly
111  *    required (e.g., tag without content in the content of a tag with
112  *    content).
113  *
114  *  - I found it useful to display the XML nesting level as a first "column",
115  *    followed by the abbreviated WBXML token interpretation. When a mapping
116  *    is defined for the parsed WBXML content, then the XML rendering is
117  *    displayed with appropriate indentation (maximum nesting level = 255,
118  *    after which the nesting and level will safely roll-over to 0).
119  *
120  *  - The WAP Forum defines the order of precedence for finding out the
121  *    WBXML content type (same rules for charset) as follows:
122  *      1. Look in the Content-Type WSP header
123  *      2. Look in the WBXML header
124  *    Currently there is no means of using content type parameters:
125  *      o  Type=<some_type>
126  *      o  Charset=<charset_of_the_content>
127  *    So it is possible some WBXML content types are incorrectly parsed.
128  *    This would only be the case when the content type declaration in the
129  *    WSP Content-Type header would be different (or would have parameters
130  *    which are relevant to the WBXML decoding) from the content type
131  *    identifier specified in the WBXML header. This has to do with the
132  *    decoding of terminated text strings in the different character codings.
133  *    TODO: investigate this and provide correct decoding at all times.
134  */
135
136 typedef struct _value_valuestring {
137         guint32 value;
138         const value_string *valstrptr;
139 } value_valuestring;
140
141 /* Tries to match val against each element in the value_value_string array vvs.
142  * Returns the associated value_string ptr on a match, or NULL on failure. */
143 static const value_string *
144 val_to_valstr(guint32 val, const value_valuestring *vvs)
145 {
146   gint i = 0;
147
148   while (vvs[i].valstrptr) {
149         if (vvs[i].value == val)
150       return(vvs[i].valstrptr);
151       i++;
152   }
153
154   return(NULL);
155 }
156
157 /* Note on Token mapping
158  * ---------------------
159  *
160  * The WBXML dissector will try mapping the token decoding to their textual
161  * representation if the media type has a defined token representation. The
162  * following logic applies:
163  *
164  * a. Inspect the WBXML PublicID
165  *      This means that I need a list { PublicID, decoding }
166  *
167  * b. Inspect the literal media type
168  *      This requires a list { "media/type", discriminator, { decodings } }
169  *
170  *   b.1. Use a discriminator to choose an appropriate token mapping;
171  *      The disciminator needs a small number of bytes from the data tvbuff_t.
172  *
173  * else
174  *   b.2. Provide a list to the end-user with all possible token mappings.
175  *
176  * c. If none match then only show the tokens without mapping.
177  *
178  */
179
180 /* ext_t_func_ptr is a pointer to a function handling the EXT_T_i tokens:
181  *
182  * char * ext_t_function(tvbuff_t *tvb, guint32 value, guint32 strtbl);
183  */
184 typedef char * (* ext_t_func_ptr)(tvbuff_t *, guint32, guint32);
185
186 /* Note on parsing of OPAQUE data
187  * ------------------------------
188  *
189  * The WBXML encapsulation allows the insertion of opaque binary data in the
190  * WBXML body. Although this opaque data has no meaning in WBXML, the media
191  * type itself may define compact encoding of given input by encoding it in
192  * such a OPAQUE blob of bytes.
193  *
194  * The WBXML dissector now supports dissection of OPAQUE data by means of a
195  * mapping function that will operate based on the token (well-known or literal)
196  * and the active code page.
197  *
198  * For well-known tokens the simplest approach is to use a switch for the code
199  * pages and another switch for the relevant tokens within a code page.
200  *
201  * For literal tokens (tags and attribute names), the only approach is a string
202  * comparison with the literal representation of the given tag or attribute
203  * name.
204  *
205  * opaque_token_func_ptr is a pointer to a function handling OPAQUE values
206  * for binary tokens representing tags or attribute starts.
207  * opaque_literal_func_ptr is a pointer to a function handling OPAQUE values
208  * for literal tokens representing tags or attribute starts.
209  *
210  * The length field of the OPAQUE entry starts at offset (not offset + 1).
211  *
212  * The length of the processed OPAQUE value is returned by reference.
213  *
214  * char * opaque_token_function(tvbuff_t *tvb, guint32 offset,
215  *              guint8 token, guint8 codepage, guint32 *length);
216  * char * opaque_literal_function(tvbuff_t *tvb, guint32 offset,
217  *              const char *token, guint8 codepage, guint32 *length);
218  */
219 typedef char * (* opaque_token_func_ptr)(tvbuff_t *, guint32, guint8, guint8, guint32 *);
220 typedef char * (* opaque_literal_func_ptr)(tvbuff_t *, guint32, const char *, guint8, guint32 *);
221
222 static char *
223 default_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
224                 guint8 token _U_, guint8 codepage _U_, guint32 *length)
225 {
226         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
227         char *str = g_strdup_printf("(%d bytes of opaque data)", data_len);
228         *length += data_len;
229         return str;
230 }
231
232 static char *
233 default_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
234                 const char *token _U_, guint8 codepage _U_, guint32 *length)
235 {
236         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
237         char *str = g_strdup_printf("(%d bytes of opaque data)", data_len);
238         *length += data_len;
239         return str;
240 }
241
242 static char *
243 default_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
244                 guint8 token _U_, guint8 codepage _U_, guint32 *length)
245 {
246         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
247         char *str = g_strdup_printf("(%d bytes of opaque data)", data_len);
248         *length += data_len;
249         return str;
250 }
251
252 static char *
253 default_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
254                 const char *token _U_, guint8 codepage _U_, guint32 *length)
255 {
256         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
257         char *str = g_strdup_printf("(%d bytes of opaque data)", data_len);
258         *length += data_len;
259         return str;
260 }
261
262 /* Render a hex %dateTime encoded timestamp as a string.
263  * 0x20011231123456 becomes "2001-12-31T12:34:56Z" */
264 static char *
265 date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
266 {
267         char *str;
268
269         switch (data_len) {
270                 case 4: /* YYYY-MM-DD[T00:00:00Z] */
271                         str = g_strdup_printf("%%DateTime: "
272                                         "%02x%02x-%02x-%02xT00:00:00Z",
273                                         tvb_get_guint8(tvb, offset),
274                                         tvb_get_guint8(tvb, offset + 1),
275                                         tvb_get_guint8(tvb, offset + 2),
276                                         tvb_get_guint8(tvb, offset + 3));
277                         break;
278                 case 5: /* YYYY-MM-DDThh[:00:00Z] */
279                         str = g_strdup_printf("%%DateTime: "
280                                         "%02x%02x-%02x-%02xT%02x:00:00Z",
281                                         tvb_get_guint8(tvb, offset),
282                                         tvb_get_guint8(tvb, offset + 1),
283                                         tvb_get_guint8(tvb, offset + 2),
284                                         tvb_get_guint8(tvb, offset + 3),
285                                         tvb_get_guint8(tvb, offset + 4));
286                         break;
287                 case 6: /* YYYY-MM-DDThh:mm[:00Z] */
288                         str = g_strdup_printf("%%DateTime: "
289                                         "%02x%02x-%02x-%02xT%02x:%02x:00Z",
290                                         tvb_get_guint8(tvb, offset),
291                                         tvb_get_guint8(tvb, offset + 1),
292                                         tvb_get_guint8(tvb, offset + 2),
293                                         tvb_get_guint8(tvb, offset + 3),
294                                         tvb_get_guint8(tvb, offset + 4),
295                                         tvb_get_guint8(tvb, offset + 5));
296                         break;
297                 case 7: /* YYYY-MM-DDThh:mm[:00Z] */
298                         str = g_strdup_printf("%%DateTime: "
299                                         "%02x%02x-%02x-%02xT%02x:%02x:%02xZ",
300                                         tvb_get_guint8(tvb, offset),
301                                         tvb_get_guint8(tvb, offset + 1),
302                                         tvb_get_guint8(tvb, offset + 2),
303                                         tvb_get_guint8(tvb, offset + 3),
304                                         tvb_get_guint8(tvb, offset + 4),
305                                         tvb_get_guint8(tvb, offset + 5),
306                                         tvb_get_guint8(tvb, offset + 6));
307                         break;
308                 default:
309                         str = g_strdup_printf("<Error: invalid binary %%DateTime "
310                                         "(%d bytes of opaque data)>", data_len);
311                         break;
312         }
313
314         return str;
315 }
316
317 /* Is ALWAYS 6 bytes long:
318  * 00YY YYYY  YYYY YYMM  MMDD DDDh  hhhh mmmm  mmss ssss  ZZZZ ZZZZ */
319 static char *
320 wv_datetime_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
321 {
322         char *str;
323         guint16 year;
324         guint8 month, day, hour, minute, second, timezone;
325         guint8 peek;
326
327         if (data_len == 6) { /* Valid */
328
329                 /* Octet 1: 00YY YYYY */
330                 year = tvb_get_guint8(tvb, offset) & 0x3F; /* ..11 1111 */
331                 year <<=6;
332                 /* Octet 2: YYYY YYMM */
333                 peek = tvb_get_guint8(tvb, offset + 1);
334                 year += (peek >> 2); /* 1111 11.. */
335                 month = (peek & 0x03) << 2; /* .... ..11 */
336                 /* Octet 3: MMDD DDDh */
337                 peek = tvb_get_guint8(tvb, offset + 2);
338                 month += (peek >> 6); /* 11.. .... */
339                 day = (peek & 0x3E) >> 1; /* ..11 111. */
340                 hour = (peek & 0x01) << 4; /* .... ...1 */
341                 /* Octet 4: hhhh mmmm */
342                 peek = tvb_get_guint8(tvb, offset + 3);
343                 hour += (peek >> 4);
344                 minute = (peek & 0x0F) << 2; /* .... 1111 */
345                 /* Octet 5: mmss ssss */
346                 peek = tvb_get_guint8(tvb, offset + 4);
347                 minute += (peek >> 6); /* 11.. .... */
348                 second = peek & 0x3F; /* ..11 1111 */
349                 /* octet 6: ZZZZZZZZ */
350                 timezone = tvb_get_guint8(tvb, offset + 5);
351                 /* Now construct the string */
352                 str = g_strdup_printf("WV-CSP DateTime: "
353                                 "%04d-%02d-%02dT%02d:%02d:%02d%c",
354                                 year, month, day, hour, minute, second, timezone);
355         } else { /* Invalid length for a WV-CSP DateTime tag value */
356                 str = g_strdup_printf("<Error: invalid binary WV-CSP DateTime value "
357                                 "(%d bytes of opaque data)>", data_len);
358         }
359         return str;
360 }
361
362 /* WV-CSP integer values for tag content is encoded in a fashion similar
363  * to a Long-Integer in WSP */
364 static char *
365 wv_integer_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
366 {
367         char *str;
368
369         switch (data_len) {
370                 case 1:
371                         str = g_strdup_printf("WV-CSP Integer: %d",
372                                         tvb_get_guint8(tvb, offset));
373                         break;
374                 case 2:
375                         str = g_strdup_printf("WV-CSP Integer: %d",
376                                         tvb_get_ntohs(tvb, offset));
377                         break;
378                 case 3:
379                         str = g_strdup_printf("WV-CSP Integer: %d",
380                                         tvb_get_ntoh24(tvb, offset));
381                         break;
382                 case 4:
383                         str = g_strdup_printf("WV-CSP Integer: %d",
384                                         tvb_get_ntohl(tvb, offset));
385                         break;
386                 default:
387                         str = g_strdup_printf("<Error: invalid binary WV-CSP Integer value "
388                                         "(%d bytes of opaque data)>", data_len);
389                         break;
390         }
391
392         return str;
393 }
394
395 static char *
396 wv_csp10_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
397                 const char *token, guint8 codepage _U_, guint32 *length)
398 {
399         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
400         char *str = NULL;
401
402         if ( token && ( (strcmp(token, "Code") == 0)
403                 || (strcmp(token, "ContentSize") == 0)
404                 || (strcmp(token, "MessageCount") == 0)
405                 || (strcmp(token, "Validity") == 0)
406                 || (strcmp(token, "KeepAliveTime") == 0)
407                 || (strcmp(token, "TimeToLive") == 0)
408                 || (strcmp(token, "AcceptedContentLength") == 0)
409                 || (strcmp(token, "MultiTrans") == 0)
410                 || (strcmp(token, "ParserSize") == 0)
411                 || (strcmp(token, "ServerPollMin") == 0)
412                 || (strcmp(token, "TCPAddress") == 0)
413                 || (strcmp(token, "TCPPort") == 0)
414                 || (strcmp(token, "UDPPort") == 0) ) )
415         {
416                 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
417         }
418         else if ( token && ( strcmp(token, "DateTime") == 0) )
419         {
420                 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
421         }
422
423         if (str == NULL) { /* Error, or not parsed */
424                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
425         }
426         *length += data_len;
427         return str;
428 }
429
430 static char *
431 wv_csp10_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
432                 guint8 token, guint8 codepage, guint32 *length)
433 {
434         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
435         char *str = NULL;
436
437         switch (codepage) {
438                 case 0: /* Common code page */
439                         switch (token) {
440                                 case 0x0B: /* <Code> */
441                                 case 0x0F: /* <ContentSize> */
442                                 case 0x1A: /* <MessageCount> */
443                                 case 0x3C: /* <Validity> */
444                                         str = wv_integer_from_opaque(tvb,
445                                                         offset + *length, data_len);
446                                         break;
447                                 case 0x11: /* <DateTime> */
448                                         str = wv_datetime_from_opaque(tvb,
449                                                         offset + *length, data_len);
450                                         break;
451                                 default:
452                                         break;
453                         }
454                         break;
455                 case 1: /* Access code page */
456                         switch (token) {
457                                 case 0x1C: /* <KeepAliveTime> */
458                                 case 0x32: /* <TimeToLive> */
459                                         str = wv_integer_from_opaque(tvb,
460                                                         offset + *length, data_len);
461                                         break;
462                                 default:
463                                         break;
464                         }
465                 case 3: /* Client capability code page */
466                         switch (token) {
467                                 case 0x06: /* <AcceptedContentLength> */
468                                 case 0x0C: /* <MultiTrans> */
469                                 case 0x0D: /* <ParserSize> */
470                                 case 0x0E: /* <ServerPollMin> */
471                                 case 0x11: /* <TCPAddress> */
472                                 case 0x12: /* <TCPPort> */
473                                 case 0x13: /* <UDPPort> */
474                                         str = wv_integer_from_opaque(tvb,
475                                                         offset + *length, data_len);
476                                         break;
477                                 default:
478                                         break;
479                         }
480                         break;
481                 default:
482                         break;
483         }
484         if (str == NULL) { /* Error, or not parsed */
485                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
486         }
487         *length += data_len;
488
489         return str;
490 }
491
492 static char *
493 wv_csp11_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
494                 const char *token, guint8 codepage _U_, guint32 *length)
495 {
496         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
497         char *str = NULL;
498
499         if ( token && ( (strcmp(token, "Code") == 0)
500                 || (strcmp(token, "ContentSize") == 0)
501                 || (strcmp(token, "MessageCount") == 0)
502                 || (strcmp(token, "Validity") == 0)
503                 || (strcmp(token, "KeepAliveTime") == 0)
504                 || (strcmp(token, "TimeToLive") == 0)
505                 || (strcmp(token, "AcceptedContentLength") == 0)
506                 || (strcmp(token, "MultiTrans") == 0)
507                 || (strcmp(token, "ParserSize") == 0)
508                 || (strcmp(token, "ServerPollMin") == 0)
509                 || (strcmp(token, "TCPPort") == 0)
510                 || (strcmp(token, "UDPPort") == 0) ) )
511         {
512                 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
513         }
514         else
515         if ( token && ( (strcmp(token, "DateTime") == 0)
516                 || (strcmp(token, "DeliveryTime") == 0) ) )
517         {
518                 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
519         }
520
521         if (str == NULL) { /* Error, or not parsed */
522                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
523         }
524         *length += data_len;
525         return str;
526 }
527
528 static char *
529 wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
530                 guint8 token, guint8 codepage, guint32 *length)
531 {
532         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
533         char *str = NULL;
534
535         switch (codepage) {
536                 case 0: /* Common code page */
537                         switch (token) {
538                                 case 0x0B: /* <Code> */
539                                 case 0x0F: /* <ContentSize> */
540                                 case 0x1A: /* <MessageCount> */
541                                 case 0x3C: /* <Validity> */
542                                         str = wv_integer_from_opaque(tvb,
543                                                         offset + *length, data_len);
544                                         break;
545                                 case 0x11: /* <DateTime> */
546                                         str = wv_datetime_from_opaque(tvb,
547                                                         offset + *length, data_len);
548                                         break;
549                                 default:
550                                         break;
551                         }
552                         break;
553                 case 1: /* Access code page */
554                         switch (token) {
555                                 case 0x1C: /* <KeepAliveTime> */
556                                 case 0x32: /* <TimeToLive> */
557                                         str = wv_integer_from_opaque(tvb,
558                                                         offset + *length, data_len);
559                                         break;
560                                 default:
561                                         break;
562                         }
563                 case 3: /* Client capability code page */
564                         switch (token) {
565                                 case 0x06: /* <AcceptedContentLength> */
566                                 case 0x0C: /* <MultiTrans> */
567                                 case 0x0D: /* <ParserSize> */
568                                 case 0x0E: /* <ServerPollMin> */
569                                 case 0x12: /* <TCPPort> */
570                                 case 0x13: /* <UDPPort> */
571                                         str = wv_integer_from_opaque(tvb,
572                                                         offset + *length, data_len);
573                                         break;
574                                 default:
575                                         break;
576                         }
577                         break;
578                 case 6: /* Messaging code page */
579                         switch (token) {
580                                 case 0x1A: /* <DeliveryTime> - not in 1.0 */
581                                         str = wv_datetime_from_opaque(tvb,
582                                                         offset + *length, data_len);
583                                         break;
584                                 default:
585                                         break;
586                         }
587                         break;
588                 default:
589                         break;
590         }
591         if (str == NULL) { /* Error, or not parsed */
592                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
593         }
594         *length += data_len;
595
596         return str;
597 }
598
599 static char *
600 wv_csp12_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
601                 const char *token, guint8 codepage _U_, guint32 *length)
602 {
603         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
604         char *str = NULL;
605
606         if ( token && ( (strcmp(token, "Code") == 0)
607                 || (strcmp(token, "ContentSize") == 0)
608                 || (strcmp(token, "MessageCount") == 0)
609                 || (strcmp(token, "Validity") == 0)
610                 || (strcmp(token, "KeepAliveTime") == 0)
611                 || (strcmp(token, "TimeToLive") == 0)
612                 || (strcmp(token, "AcceptedContentLength") == 0)
613                 || (strcmp(token, "MultiTrans") == 0)
614                 || (strcmp(token, "ParserSize") == 0)
615                 || (strcmp(token, "ServerPollMin") == 0)
616                 || (strcmp(token, "TCPPort") == 0)
617                 || (strcmp(token, "UDPPort") == 0)
618                 || (strcmp(token, "HistoryPeriod") == 0)
619                 || (strcmp(token, "MaxWatcherList") == 0) ) )
620         {
621                 str = wv_integer_from_opaque(tvb, offset + *length, data_len);
622         }
623         else
624         if ( token && ( (strcmp(token, "DateTime") == 0)
625                 || (strcmp(token, "DeliveryTime") == 0) ) )
626         {
627                 str = wv_datetime_from_opaque(tvb, offset + *length, data_len);
628         }
629
630         if (str == NULL) { /* Error, or not parsed */
631                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
632         }
633         *length += data_len;
634         return str;
635 }
636
637 static char *
638 wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
639                 guint8 token, guint8 codepage, guint32 *length)
640 {
641         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
642         char *str = NULL;
643
644         switch (codepage) {
645                 case 0: /* Common code page */
646                         switch (token) {
647                                 case 0x0B: /* <Code> */
648                                 case 0x0F: /* <ContentSize> */
649                                 case 0x1A: /* <MessageCount> */
650                                 case 0x3C: /* <Validity> */
651                                         str = wv_integer_from_opaque(tvb,
652                                                         offset + *length, data_len);
653                                         break;
654                                 case 0x11: /* <DateTime> */
655                                         str = wv_datetime_from_opaque(tvb,
656                                                         offset + *length, data_len);
657                                         break;
658                                 default:
659                                         break;
660                         }
661                         break;
662                 case 1: /* Access code page */
663                         switch (token) {
664                                 case 0x1C: /* <KeepAliveTime> */
665                                 case 0x32: /* <TimeToLive> */
666                                         str = wv_integer_from_opaque(tvb,
667                                                         offset + *length, data_len);
668                                         break;
669                                 default:
670                                         break;
671                         }
672                 case 3: /* Client capability code page */
673                         switch (token) {
674                                 case 0x06: /* <AcceptedContentLength> */
675                                 case 0x0C: /* <MultiTrans> */
676                                 case 0x0D: /* <ParserSize> */
677                                 case 0x0E: /* <ServerPollMin> */
678                                 case 0x12: /* <TCPPort> */
679                                 case 0x13: /* <UDPPort> */
680                                         str = wv_integer_from_opaque(tvb,
681                                                         offset + *length, data_len);
682                                         break;
683                                 default:
684                                         break;
685                         }
686                         break;
687                 case 6: /* Messaging code page */
688                         switch (token) {
689                                 case 0x1A: /* <DeliveryTime> - not in 1.0 */
690                                         str = wv_datetime_from_opaque(tvb,
691                                                         offset + *length, data_len);
692                                         break;
693                                 default:
694                                         break;
695                         }
696                         break;
697                 case 9: /* Common code page (continued) */
698                         switch (token) {
699                                 case 0x08: /* <HistoryPeriod> - 1.2 only */
700                                 case 0x0A: /* <MaxWatcherList> - 1.2 only */
701                                         str = wv_integer_from_opaque(tvb,
702                                                         offset + *length, data_len);
703                                         break;
704                                 default:
705                                         break;
706                         }
707                         break;
708                 default:
709                         break;
710         }
711         if (str == NULL) { /* Error, or not parsed */
712                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
713         }
714         *length += data_len;
715
716         return str;
717 }
718
719 static char *
720 sic10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
721                 const char *token, guint8 codepage _U_, guint32 *length)
722 {
723         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
724         char *str = NULL;
725
726         if ( token && ( (strcmp(token, "created") == 0)
727                 || (strcmp(token, "si-expires") == 0) ) )
728         {
729                 str = date_time_from_opaque(tvb, offset + *length, data_len);
730         }
731         if (str == NULL) { /* Error, or not parsed */
732                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
733         }
734         *length += data_len;
735
736         return str;
737 }
738
739 static char *
740 sic10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
741                 guint8 token, guint8 codepage, guint32 *length)
742 {
743         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
744         char *str = NULL;
745
746         switch (codepage) {
747                 case 0: /* Only valid codepage for SI */
748                         switch (token) {
749                                 case 0x0A: /* created= */
750                                 case 0x10: /* si-expires= */
751                                         str = date_time_from_opaque(tvb,
752                                                         offset + *length, data_len);
753                                         break;
754                                 default:
755                                         break;
756                         }
757                         break;
758                 default:
759                         break;
760         }
761         if (str == NULL) { /* Error, or not parsed */
762                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
763         }
764         *length += data_len;
765
766         return str;
767 }
768
769 static char *
770 emnc10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
771                 const char *token, guint8 codepage _U_, guint32 *length)
772 {
773         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
774         char *str = NULL;
775
776         if ( token && (strcmp(token, "timestamp") == 0) )
777         {
778                 str = date_time_from_opaque(tvb, offset + *length, data_len);
779         }
780         if (str == NULL) { /* Error, or not parsed */
781                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
782         }
783         *length += data_len;
784
785         return str;
786 }
787
788 static char *
789 emnc10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
790                 guint8 token, guint8 codepage, guint32 *length)
791 {
792         guint32 data_len = tvb_get_guintvar(tvb, offset, length);
793         char *str = NULL;
794
795         switch (codepage) {
796                 case 0: /* Only valid codepage for EMN */
797                         switch (token) {
798                                 case 0x05: /* timestamp= */
799                                         str = date_time_from_opaque(tvb,
800                                                         offset + *length, data_len);
801                                         break;
802                                 default:
803                                         break;
804                         }
805                         break;
806                 default:
807                         break;
808         }
809         if (str == NULL) { /* Error, or not parsed */
810                 str = g_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
811         }
812         *length += data_len;
813
814         return str;
815 }
816
817 typedef struct _wbxml_decoding {
818     const char *name;
819     const char *abbrev;
820     ext_t_func_ptr ext_t[3];
821         opaque_token_func_ptr   opaque_binary_tag;
822         opaque_literal_func_ptr opaque_literal_tag;
823         opaque_token_func_ptr   opaque_binary_attr;
824         opaque_literal_func_ptr opaque_literal_attr;
825     const value_valuestring *global;
826     const value_valuestring *tags;
827     const value_valuestring *attrStart;
828     const value_valuestring *attrValue;
829 } wbxml_decoding;
830
831 /* Define a pointer to a discriminator function taking a tvb and the start
832  * offset of the WBXML tokens in the body as arguments.
833  */
834 typedef const wbxml_decoding * (* discriminator_func_ptr)(tvbuff_t *, guint32);
835
836 /* For the decoding lists based on the known WBXML public ID */
837 typedef struct _wbxml_integer_list {
838     guint32 public_id;
839     const wbxml_decoding *map;
840 } wbxml_integer_list;
841
842 /* For the decoding lists on the literal content type */
843 typedef struct _wbxml_literal_list {
844     const char *content_type;
845     discriminator_func_ptr discriminator; /* TODO */
846     const wbxml_decoding *map;
847 } wbxml_literal_list;
848
849 /************************** Variable declarations **************************/
850
851
852 /* Initialize the protocol and registered fields */
853 static int proto_wbxml = -1;
854 static int hf_wbxml_version = -1;
855 static int hf_wbxml_public_id_known = -1;
856 static int hf_wbxml_public_id_literal = -1;
857 static int hf_wbxml_charset = -1;
858
859 /* Initialize the subtree pointers */
860 static gint ett_wbxml = -1;
861 static gint ett_wbxml_str_tbl = -1;
862 static gint ett_wbxml_content = -1;
863
864 /* WBXML Preferences */
865 static gboolean skip_wbxml_token_mapping = FALSE;
866 static gboolean disable_wbxml_token_parsing = FALSE;
867
868
869 /**************** WBXML related declarations and definitions ****************/
870
871
872 /* WBXML public ID mappings. For an up-to-date list, see
873  * http://www.openmobilealliance.org/tech/omna/ */
874 static const value_string vals_wbxml_public_ids[] = {
875         /* 0x00 = literal public identifier */
876         { 0x01, "Unknown / missing Public Identifier" },
877         { 0x02, "-//WAPFORUM//DTD WML 1.0//EN (WML 1.0)" },
878         { 0x03, "-//WAPFORUM//DTD WTA 1.0//EN (WTA Event 1.0) - Deprecated" },
879         { 0x04, "-//WAPFORUM//DTD WML 1.1//EN (WML 1.1)" },
880         { 0x05, "-//WAPFORUM//DTD SI 1.0//EN (Service Indication 1.0)" },
881         { 0x06, "-//WAPFORUM//DTD SL 1.0//EN (Service Loading 1.0)" },
882         { 0x07, "-//WAPFORUM//DTD CO 1.0//EN (Cache Operation 1.0)" },
883         { 0x08, "-//WAPFORUM//DTD CHANNEL 1.1//EN (Channel 1.1)" },
884         { 0x09, "-//WAPFORUM//DTD WML 1.2//EN (WML 1.2)" },
885         { 0x0a, "-//WAPFORUM//DTD WML 1.3//EN (WML 1.3)" },
886         { 0x0b, "-//WAPFORUM//DTD PROV 1.0//EN (Provisioning 1.0)" },
887         { 0x0c, "-//WAPFORUM//DTD WTA-WML 1.2//EN (WTA-WML 1.2)" },
888         { 0x0d, "-//WAPFORUM//DTD EMN 1.0//EN (Email Notification 1.0)" },
889         { 0x0e, "-//WAPFORUM//DTD DRMREL 1.0//EN (DRMREL 1.0)" },
890         { 0x0f, "-//WIRELESSVILLAGE//DTD CSP 1.0//EN"
891                 " (Wireless Village Client-Server Protocol DTD v1.0)" },
892         { 0x10, "-//WIRELESSVILLAGE//DTD CSP 1.1//EN"
893                 " (Wireless Village Client-Server Protocol DTD v1.1)" },
894
895         /* Registered values - www.syncml.org */
896         { 0x0fd1, "-//SYNCML//DTD SyncML 1.0//EN (SyncML 1.0)" },
897         { 0x0fd3, "-//SYNCML//DTD SyncML 1.1//EN (SyncML 1.1)" },
898
899         /* Registered values - www.wapforum.org/wina/ */
900         { 0x1100, "-//PHONE.COM//DTD ALERT 1.0//EN" },
901         { 0x1101, "-//PHONE.COM//DTD CACHE-OPERATION 1.0//EN" },
902         { 0x1102, "-//PHONE.COM//DTD SIGNAL 1.0//EN" },
903         { 0x1103, "-//PHONE.COM//DTD LIST 1.0//EN" },
904         { 0x1104, "-//PHONE.COM//DTD LISTCMD 1.0//EN" },
905         { 0x1105, "-//PHONE.COM//DTD CHANNEL 1.0//EN" },
906         { 0x1106, "-//PHONE.COM//DTD MMC 1.0//EN" },
907         { 0x1107, "-//PHONE.COM//DTD BEARER-CHOICE 1.0//EN" },
908         { 0x1108, "-//PHONE.COM//DTD WML 1.1//EN (WML+ 1.1)" },
909         { 0x1109, "-//PHONE.COM//DTD CHANNEL 1.1//EN" },
910         { 0x110a, "-//PHONE.COM//DTD LIST 1.1//EN" },
911         { 0x110b, "-//PHONE.COM//DTD LISTCMD 1.1//EN" },
912         { 0x110c, "-//PHONE.COM//DTD MMC 1.1//EN" },
913         { 0x110d, "-//PHONE.COM//DTD WML 1.3//EN (WML+ 1.3)" },
914         { 0x110e, "-//PHONE.COM//DTD MMC 2.0//EN" },
915         /* 0x110F -- 0x11FF: unassigned */
916         { 0x1200, "-//3GPP2.COM//DTD IOTA 1.0//EN" },
917
918         { 0x00, NULL }
919 };
920
921 static const value_string vals_wbxml_versions[] = {
922         { 0x00, "1.0" },        /* WAP-104-WBXML */
923         { 0x01, "1.1" },        /* WAP-135-WBXML */
924         { 0x02, "1.2" },        /* WAP-154-WBXML */
925         { 0x03, "1.3" },        /* WAP-192-WBXML */
926
927         { 0x00, NULL }
928 };
929
930 /* WBXML 1.0 global tokens: WAP-104-WBXML
931  * Same token mapping as in vals_wbxml1x_global_tokens, but:
932  *   { 0xC3, "RESERVED_2" }
933  */
934
935 /* WBXML 1.x (x>0) global tokens: WAP-135-WBXML, WAP-154-WBXML, WAP-192-WBXML
936  */
937 static const value_string vals_wbxml1x_global_tokens[] = {
938         { 0x00, "SWITCH_PAGE" },
939         { 0x01, "END" },
940         { 0x02, "ENTITY" },
941         { 0x03, "STR_I" },
942         { 0x04, "LITERAL" },
943
944         { 0x40, "EXT_I_0" },
945         { 0x41, "EXT_I_1" },
946         { 0x42, "EXT_I_2" },
947         { 0x43, "PI" },
948         { 0x44, "LITERAL_C" },
949
950         { 0x80, "EXT_T_0" },
951         { 0x81, "EXT_T_1" },
952         { 0x82, "EXT_T_2" },
953         { 0x83, "STR_T" },
954         { 0x84, "LITERAL_A" },
955
956         { 0xC0, "EXT_0" },
957         { 0xC1, "EXT_1" },
958         { 0xC2, "EXT_2" },
959         { 0xC3, "OPAQUE" },
960         { 0xC4, "LITERAL_AC" },
961
962         { 0x00, NULL }
963 };
964
965
966
967
968
969 /********************** WBXML token mapping definition **********************/
970
971 /*
972  * NOTE: Please make sure the Attribute Start values all contain an equal sign
973  *       even in cases where they do not contain the start of an Attribute
974  *       Value.
975  */
976
977
978 /* WML 1.0
979  *
980  * Wireless Markup Language
981  ***************************************/
982 static char *
983 ext_t_0_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
984 {
985     gint str_len = tvb_strsize (tvb, str_tbl + value);
986     char *str = g_strdup_printf("Variable substitution - escaped: '%s'",
987             tvb_get_ptr(tvb, str_tbl + value, str_len));
988     return str;
989 }
990
991 static char *
992 ext_t_1_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
993 {
994     gint str_len = tvb_strsize (tvb, str_tbl + value);
995     char *str = g_strdup_printf("Variable substitution - unescaped: '%s'",
996             tvb_get_ptr(tvb, str_tbl + value, str_len));
997     return str;
998 }
999
1000 static char *
1001 ext_t_2_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
1002 {
1003     gint str_len = tvb_strsize (tvb, str_tbl + value);
1004     char *str = g_strdup_printf("Variable substitution - no transformation: '%s'",
1005             tvb_get_ptr(tvb, str_tbl + value, str_len));
1006     return str;
1007 }
1008 /*****   Global extension tokens   *****/
1009 static const value_string wbxml_wmlc10_global_cp0[] = {
1010         { 0x40, "Variable substitution - escaped" },
1011         { 0x41, "Variable substitution - unescaped" },
1012         { 0x42, "Variable substitution - no transformation" },
1013         { 0x80, "Variable substitution - escaped" },
1014         { 0x81, "Variable substitution - unescaped" },
1015         { 0x82, "Variable substitution - no transformation" },
1016         { 0xC0, "Reserved" },
1017         { 0xC1, "Reserved" },
1018         { 0xC2, "Reserved" },
1019
1020         { 0x00, NULL }
1021 };
1022
1023 /*****         Tag tokens          *****/
1024 static const value_string wbxml_wmlc10_tags_cp0[] = {
1025         /* 0x00 -- 0x04 GLOBAL */
1026         /* 0x05 -- 0x21 */
1027         { 0x22, "A" },
1028         { 0x23, "ACCESS" },
1029         { 0x24, "B" },
1030         { 0x25, "BIG" },
1031         { 0x26, "BR" },
1032         { 0x27, "CARD" },
1033         { 0x28, "DO" },
1034         { 0x29, "EM" },
1035         { 0x2A, "FIELDSET" },
1036         { 0x2B, "GO" },
1037         { 0x2C, "HEAD" },
1038         { 0x2D, "I" },
1039         { 0x2E, "IMG" },
1040         { 0x2F, "INPUT" },
1041         { 0x30, "META" },
1042         { 0x31, "NOOP" },
1043         { 0x32, "PREV" },
1044         { 0x33, "ONEVENT" },
1045         { 0x34, "OPTGROUP" },
1046         { 0x35, "OPTION" },
1047         { 0x36, "REFRESH" },
1048         { 0x37, "SELECT" },
1049         { 0x38, "SMALL" },
1050         { 0x39, "STRONG" },
1051         { 0x3A, "TAB" },
1052         { 0x3B, "TEMPLATE" },
1053         { 0x3C, "TIMER" },
1054         { 0x3D, "U" },
1055         { 0x3E, "VAR" },
1056         { 0x3F, "WML" },
1057
1058         { 0x00, NULL }
1059 };
1060
1061 /*****    Attribute Start tokens   *****/
1062 static const value_string wbxml_wmlc10_attrStart_cp0[] = {
1063         /* 0x00 -- 0x04 GLOBAL */
1064         { 0x05, "ACCEPT-CHARSET=" },
1065         { 0x06, "ALIGN='BOTTOM'" },
1066         { 0x07, "ALIGN='CENTER'" },
1067         { 0x08, "ALIGN='LEFT'" },
1068         { 0x09, "ALIGN='MIDDLE'" },
1069         { 0x0A, "ALIGN='RIGHT'" },
1070         { 0x0B, "ALIGN='TOP'" },
1071         { 0x0C, "ALT=" },
1072         { 0x0D, "CONTENT=" },
1073         { 0x0E, "DEFAULT=" },
1074         { 0x0F, "DOMAIN=" },
1075         { 0x10, "EMPTYOK='FALSE'" },
1076         { 0x11, "EMPTYOK='TRUE'" },
1077         { 0x12, "FORMAT=" },
1078         { 0x13, "HEIGHT=" },
1079         { 0x14, "HSPACE=" },
1080         { 0x15, "IDEFAULT=" },
1081         { 0x16, "IKEY=" },
1082         { 0x17, "KEY=" },
1083         { 0x18, "LABEL=" },
1084         { 0x19, "LOCALSRC=" },
1085         { 0x1A, "MAXLENGTH=" },
1086         { 0x1B, "METHOD='GET'" },
1087         { 0x1C, "METHOD='POST'" },
1088         { 0x1D, "MODE='NOWRAP'" },
1089         { 0x1E, "MODE='WRAP'" },
1090         { 0x1F, "MULTIPLE='FALSE'" },
1091         { 0x20, "MULTIPLE='TRUE'" },
1092         { 0x21, "NAME=" },
1093         { 0x22, "NEWCONTEXT='FALSE'" },
1094         { 0x23, "NEWCONTEXT='TRUE'" },
1095         { 0x24, "ONCLICK=" },
1096         { 0x25, "ONENTERBACKWARD=" },
1097         { 0x26, "ONENTERFORWARD=" },
1098         { 0x27, "ONTIMER=" },
1099         { 0x28, "OPTIONAL='FALSE'" },
1100         { 0x29, "OPTIONAL='TRUE'" },
1101         { 0x2A, "PATH=" },
1102         { 0x2B, "POSTDATA=" },
1103         { 0x2C, "PUBLIC='FALSE'" },
1104         { 0x2D, "PUBLIC='TRUE'" },
1105         { 0x2E, "SCHEME=" },
1106         { 0x2F, "SENDREFERER='FALSE'" },
1107         { 0x30, "SENDREFERER='TRUE'" },
1108         { 0x31, "SIZE=" },
1109         { 0x32, "SRC=" },
1110         { 0x33, "STYLE='LIST'" },
1111         { 0x34, "STYLE='SET'" },
1112         { 0x35, "TABINDEX=" },
1113         { 0x36, "TITLE=" },
1114         { 0x37, "TYPE=" },
1115         { 0x38, "TYPE='ACCEPT'" },
1116         { 0x39, "TYPE='DELETE'" },
1117         { 0x3A, "TYPE='HELP'" },
1118         { 0x3B, "TYPE='PASSWORD'" },
1119         { 0x3C, "TYPE='ONCLICK'" },
1120         { 0x3D, "TYPE='ONENTERBACKWARD'" },
1121         { 0x3E, "TYPE='ONENTERFORWARD'" },
1122         { 0x3F, "TYPE='ONTIMER'" },
1123         /* 0x40 -- 0x44 GLOBAL */
1124         { 0x45, "TYPE='OPTIONS'" },
1125         { 0x46, "TYPE='PREV'" },
1126         { 0x47, "TYPE='RESET'" },
1127         { 0x48, "TYPE='TEXT'" },
1128         { 0x49, "TYPE='vnd.'" },
1129         { 0x4A, "URL=" },
1130         { 0x4B, "URL='http://'" },
1131         { 0x4C, "URL='https://'" },
1132         { 0x4D, "USER-AGENT=" },
1133         { 0x4E, "VALUE=" },
1134         { 0x4F, "VSPACE=" },
1135         { 0x50, "WIDTH=" },
1136         { 0x51, "xml:lang=" },
1137
1138         { 0x00, NULL }
1139 };
1140
1141 /*****    Attribute Value tokens   *****/
1142 static const value_string wbxml_wmlc10_attrValue_cp0[] = {
1143         /* 0x80 -- 0x84 GLOBAL */
1144         { 0x85, "'.com/'" },
1145         { 0x86, "'.edu/'" },
1146         { 0x87, "'.net/'" },
1147         { 0x88, "'.org/'" },
1148         { 0x89, "'ACCEPT'" },
1149         { 0x8A, "'BOTTOM'" },
1150         { 0x8B, "'CLEAR'" },
1151         { 0x8C, "'DELETE'" },
1152         { 0x8D, "'HELP'" },
1153         { 0x8E, "'http://'" },
1154         { 0x8F, "'http://www.'" },
1155         { 0x90, "'https://'" },
1156         { 0x91, "'https://www.'" },
1157         { 0x92, "'LIST'" },
1158         { 0x93, "'MIDDLE'" },
1159         { 0x94, "'NOWRAP'" },
1160         { 0x95, "'ONCLICK'" },
1161         { 0x96, "'ONENTERBACKWARD'" },
1162         { 0x97, "'ONENTERFORWARD'" },
1163         { 0x98, "'ONTIMER'" },
1164         { 0x99, "'OPTIONS'" },
1165         { 0x9A, "'PASSWORD'" },
1166         { 0x9B, "'RESET'" },
1167         { 0x9C, "'SET'" },
1168         { 0x9D, "'TEXT'" },
1169         { 0x9E, "'TOP'" },
1170         { 0x9F, "'UNKNOWN'" },
1171         { 0xA0, "'WRAP'" },
1172         { 0xA1, "'www.'" },
1173
1174         { 0x00, NULL }
1175 };
1176
1177 /***** Token code page aggregation *****/
1178 static const value_valuestring wbxml_wmlc10_global[] = {
1179         { 0, wbxml_wmlc10_global_cp0 },
1180         { 0, NULL }
1181 };
1182
1183 static const value_valuestring wbxml_wmlc10_tags[] = {
1184         { 0, wbxml_wmlc10_tags_cp0 },
1185         { 0, NULL }
1186 };
1187
1188 static const value_valuestring wbxml_wmlc10_attrStart[] = {
1189         { 0, wbxml_wmlc10_attrStart_cp0 },
1190         { 0, NULL }
1191 };
1192
1193 static const value_valuestring wbxml_wmlc10_attrValue[] = {
1194         { 0, wbxml_wmlc10_attrValue_cp0 },
1195         { 0, NULL }
1196 };
1197
1198 static const wbxml_decoding decode_wmlc_10 = {
1199     "Wireless Markup Language 1.0",
1200     "WML 1.0",
1201     { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 },
1202         default_opaque_binary_tag,
1203         default_opaque_literal_tag,
1204         default_opaque_binary_attr,
1205         default_opaque_literal_attr,
1206     wbxml_wmlc10_global,
1207     wbxml_wmlc10_tags,
1208     wbxml_wmlc10_attrStart,
1209     wbxml_wmlc10_attrValue
1210 };
1211
1212
1213
1214
1215 /* WML 1.1
1216  *
1217  * Wireless Markup Language
1218  ***************************************/
1219
1220 /*****   Global extension tokens   *****/
1221 /* Same as in WML 1.0 */
1222
1223 /*****         Tag tokens          *****/
1224 static const value_string wbxml_wmlc11_tags_cp0[] = {
1225         /* 0x00 -- 0x04 GLOBAL */
1226         /* 0x05 -- 0x1B */
1227         { 0x1C, "a" },
1228         { 0x1D, "td" },
1229         { 0x1E, "tr" },
1230         { 0x1F, "table" },
1231         { 0x20, "p" },
1232         { 0x21, "postfield" },
1233         { 0x22, "anchor" },
1234         { 0x23, "access" },
1235         { 0x24, "b" },
1236         { 0x25, "big" },
1237         { 0x26, "br" },
1238         { 0x27, "card" },
1239         { 0x28, "do" },
1240         { 0x29, "em" },
1241         { 0x2A, "fieldset" },
1242         { 0x2B, "go" },
1243         { 0x2C, "head" },
1244         { 0x2D, "i" },
1245         { 0x2E, "img" },
1246         { 0x2F, "input" },
1247         { 0x30, "meta" },
1248         { 0x31, "noop" },
1249         { 0x32, "prev" },
1250         { 0x33, "onevent" },
1251         { 0x34, "optgroup" },
1252         { 0x35, "option" },
1253         { 0x36, "refresh" },
1254         { 0x37, "select" },
1255         { 0x38, "small" },
1256         { 0x39, "strong" },
1257         /* 0x3A */
1258         { 0x3B, "template" },
1259         { 0x3C, "timer" },
1260         { 0x3D, "u" },
1261         { 0x3E, "setvar" },
1262         { 0x3F, "wml" },
1263
1264         { 0x00, NULL }
1265 };
1266
1267 /*****    Attribute Start tokens   *****/
1268 static const value_string wbxml_wmlc11_attrStart_cp0[] = {
1269         /* 0x00 -- 0x04 GLOBAL */
1270         { 0x05, "accept-charset=" },
1271         { 0x06, "align='bottom'" },
1272         { 0x07, "align='center'" },
1273         { 0x08, "align='left'" },
1274         { 0x09, "align='middle'" },
1275         { 0x0A, "align='right'" },
1276         { 0x0B, "align='top'" },
1277         { 0x0C, "alt=" },
1278         { 0x0D, "content=" },
1279         /* 0x0E */
1280         { 0x0F, "domain=" },
1281         { 0x10, "emptyok='false'" },
1282         { 0x11, "emptyok='true'" },
1283         { 0x12, "format=" },
1284         { 0x13, "height=" },
1285         { 0x14, "hspace=" },
1286         { 0x15, "ivalue=" },
1287         { 0x16, "iname=" },
1288         /* 0x17 */
1289         { 0x18, "label=" },
1290         { 0x19, "localsrc=" },
1291         { 0x1A, "maxlength=" },
1292         { 0x1B, "method='get'" },
1293         { 0x1C, "method='post'" },
1294         { 0x1D, "mode='nowrap'" },
1295         { 0x1E, "mode='wrap'" },
1296         { 0x1F, "multiple='false'" },
1297         { 0x20, "multiple='true'" },
1298         { 0x21, "name=" },
1299         { 0x22, "newcontext='false'" },
1300         { 0x23, "newcontext='true'" },
1301         { 0x24, "onpick=" },
1302         { 0x25, "onenterbackward=" },
1303         { 0x26, "onenterforward=" },
1304         { 0x27, "ontimer=" },
1305         { 0x28, "optional='false'" },
1306         { 0x29, "optional='true'" },
1307         { 0x2A, "path=" },
1308         /* 0x2B -- 0x2D */
1309         { 0x2E, "scheme=" },
1310         { 0x2F, "sendreferer='false'" },
1311         { 0x30, "sendreferer='true'" },
1312         { 0x31, "size=" },
1313         { 0x32, "src=" },
1314         { 0x33, "ordered='false'" },
1315         { 0x34, "ordered='true'" },
1316         { 0x35, "tabindex=" },
1317         { 0x36, "title=" },
1318         { 0x37, "type=" },
1319         { 0x38, "type='accept'" },
1320         { 0x39, "type='delete'" },
1321         { 0x3A, "type='help'" },
1322         { 0x3B, "type='password'" },
1323         { 0x3C, "type='onpick'" },
1324         { 0x3D, "type='onenterbackward'" },
1325         { 0x3E, "type='onenterforward'" },
1326         { 0x3F, "type='ontimer'" },
1327         /* 0x40 -- 0x44 GLOBAL */
1328         { 0x45, "type='options'" },
1329         { 0x46, "type='prev'" },
1330         { 0x47, "type='reset'" },
1331         { 0x48, "type='text'" },
1332         { 0x49, "type='vnd.'" },
1333         { 0x4A, "href=" },
1334         { 0x4B, "href='http://'" },
1335         { 0x4C, "href='https://'" },
1336         { 0x4D, "value=" },
1337         { 0x4E, "vspace=" },
1338         { 0x4F, "width=" },
1339         { 0x50, "xml:lang=" },
1340         /* 0x51 */
1341         { 0x52, "align=" },
1342         { 0x53, "columns=" },
1343         { 0x54, "class=" },
1344         { 0x55, "id=" },
1345         { 0x56, "forua='false'" },
1346         { 0x57, "forua='true'" },
1347         { 0x58, "src='http://'" },
1348         { 0x59, "src='https://'" },
1349         { 0x5A, "http-equiv=" },
1350         { 0x5B, "http-equiv='Content-Type'" },
1351         { 0x5C, "content='application/vnd.wap.wmlc;charset='" },
1352         { 0x5D, "http-equiv='Expires'" },
1353
1354         { 0x00, NULL }
1355 };
1356
1357 /*****    Attribute Value tokens   *****/
1358 static const value_string wbxml_wmlc11_attrValue_cp0[] = {
1359         /* 0x80 -- 0x84 GLOBAL */
1360         { 0x85, "'.com/'" },
1361         { 0x86, "'.edu/'" },
1362         { 0x87, "'.net/'" },
1363         { 0x88, "'.org/'" },
1364         { 0x89, "'accept'" },
1365         { 0x8A, "'bottom'" },
1366         { 0x8B, "'clear'" },
1367         { 0x8C, "'delete'" },
1368         { 0x8D, "'help'" },
1369         { 0x8E, "'http://'" },
1370         { 0x8F, "'http://www.'" },
1371         { 0x90, "'https://'" },
1372         { 0x91, "'https://www.'" },
1373         /* 0x92 */
1374         { 0x93, "'middle'" },
1375         { 0x94, "'nowrap'" },
1376         { 0x95, "'onpick'" },
1377         { 0x96, "'onenterbackward'" },
1378         { 0x97, "'onenterforward'" },
1379         { 0x98, "'ontimer'" },
1380         { 0x99, "'options'" },
1381         { 0x9A, "'password'" },
1382         { 0x9B, "'reset'" },
1383         /* 0x9C */
1384         { 0x9D, "'text'" },
1385         { 0x9E, "'top'" },
1386         { 0x9F, "'unknown'" },
1387         { 0xA0, "'wrap'" },
1388         { 0xA1, "'www.'" },
1389
1390         { 0x00, NULL }
1391 };
1392
1393 /***** Token code page aggregation *****/
1394 static const value_valuestring wbxml_wmlc11_global[] = {
1395         { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */
1396         { 0, NULL }
1397 };
1398
1399 static const value_valuestring wbxml_wmlc11_tags[] = {
1400         { 0, wbxml_wmlc11_tags_cp0 },
1401         { 0, NULL }
1402 };
1403
1404 static const value_valuestring wbxml_wmlc11_attrStart[] = {
1405         { 0, wbxml_wmlc11_attrStart_cp0 },
1406         { 0, NULL }
1407 };
1408
1409 static const value_valuestring wbxml_wmlc11_attrValue[] = {
1410         { 0, wbxml_wmlc11_attrValue_cp0 },
1411         { 0, NULL }
1412 };
1413
1414 static const wbxml_decoding decode_wmlc_11 = {
1415     "Wireless Markup Language 1.1",
1416     "WML 1.1",
1417     { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 },
1418         default_opaque_binary_tag,
1419         default_opaque_literal_tag,
1420         default_opaque_binary_attr,
1421         default_opaque_literal_attr,
1422     wbxml_wmlc11_global,
1423     wbxml_wmlc11_tags,
1424     wbxml_wmlc11_attrStart,
1425     wbxml_wmlc11_attrValue
1426 };
1427
1428
1429
1430
1431
1432 /* WML 1.2
1433  *
1434  * Wireless Markup Language
1435  ***************************************/
1436
1437 /*****   Global extension tokens   *****/
1438 /* Same as in WML 1.0 */
1439
1440 /*****         Tag tokens          *****/
1441 static const value_string wbxml_wmlc12_tags_cp0[] = {
1442         /* 0x00 -- 0x04 GLOBAL */
1443         /* 0x05 -- 0x1A */
1444         { 0x1B, "pre" },
1445         { 0x1C, "a" },
1446         { 0x1D, "td" },
1447         { 0x1E, "tr" },
1448         { 0x1F, "table" },
1449         { 0x20, "p" },
1450         { 0x21, "postfield" },
1451         { 0x22, "anchor" },
1452         { 0x23, "access" },
1453         { 0x24, "b" },
1454         { 0x25, "big" },
1455         { 0x26, "br" },
1456         { 0x27, "card" },
1457         { 0x28, "do" },
1458         { 0x29, "em" },
1459         { 0x2A, "fieldset" },
1460         { 0x2B, "go" },
1461         { 0x2C, "head" },
1462         { 0x2D, "i" },
1463         { 0x2E, "img" },
1464         { 0x2F, "input" },
1465         { 0x30, "meta" },
1466         { 0x31, "noop" },
1467         { 0x32, "prev" },
1468         { 0x33, "onevent" },
1469         { 0x34, "optgroup" },
1470         { 0x35, "option" },
1471         { 0x36, "refresh" },
1472         { 0x37, "select" },
1473         { 0x38, "small" },
1474         { 0x39, "strong" },
1475         /* 0x3A */
1476         { 0x3B, "template" },
1477         { 0x3C, "timer" },
1478         { 0x3D, "u" },
1479         { 0x3E, "setvar" },
1480         { 0x3F, "wml" },
1481
1482         { 0x00, NULL }
1483 };
1484
1485 /*****    Attribute Start tokens   *****/
1486 static const value_string wbxml_wmlc12_attrStart_cp0[] = {
1487         /* 0x00 -- 0x04 GLOBAL */
1488         { 0x05, "accept-charset=" },
1489         { 0x06, "align='bottom'" },
1490         { 0x07, "align='center'" },
1491         { 0x08, "align='left'" },
1492         { 0x09, "align='middle'" },
1493         { 0x0A, "align='right'" },
1494         { 0x0B, "align='top'" },
1495         { 0x0C, "alt=" },
1496         { 0x0D, "content=" },
1497         /* 0x0E */
1498         { 0x0F, "domain=" },
1499         { 0x10, "emptyok='false'" },
1500         { 0x11, "emptyok='true'" },
1501         { 0x12, "format=" },
1502         { 0x13, "height=" },
1503         { 0x14, "hspace=" },
1504         { 0x15, "ivalue=" },
1505         { 0x16, "iname=" },
1506         /* 0x17 */
1507         { 0x18, "label=" },
1508         { 0x19, "localsrc=" },
1509         { 0x1A, "maxlength=" },
1510         { 0x1B, "method='get'" },
1511         { 0x1C, "method='post'" },
1512         { 0x1D, "mode='nowrap'" },
1513         { 0x1E, "mode='wrap'" },
1514         { 0x1F, "multiple='false'" },
1515         { 0x20, "multiple='true'" },
1516         { 0x21, "name=" },
1517         { 0x22, "newcontext='false'" },
1518         { 0x23, "newcontext='true'" },
1519         { 0x24, "onpick=" },
1520         { 0x25, "onenterbackward=" },
1521         { 0x26, "onenterforward=" },
1522         { 0x27, "ontimer=" },
1523         { 0x28, "optional='false'" },
1524         { 0x29, "optional='true'" },
1525         { 0x2A, "path=" },
1526         /* 0x2B -- 0x2D */
1527         { 0x2E, "scheme=" },
1528         { 0x2F, "sendreferer='false'" },
1529         { 0x30, "sendreferer='true'" },
1530         { 0x31, "size=" },
1531         { 0x32, "src=" },
1532         { 0x33, "ordered='false'" },
1533         { 0x34, "ordered='true'" },
1534         { 0x35, "tabindex=" },
1535         { 0x36, "title=" },
1536         { 0x37, "type=" },
1537         { 0x38, "type='accept'" },
1538         { 0x39, "type='delete'" },
1539         { 0x3A, "type='help'" },
1540         { 0x3B, "type='password'" },
1541         { 0x3C, "type='onpick'" },
1542         { 0x3D, "type='onenterbackward'" },
1543         { 0x3E, "type='onenterforward'" },
1544         { 0x3F, "type='ontimer'" },
1545         /* 0x40 -- 0x44 GLOBAL */
1546         { 0x45, "type='options'" },
1547         { 0x46, "type='prev'" },
1548         { 0x47, "type='reset'" },
1549         { 0x48, "type='text'" },
1550         { 0x49, "type='vnd.'" },
1551         { 0x4A, "href=" },
1552         { 0x4B, "href='http://'" },
1553         { 0x4C, "href='https://'" },
1554         { 0x4D, "value=" },
1555         { 0x4E, "vspace=" },
1556         { 0x4F, "width=" },
1557         { 0x50, "xml:lang=" },
1558         /* 0x51 */
1559         { 0x52, "align=" },
1560         { 0x53, "columns=" },
1561         { 0x54, "class=" },
1562         { 0x55, "id=" },
1563         { 0x56, "forua='false'" },
1564         { 0x57, "forua='true'" },
1565         { 0x58, "src='http://'" },
1566         { 0x59, "src='https://'" },
1567         { 0x5A, "http-equiv=" },
1568         { 0x5B, "http-equiv='Content-Type'" },
1569         { 0x5C, "content='application/vnd.wap.wmlc;charset='" },
1570         { 0x5D, "http-equiv='Expires'" },
1571         { 0x5E, "accesskey=" },
1572         { 0x5F, "enctype=" },
1573         { 0x60, "enctype='application/x-www-form-urlencoded'" },
1574         { 0x61, "enctype='multipart/form-data'" },
1575
1576         { 0x00, NULL }
1577 };
1578
1579 /*****    Attribute Value tokens   *****/
1580 /* Same as in WML 1.1 */
1581
1582 /***** Token code page aggregation *****/
1583 static const value_valuestring wbxml_wmlc12_global[] = {
1584         { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */
1585         { 0, NULL }
1586 };
1587
1588 static const value_valuestring wbxml_wmlc12_tags[] = {
1589         { 0, wbxml_wmlc12_tags_cp0 },
1590         { 0, NULL }
1591 };
1592
1593 static const value_valuestring wbxml_wmlc12_attrStart[] = {
1594         { 0, wbxml_wmlc12_attrStart_cp0 },
1595         { 0, NULL }
1596 };
1597
1598 static const value_valuestring wbxml_wmlc12_attrValue[] = {
1599         { 0, wbxml_wmlc11_attrValue_cp0 }, /* Same as WML 1.1 */
1600         { 0, NULL }
1601 };
1602
1603 static const wbxml_decoding decode_wmlc_12 = {
1604     "Wireless Markup Language 1.2",
1605     "WML 1.2",
1606     { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 },
1607         default_opaque_binary_tag,
1608         default_opaque_literal_tag,
1609         default_opaque_binary_attr,
1610         default_opaque_literal_attr,
1611     wbxml_wmlc12_global,
1612     wbxml_wmlc12_tags,
1613     wbxml_wmlc12_attrStart,
1614     wbxml_wmlc12_attrValue
1615 };
1616
1617
1618
1619
1620
1621 /* WML 1.3
1622  *
1623  * Wireless Markup Language
1624  ***************************************/
1625
1626 /*****   Global extension tokens   *****/
1627 /* Same as in WML 1.0 */
1628
1629 /*****         Tag tokens          *****/
1630 /* Same as in WML 1.2 */
1631
1632 /*****    Attribute Start tokens   *****/
1633 static const value_string wbxml_wmlc13_attrStart_cp0[] = {
1634         /* 0x00 -- 0x04 GLOBAL */
1635         { 0x05, "accept-charset=" },
1636         { 0x06, "align='bottom'" },
1637         { 0x07, "align='center'" },
1638         { 0x08, "align='left'" },
1639         { 0x09, "align='middle'" },
1640         { 0x0A, "align='right'" },
1641         { 0x0B, "align='top'" },
1642         { 0x0C, "alt=" },
1643         { 0x0D, "content=" },
1644         /* 0x0E */
1645         { 0x0F, "domain=" },
1646         { 0x10, "emptyok='false'" },
1647         { 0x11, "emptyok='true'" },
1648         { 0x12, "format=" },
1649         { 0x13, "height=" },
1650         { 0x14, "hspace=" },
1651         { 0x15, "ivalue=" },
1652         { 0x16, "iname=" },
1653         /* 0x17 */
1654         { 0x18, "label=" },
1655         { 0x19, "localsrc=" },
1656         { 0x1A, "maxlength=" },
1657         { 0x1B, "method='get'" },
1658         { 0x1C, "method='post'" },
1659         { 0x1D, "mode='nowrap'" },
1660         { 0x1E, "mode='wrap'" },
1661         { 0x1F, "multiple='false'" },
1662         { 0x20, "multiple='true'" },
1663         { 0x21, "name=" },
1664         { 0x22, "newcontext='false'" },
1665         { 0x23, "newcontext='true'" },
1666         { 0x24, "onpick=" },
1667         { 0x25, "onenterbackward=" },
1668         { 0x26, "onenterforward=" },
1669         { 0x27, "ontimer=" },
1670         { 0x28, "optional='false'" },
1671         { 0x29, "optional='true'" },
1672         { 0x2A, "path=" },
1673         /* 0x2B -- 0x2D */
1674         { 0x2E, "scheme=" },
1675         { 0x2F, "sendreferer='false'" },
1676         { 0x30, "sendreferer='true'" },
1677         { 0x31, "size=" },
1678         { 0x32, "src=" },
1679         { 0x33, "ordered='false'" },
1680         { 0x34, "ordered='true'" },
1681         { 0x35, "tabindex=" },
1682         { 0x36, "title=" },
1683         { 0x37, "type=" },
1684         { 0x38, "type='accept'" },
1685         { 0x39, "type='delete'" },
1686         { 0x3A, "type='help'" },
1687         { 0x3B, "type='password'" },
1688         { 0x3C, "type='onpick'" },
1689         { 0x3D, "type='onenterbackward'" },
1690         { 0x3E, "type='onenterforward'" },
1691         { 0x3F, "type='ontimer'" },
1692         /* 0x40 -- 0x44 GLOBAL */
1693         { 0x45, "type='options'" },
1694         { 0x46, "type='prev'" },
1695         { 0x47, "type='reset'" },
1696         { 0x48, "type='text'" },
1697         { 0x49, "type='vnd.'" },
1698         { 0x4A, "href=" },
1699         { 0x4B, "href='http://'" },
1700         { 0x4C, "href='https://'" },
1701         { 0x4D, "value=" },
1702         { 0x4E, "vspace=" },
1703         { 0x4F, "width=" },
1704         { 0x50, "xml:lang=" },
1705         /* 0x51 */
1706         { 0x52, "align=" },
1707         { 0x53, "columns=" },
1708         { 0x54, "class=" },
1709         { 0x55, "id=" },
1710         { 0x56, "forua='false'" },
1711         { 0x57, "forua='true'" },
1712         { 0x58, "src='http://'" },
1713         { 0x59, "src='https://'" },
1714         { 0x5A, "http-equiv=" },
1715         { 0x5B, "http-equiv='Content-Type'" },
1716         { 0x5C, "content='application/vnd.wap.wmlc;charset='" },
1717         { 0x5D, "http-equiv='Expires'" },
1718         { 0x5E, "accesskey=" },
1719         { 0x5F, "enctype=" },
1720         { 0x60, "enctype='application/x-www-form-urlencoded'" },
1721         { 0x61, "enctype='multipart/form-data'" },
1722         { 0x62, "xml:space='preserve'" },
1723         { 0x63, "xml:space='default'" },
1724         { 0x64, "cache-control='no-cache'" },
1725
1726         { 0x00, NULL }
1727 };
1728
1729 /*****    Attribute Value tokens   *****/
1730 /* Same as in WML 1.1 */
1731
1732 /***** Token code page aggregation *****/
1733 static const value_valuestring wbxml_wmlc13_global[] = {
1734         { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */
1735         { 0, NULL }
1736 };
1737
1738 static const value_valuestring wbxml_wmlc13_tags[] = {
1739         { 0, wbxml_wmlc12_tags_cp0 },
1740         { 0, NULL }
1741 };
1742
1743 static const value_valuestring wbxml_wmlc13_attrStart[] = {
1744         { 0, wbxml_wmlc13_attrStart_cp0 },
1745         { 0, NULL }
1746 };
1747
1748 static const value_valuestring wbxml_wmlc13_attrValue[] = {
1749         { 0, wbxml_wmlc11_attrValue_cp0 }, /* Same as WML 1.1 */
1750         { 0, NULL }
1751 };
1752
1753 static const wbxml_decoding decode_wmlc_13 = {
1754     "Wireless Markup Language 1.3",
1755     "WML 1.3",
1756     { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 },
1757         default_opaque_binary_tag,
1758         default_opaque_literal_tag,
1759         default_opaque_binary_attr,
1760         default_opaque_literal_attr,
1761     wbxml_wmlc13_global,
1762     wbxml_wmlc13_tags,
1763     wbxml_wmlc13_attrStart,
1764     wbxml_wmlc13_attrValue
1765 };
1766
1767
1768
1769
1770
1771 /* SI 1.0
1772  *
1773  * Service Indication
1774  ***************************************/
1775
1776 /*****   Global extension tokens   *****/
1777
1778 /*****         Tag tokens          *****/
1779 static const value_string wbxml_sic10_tags_cp0[] = {
1780         /* 0x00 -- 0x04 GLOBAL */
1781         { 0x05, "si" },
1782         { 0x06, "indication" },
1783         { 0x07, "info" },
1784         { 0x08, "item" },
1785
1786         { 0x00, NULL }
1787 };
1788
1789 /*****    Attribute Start tokens   *****/
1790 static const value_string wbxml_sic10_attrStart_cp0[] = {
1791         /* 0x00 -- 0x04 GLOBAL */
1792         { 0x05, "action='signal-none'" },
1793         { 0x06, "action='signal-low'" },
1794         { 0x07, "action='signal-medium'" },
1795         { 0x08, "action='signal-high'" },
1796         { 0x09, "action='delete'" },
1797         { 0x0a, "created=" },
1798         { 0x0b, "href=" },
1799         { 0x0c, "href='http://'" },
1800         { 0x0d, "href='http://www.'" },
1801         { 0x0e, "href='https://'" },
1802         { 0x0f, "href='https://www.'" },
1803         { 0x10, "si-expires=" },
1804         { 0x11, "si-id=" },
1805         { 0x12, "class=" },
1806
1807         { 0x00, NULL }
1808 };
1809
1810 /*****    Attribute Value tokens   *****/
1811 static const value_string wbxml_sic10_attrValue_cp0[] = {
1812         /* 0x80 -- 0x84 GLOBAL */
1813         { 0x85, "'.com/'" },
1814         { 0x86, "'.edu/'" },
1815         { 0x87, "'.net/'" },
1816         { 0x88, "'.org/'" },
1817
1818         { 0x00, NULL }
1819 };
1820
1821 /***** Token code page aggregation *****/
1822 static const value_valuestring wbxml_sic10_tags[] = {
1823         { 0, wbxml_sic10_tags_cp0 },
1824         { 0, NULL }
1825 };
1826
1827 static const value_valuestring wbxml_sic10_attrStart[] = {
1828         { 0, wbxml_sic10_attrStart_cp0 },
1829         { 0, NULL }
1830 };
1831
1832 static const value_valuestring wbxml_sic10_attrValue[] = {
1833         { 0, wbxml_sic10_attrValue_cp0 },
1834         { 0, NULL }
1835 };
1836
1837 static const wbxml_decoding decode_sic_10 = {
1838     "Service Indication 1.0",
1839     "SI 1.0",
1840     { NULL, NULL, NULL },
1841         default_opaque_binary_tag,
1842         default_opaque_literal_tag,
1843         sic10_opaque_binary_attr,
1844         sic10_opaque_literal_attr,
1845     NULL,
1846     wbxml_sic10_tags,
1847     wbxml_sic10_attrStart,
1848     wbxml_sic10_attrValue
1849 };
1850
1851
1852
1853
1854
1855 /* SL 1.0
1856  *
1857  * Service Loading
1858  ***************************************/
1859
1860 /*****   Global extension tokens   *****/
1861
1862 /*****         Tag tokens          *****/
1863 static const value_string wbxml_slc10_tags_cp0[] = {
1864         /* 0x00 -- 0x04 GLOBAL */
1865         { 0x05, "sl" },
1866
1867         { 0x00, NULL }
1868 };
1869
1870 /*****    Attribute Start tokens   *****/
1871 static const value_string wbxml_slc10_attrStart_cp0[] = {
1872         /* 0x00 -- 0x04 GLOBAL */
1873         { 0x05, "action='execute-low'" },
1874         { 0x06, "action='execute-high'" },
1875         { 0x07, "action='cache'" },
1876         { 0x08, "href=" },
1877         { 0x09, "href='http://'" },
1878         { 0x0a, "href='http://www.'" },
1879         { 0x0b, "href='https://'" },
1880         { 0x0c, "href='https://www.'" },
1881
1882         { 0x00, NULL }
1883 };
1884
1885 /*****    Attribute Value tokens   *****/
1886 /* Same as in SI 1.0 */
1887
1888 /***** Token code page aggregation *****/
1889 static const value_valuestring wbxml_slc10_tags[] = {
1890         { 0, wbxml_slc10_tags_cp0 },
1891         { 0, NULL }
1892 };
1893
1894 static const value_valuestring wbxml_slc10_attrStart[] = {
1895         { 0, wbxml_slc10_attrStart_cp0 },
1896         { 0, NULL }
1897 };
1898
1899 static const value_valuestring wbxml_slc10_attrValue[] = {
1900         { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */
1901         { 0, NULL }
1902 };
1903
1904 static const wbxml_decoding decode_slc_10 = {
1905     "Service Loading 1.0",
1906     "SL 1.0",
1907     { NULL, NULL, NULL },
1908         default_opaque_binary_tag,
1909         default_opaque_literal_tag,
1910         default_opaque_binary_attr,
1911         default_opaque_literal_attr,
1912     NULL,
1913     wbxml_slc10_tags,
1914     wbxml_slc10_attrStart,
1915     wbxml_slc10_attrValue
1916 };
1917
1918
1919
1920
1921
1922 /* CO 1.0
1923  *
1924  * Cache Operation
1925  ***************************************/
1926
1927 /*****   Global extension tokens   *****/
1928
1929 /*****         Tag tokens          *****/
1930 static const value_string wbxml_coc10_tags_cp0[] = {
1931         /* 0x00 -- 0x04 GLOBAL */
1932         { 0x05, "co" },
1933         { 0x06, "invalidate-object" },
1934         { 0x07, "invalidate-service" },
1935
1936         { 0x00, NULL }
1937 };
1938
1939 /*****    Attribute Start tokens   *****/
1940 static const value_string wbxml_coc10_attrStart_cp0[] = {
1941         /* 0x00 -- 0x04 GLOBAL */
1942         { 0x05, "uri=" },
1943         { 0x06, "uri='http://'" },
1944         { 0x07, "uri='http://www.'" },
1945         { 0x08, "uri='https://'" },
1946         { 0x09, "uri='https://www.'" },
1947
1948         { 0x00, NULL }
1949 };
1950
1951 /*****    Attribute Value tokens   *****/
1952 /* Same as in SI 1.0 */
1953
1954 /***** Token code page aggregation *****/
1955 static const value_valuestring wbxml_coc10_tags[] = {
1956         { 0, wbxml_coc10_tags_cp0 },
1957         { 0, NULL }
1958 };
1959
1960 static const value_valuestring wbxml_coc10_attrStart[] = {
1961         { 0, wbxml_coc10_attrStart_cp0 },
1962         { 0, NULL }
1963 };
1964
1965 static const value_valuestring wbxml_coc10_attrValue[] = {
1966         { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */
1967         { 0, NULL }
1968 };
1969
1970 static const wbxml_decoding decode_coc_10 = {
1971     "Cache Operation 1.0",
1972     "CO 1.0",
1973     { NULL, NULL, NULL },
1974         default_opaque_binary_tag,
1975         default_opaque_literal_tag,
1976         default_opaque_binary_attr,
1977         default_opaque_literal_attr,
1978     NULL,
1979     wbxml_coc10_tags,
1980     wbxml_coc10_attrStart,
1981     wbxml_coc10_attrValue
1982 };
1983
1984
1985
1986
1987
1988 /* PROV 1.0
1989  *
1990  * Client Provisioning
1991  ***************************************/
1992
1993 /*****   Global extension tokens   *****/
1994
1995 /*****         Tag tokens          *****/
1996 static const value_string wbxml_provc10_tags_cp0[] = {
1997         /* 0x00 -- 0x04 GLOBAL */
1998         { 0x05, "wap-provisioningdoc" },
1999         { 0x06, "characteristic" },
2000         { 0x07, "parm" },
2001
2002         { 0x00, NULL }
2003 };
2004 static const value_string wbxml_provc10_tags_cp1[] = {
2005         /* 0x00 -- 0x04 GLOBAL */
2006         /* 0x05 */
2007         { 0x06, "characteristic" },
2008         { 0x07, "parm" },
2009
2010         { 0x00, NULL }
2011 };
2012
2013 /*****    Attribute Start tokens   *****/
2014 static const value_string wbxml_provc10_attrStart_cp0[] = {
2015         /* 0x00 -- 0x04 GLOBAL */
2016         { 0x05, "name=" },
2017         { 0x06, "value=" },
2018         { 0x07, "name='NAME'" },
2019         { 0x08, "name='NAP-ADDRESS'" },
2020         { 0x09, "name='NAP-ADDRTYPE'" },
2021         { 0x0A, "name='CALLTYPE'" },
2022         { 0x0B, "name='VALIDUNTIL'" },
2023         { 0x0C, "name='AUTHTYPE'" },
2024         { 0x0D, "name='AUTHNAME'" },
2025         { 0x0E, "name='AUTHSECRET'" },
2026         { 0x0F, "name='LINGER'" },
2027         { 0x10, "name='BEARER'" },
2028         { 0x11, "name='NAPID'" },
2029         { 0x12, "name='COUNTRY'" },
2030         { 0x13, "name='NETWORK'" },
2031         { 0x14, "name='INTERNET'" },
2032         { 0x15, "name='PROXY-ID'" },
2033         { 0x16, "name='PROXY-PROVIDER-ID'" },
2034         { 0x17, "name='DOMAIN'" },
2035         { 0x18, "name='PROVURL'" },
2036         { 0x19, "name='PXAUTH-TYPE'" },
2037         { 0x1A, "name='PXAUTH-ID'" },
2038         { 0x1B, "name='PXAUTH-PW'" },
2039         { 0x1C, "name='STARTPAGE'" },
2040         { 0x1D, "name='BASAUTH-ID'" },
2041         { 0x1E, "name='BASAUTH-PW'" },
2042         { 0x1F, "name='PUSHENABLED'" },
2043         { 0x20, "name='PXADDR'" },
2044         { 0x21, "name='PXADDRTYPE'" },
2045         { 0x22, "name='TO-NAPID'" },
2046         { 0x23, "name='PORTNBR'" },
2047         { 0x24, "name='SERVICE'" },
2048         { 0x25, "name='LINKSPEED'" },
2049         { 0x26, "name='DNLINKSPEED'" },
2050         { 0x27, "name='LOCAL-ADDR'" },
2051         { 0x28, "name='LOCAL-ADDRTYPE'" },
2052         { 0x29, "name='CONTEXT-ALLOW'" },
2053         { 0x2A, "name='TRUST'" },
2054         { 0x2B, "name='MASTER'" },
2055         { 0x2C, "name='SID'" },
2056         { 0x2D, "name='SOC'" },
2057         { 0x2E, "name='WSP-VERSION'" },
2058         { 0x2F, "name='PHYSICAL-PROXY-ID'" },
2059         { 0x30, "name='CLIENT-ID'" },
2060         { 0x31, "name='DELIVERY-ERR-SDU'" },
2061         { 0x32, "name='DELIVERY-ORDER'" },
2062         { 0x33, "name='TRAFFIC-CLASS'" },
2063         { 0x34, "name='MAX-SDU-SIZE'" },
2064         { 0x35, "name='MAX-BITRATE-UPLINK'" },
2065         { 0x36, "name='MAX-BITRATE-DNLINK'" },
2066         { 0x37, "name='RESIDUAL-BER'" },
2067         { 0x38, "name='SDU-ERROR-RATIO'" },
2068         { 0x39, "name='TRAFFIC-HANDL-PRIO'" },
2069         { 0x3A, "name='TRANSFER-DELAY'" },
2070         { 0x3B, "name='GUARANTEED-BITRATE-UPLINK'" },
2071         { 0x3C, "name='GUARANTEED-BITRATE-DNLINK'" },
2072         { 0x3D, "name='PXADDR-FQDN'" },
2073         { 0x3E, "name='PROXY-PW'" },
2074         { 0x3F, "name='PPGAUTH-TYPE'" },
2075         /* 0x40 -- 0x44 GLOBAL */
2076         { 0x45, "version=" },
2077         { 0x46, "version='1.0'" },
2078         { 0x47, "name='PULLENABLED'" },
2079         { 0x48, "name='DNS-ADDR'" },
2080         { 0x49, "name='MAX-NUM-RETRY'" },
2081         { 0x4A, "name='FIRST-RETRY-TIMEOUT'" },
2082         { 0x4B, "name='REREG-THRESHOLD'" },
2083         { 0x4C, "name='T-BIT'" },
2084         /* 0x4D */
2085         { 0x4E, "name='AUTH-ENTITY'" },
2086         { 0x4F, "name='SPI'" },
2087         { 0x50, "type=" },
2088         { 0x51, "type='PXLOGICAL'" },
2089         { 0x52, "type='PXPHYSICAL'" },
2090         { 0x53, "type='PORT'" },
2091         { 0x54, "type='VALIDITY'" },
2092         { 0x55, "type='NAPDEF'" },
2093         { 0x56, "type='BOOTSTRAP'" },
2094         { 0x57, "type='VENDORCONFIG'" },
2095         { 0x58, "type='CLIENTIDENTITY'" },
2096         { 0x59, "type='PXAUTHINFO'" },
2097         { 0x5A, "type='NAPAUTHINFO'" },
2098         { 0x5B, "type='ACCESS'" },
2099
2100         { 0x00, NULL }
2101 };
2102 static const value_string wbxml_provc10_attrStart_cp1[] = {
2103         /* 0x00 -- 0x04 GLOBAL */
2104         /* 0x05 -- 0x06 */
2105         { 0x07, "name='NAME'" },
2106         /* 0x08 -- 0x13 */
2107         { 0x14, "name='INTERNET'" },
2108         /* 0x15 -- 0x1B */
2109         { 0x1C, "name='STARTPAGE'" },
2110         /* 0x1D -- 0x21 */
2111         { 0x22, "name='TO-NAPID'" },
2112         { 0x23, "name='PORTNBR'" },
2113         { 0x24, "name='SERVICE'" },
2114         /* 0x25 -- 0x2D */
2115         { 0x2E, "name='AACCEPT'" },
2116         { 0x2F, "name='AAUTHDATA'" },
2117         { 0x30, "name='AAUTHLEVEL'" },
2118         { 0x31, "name='AAUTHNAME'" },
2119         { 0x32, "name='AAUTHSECRET'" },
2120         { 0x33, "name='AAUTHTYPE'" },
2121         { 0x34, "name='ADDR'" },
2122         { 0x35, "name='ADDRTYPE'" },
2123         { 0x36, "name='APPID'" },
2124         { 0x37, "name='APROTOCOL'" },
2125         { 0x38, "name='PROVIDER-ID'" },
2126         { 0x39, "name='TO-PROXY'" },
2127         { 0x3A, "name='URI'" },
2128         { 0x3B, "name='RULE'" },
2129         /* 0x3C -- 0x3F */
2130         /* 0x40 -- 0x44 GLOBAL */
2131         /* 0x45 -- 0x4F */
2132         { 0x50, "type=" },
2133         /* 0x51 -- 0x52 */
2134         { 0x53, "type='PORT'" },
2135         /* 0x54 */
2136         { 0x55, "type='APPLICATION'" },
2137         { 0x56, "type='APPADDR'" },
2138         { 0x57, "type='APPAUTH'" },
2139         { 0x58, "type='CLIENTIDENTITY'" },
2140         { 0x59, "type='RESOURCE'" },
2141         /* 0x5A -- 0x7F */
2142
2143         { 0x00, NULL }
2144 };
2145
2146 /*****    Attribute Start tokens   *****/
2147 static const value_string wbxml_provc10_attrValue_cp0[] = {
2148         /* 0x80 -- 0x84 GLOBAL */
2149         { 0x85, "'IPV4'" },
2150         { 0x86, "'IPV6'" },
2151         { 0x87, "'E164'" },
2152         { 0x88, "'ALPHA'" },
2153         { 0x89, "'APN'" },
2154         { 0x8A, "'SCODE'" },
2155         { 0x8B, "'TETRA-ITSI'" },
2156         { 0x8C, "'MAN'" },
2157         /* 0x8D -- 0x8F */
2158         { 0x90, "'ANALOG-MODEM'" },
2159         { 0x91, "'V.120'" },
2160         { 0x92, "'V.110'" },
2161         { 0x93, "'X.31'" },
2162         { 0x94, "'BIT-TRANSPARENT'" },
2163         { 0x95, "'DIRECT-ASYNCHRONOUS-DATA-SERVICE'" },
2164         /* 0x96 -- 0x99 */
2165         { 0x9A, "'PAP'" },
2166         { 0x9B, "'CHAP'" },
2167         { 0x9C, "'HTTP-BASIC'" },
2168         { 0x9D, "'HTTP-DIGEST'" },
2169         { 0x9E, "'WTLS-SS'" },
2170         { 0x9F, "'MD5'" },
2171         /* 0xA0 -- 0xA1 */
2172         { 0xA2, "'GSM-USSD'" },
2173         { 0xA3, "'GSM-SMS'" },
2174         { 0xA4, "'ANSI-136-GUTS'" },
2175         { 0xA5, "'IS-95-CDMA-SMS'" },
2176         { 0xA6, "'IS-95-CDMA-CSD'" },
2177         { 0xA7, "'IS-95-CDMA-PACKET'" },
2178         { 0xA8, "'ANSI-136-CSD'" },
2179         { 0xA9, "'ANSI-136-GPRS'" },
2180         { 0xAA, "'GSM-CSD'" },
2181         { 0xAB, "'GSM-GPRS'" },
2182         { 0xAC, "'AMPS-CDPD'" },
2183         { 0xAD, "'PDC-CSD'" },
2184         { 0xAE, "'PDC-PACKET'" },
2185         { 0xAF, "'IDEN-SMS'" },
2186         { 0xB0, "'IDEN-CSD'" },
2187         { 0xB1, "'IDEN-PACKET'" },
2188         { 0xB2, "'FLEX/REFLEX'" },
2189         { 0xB3, "'PHS-SMS'" },
2190         { 0xB4, "'PHS-CSD'" },
2191         { 0xB5, "'TETRA-SDS'" },
2192         { 0xB6, "'TETRA-PACKET'" },
2193         { 0xB7, "'ANSI-136-GHOST'" },
2194         { 0xB8, "'MOBITEX-MPAK'" },
2195         { 0xB9, "'CDMA2000-IX-SIMPLE-IP'" },
2196         { 0xBA, "'CDMA2000-IX-MOBILE-IP'" },
2197         /* 0xBB -- 0xBF */
2198         /* 0xC0 -- 0xC4 GLOBAL */
2199         { 0xC5, "'AUTOBAUDING'" },
2200         /* 0xC6 -- 0xC9 */
2201         { 0xCA, "'CL-WSP'" },
2202         { 0xCB, "'CO-WSP'" },
2203         { 0xCC, "'CL-SEC-WSP'" },
2204         { 0xCD, "'CO-SEC-WSP'" },
2205         { 0xCE, "'CL-SEC-WTA'" },
2206         { 0xCF, "'CO-SEC-WTA'" },
2207         { 0xD0, "'OTA-HTTP-TO'" },
2208         { 0xD1, "'OTA-HTTP-TLS-TO'" },
2209         { 0xD2, "'OTA-HTTP-PO'" },
2210         { 0xD3, "'OTA-HTTP-TLS-PO'" },
2211         /* 0xD4 -- 0xFF */
2212
2213         { 0x00, NULL }
2214 };
2215 static const value_string wbxml_provc10_attrValue_cp1[] = {
2216         /* 0x80 -- 0x84 GLOBAL */
2217         /* 0x85 */
2218         { 0x86, "'IPV6'" },
2219         { 0x87, "'E164'" },
2220         { 0x88, "'ALPHA'" },
2221         { 0x8D, "'APPSRV'" },
2222         { 0x8E, "'OBEX'" },
2223         /* 0x8F */
2224
2225         /* XXX - Errors that require a fix in the OMA/WAP Client Provisioning specs:
2226         { 0xXXX, "','" },
2227         { 0xXXX, "'HTTP-'" },
2228         { 0xXXX, "'BASIC'" },
2229         { 0xXXX, "'DIGEST'" },
2230         */
2231
2232         { 0xE0, "'AAA'" },
2233         { 0xE1, "'HA'" },
2234
2235         { 0x00, NULL }
2236 };
2237
2238 /***** Token code page aggregation *****/
2239 static const value_valuestring wbxml_provc10_tags[] = {
2240         { 0, wbxml_provc10_tags_cp0 },
2241         { 1, wbxml_provc10_tags_cp1 },
2242         { 0, NULL }
2243 };
2244
2245 static const value_valuestring wbxml_provc10_attrStart[] = {
2246         { 0, wbxml_provc10_attrStart_cp0 },
2247         { 1, wbxml_provc10_attrStart_cp1 },
2248         { 0, NULL }
2249 };
2250
2251 static const value_valuestring wbxml_provc10_attrValue[] = {
2252         { 0, wbxml_provc10_attrValue_cp0 },
2253         { 1, wbxml_provc10_attrValue_cp1 },
2254         { 0, NULL }
2255 };
2256
2257 static const wbxml_decoding decode_provc_10 = {
2258     "WAP Client Provisioning Document 1.0",
2259     "WAP ProvisioningDoc 1.0",
2260     { NULL, NULL, NULL },
2261         default_opaque_binary_tag,
2262         default_opaque_literal_tag,
2263         default_opaque_binary_attr,
2264         default_opaque_literal_attr,
2265     NULL,
2266     wbxml_provc10_tags,
2267     wbxml_provc10_attrStart,
2268     wbxml_provc10_attrValue
2269 };
2270
2271
2272
2273
2274
2275 /* EMN 1.0
2276  *
2277  * Email Notification
2278  ***************************************/
2279
2280 /*****   Global extension tokens   *****/
2281
2282 /*****         Tag tokens          *****/
2283 static const value_string wbxml_emnc10_tags_cp0[] = {
2284         /* 0x00 -- 0x04 GLOBAL */
2285         { 0x05, "emn" },
2286
2287         { 0x00, NULL }
2288 };
2289
2290 /*****    Attribute Start tokens   *****/
2291 static const value_string wbxml_emnc10_attrStart_cp0[] = {
2292         /* 0x00 -- 0x04 GLOBAL */
2293         { 0x05, "timestamp=" },
2294         { 0x06, "mailbox=" },
2295         { 0x07, "mailbox='mailat:'" },
2296         { 0x08, "mailbox='pop://'" },
2297         { 0x09, "mailbox='imap://'" },
2298         { 0x0a, "mailbox='http://'" },
2299         { 0x0b, "mailbox='http://www.'" },
2300         { 0x0c, "mailbox='https://'" },
2301         { 0x0D, "mailbox='https://www.'" },
2302
2303         { 0x00, NULL }
2304 };
2305
2306 /*****    Attribute Value tokens   *****/
2307 /* Same as in SI 1.0 */
2308
2309 /***** Token code page aggregation *****/
2310 static const value_valuestring wbxml_emnc10_tags[] = {
2311         { 0, wbxml_emnc10_tags_cp0 },
2312         { 0, NULL }
2313 };
2314
2315 static const value_valuestring wbxml_emnc10_attrStart[] = {
2316         { 0, wbxml_emnc10_attrStart_cp0 },
2317         { 0, NULL }
2318 };
2319
2320 static const value_valuestring wbxml_emnc10_attrValue[] = {
2321         { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */
2322         { 0, NULL }
2323 };
2324
2325 static const wbxml_decoding decode_emnc_10 = {
2326     "E-Mail Notification 1.0",
2327     "EMN 1.0",
2328     { NULL, NULL, NULL },
2329         default_opaque_binary_tag,
2330         default_opaque_literal_tag,
2331         emnc10_opaque_binary_attr,
2332         emnc10_opaque_literal_attr,
2333     NULL,
2334     wbxml_emnc10_tags,
2335     wbxml_emnc10_attrStart,
2336     wbxml_emnc10_attrValue
2337 };
2338
2339
2340
2341
2342
2343 /* SyncML 1.0
2344  *
2345  * SyncML Representation Protocol
2346  ***************************************/
2347
2348 /*****   Global extension tokens   *****/
2349
2350 /*****         Tag tokens          *****/
2351 static const value_string wbxml_syncmlc10_tags_cp0[] = { /* SyncML 1.0 */
2352         /* 0x00 -- 0x04 GLOBAL */
2353         { 0x05, "Add" },
2354         { 0x06, "Alert" },
2355         { 0x07, "Archive" },
2356         { 0x08, "Atomic" },
2357         { 0x09, "Chal" },
2358         { 0x0A, "Cmd" },
2359         { 0x0B, "CmdID" },
2360         { 0x0C, "CmdRef" },
2361         { 0x0D, "Copy" },
2362         { 0x0E, "Cred" },
2363         { 0x0F, "Data" },
2364         { 0x10, "Delete" },
2365         { 0x11, "Exec" },
2366         { 0x12, "Final" },
2367         { 0x13, "Get" },
2368         { 0x14, "Item" },
2369         { 0x15, "Lang" },
2370         { 0x16, "LocName" },
2371         { 0x17, "LocURI" },
2372         { 0x18, "Map" },
2373         { 0x19, "MapItem" },
2374         { 0x1A, "Meta" },
2375         { 0x1B, "MsgID" },
2376         { 0x1C, "MsgRef" },
2377         { 0x1D, "NoResp" },
2378         { 0x1E, "NoResults" },
2379         { 0x1F, "Put" },
2380         { 0x20, "Replace" },
2381         { 0x21, "RespURI" },
2382         { 0x22, "Results" },
2383         { 0x23, "Search" },
2384         { 0x24, "Sequence" },
2385         { 0x25, "SessionID" },
2386         { 0x26, "SftDel" },
2387         { 0x27, "Source" },
2388         { 0x28, "SourceRef" },
2389         { 0x29, "Status" },
2390         { 0x2A, "Sync" },
2391         { 0x2B, "SyncBody" },
2392         { 0x2C, "SyncHdr" },
2393         { 0x2D, "SyncML" },
2394         { 0x2E, "Target" },
2395         { 0x2F, "TargetRef" },
2396         /* 0x30 - Reserved */
2397         { 0x31, "VerDTD" },
2398         { 0x32, "VerProto" },
2399
2400         { 0x00, NULL }
2401 };
2402
2403 static const value_string wbxml_syncmlc10_tags_cp1[] = { /* MetInf 1.0 */
2404         /* 0x00 -- 0x04 GLOBAL */
2405         { 0x05, "Anchor" },
2406         { 0x06, "EMI" },
2407         { 0x07, "Format" },
2408         { 0x08, "FreeID" },
2409         { 0x09, "FreeMem" },
2410         { 0x0A, "Last" },
2411         { 0x0B, "Mark" },
2412         { 0x0C, "MaxMsgSize" },
2413         { 0x0D, "Mem" },
2414         { 0x0E, "MetInf" },
2415         { 0x0F, "Next" },
2416         { 0x10, "NextNonce" },
2417         { 0x11, "SharedMem" },
2418         { 0x12, "Size" },
2419         { 0x13, "Type" },
2420         { 0x14, "Version" },
2421
2422         { 0x00, NULL }
2423 };
2424
2425 /*****    Attribute Start tokens   *****/
2426
2427 /*****    Attribute Value tokens   *****/
2428
2429 /***** Token code page aggregation *****/
2430 static const value_valuestring wbxml_syncmlc10_tags[] = {
2431         { 0, wbxml_syncmlc10_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.0//EN */
2432         { 1, wbxml_syncmlc10_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.0//EN */
2433         { 0, NULL }
2434 };
2435
2436 static const wbxml_decoding decode_syncmlc_10 = {
2437     "SyncML Representation Protocol 1.0",
2438     "SyncML 1.0",
2439     { NULL, NULL, NULL },
2440         default_opaque_binary_tag,
2441         default_opaque_literal_tag,
2442         default_opaque_binary_attr,
2443         default_opaque_literal_attr,
2444     NULL,
2445     wbxml_syncmlc10_tags,
2446     NULL,
2447     NULL
2448 };
2449
2450
2451
2452
2453
2454 /* SyncML 1.1
2455  *
2456  * SyncML Representation Protocol
2457  ***************************************/
2458
2459 /*****   Global extension tokens   *****/
2460
2461 /*****         Tag tokens          *****/
2462 static const value_string wbxml_syncmlc11_tags_cp0[] = { /* SyncML 1.1 */
2463         /* 0x00 -- 0x04 GLOBAL */
2464         { 0x05, "Add" },
2465         { 0x06, "Alert" },
2466         { 0x07, "Archive" },
2467         { 0x08, "Atomic" },
2468         { 0x09, "Chal" },
2469         { 0x0a, "Cmd" },
2470         { 0x0b, "CmdID" },
2471         { 0x0c, "CmdRef" },
2472         { 0x0d, "Copy" },
2473         { 0x0e, "Cred" },
2474         { 0x0f, "Data" },
2475         { 0x10, "Delete" },
2476         { 0x11, "Exec" },
2477         { 0x12, "Final" },
2478         { 0x13, "Get" },
2479         { 0x14, "Item" },
2480         { 0x15, "Lang" },
2481         { 0x16, "LocName" },
2482         { 0x17, "LocURI" },
2483         { 0x18, "Map" },
2484         { 0x19, "MapItem" },
2485         { 0x1a, "Meta" },
2486         { 0x1b, "MsgID" },
2487         { 0x1c, "MsgRef" },
2488         { 0x1d, "NoResp" },
2489         { 0x1e, "NoResults" },
2490         { 0x1f, "Put" },
2491         { 0x20, "Replace" },
2492         { 0x21, "RespURI" },
2493         { 0x22, "Results" },
2494         { 0x23, "Search" },
2495         { 0x24, "Sequence" },
2496         { 0x25, "SessionID" },
2497         { 0x26, "SftDel" },
2498         { 0x27, "Source" },
2499         { 0x28, "SourceRef" },
2500         { 0x29, "Status" },
2501         { 0x2a, "Sync" },
2502         { 0x2b, "SyncBody" },
2503         { 0x2c, "SyncHdr" },
2504         { 0x2d, "SyncML" },
2505         { 0x2e, "Target" },
2506         { 0x2f, "TargetRef" },
2507         /* 0x30 - Reserved */
2508         { 0x31, "VerDTD" },
2509         { 0x32, "VerProto" },
2510         { 0x33, "NumberOfChanges" },
2511         { 0x34, "MoreData" },
2512
2513         { 0x00, NULL }
2514 };
2515
2516 static const value_string wbxml_syncmlc11_tags_cp1[] = { /* MetInf 1.1 */
2517         /* 0x00 -- 0x04 GLOBAL */
2518         { 0x05, "Anchor" },
2519         { 0x06, "EMI" },
2520         { 0x07, "Format" },
2521         { 0x08, "FreeID" },
2522         { 0x09, "FreeMem" },
2523         { 0x0A, "Last" },
2524         { 0x0B, "Mark" },
2525         { 0x0C, "MaxMsgSize" },
2526         { 0x0D, "Mem" },
2527         { 0x0E, "MetInf" },
2528         { 0x0F, "Next" },
2529         { 0x10, "NextNonce" },
2530         { 0x11, "SharedMem" },
2531         { 0x12, "Size" },
2532         { 0x13, "Type" },
2533         { 0x14, "Version" },
2534         { 0x15, "MaxObjSize" },
2535
2536         { 0x00, NULL }
2537 };
2538
2539 /*****    Attribute Start tokens   *****/
2540
2541 /*****    Attribute Value tokens   *****/
2542
2543 /***** Token code page aggregation *****/
2544 static const value_valuestring wbxml_syncmlc11_tags[] = {
2545         { 0, wbxml_syncmlc11_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.1//EN */
2546         { 1, wbxml_syncmlc11_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.1//EN */
2547         { 0, NULL }
2548 };
2549
2550 static const wbxml_decoding decode_syncmlc_11 = {
2551     "SyncML Representation Protocol 1.1",
2552     "SyncML 1.1",
2553     { NULL, NULL, NULL },
2554         default_opaque_binary_tag,
2555         default_opaque_literal_tag,
2556         default_opaque_binary_attr,
2557         default_opaque_literal_attr,
2558     NULL,
2559     wbxml_syncmlc11_tags,
2560     NULL,
2561     NULL
2562 };
2563
2564
2565
2566
2567
2568 /* CHANNEL 1.0
2569  *
2570  * WTA Channel
2571  ***************************************/
2572
2573 /*****   Global extension tokens   *****/
2574
2575 /*****         Tag tokens          *****/
2576 static const value_string wbxml_channelc10_tags_cp0[] = {
2577         /* 0x00 -- 0x04 GLOBAL */
2578         { 0x05, "channel" },
2579         { 0x06, "title" },
2580         { 0x07, "abstract" },
2581         { 0x08, "resource" },
2582
2583         { 0x00, NULL }
2584 };
2585
2586 /*****    Attribute Start tokens   *****/
2587 static const value_string wbxml_channelc10_attrStart_cp0[] = {
2588         /* 0x00 -- 0x04 GLOBAL */
2589         { 0x05, "maxspace=" },
2590         { 0x06, "base=" },
2591         { 0x07, "href=" },
2592         { 0x08, "href='http://'" },
2593         { 0x09, "href='https://'" },
2594         { 0x0A, "lastmod=" },
2595         { 0x0B, "etag=" },
2596         { 0x0C, "md5=" },
2597         { 0x0D, "success=" },
2598         { 0x0E, "success='http://'" },
2599         { 0x0F, "success='https://'" },
2600         { 0x10, "failure=" },
2601         { 0x11, "failure='http://'" },
2602         { 0x12, "failure='https://'" },
2603         { 0x13, "EventId=" },
2604
2605         { 0x00, NULL }
2606 };
2607
2608 /*****    Attribute Value tokens   *****/
2609
2610 /***** Token code page aggregation *****/
2611 static const value_valuestring wbxml_channelc10_tags[] = {
2612         { 0, wbxml_channelc10_tags_cp0 },
2613         { 0, NULL }
2614 };
2615
2616 static const value_valuestring wbxml_channelc10_attrStart[] = {
2617         { 0, wbxml_channelc10_attrStart_cp0 },
2618         { 0, NULL }
2619 };
2620
2621 static const wbxml_decoding decode_channelc_10 = {
2622     "Wireless Telephony Application (WTA) Channel 1.0",
2623     "CHANNEL 1.0",
2624     { NULL, NULL, NULL },
2625         default_opaque_binary_tag,
2626         default_opaque_literal_tag,
2627         default_opaque_binary_attr,
2628         default_opaque_literal_attr,
2629     NULL,
2630     wbxml_channelc10_tags,
2631     wbxml_channelc10_attrStart,
2632     NULL
2633 };
2634
2635
2636
2637
2638
2639 /* application/x-wap-prov.browser-settings
2640  * application/x-wap-prov.browser-bookmarks
2641  *
2642  * Nokia OTA Provisioning document format
2643  ***************************************/
2644
2645 /*****   Global extension tokens   *****/
2646
2647 /*****         Tag tokens          *****/
2648 static const value_string wbxml_nokiaprovc70_tags_cp0[] = {
2649         /* 0x00 -- 0x04 GLOBAL */
2650         { 0x05, "CHARACTERISTIC-LIST" },
2651         { 0x06, "CHARACTERISTIC" },
2652         { 0x07, "PARM" },
2653
2654         { 0x00, NULL }
2655 };
2656
2657 /*****    Attribute Start tokens   *****/
2658 static const value_string wbxml_nokiaprovc70_attrStart_cp0[] = {
2659         /* 0x00 -- 0x04 GLOBAL */
2660         { 0x06, "TYPE='ADDRESS'" },
2661         { 0x07, "TYPE='URL'" },
2662         { 0x08, "TYPE='NAME'" },
2663         { 0x10, "NAME=" },
2664         { 0x11, "VALUE=" },
2665         { 0x12, "NAME='BEARER'" },
2666         { 0x13, "NAME='PROXY'" },
2667         { 0x14, "NAME='PORT'" },
2668         { 0x15, "NAME='NAME'" },
2669         { 0x16, "NAME='PROXY_TYPE'" },
2670         { 0x17, "NAME='URL'" },
2671         { 0x18, "NAME='PROXY_AUTHNAME'" },
2672         { 0x19, "NAME='PROXY_AUTHSECRET'" },
2673         { 0x1A, "NAME='SMS_SMSC_ADDRESS'" },
2674         { 0x1B, "NAME='USSD_SERVICE_CODE'" },
2675         { 0x1C, "NAME='GPRS_ACCESSPOINTNAME'" },
2676         { 0x1D, "NAME='PPP_LOGINTYPE'" },
2677         { 0x1E, "NAME='PROXY_LOGINTYPE'" },
2678         { 0x21, "NAME='CSD_DIALSTRING'" },
2679         { 0x22, "NAME='PPP_AUTHTYPE'" },
2680         { 0x23, "NAME='PPP_AUTHNAME'" },
2681         { 0x24, "NAME='PPP_AUTHSECRET'" },
2682         { 0x28, "NAME='CSD_CALLTYPE'" },
2683         { 0x29, "NAME='CSD_CALLSPEED'" },
2684         { 0x45, "VALUE='GSM/CSD'" },
2685         { 0x46, "VALUE='GSM/SMS'" },
2686         { 0x47, "VALUE='GSM/USSD'" },
2687         { 0x48, "VALUE='IS-136/CSD'" },
2688         { 0x49, "VALUE='GPRS'" },
2689         { 0x60, "VALUE='9200'" },
2690         { 0x61, "VALUE='9201'" },
2691         { 0x62, "VALUE='9202'" },
2692         { 0x63, "VALUE='9203'" },
2693         { 0x64, "VALUE='AUTOMATIC'" },
2694         { 0x65, "VALUE='MANUAL'" },
2695         { 0x6A, "VALUE='AUTO'" },
2696         { 0x6B, "VALUE='9600'" },
2697         { 0x6C, "VALUE='14400'" },
2698         { 0x6D, "VALUE='19200'" },
2699         { 0x6E, "VALUE='28800'" },
2700         { 0x6F, "VALUE='38400'" },
2701         { 0x70, "VALUE='PAP'" },
2702         { 0x71, "VALUE='CHAP'" },
2703         { 0x72, "VALUE='ANALOGUE'" },
2704         { 0x73, "VALUE='ISDN'" },
2705         { 0x74, "VALUE='43200'" },
2706         { 0x75, "VALUE='57600'" },
2707         { 0x76, "VALUE='MSISDN_NO'" },
2708         { 0x77, "VALUE='IPV4'" },
2709         { 0x78, "VALUE='MS_CHAP'" },
2710         { 0x7C, "TYPE='MMSURL'" },
2711         { 0x7D, "TYPE='ID'" },
2712         { 0x7E, "NAME='ISP_NAME'" },
2713         { 0x7F, "TYPE='BOOKMARK'" },
2714
2715         { 0x00, NULL }
2716 };
2717
2718 /*****    Attribute Value tokens   *****/
2719
2720 /***** Token code page aggregation *****/
2721 static const value_valuestring wbxml_nokiaprovc70_tags[] = {
2722         { 0, wbxml_nokiaprovc70_tags_cp0 },
2723         { 0, NULL }
2724 };
2725
2726 static const value_valuestring wbxml_nokiaprovc70_attrStart[] = {
2727         { 0, wbxml_nokiaprovc70_attrStart_cp0 },
2728         { 0, NULL }
2729 };
2730
2731 static const wbxml_decoding decode_nokiaprovc_70 = {
2732     "Nokia Client Provisioning 7.0",
2733     "Nokia Client Provisioning 7.0",
2734     { NULL, NULL, NULL },
2735         default_opaque_binary_tag,
2736         default_opaque_literal_tag,
2737         default_opaque_binary_attr,
2738         default_opaque_literal_attr,
2739     NULL,
2740     wbxml_nokiaprovc70_tags,
2741     wbxml_nokiaprovc70_attrStart,
2742     NULL
2743 };
2744
2745
2746
2747
2748
2749 /* UAProf [WAP-248]
2750  *
2751  * User-Agent Profile (used in profile-diff WSP header)
2752  ***************************************/
2753
2754 /*****   Global extension tokens   *****/
2755
2756 /*****         Tag tokens          *****/
2757 /* CodePage     0       RDF */
2758 static const value_string  wbxml_uaprof_tags_cp0[] = {
2759         {0x05, "rdf:RDF"},
2760         {0x06, "rdf:Description"},
2761         {0x07, "rdf:Alt"},
2762         {0x08, "rdf:Bag"},
2763         {0x09, "rdf:Seq"},
2764         {0x0A, "rdf:li"},
2765         {0x0B, "rdf:type"},
2766         {0x0C, "rdf:value"},
2767         {0x0D, "rdf:subject"},
2768         {0x0E, "rdf:predicate"},
2769         {0x0F, "rdf:object"},
2770
2771         { 0x00, NULL }
2772 };
2773
2774 /* CodePage     1       Core Vocabulary */
2775 static const value_string  wbxml_uaprof_tags_cp1[] = {
2776         {0x06, "rdf:Description"},
2777         {0x07, "rdf:Alt"},
2778         {0x08, "rdf:Bag"},
2779         {0x09, "rdf:Seq"},
2780         {0x0A, "rdf:li"},
2781         {0x0B, "rdf:type"},
2782         {0x0C, "prf:component"},
2783         {0x0D, "prf:defaults"},
2784         {0x0E, "prf:BitsPerPixel"},
2785         {0x0F, "prf:ColorCapable"},
2786         {0x10, "prf:CPU"},
2787         {0x11, "prf:ImageCapable"},
2788         {0x12, "prf:InputCharSet"},
2789         {0x13, "prf:Keyboard"},
2790         {0x15, "prf:Model"},
2791         {0x16, "prf:OutputCharSet"},
2792         {0x17, "prf:PointingResolution"},
2793         {0x18, "prf:ScreenSize"},
2794         {0x19, "prf:ScreenSizeChar"},
2795         {0x1A, "prf:NumberOfSoftKeys"},
2796         {0x1B, "prf:SoundOutputCapable"},
2797         {0x1C, "prf:TextInputCapable"},
2798         {0x1D, "prf:Vendor"},
2799         {0x1E, "prf:VoiceInputCapable"},
2800         {0x1F, "prf:AcceptDownloadableSoftware"},
2801         {0x20, "prf:AudioInputEncoder"},
2802         {0x21, "prf:DownloadableSoftwareSupport"},
2803         {0x22, "prf:JavaEnabled"},
2804         {0x23, "prf:JVMVersion"},
2805         {0x24, "prf:MexeClassmark"},
2806         {0x25, "prf:MexeSpec"},
2807         {0x26, "prf:OSName"},
2808         {0x27, "prf:OSVendor"},
2809         {0x28, "prf:OSVersion"},
2810         {0x29, "prf:RecipientAppAgent"},
2811         {0x2A, "prf:SoftwareNumber"},
2812         {0x2B, "prf:VideoInputEncoder"},
2813         {0x2C, "prf:CurrentBearerService"},
2814         {0x2D, "prf:SecuritySupport"},
2815         {0x2E, "prf:SupportedBearers"},
2816         {0x2F, "prf:WapDeviceClass"},
2817         {0x30, "prf:WapPushMsgPriority"}, /* Deprecated */
2818         {0x31, "prf:WapPushMsgSize"}, /* Deprecated */
2819         {0x32, "prf:WapVersion"},
2820         {0x33, "prf:WmlDeckSize"},
2821         {0x34, "prf:WmlScriptLibraries"},
2822         {0x35, "prf:WmlScriptVersion"},
2823         {0x36, "prf:WmlVersion"},
2824         {0x37, "prf:WtaiLibraries"},
2825         {0x38, "prf:WtaVersion"},
2826         {0x39, "prf:PixelAspectRatio"},
2827         {0x3A, "prf:StandardFontProportional"},
2828         {0x3B, "prf:WapSupportedApplications"}, /* Deprecated */
2829         {0x3C, "prf:BluetoothProfile"},
2830         {0x3D, "prf:MexeClassmarks"},
2831         {0x3E, "prf:MexeSecureDomains"},
2832
2833         { 0x00, NULL }
2834 };
2835
2836 /* CodePage     4       Core Vocabulary (continued) */
2837 static const value_string  wbxml_uaprof_tags_cp4[] = {
2838         {0x10, "prf:SupportedBluetoothVersion"},
2839         {0x11, "prf:SupportedPictogramSet"},
2840         {0x12, "prf:CcppAccept"},
2841         {0x13, "prf:CcppAccept-Charset"},
2842         {0x14, "prf:CcppAccept-Encoding"},
2843         {0x15, "prf:CcppAccept-Language"},
2844
2845         { 0x00, NULL }
2846 };
2847
2848 /* CodePage     2       BrowserUA */
2849 static const value_string  wbxml_uaprof_tags_cp2[] = {
2850         {0x05, "rdf:Description"},
2851         {0x06, "rdf:Alt"},
2852         {0x07, "rdf:Bag"},
2853         {0x08, "rdf:Seq"},
2854         {0x09, "rdf:li"},
2855         {0x0A, "rdf:type"},
2856         {0x0B, "prf:component"},
2857         {0x0C, "prf:defaults"},
2858         {0x0D, "prf:BrowserName"},
2859         {0x0E, "prf:BrowserVersion"},
2860         {0x0F, "prf:CcppAccept"}, /* Deprecated */
2861         {0x10, "prf:CcppAccept-Charset"}, /* Deprecated */
2862         {0x11, "prf:CcppAccept-Encoding"}, /* Deprecated */
2863         {0x12, "prf:CcppAccept-Language"}, /* Deprecated */
2864         {0x13, "prf:DownloadableBrowserApps"},
2865         {0x14, "prf:FramesCapable"},
2866         {0x15, "prf:HtmlVersion"},
2867         {0x16, "prf:JavaAppletEnabled"},
2868         {0x17, "prf:JavaScriptEnabled"},
2869         {0x18, "prf:JavaScriptVersion"},
2870         {0x19, "prf:PreferenceForFrames"},
2871         {0x1A, "prf:TablesCapable"},
2872         {0x1B, "Prf:XhtmlVersion"},
2873         {0x1C, "prf:XhtmlModules"},
2874
2875         { 0x00, NULL }
2876 };
2877
2878 /* CodePage     3       PushCharacteristics */
2879 static const value_string  wbxml_uaprof_tags_cp3[] = {
2880         {0x05, "rdf:Description"},
2881         {0x06, "rdf:Alt"},
2882         {0x07, "rdf:Bag"},
2883         {0x08, "rdf:Seq"},
2884         {0x09, "rdf:li"},
2885         {0x0A, "rdf:type"},
2886         {0x0B, "prf:component"},
2887         {0x0C, "prf:defaults"},
2888         {0x0D, "prf:Push-Accept"},
2889         {0x0E, "prf:Push-Accept-Charset"},
2890         {0x0F, "prf:Push-Accept-Encoding"},
2891         {0x10, "prf:Push-Accept-Language"},
2892         {0x11, "prf:Push-Accept-AppID"},
2893         {0x12, "prf:Push-MsgSize"},
2894         {0x13, "prf:Push-MaxPushReq"},
2895
2896         { 0x00, NULL }
2897 };
2898
2899 /*****    Attribute Start tokens   *****/
2900 /* CodePage     0       RDF */
2901 static const value_string  wbxml_uaprof_attrStart_cp0[] = {
2902         {0x05, "ID"},
2903         {0x06, "rdf:about"},
2904         {0x07, "rdf:aboutEach"},
2905         {0x08, "rdf:aboutEachPrefix"},
2906         {0x09, "rdf:bagID"},
2907         {0x0A, "rdf:type"},
2908         {0x0B, "rdf:resource"},
2909         {0x0C, "rdf:parseType='Literal'"},
2910         {0x0D, "rdf:parseType='Resource'"},
2911         {0x0E, "xml:lang"},
2912         {0x0F, "xmlns:prf"},
2913         {0x10, "xmlns:rdf"},
2914
2915         { 0x00, NULL }
2916 };
2917
2918 /* CodePage     1       Core Vocabulary */
2919 static const value_string  wbxml_uaprof_attrStart_cp1[] = {
2920         {0x05, "rdf:resource"},
2921         {0x06, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
2922                 "ccppschema-20010430#HardwarePlatform'"},
2923         {0x07, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
2924                 "ccppschema-20010430#SoftwarePlatform'"},
2925         {0x08, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
2926                 "ccppschema-20010430#NetworkCharacteristics'"},
2927         {0x09, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
2928                 "ccppschema-20010430#WapCharacteristics'"},
2929         {0x0A, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
2930                 "ccppschema-20010430#BrowserUA'"},
2931         {0x0B, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/"
2932                 "ccppschema-20010430#PushCharacteristics'"},
2933         {0x10, "prf:BitsPerPixel"},
2934         {0x11, "prf:ColorCapable='Yes'"},
2935         {0x12, "prf:ColorCapable='No'"},
2936         {0x13, "prf:CPU"},
2937         {0x14, "prf:ImageCapable='Yes'"},
2938         {0x15, "prf:ImageCapable='No'"},
2939         {0x16, "prf:InputCharSet"},
2940         {0x17, "prf:Keyboard"},
2941         {0x19, "prf:Model"},
2942         {0x1A, "prf:OutputCharSet"},
2943         {0x1B, "prf:PointingResolution"},
2944         {0x1C, "prf:ScreenSize"},
2945         {0x1D, "prf:ScreenSizeChar"},
2946         {0x1E, "prf:NumberOfSoftKeys='Yes'"},
2947         {0x20, "prf:SoundOutputCapable='Yes'"},
2948         {0x21, "prf:SoundOutputCapable='No'"},
2949         {0x22, "prf:TextInputCapable='Yes'"},
2950         {0x23, "prf:TextInputCapable='No'"},
2951         {0x24, "prf:Vendor"},
2952         {0x25, "prf:VoiceInputCapable='Yes'"},
2953         {0x26, "prf:VoiceInputCapable='No'"},
2954         {0x27, "prf:PixelAspectRatio"},
2955         {0x28, "prf:StandardFontProportional='Yes'"},
2956         {0x29, "prf:StandardFontProportional='No'"},
2957         {0x30, "prf:AcceptDownloadableSoftware='Yes'"},
2958         {0x31, "prf:AcceptDownloadableSoftware='No'"},
2959         {0x32, "prf:AudioInputEncoder"},
2960         {0x33, "prf:DownloadableSoftwareSupport"},
2961         {0x35, "prf:JavaEnabled='Yes'"},
2962         {0x36, "prf:JavaEnabled='No'"},
2963         {0x37, "prf:JVMVersion"},
2964         {0x38, "prf:MexeClassmark"},
2965         {0x39, "prf:MexeSpec"},
2966         {0x3A, "prf:OSName"},
2967         {0x3B, "prf:OSVendor"},
2968         {0x3C, "prf:OSVersion"},
2969         {0x3D, "prf:RecipientAppAgent"},
2970         {0x3E, "prf:SoftwareNumber"},
2971         {0x21, "prf:SoundOutputCapable='No'"},
2972         {0x22, "prf:TextInputCapable='Yes'"},
2973         {0x23, "prf:TextInputCapable='No'"},
2974         {0x24, "prf:Vendor"},
2975         {0x25, "prf:VoiceInputCapable='Yes'"},
2976         {0x26, "prf:VoiceInputCapable='No'"},
2977         {0x27, "prf:PixelAspectRatio"},
2978         {0x28, "prf:StandardFontProportional='Yes'"},
2979         {0x29, "prf:StandardFontProportional='No'"},
2980         {0x30, "prf:AcceptDownloadableSoftware='Yes'"},
2981         {0x31, "prf:AcceptDownloadableSoftware='No'"},
2982         {0x32, "prf:AudioInputEncoder"},
2983         {0x33, "prf:DownloadableSoftwareSupport"},
2984         {0x35, "prf:JavaEnabled='Yes'"},
2985         {0x36, "prf:JavaEnabled='No'"},
2986         {0x37, "prf:JVMVersion"},
2987         {0x38, "prf:MexeClassmark"},
2988         {0x39, "prf:MexeSpec"},
2989         {0x3A, "prf:OSName"},
2990         {0x3B, "prf:OSVendor"},
2991         {0x3C, "prf:OSVersion"},
2992         {0x3D, "prf:RecipientAppAgent"},
2993         {0x3E, "prf:SoftwareNumber"},
2994         {0x3F, "prf:VideoInputEncoder"},
2995         {0x50, "prf:CurrentBearerService"},
2996         {0x51, "prf:SecuritySupport"},
2997         {0x52, "prf:SupportedBearers"},
2998         {0x60, "prf:WapDeviceClass"},
2999         {0x61, "prf:WapPushMsgPriority"}, /* Deprecated */
3000         {0x62, "prf:WapPushMsgSize"}, /* Deprecated */
3001         {0x63, "prf:WapVersion"},
3002         {0x64, "prf:WmlDeckSize"},
3003         {0x65, "prf:WmlScriptLibraries"},
3004         {0x66, "prf:WmlScriptVersion"},
3005         {0x67, "prf:WmlVersion"},
3006         {0x68, "prf:WtaiLibraries"},
3007         {0x69, "prf:WtaVersion"},
3008         {0x70, "prf:WapSupportedApplications"}, /* Deprecated */
3009         {0x71, "prf:BluetoothProfile"},
3010         {0x72, "prf:MexeClassmarks"},
3011         {0x73, "prf:MexeSecureDomains='YES'"},
3012         {0x74, "prf:MexeSecureDomains='NO'"},
3013         {0x75, "prf:SupportedBluetoothVersion"},
3014         {0x76, "prf:SupportedPictogramSet"},
3015         {0x77, "prf:CcppAccept"},
3016         {0x78, "prf:CcppAccept-Charset"},
3017         {0x79, "prf:CcppAccept-Encoding"},
3018         {0x7F, "prf:CcppAccept-Language"},
3019
3020         { 0x00, NULL }
3021 };
3022
3023 /* CodePage     2       BrowserUA */
3024 static const value_string  wbxml_uaprof_attrStart_cp2[] = {
3025         {0x05, "prf:CcppAccept"}, /* Deprecated */
3026         {0x06, "prf:CcppAccept-Charset"}, /* Deprecated */
3027         {0x07, "prf:CcppAccept-Encoding"}, /* Deprecated */
3028         {0x08, "prf:CcppAccept-Language"}, /* Deprecated */
3029         {0x09, "prf:DownloadableBrowserApps"},
3030         {0x0A, "prf:FramesCapable='Yes'"},
3031         {0x0B, "prf:FramesCapable='No'"},
3032         {0x0C, "prf:HtmlVersion='3.2'"},
3033         {0x0D, "prf:HtmlVersion='4.0'"},
3034         {0x0E, "prf:JavaAppletEnabled='Yes'"},
3035         {0x0F, "prf:JavaAppletEnabled='No'"},
3036         {0x10, "prf:JavaScriptEnabled='Yes'"},
3037         {0x11, "prf:JavaScriptEnabled='No'"},
3038         {0x12, "prf:JavaScriptVersion"},
3039         {0x13, "prf:PreferenceForFrames='Yes'"},
3040         {0x14, "prf:PreferenceForFrames='No'"},
3041         {0x15, "prf:TablesCapable='Yes'"},
3042         {0x16, "prf:TablesCapable='No'"},
3043         {0x17, "prf:XhtmlVersion"},
3044         {0x18, "prf:XhtmlModules"},
3045         {0x19, "prf:BrowserName"},
3046         {0x1A, "prf:BrowserVersion"},
3047
3048         { 0x00, NULL }
3049 };
3050
3051 /* CodePage     3       PushCharacteristics */
3052 static const value_string  wbxml_uaprof_attrStart_cp3[] = {
3053         {0x05, "prf:Push-Accept"},
3054         {0x06, "prf:Push-Accept-Charset"},
3055         {0x07, "prf:Push-Accept-Encoding"},
3056         {0x08, "prf:Push-Accept-Language"},
3057         {0x09, "prf:Push-Accept-AppID"},
3058         {0x0A, "prf:Push-MsgSize"},
3059         {0x0B, "prf:Push-MaxPushReq"},
3060
3061         { 0x00, NULL }
3062 };
3063
3064 /*****    Attribute Value tokens   *****/
3065 /* CodePage     0       RDF */
3066 static const value_string  wbxml_uaprof_attrValue_cp0[] = {
3067         {0x85, "rdf:Statement"},
3068         {0x86, "http://"},
3069         {0x87, "http://www."},
3070         {0x88, "https://"},
3071         {0x89, "https://www."},
3072         {0x8A, "www."},
3073         {0x8B, ".com/"},
3074         {0x8C, ".edu/"},
3075         {0x8D, ".net/"},
3076         {0x8E, ".org/"},
3077
3078         { 0x00, NULL }
3079 };
3080
3081 /* CodePage     1       CoreVocabularyAttrValue */
3082 static const value_string  wbxml_uaprof_attrValue_cp1[] = {
3083         {0x85, "No"},
3084         {0x86, "Yes"},
3085
3086         { 0x00, NULL }
3087 };
3088
3089 /* CodePage     2       BrowserUAAttrValue */
3090 static const value_string  wbxml_uaprof_attrValue_cp2[] = {
3091         {0x85, "No"},
3092         {0x86, "Yes"},
3093
3094         { 0x00, NULL }
3095 };
3096
3097 /***** Token code page aggregation *****/
3098 static const value_valuestring wbxml_uaprof_tags[] = {
3099         { 0, wbxml_uaprof_tags_cp0 },
3100         { 1, wbxml_uaprof_tags_cp1 },
3101         { 2, wbxml_uaprof_tags_cp2 },
3102         { 3, wbxml_uaprof_tags_cp3 },
3103         { 4, wbxml_uaprof_tags_cp4 },
3104         { 0, NULL }
3105 };
3106
3107 static const value_valuestring wbxml_uaprof_attrStart[] = {
3108         { 0, wbxml_uaprof_attrStart_cp0 },
3109         { 1, wbxml_uaprof_attrStart_cp1 },
3110         { 2, wbxml_uaprof_attrStart_cp2 },
3111         { 3, wbxml_uaprof_attrStart_cp3 },
3112         { 0, NULL }
3113 };
3114
3115 static const value_valuestring wbxml_uaprof_attrValue[] = {
3116         { 0, wbxml_uaprof_attrValue_cp0 },
3117         { 1, wbxml_uaprof_attrValue_cp1 },
3118         { 2, wbxml_uaprof_attrValue_cp2 },
3119         { 0, NULL }
3120 };
3121
3122 static const wbxml_decoding decode_uaprof_wap_248 = {
3123     "User-Agent Profile (WAP-174, WAP-248)",
3124     "UAProf (WAP-174, WAP-248)",
3125     { NULL, NULL, NULL },
3126         default_opaque_binary_tag,
3127         default_opaque_literal_tag,
3128         default_opaque_binary_attr,
3129         default_opaque_literal_attr,
3130     NULL,
3131     wbxml_uaprof_tags,
3132     wbxml_uaprof_attrStart,
3133     wbxml_uaprof_attrValue
3134 };
3135
3136
3137
3138
3139
3140 /* WV-CSP 1.0
3141  *
3142  * Wireless Village Client Server Protocol
3143  ***************************************/
3144
3145 /*****   Global extension tokens   *****/
3146
3147 /*****         Tag tokens          *****/
3148 /* Common code page (0x00) */
3149 static const value_string wbxml_wv_csp_10_tags_cp0[] = {
3150         /* 0x00 -- 0x04 GLOBAL */
3151         { 0x05, "Acceptance" },
3152         { 0x06, "AddList" },
3153         { 0x07, "AddNickList" },
3154         { 0x08, "Attribute" },
3155         { 0x09, "AttributeList" },
3156         { 0x0A, "ClientID" },
3157         { 0x0B, "Code" },
3158         { 0x0C, "ContactList" },
3159         { 0x0D, "ContentData" },
3160         { 0x0E, "ContentEncoding" },
3161         { 0x0F, "ContentSize" },
3162         { 0x10, "ContentType" },