Coverage Report

Created: 2026-01-02 06:13

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