PageRenderTime 44ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 1ms

/epan/dissectors/packet-wbxml.c

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