Remove unused dissector handles from the WAP dissectors.
authorobiot <obiot@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 15 Dec 2003 22:38:29 +0000 (22:38 +0000)
committerobiot <obiot@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 15 Dec 2003 22:38:29 +0000 (22:38 +0000)
Rename the WAP protocols so that they reflect the protocol name and not the
protocol stack name.

Fix the WSP content-type header.

Rename the WSP header fields from 'hdr' to 'header'.

Rename the WSP Openwave header fields from header code page 'x-up-1':
replace 'openwave' with 'x_up_1' (is more intuitive).

Remove unused WSP header fields.

Rename the WTLS header fields so they do not contain 'wsp' anymore.

Correct the WBXML code page switches in the token parsers.

Fix the code page support of multi-codepage content.

Update the PROV WBXML content (and find bugs in the new OMA Prov spec :).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9291 f5534014-38df-0310-8fa8-9805f1628bb7

packet-wbxml.c
packet-wsp.c
packet-wtls.c
packet-wtp.c

index 78aca10934f1aec6b6ad301d8b2c9b9d3a7065d6..7c16b62992a1752e90cad507b259d0508352b53f 100644 (file)
@@ -1,8 +1,9 @@
 /* packet-wbxml.c
+ *
  * Routines for wbxml dissection
  * Copyright 2003, Olivier Biot <olivier.biot (ad) siemens.com>
  *
- * $Id: packet-wbxml.c,v 1.20 2003/12/13 13:27:30 obiot Exp $
+ * $Id: packet-wbxml.c,v 1.21 2003/12/15 22:38:29 obiot Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  *      o  stag      : TAG | LITERAL | LITERAL_A | LITERAL_C | LITERAL_AC
  *      o  attr      : ATTRSTART | ATTRVALUE
  *      o  extension : EXT_I | EXT_T | EXT
- *    Code page switches are displayed in a separate column. The only allowed
- *    code page switches are from code page 0 to another codepage (by means of
- *    a SWITCH_PAGE token), and from this other code page back to code page 0
- *    (this happens automatically).
+ *    Code page switches are displayed in a separate column.
+ *
+ *  - The WBXML spec states that code pages are static to both the tag and the
+ *    attribute state parser. A SWITCH_PAGE within a state switches the code
+ *    page of the active state only. Note that code page 255 is reserved for
+ *    application-specific (read: testing) purposes.
  *
  *  - In order to render the XML content, recursion is inevitable at some
  *    point (when a tag with content occurs in the content of a tag with
@@ -1156,6 +1159,14 @@ static const value_string wbxml_provc10_tags_cp0[] = {
 
        { 0x00, NULL }
 };
+static const value_string wbxml_provc10_tags_cp1[] = {
+       /* 0x00 -- 0x04 GLOBAL */
+       /* 0x05 */
+       { 0x06, "characteristic" },
+       { 0x07, "parm" },
+
+       { 0x00, NULL }
+};
 
 /*****    Attribute Start tokens   *****/
 static const value_string wbxml_provc10_attrStart_cp0[] = {
@@ -1216,11 +1227,21 @@ static const value_string wbxml_provc10_attrStart_cp0[] = {
        { 0x3A, "name='TRANSFER-DELAY'" },
        { 0x3B, "name='GUARANTEED-BITRATE-UPLINK'" },
        { 0x3C, "name='GUARANTEED-BITRATE-DNLINK'" },
-       /* 0x3D -- 0x3F */
+       { 0x3D, "name='PXADDR-FQDN'" },
+       { 0x3E, "name='PROXY-PW'" },
+       { 0x3F, "name='PPGAUTH-TYPE'" },
        /* 0x40 -- 0x44 GLOBAL */
        { 0x45, "version=" },
        { 0x46, "version='1.0'" },
-       /* 0x47 -- 0x4F */
+       { 0x47, "name='PULLENABLED'" },
+       { 0x48, "name='DNS-ADDR'" },
+       { 0x49, "name='MAX-NUM-RETRY'" },
+       { 0x4A, "name='FIRST-RETRY-TIMEOUT'" },
+       { 0x4B, "name='REREG-THRESHOLD'" },
+       { 0x4C, "name='T-BIT'" },
+       /* 0x4D */
+       { 0x4E, "name='AUTH-ENTITY'" },
+       { 0x4F, "name='SPI'" },
        { 0x50, "type=" },
        { 0x51, "type='PXLOGICAL'" },
        { 0x52, "type='PXPHYSICAL'" },
@@ -1232,6 +1253,50 @@ static const value_string wbxml_provc10_attrStart_cp0[] = {
        { 0x58, "type='CLIENTIDENTITY'" },
        { 0x59, "type='PXAUTHINFO'" },
        { 0x5A, "type='NAPAUTHINFO'" },
+       { 0x5B, "type='ACCESS'" },
+
+       { 0x00, NULL }
+};
+static const value_string wbxml_provc10_attrStart_cp1[] = {
+       /* 0x00 -- 0x04 GLOBAL */
+       /* 0x05 -- 0x06 */
+       { 0x07, "name='NAME'" },
+       /* 0x08 -- 0x13 */
+       { 0x14, "name='INTERNET'" },
+       /* 0x15 -- 0x1B */
+       { 0x1C, "name='STARTPAGE'" },
+       /* 0x1D -- 0x21 */
+       { 0x22, "name='TO-NAPID'" },
+       { 0x23, "name='PORTNBR'" },
+       { 0x24, "name='SERVICE'" },
+       /* 0x25 -- 0x2D */
+       { 0x2E, "name='AACCEPT'" },
+       { 0x2F, "name='AAUTHDATA'" },
+       { 0x30, "name='AAUTHLEVEL'" },
+       { 0x31, "name='AAUTHNAME'" },
+       { 0x32, "name='AAUTHSECRET'" },
+       { 0x33, "name='AAUTHTYPE'" },
+       { 0x34, "name='ADDR'" },
+       { 0x35, "name='ADDRTYPE'" },
+       { 0x36, "name='APPID'" },
+       { 0x37, "name='APROTOCOL'" },
+       { 0x38, "name='PROVIDER-ID'" },
+       { 0x39, "name='TO-PROXY'" },
+       { 0x3A, "name='URI'" },
+       { 0x3B, "name='RULE'" },
+       /* 0x3C -- 0x3F */
+       /* 0x40 -- 0x44 GLOBAL */
+       /* 0x45 -- 0x4F */
+       { 0x50, "type=" },
+       /* 0x51 -- 0x52 */
+       { 0x53, "type='PORT'" },
+       /* 0x54 */
+       { 0x55, "type='APPLICATION'" },
+       { 0x56, "type='APPADDR'" },
+       { 0x57, "type='APPAUTH'" },
+       { 0x58, "type='CLIENTIDENTITY'" },
+       { 0x59, "type='RESOURCE'" },
+       /* 0x5A -- 0x7F */
 
        { 0x00, NULL }
 };
@@ -1260,7 +1325,8 @@ static const value_string wbxml_provc10_attrValue_cp0[] = {
        { 0x9C, "'HTTP-BASIC'" },
        { 0x9D, "'HTTP-DIGEST'" },
        { 0x9E, "'WTLS-SS'" },
-       /* 0x9F -- 0xA1 */
+       { 0x9F, "'MD5'" },
+       /* 0xA0 -- 0xA1 */
        { 0xA2, "'GSM-USSD'" },
        { 0xA3, "'GSM-SMS'" },
        { 0xA4, "'ANSI-136-GUTS'" },
@@ -1284,7 +1350,9 @@ static const value_string wbxml_provc10_attrValue_cp0[] = {
        { 0xB6, "'TETRA-PACKET'" },
        { 0xB7, "'ANSI-136-GHOST'" },
        { 0xB8, "'MOBITEX-MPAK'" },
-       /* 0xB9 -- 0xBF */
+       { 0xB9, "'CDMA2000-IX-SIMPLE-IP'" },
+       { 0xBA, "'CDMA2000-IX-MOBILE-IP'" },
+       /* 0xBB -- 0xBF */
        /* 0xC0 -- 0xC4 GLOBAL */
        { 0xC5, "'AUTOBAUDING'" },
        /* 0xC6 -- 0xC9 */
@@ -1294,6 +1362,33 @@ static const value_string wbxml_provc10_attrValue_cp0[] = {
        { 0xCD, "'CO-SEC-WSP'" },
        { 0xCE, "'CL-SEC-WTA'" },
        { 0xCF, "'CO-SEC-WTA'" },
+       { 0xD0, "'OTA-HTTP-TO'" },
+       { 0xD1, "'OTA-HTTP-TLS-TO'" },
+       { 0xD2, "'OTA-HTTP-PO'" },
+       { 0xD3, "'OTA-HTTP-TLS-PO'" },
+       /* 0xD4 -- 0xFF */
+
+       { 0x00, NULL }
+};
+static const value_string wbxml_provc10_attrValue_cp1[] = {
+       /* 0x80 -- 0x84 GLOBAL */
+       /* 0x85 */
+       { 0x86, "'IPV6'" },
+       { 0x87, "'E164'" },
+       { 0x88, "'ALPHA'" },
+       { 0x8D, "'APPSRV'" },
+       { 0x8E, "'OBEX'" },
+       /* 0x8F */
+
+       /* XXX - Errors that require a fix in the OMA/WAP Client Provisioning specs:
+       { 0xXXX, "','" },
+       { 0xXXX, "'HTTP-'" },
+       { 0xXXX, "'BASIC'" },
+       { 0xXXX, "'DIGEST'" },
+       */
+
+       { 0xE0, "'AAA'" },
+       { 0xE1, "'HA'" },
 
        { 0x00, NULL }
 };
@@ -1301,16 +1396,19 @@ static const value_string wbxml_provc10_attrValue_cp0[] = {
 /***** Token code page aggregation *****/
 static const value_valuestring wbxml_provc10_tags[] = {
        { 0, wbxml_provc10_tags_cp0 },
+       { 1, wbxml_provc10_tags_cp1 },
        { 0, NULL }
 };
 
 static const value_valuestring wbxml_provc10_attrStart[] = {
        { 0, wbxml_provc10_attrStart_cp0 },
+       { 1, wbxml_provc10_attrStart_cp1 },
        { 0, NULL }
 };
 
 static const value_valuestring wbxml_provc10_attrValue[] = {
        { 0, wbxml_provc10_attrValue_cp0 },
+       { 1, wbxml_provc10_attrValue_cp1 },
        { 0, NULL }
 };
 
@@ -1461,7 +1559,7 @@ static const value_string wbxml_syncmlc10_tags_cp1[] = { /* MetInf 1.0 */
 /***** Token code page aggregation *****/
 static const value_valuestring wbxml_syncmlc10_tags[] = {
        { 0, wbxml_syncmlc10_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.0//EN */
-       { 0, wbxml_syncmlc10_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.0//EN */
+       { 1, wbxml_syncmlc10_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.0//EN */
        { 0, NULL }
 };
 
@@ -1561,7 +1659,7 @@ static const value_string wbxml_syncmlc11_tags_cp1[] = { /* MetInf 1.1 */
 /***** Token code page aggregation *****/
 static const value_valuestring wbxml_syncmlc11_tags[] = {
        { 0, wbxml_syncmlc11_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.1//EN */
-       { 0, wbxml_syncmlc11_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.1//EN */
+       { 1, wbxml_syncmlc11_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.1//EN */
        { 0, NULL }
 };
 
@@ -1981,25 +2079,25 @@ show_wbxml_string_table (proto_tree *tree, tvbuff_t *tvb, guint32 str_tbl,
 /* Parse data while in STAG state */
 static guint32
 parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
-               guint32 str_tbl, guint8 *level);
+               guint32 str_tbl, guint8 *level, guint8 *codepage_stag, guint8 *codepage_attr);
 
 /* Parse data while in STAG state;
  * interpret tokens as defined by content type */
 static guint32
 parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
-               guint32 str_tbl, guint8 *level,
+               guint32 str_tbl, guint8 *level, guint8 *codepage_stag, guint8 *codepage_attr,
                const wbxml_token_map *map);
 
 /* Parse data while in ATTR state */
 static guint32
 parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
-               guint32 offset, guint32 str_tbl, guint8 level);
+               guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr);
 
 /* Parse data while in ATTR state;
  * interpret tokens as defined by content type */
 static guint32
 parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
-               guint32 offset, guint32 str_tbl, guint8 level,
+               guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr,
                const wbxml_token_map *map);
 
 
@@ -2029,6 +2127,8 @@ dissect_wbxml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        guint8 level = 0; /* WBXML recursion level */
        const wbxml_token_map *content_map = NULL;
        gchar *summary = NULL;
+       guint8 codepage_stag = 0;
+       guint8 codepage_attr = 0;
 
        DebugLog(("dissect_wbxml: Dissecting packet %u\n", pinfo->fd->num));
        /* WBXML format
@@ -2182,7 +2282,8 @@ dissect_wbxml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                                                "| WBXML Token Description         "
                                                                "| Rendering");
                                                len = parse_wbxml_tag_defined (wbxml_content_tree,
-                                                               tvb, offset, str_tbl, &level, content_map);
+                                                               tvb, offset, str_tbl, &level, &codepage_stag,
+                                                               &codepage_attr, content_map);
                                                return;
                                        }
                                }
@@ -2197,7 +2298,7 @@ dissect_wbxml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                        "| WBXML Token Description         "
                                        "| Rendering");
                        len = parse_wbxml_tag (wbxml_content_tree, tvb, offset,
-                                       str_tbl, &level);
+                                       str_tbl, &level, &codepage_stag, &codepage_attr);
                        return;
                }
                return;
@@ -2306,7 +2407,7 @@ static const char * Indent (guint8 level) {
  */
 static guint32
 parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
-               guint32 str_tbl, guint8 *level,
+               guint32 str_tbl, guint8 *level, guint8 *codepage_stag, guint8 *codepage_attr,
                const wbxml_token_map *map)
 {
        guint32 tvb_len = tvb_reported_length (tvb);
@@ -2321,7 +2422,6 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
        guint8 tag_new_known = 0; /* Will contain peek & 0x3F (tag identity) */
        const char *tag_save_literal; /* Will contain the LITERAL tag identity */
        const char *tag_new_literal; /* Will contain the LITERAL tag identity */
-       guint8 codepage_stag = 0; /* Initial codepage in state = STAG */
        guint8 parsing_tag_content = FALSE; /* Are we parsing content from a
                                                                                   tag with content: <x>Content</x>
                                                                                   
@@ -2336,28 +2436,29 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                if ((peek & 0x3F) < 4) switch (peek) { /* Global tokens in state = STAG
                                                                                                  but not the LITERAL tokens */
                        case 0x00: /* SWITCH_PAGE */
-                               codepage_stag = tvb_get_guint8 (tvb, off+1);
+                               *codepage_stag = tvb_get_guint8 (tvb, off+1);
                                proto_tree_add_text (tree, tvb, off, 2,
-                                               "      | Tag   | T 0->%3d "
+                                               "      | Tag   | T -->%3d "
                                                "| SWITCH_PAGE (Tag code page)     "
                                                "|",
-                                               codepage_stag);
+                                               *codepage_stag);
                                off += 2;
                                break;
                        case 0x01: /* END: only possible for Tag with Content */
                                if (tag_save_known) { /* Known TAG */
                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   |          "
+                                                       "  %3d | Tag   | T %3d    "
                                                        "| END (Known Tag 0x%02X)            "
                                                        "| %s</%s>",
-                                                       *level, tag_save_known, Indent (*level),
+                                                       *level, *codepage_stag,
+                                                       tag_save_known, Indent (*level),
                                                        tag_save_literal); /* We already looked it up! */
                                } else { /* Literal TAG */
                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   |          "
+                                                       "  %3d | Tag   | T %3d    "
                                                        "| END (Literal Tag)               "
                                                        "| %s</%s>",
-                                                       *level, Indent (*level),
+                                                       *level, *codepage_stag, Indent (*level),
                                                        tag_save_literal);
                                }
                                (*level)--;
@@ -2369,19 +2470,19 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                        case 0x02: /* ENTITY */
                                ent = tvb_get_guintvar (tvb, off+1, &len);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| ENTITY                          "
                                                "| %s'&#%u;'",
-                                               *level, Indent (*level), ent);
+                                               *level, *codepage_stag, Indent (*level), ent);
                                off += 1+len;
                                break;
                        case 0x03: /* STR_I */
                                len = tvb_strsize (tvb, off+1);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| STR_I (Inline string)           "
                                                "| %s\'%s\'",
-                                               *level, Indent(*level),
+                                               *level, *codepage_stag, Indent(*level),
                                                tvb_format_text (tvb, off+1, len-1));
                                off += 1+len;
                                break;
@@ -2390,46 +2491,38 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                        case 0x42: /* EXT_I_2 */
                                /* Extension tokens */
                                len = tvb_strsize (tvb, off+1);
-                               if (codepage_stag) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d | Tag   | T %3d->0 "
-                                                       "| EXT_I_%1x    (Extension Token)    "
-                                                       "| %s(%s: \'%s\')",
-                                                       *level, codepage_stag, peek & 0x0f, Indent (*level),
-                                                       map_token (map->global, codepage_stag, peek),
-                                                       tvb_format_text (tvb, off+1, len-1));
-                                       /* Reset code page */
-                                       codepage_stag = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d | Tag   |          "
-                                                       "| EXT_I_%1x    (Extension Token)    "
-                                                       "| %s(%s: \'%s\')",
-                                                       *level, peek & 0x0f, Indent (*level),
-                                                       map_token (map->global, codepage_stag, peek),
-                                                       tvb_format_text (tvb, off+1, len-1));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1+len,
+                                               "  %3d | Tag   | T %3d    "
+                                               "| EXT_I_%1x    (Extension Token)    "
+                                               "| %s(%s: \'%s\')",
+                                               *level, *codepage_stag,
+                                               peek & 0x0f, Indent (*level),
+                                               map_token (map->global, *codepage_stag, peek),
+                                               tvb_format_text (tvb, off+1, len-1));
                                off += 1+len;
                                break;
                        case 0x43: /* PI */
                                proto_tree_add_text (tree, tvb, off, 1,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| PI (XML Processing Instruction) "
                                                "| %s<?xml",
-                                               *level, Indent (*level));
-                               len = parse_wbxml_attribute_list_defined (tree, tvb, off, str_tbl,
-                                               *level, map);
+                                               *level, *codepage_stag, Indent (*level));
+                               len = parse_wbxml_attribute_list_defined (tree, tvb, off,
+                                               str_tbl, *level, codepage_attr, map);
                                /* Check that there is still room in packet */
                                off += len;
                                if (off >= tvb_len) {
                                        DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
+                                       /*
+                                        * TODO - Do we need to free g_malloc()ed memory?
+                                        */
                                        THROW(ReportedBoundsError);
                                }
                                proto_tree_add_text (tree, tvb, off-1, 1,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| END (PI)                        "
                                                "| %s?>",
-                                               *level, Indent (*level));
+                                               *level, *codepage_stag, Indent (*level));
                                break;
                        case 0x80: /* EXT_T_0 */
                        case 0x81: /* EXT_T_1 */
@@ -2437,35 +2530,23 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                /* Extension tokens */
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
-                               if (codepage_stag) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d | Tag   | T %3d->0 "
-                                                       "| EXT_T_%1x    (Extension Token)    "
-                                                       "| %s(%s: \'%s\')",
-                                                       *level, codepage_stag, peek & 0x0f, Indent (*level),
-                                                       map_token (map->global, codepage_stag, peek),
-                                                       tvb_format_text (tvb, str_tbl+index, str_len-1));
-                                       /* Reset code page */
-                                       codepage_stag = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d | Tag   |          "
-                                                       "| EXT_T_%1x    (Extension Token)    "
-                                                       "| %s(%s: \'%s\')",
-                                                       *level, peek & 0x0f, Indent (*level),
-                                                       map_token (map->global, codepage_stag, peek),
-                                                       tvb_format_text (tvb, str_tbl+index, str_len-1));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1+len,
+                                               "  %3d | Tag   | T %3d    "
+                                               "| EXT_T_%1x    (Extension Token)    "
+                                               "| %s(%s: \'%s\')",
+                                               *level, *codepage_stag, peek & 0x0f, Indent (*level),
+                                               map_token (map->global, *codepage_stag, peek),
+                                               tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
                        case 0x83: /* STR_T */
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| STR_T (Tableref string)         "
                                                "| %s\'%s\'",
-                                               *level, Indent (*level),
+                                               *level, *codepage_stag, Indent (*level),
                                                tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
@@ -2473,40 +2554,29 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                        case 0xC1: /* EXT_1 */
                        case 0xC2: /* EXT_2 */
                                /* Extension tokens */
-                               if (codepage_stag) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   | T %3d->0 "
-                                                       "| EXT_%1x      (Extension Token)    "
-                                                       "| %s(%s)",
-                                                       *level, codepage_stag, peek & 0x0f, Indent (*level),
-                                                       map_token (map->global, codepage_stag, peek));
-                                       /* Reset code page */
-                                       codepage_stag = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   |          "
-                                                       "| EXT_%1x      (Extension Token)    "
-                                                       "| %s(%s)",
-                                                       *level, peek & 0x0f, Indent (*level),
-                                                       map_token (map->global, codepage_stag, peek));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1,
+                                               "  %3d | Tag   | T %3d    "
+                                               "| EXT_%1x      (Extension Token)    "
+                                               "| %s(%s)",
+                                               *level, *codepage_stag, peek & 0x0f, Indent (*level),
+                                               map_token (map->global, *codepage_stag, peek));
                                off++;
                                break;
                        case 0xC3: /* OPAQUE - WBXML 1.1 and newer */
                                if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */
                                        index = tvb_get_guintvar (tvb, off+1, &len);
                                        proto_tree_add_text (tree, tvb, off, 1 + len + index,
-                                                       "  %3d | Tag   |          "
+                                                       "  %3d | Tag   | T %3d    "
                                                        "| OPAQUE (Opaque data)            "
                                                        "| %s(%d bytes of opaque data)",
-                                                       *level, Indent (*level), index);
+                                                       *level, *codepage_stag, Indent (*level), index);
                                        off += 1+len+index;
                                } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */
                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   |          "
+                                                       "  %3d | Tag   | T %3d    "
                                                        "| RESERVED_2     (Invalid Token!) "
                                                        "| WBXML 1.0 parsing stops here.",
-                                                       *level);
+                                                       *level, *codepage_stag);
                                        /* Stop processing as it is impossible to parse now */
                                        off = tvb_len;
                                        DebugLog(("STAG: level = %u, Return: len = %u\n", *level, off - offset));
@@ -2539,7 +2609,7 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                tag_new_known = 0; /* invalidate known tag_new */
                        } else { /* Known tag */
                                tag_new_known = peek & 0x3F;
-                               tag_new_literal = map_token (map->tags, codepage_stag,
+                               tag_new_literal = map_token (map->tags, *codepage_stag,
                                                                                tag_new_known);
                                /* Stored looked up tag name string */
                        }
@@ -2557,7 +2627,7 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                         * recursion will take care of it */
                                        (*level)++;
                                        len = parse_wbxml_tag_defined (tree, tvb, off, str_tbl,
-                                                       level, map);
+                                                       level, codepage_stag, codepage_attr, map);
                                        off += len;
                                } else { /* Now we will have content to parse */
                                        /* Save the start tag so we can properly close it later. */
@@ -2572,77 +2642,56 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                        /* Process the attribute list if present */
                                        if (peek & 0x80) { /* Content and Attribute list present */
                                                if (tag_new_known) { /* Known tag */
-                                                       if (codepage_stag) { /* Not default code page */
-                                                               proto_tree_add_text (tree, tvb, off, 1,
-                                                                               "  %3d | Tag   | T %3d->0 "
-                                                                               "|   Known Tag 0x%02X           (AC) "
-                                                                               "| %s<%s",
-                                                                               *level, codepage_stag, tag_new_known,
-                                                                               Indent (*level), tag_new_literal);
-                                                               /* Tag string already looked up earlier! */
-                                                               /* Reset code page */
-                                                               codepage_stag = 0;
-                                                       } else { /* Code page 0 */
-                                                               proto_tree_add_text (tree, tvb, off, 1,
-                                                                               "  %3d | Tag   |          "
-                                                                               "|   Known Tag 0x%02X           (AC) "
-                                                                               "| %s<%s",
-                                                                               *level, tag_new_known,
-                                                                               Indent (*level), tag_new_literal);
-                                                               /* Tag string already looked up earlier! */
-                                                       }
+                                                       proto_tree_add_text (tree, tvb, off, 1,
+                                                                       "  %3d | Tag   | T %3d    "
+                                                                       "|   Known Tag 0x%02X           (AC) "
+                                                                       "| %s<%s",
+                                                                       *level, *codepage_stag, tag_new_known,
+                                                                       Indent (*level), tag_new_literal);
+                                                       /* Tag string already looked up earlier! */
                                                        off++;
                                                } else { /* LITERAL tag */
                                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   |          "
+                                                                       "  %3d | Tag   | T %3d    "
                                                                        "| LITERAL_AC (Literal tag)   (AC) "
                                                                        "| %s<%s",
-                                                                       *level, Indent (*level), tag_new_literal);
+                                                                       *level, *codepage_stag, Indent (*level), tag_new_literal);
                                                        off += 1 + tag_len;
                                                }
                                                len = parse_wbxml_attribute_list_defined (tree, tvb,
-                                                               off, str_tbl, *level, map);
+                                                               off, str_tbl, *level, codepage_attr, map);
                                                /* Check that there is still room in packet */
                                                off += len;
                                                if (off >= tvb_len) {
-                                                       DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
+                                                       DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n",
+                                                                               *level, off - offset));
+                                                       /*
+                                                        * TODO - Do we need to free g_malloc()ed memory?
+                                                        */
                                                        THROW(ReportedBoundsError);
                                                }
                                                proto_tree_add_text (tree, tvb, off-1, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| END (attribute list)            "
                                                                "| %s>",
-                                                               *level, Indent (*level));
+                                                               *level, *codepage_stag, Indent (*level));
                                        } else { /* Content, no Attribute list */
                                                if (tag_new_known) { /* Known tag */
-                                                       if (codepage_stag) { /* Not default code page */
-                                                               proto_tree_add_text (tree, tvb, off, 1,
-                                                                               "  %3d | Tag   | T %3d->0 "
-                                                                               "|   Known Tag 0x%02X           (.C) "
-                                                                               "| %s<%s>",
-                                                                               *level, codepage_stag, tag_new_known,
-                                                                               Indent (*level),
-                                                                               tag_new_literal);
-                                                               /* Tag string already looked up earlier! */
-                                                               /* Reset code page */
-                                                               codepage_stag = 0;
-                                                       } else { /* Code page 0 */
-                                                               proto_tree_add_text (tree, tvb, off, 1,
-                                                                               "  %3d | Tag   |          "
-                                                                               "|   Known Tag 0x%02X           (.C) "
-                                                                               "| %s<%s>",
-                                                                               *level, tag_new_known,
-                                                                               Indent (*level),
-                                                                               tag_new_literal);
-                                                               /* Tag string already looked up earlier! */
-                                                       }
+                                                       proto_tree_add_text (tree, tvb, off, 1,
+                                                                       "  %3d | Tag   | T %3d    "
+                                                                       "|   Known Tag 0x%02X           (.C) "
+                                                                       "| %s<%s>",
+                                                                       *level, *codepage_stag, tag_new_known,
+                                                                       Indent (*level), tag_new_literal);
+                                                       /* Tag string already looked up earlier! */
                                                        off++;
                                                } else { /* LITERAL tag */
                                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   |          "
+                                                                       "  %3d | Tag   | T %3d    "
                                                                        "| LITERAL_C  (Literal Tag)   (.C) "
                                                                        "| %s<%s>",
-                                                                       *level, Indent (*level), tag_new_literal);
+                                                                       *level, *codepage_stag, Indent (*level),
+                                                                       tag_new_literal);
                                                        off += 1 + tag_len;
                                                }
                                        }
@@ -2659,88 +2708,71 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                (*level)++;
                                if (peek & 0x80) { /* No Content, Attribute list present */
                                        if (tag_new_known) { /* Known tag */
-                                               if (codepage_stag) { /* Not default code page */
-                                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   | T %3d->0 "
-                                                                       "|   Known Tag 0x%02X           (A.) "
-                                                                       "| %s<%s",
-                                                                       *level, codepage_stag, tag_new_known,
-                                                                       Indent (*level), tag_new_literal);
-                                                       /* Tag string already looked up earlier! */
-                                                       /* Reset code page */
-                                                       codepage_stag = 0;
-                                               } else { /* Code page 0 */
-                                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   |          "
-                                                                       "|   Known Tag 0x%02X           (A.) "
-                                                                       "| %s<%s",
-                                                                       *level, tag_new_known,
-                                                                       Indent (*level), tag_new_literal);
-                                                       /* Tag string already looked up earlier! */
-                                               }
+                                               proto_tree_add_text (tree, tvb, off, 1,
+                                                               "  %3d | Tag   | T %3d    "
+                                                               "|   Known Tag 0x%02X           (A.) "
+                                                               "| %s<%s",
+                                                               *level, *codepage_stag, tag_new_known,
+                                                               Indent (*level), tag_new_literal);
+                                               /* Tag string already looked up earlier! */
                                                off++;
                                                len = parse_wbxml_attribute_list_defined (tree, tvb,
-                                                               off, str_tbl, *level, map);
+                                                               off, str_tbl, *level, codepage_attr, map);
                                                /* Check that there is still room in packet */
                                                off += len;
                                                if (off >= tvb_len) {
                                                        DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
+                                                       /*
+                                                        * TODO - Do we need to free g_malloc()ed memory?
+                                                        */
                                                        THROW(ReportedBoundsError);
                                                }
                                                proto_tree_add_text (tree, tvb, off-1, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| END (Known Tag)                 "
                                                                "| %s/>",
-                                                               *level, Indent (*level));
+                                                               *level, *codepage_stag, Indent (*level));
                                        } else { /* LITERAL tag */
                                                proto_tree_add_text (tree, tvb, off, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| LITERAL_A  (Literal Tag)   (A.) "
                                                                "| %s<%s",
-                                                               *level, Indent (*level), tag_new_literal);
+                                                               *level, *codepage_stag, Indent (*level), tag_new_literal);
                                                off += 1 + tag_len;
                                                len = parse_wbxml_attribute_list_defined (tree, tvb,
-                                                               off, str_tbl, *level, map);
+                                                               off, str_tbl, *level, codepage_attr, map);
                                                /* Check that there is still room in packet */
                                                off += len;
                                                if (off >= tvb_len) {
                                                        DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
+                                                       /*
+                                                        * TODO - Do we need to free g_malloc()ed memory?
+                                                        */
                                                        THROW(ReportedBoundsError);
                                                }
                                                proto_tree_add_text (tree, tvb, off-1, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| END (Literal Tag)               "
                                                                "| %s/>",
-                                                               *level, Indent (*level));
+                                                               *level, *codepage_stag, Indent (*level));
                                        }
                                } else { /* No Content, No Attribute list */
                                        if (tag_new_known) { /* Known tag */
-                                               if (codepage_stag) { /* Not default code page */
-                                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   | T %3d->0 "
-                                                                       "|   Known Tag 0x%02x           (..) "
-                                                                       "| %s<%s />",
-                                                                       *level, codepage_stag, tag_new_known,
-                                                                       Indent (*level), tag_new_literal);
-                                                       /* Tag string already looked up earlier! */
-                                                       /* Reset code page */
-                                                       codepage_stag = 0;
-                                               } else { /* Code page 0 */
-                                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   |          "
-                                                                       "|   Known Tag 0x%02x           (..) "
-                                                                       "| %s<%s />",
-                                                                       *level, tag_new_known,
-                                                                       Indent (*level), tag_new_literal);
-                                                       /* Tag string already looked up earlier! */
-                                               }
+                                               proto_tree_add_text (tree, tvb, off, 1,
+                                                               "  %3d | Tag   | T %3d    "
+                                                               "|   Known Tag 0x%02x           (..) "
+                                                               "| %s<%s />",
+                                                               *level, *codepage_stag, tag_new_known,
+                                                               Indent (*level), tag_new_literal);
+                                               /* Tag string already looked up earlier! */
                                                off++;
                                        } else { /* LITERAL tag */
                                                proto_tree_add_text (tree, tvb, off, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| LITERAL    (Literal Tag)   (..) "
                                                                "| %s<%s />",
-                                                               *level, Indent (*level), tag_new_literal);
+                                                               *level, *codepage_stag, Indent (*level),
+                                                               tag_new_literal);
                                                off += 1 + tag_len;
                                        }
                                }
@@ -2761,7 +2793,8 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
  */
 static guint32
 parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
-               guint32 str_tbl, guint8 *level)
+               guint32 str_tbl, guint8 *level,
+               guint8 *codepage_stag, guint8 *codepage_attr)
 {
        guint32 tvb_len = tvb_reported_length (tvb);
        guint32 off = offset;
@@ -2777,7 +2810,6 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
        const char *tag_new_literal; /* Will contain the LITERAL tag identity */
        char tag_save_buf[10]; /* Will contain "tag_0x%02X" */
        char tag_new_buf[10]; /* Will contain "tag_0x%02X" */
-       guint8 codepage_stag = 0; /* Initial codepage in state = STAG */
        guint8 parsing_tag_content = FALSE; /* Are we parsing content from a
                                                                                   tag with content: <x>Content</x>
                                                                                   
@@ -2792,52 +2824,54 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                if ((peek & 0x3F) < 4) switch (peek) { /* Global tokens in state = STAG
                                                                                                  but not the LITERAL tokens */
                        case 0x00: /* SWITCH_PAGE */
-                               codepage_stag = tvb_get_guint8 (tvb, off+1);
+                               *codepage_stag = tvb_get_guint8 (tvb, off+1);
                                proto_tree_add_text (tree, tvb, off, 2,
-                                               "      | Tag   | T 0->%3d "
+                                               "      | Tag   | T -->%3d "
                                                "| SWITCH_PAGE (Tag code page)     "
                                                "|",
-                                               codepage_stag);
+                                               *codepage_stag);
                                off += 2;
                                break;
                        case 0x01: /* END: only possible for Tag with Content */
                                if (tag_save_known) { /* Known TAG */
                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   |          "
+                                                       "  %3d | Tag   | T %3d    "
                                                        "| END (Known Tag 0x%02X)            "
                                                        "| %s</%s>",
-                                                       *level, tag_save_known, Indent (*level),
+                                                       *level, *codepage_stag, tag_save_known,
+                                                       Indent (*level),
                                                        tag_save_literal); /* We already looked it up! */
                                } else { /* Literal TAG */
                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   |          "
+                                                       "  %3d | Tag   | T %3d    "
                                                        "| END (Literal Tag)               "
                                                        "| %s</%s>",
-                                                       *level, Indent (*level),
+                                                       *level, *codepage_stag, Indent (*level),
                                                        tag_save_literal);
                                }
                                (*level)--;
                                off++;
                                /* Reset code page: not needed as return from recursion */
-                               DebugLog(("STAG: level = %u, Return: len = %u\n", *level, off - offset));
+                               DebugLog(("STAG: level = %u, Return: len = %u\n",
+                                                       *level, off - offset));
                                return (off - offset);
                                break;
                        case 0x02: /* ENTITY */
                                ent = tvb_get_guintvar (tvb, off+1, &len);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| ENTITY                          "
                                                "| %s'&#%u;'",
-                                               *level, Indent (*level), ent);
+                                               *level, *codepage_stag, Indent (*level), ent);
                                off += 1+len;
                                break;
                        case 0x03: /* STR_I */
                                len = tvb_strsize (tvb, off+1);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| STR_I (Inline string)           "
                                                "| %s\'%s\'",
-                                               *level, Indent(*level),
+                                               *level, *codepage_stag, Indent(*level),
                                                tvb_format_text (tvb, off+1, len-1));
                                off += 1+len;
                                break;
@@ -2846,43 +2880,37 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                        case 0x42: /* EXT_I_2 */
                                /* Extension tokens */
                                len = tvb_strsize (tvb, off+1);
-                               if (codepage_stag) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d | Tag   | T %3d->0 "
-                                                       "| EXT_I_%1x    (Extension Token)    "
-                                                       "| %s(Inline string extension: \'%s\')",
-                                                       *level, codepage_stag, peek & 0x0f, Indent (*level),
-                                                       tvb_format_text (tvb, off+1, len-1));
-                                       /* Reset code page */
-                                       codepage_stag = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d | Tag   |          "
-                                                       "| EXT_I_%1x    (Extension Token)    "
-                                                       "| %s(Inline string extension: \'%s\')",
-                                                       *level, peek & 0x0f, Indent (*level),
-                                                       tvb_format_text (tvb, off+1, len-1));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1+len,
+                                               "  %3d | Tag   | T %3d    "
+                                               "| EXT_I_%1x    (Extension Token)    "
+                                               "| %s(Inline string extension: \'%s\')",
+                                               *level, *codepage_stag, peek & 0x0f, Indent (*level),
+                                               tvb_format_text (tvb, off+1, len-1));
                                off += 1+len;
                                break;
                        case 0x43: /* PI */
                                proto_tree_add_text (tree, tvb, off, 1,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| PI (XML Processing Instruction) "
                                                "| %s<?xml",
-                                               *level, Indent (*level));
-                               len = parse_wbxml_attribute_list (tree, tvb, off, str_tbl, *level);
+                                               *level, *codepage_stag, Indent (*level));
+                               len = parse_wbxml_attribute_list (tree, tvb, off, str_tbl,
+                                               *level, codepage_attr);
                                /* Check that there is still room in packet */
                                off += len;
                                if (off >= tvb_len) {
-                                       DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
+                                       DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n",
+                                                               *level, off - offset));
+                                       /*
+                                        * TODO - Do we need to free g_malloc()ed memory?
+                                        */
                                        THROW(ReportedBoundsError);
                                }
                                proto_tree_add_text (tree, tvb, off-1, 1,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| END (PI)                        "
                                                "| %s?>",
-                                               *level, Indent (*level));
+                                               *level, *codepage_stag, Indent (*level));
                                break;
                        case 0x80: /* EXT_T_0 */
                        case 0x81: /* EXT_T_1 */
@@ -2890,33 +2918,22 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                /* Extension tokens */
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
-                               if (codepage_stag) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d | Tag   | T %3d->0 "
-                                                       "| EXT_T_%1x    (Extension Token)    "
-                                                       "| %s(Tableref string extension: \'%s\')",
-                                                       *level, codepage_stag, peek & 0x0f, Indent (*level),
-                                                       tvb_format_text (tvb, str_tbl+index, str_len-1));
-                                       /* Reset code page */
-                                       codepage_stag = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d | Tag   |          "
-                                                       "| EXT_T_%1x    (Extension Token)    "
-                                                       "| %s(Tableref string extension: \'%s\')",
-                                                       *level, peek & 0x0f, Indent (*level),
-                                                       tvb_format_text (tvb, str_tbl+index, str_len-1));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1+len,
+                                               "  %3d | Tag   | T %3d    "
+                                               "| EXT_T_%1x    (Extension Token)    "
+                                               "| %s(Tableref string extension: \'%s\')",
+                                               *level, *codepage_stag, peek & 0x0f, Indent (*level),
+                                               tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
                        case 0x83: /* STR_T */
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d | Tag   |          "
+                                               "  %3d | Tag   | T %3d    "
                                                "| STR_T (Tableref string)         "
                                                "| %s\'%s\'",
-                                               *level, Indent (*level),
+                                               *level, *codepage_stag, Indent (*level),
                                                tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
@@ -2924,42 +2941,32 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                        case 0xC1: /* EXT_1 */
                        case 0xC2: /* EXT_2 */
                                /* Extension tokens */
-                               if (codepage_stag) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   | T %3d->0 "
-                                                       "| EXT_%1x      (Extension Token)    "
-                                                       "| %s(Single-byte extension)",
-                                                       *level, codepage_stag, peek & 0x0f,
-                                                       Indent (*level));
-                                       /* Reset code page */
-                                       codepage_stag = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   |          "
-                                                       "| EXT_%1x      (Extension Token)    "
-                                                       "| %s(Single-byte extension)",
-                                                       *level, peek & 0x0f, Indent (*level));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1,
+                                               "  %3d | Tag   | T %3d    "
+                                               "| EXT_%1x      (Extension Token)    "
+                                               "| %s(Single-byte extension)",
+                                               *level, *codepage_stag, peek & 0x0f, Indent (*level));
                                off++;
                                break;
                        case 0xC3: /* OPAQUE - WBXML 1.1 and newer */
                                if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */
                                        index = tvb_get_guintvar (tvb, off+1, &len);
                                        proto_tree_add_text (tree, tvb, off, 1 + len + index,
-                                                       "  %3d | Tag   |          "
+                                                       "  %3d | Tag   | T %3d    "
                                                        "| OPAQUE (Opaque data)            "
                                                        "| %s(%d bytes of opaque data)",
-                                                       *level, Indent (*level), index);
+                                                       *level, *codepage_stag, Indent (*level), index);
                                        off += 1+len+index;
                                } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */
                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d | Tag   |          "
+                                                       "  %3d | Tag   | T %3d    "
                                                        "| RESERVED_2     (Invalid Token!) "
                                                        "| WBXML 1.0 parsing stops here.",
-                                                       *level);
+                                                       *level, *codepage_stag);
                                        /* Stop processing as it is impossible to parse now */
                                        off = tvb_len;
-                                       DebugLog(("STAG: level = %u, Return: len = %u\n", *level, off - offset));
+                                       DebugLog(("STAG: level = %u, Return: len = %u\n",
+                                                               *level, off - offset));
                                        return (off - offset);
                                }
                                break;
@@ -2982,7 +2989,8 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                        /* Store the new tag */
                        tag_len = 0;
                        if ((peek & 0x3F) == 4) { /* LITERAL */
-                               DebugLog(("STAG: LITERAL tag (peek = 0x%02X, off = %u) - TableRef follows!\n", peek, off));
+                               DebugLog(("STAG: LITERAL tag (peek = 0x%02X, off = %u)"
+                                                       " - TableRef follows!\n", peek, off));
                                index = tvb_get_guintvar (tvb, off+1, &tag_len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
                                tag_new_literal = tvb_get_ptr (tvb, str_tbl+index, str_len);
@@ -3007,7 +3015,8 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                        /* Do not process the attribute list:
                                         * recursion will take care of it */
                                        (*level)++;
-                                       len = parse_wbxml_tag (tree, tvb, off, str_tbl, level);
+                                       len = parse_wbxml_tag (tree, tvb, off, str_tbl, level,
+                                                       codepage_stag, codepage_attr);
                                        off += len;
                                } else { /* Now we will have content to parse */
                                        /* Save the start tag so we can properly close it later. */
@@ -3024,77 +3033,58 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                        /* Process the attribute list if present */
                                        if (peek & 0x80) { /* Content and Attribute list present */
                                                if (tag_new_known) { /* Known tag */
-                                                       if (codepage_stag) { /* Not default code page */
-                                                               proto_tree_add_text (tree, tvb, off, 1,
-                                                                               "  %3d | Tag   | T %3d->0 "
-                                                                               "|   Known Tag 0x%02X           (AC) "
-                                                                               "| %s<%s",
-                                                                               *level, codepage_stag, tag_new_known,
-                                                                               Indent (*level), tag_new_literal);
-                                                               /* Tag string already looked up earlier! */
-                                                               /* Reset code page */
-                                                               codepage_stag = 0;
-                                                       } else { /* Code page 0 */
-                                                               proto_tree_add_text (tree, tvb, off, 1,
-                                                                               "  %3d | Tag   |          "
-                                                                               "|   Known Tag 0x%02X           (AC) "
-                                                                               "| %s<%s",
-                                                                               *level, tag_new_known,
-                                                                               Indent (*level), tag_new_literal);
-                                                               /* Tag string already looked up earlier! */
-                                                       }
+                                                       proto_tree_add_text (tree, tvb, off, 1,
+                                                                       "  %3d | Tag   | T %3d    "
+                                                                       "|   Known Tag 0x%02X           (AC) "
+                                                                       "| %s<%s",
+                                                                       *level, *codepage_stag, tag_new_known,
+                                                                       Indent (*level), tag_new_literal);
+                                                       /* Tag string already looked up earlier! */
                                                        off++;
                                                } else { /* LITERAL tag */
                                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   |          "
+                                                                       "  %3d | Tag   | T %3d    "
                                                                        "| LITERAL_AC (Literal tag)   (AC) "
                                                                        "| %s<%s",
-                                                                       *level, Indent (*level), tag_new_literal);
+                                                                       *level, *codepage_stag, Indent (*level),
+                                                                       tag_new_literal);
                                                        off += 1 + tag_len;
                                                }
                                                len = parse_wbxml_attribute_list (tree, tvb,
-                                                               off, str_tbl, *level);
+                                                               off, str_tbl, *level, codepage_attr);
                                                /* Check that there is still room in packet */
                                                off += len;
                                                if (off >= tvb_len) {
-                                                       DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
+                                                       DebugLog(("STAG: level = %u, ThrowException: "
+                                                                               "len = %u (short frame)\n",
+                                                                               *level, off - offset));
+                                                       /*
+                                                        * TODO - Do we need to free g_malloc()ed memory?
+                                                        */
                                                        THROW(ReportedBoundsError);
                                                }
                                                proto_tree_add_text (tree, tvb, off-1, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| END (attribute list)            "
                                                                "| %s>",
-                                                               *level, Indent (*level));
+                                                               *level, *codepage_stag, Indent (*level));
                                        } else { /* Content, no Attribute list */
                                                if (tag_new_known) { /* Known tag */
-                                                       if (codepage_stag) { /* Not default code page */
-                                                               proto_tree_add_text (tree, tvb, off, 1,
-                                                                               "  %3d | Tag   | T %3d->0 "
-                                                                               "|   Known Tag 0x%02X           (.C) "
-                                                                               "| %s<%s>",
-                                                                               *level, codepage_stag, tag_new_known,
-                                                                               Indent (*level),
-                                                                               tag_new_literal);
-                                                               /* Tag string already looked up earlier! */
-                                                               /* Reset code page */
-                                                               codepage_stag = 0;
-                                                       } else { /* Code page 0 */
-                                                               proto_tree_add_text (tree, tvb, off, 1,
-                                                                               "  %3d | Tag   |          "
-                                                                               "|   Known Tag 0x%02X           (.C) "
-                                                                               "| %s<%s>",
-                                                                               *level, tag_new_known,
-                                                                               Indent (*level),
-                                                                               tag_new_literal);
-                                                               /* Tag string already looked up earlier! */
-                                                       }
+                                                       proto_tree_add_text (tree, tvb, off, 1,
+                                                                       "  %3d | Tag   | T %3d    "
+                                                                       "|   Known Tag 0x%02X           (.C) "
+                                                                       "| %s<%s>",
+                                                                       *level, *codepage_stag, tag_new_known,
+                                                                       Indent (*level), tag_new_literal);
+                                                       /* Tag string already looked up earlier! */
                                                        off++;
                                                } else { /* LITERAL tag */
                                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   |          "
+                                                                       "  %3d | Tag   | T %3d    "
                                                                        "| LITERAL_C  (Literal Tag)   (.C) "
                                                                        "| %s<%s>",
-                                                                       *level, Indent (*level), tag_new_literal);
+                                                                       *level, *codepage_stag, Indent (*level),
+                                                                       tag_new_literal);
                                                        off += 1 + tag_len;
                                                }
                                        }
@@ -3104,95 +3094,84 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                                         * Next time we encounter a tag with content: recurse
                                         */
                                        parsing_tag_content = TRUE;
-                                       DebugLog(("Tag in Tag - No recursion this time! (off = %u)\n", off));
+                                       DebugLog(("Tag in Tag - No recursion this time! "
+                                                               "(off = %u)\n", off));
                                }
                        } else { /* No Content */
                                DebugLog(("<Tag/> in Tag - No recursion! (off = %u)\n", off));
                                (*level)++;
                                if (peek & 0x80) { /* No Content, Attribute list present */
                                        if (tag_new_known) { /* Known tag */
-                                               if (codepage_stag) { /* Not default code page */
-                                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   | T %3d->0 "
-                                                                       "|   Known Tag 0x%02X           (A.) "
-                                                                       "| %s<%s",
-                                                                       *level, codepage_stag, tag_new_known,
-                                                                       Indent (*level), tag_new_literal);
-                                                       /* Tag string already looked up earlier! */
-                                                       /* Reset code page */
-                                                       codepage_stag = 0;
-                                               } else { /* Code page 0 */
-                                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   |          "
-                                                                       "|   Known Tag 0x%02X           (A.) "
-                                                                       "| %s<%s",
-                                                                       *level, tag_new_known,
-                                                                       Indent (*level), tag_new_literal);
-                                                       /* Tag string already looked up earlier! */
-                                               }
+                                               proto_tree_add_text (tree, tvb, off, 1,
+                                                               "  %3d | Tag   | T %3d    "
+                                                               "|   Known Tag 0x%02X           (A.) "
+                                                               "| %s<%s",
+                                                               *level, *codepage_stag, tag_new_known,
+                                                               Indent (*level), tag_new_literal);
+                                               /* Tag string already looked up earlier! */
                                                off++;
                                                len = parse_wbxml_attribute_list (tree, tvb,
-                                                               off, str_tbl, *level);
+                                                               off, str_tbl, *level, codepage_attr);
                                                /* Check that there is still room in packet */
                                                off += len;
                                                if (off >= tvb_len) {
-                                                       DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
+                                                       DebugLog(("STAG: level = %u, ThrowException: "
+                                                                               "len = %u (short frame)\n",
+                                                                               *level, off - offset));
+                                                       /*
+                                                        * TODO - Do we need to free g_malloc()ed memory?
+                                                        */
                                                        THROW(ReportedBoundsError);
                                                }
                                                proto_tree_add_text (tree, tvb, off-1, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| END (Known Tag)                 "
                                                                "| %s/>",
-                                                               *level, Indent (*level));
+                                                               *level, *codepage_stag, Indent (*level));
                                        } else { /* LITERAL tag */
                                                proto_tree_add_text (tree, tvb, off, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| LITERAL_A  (Literal Tag)   (A.) "
                                                                "| %s<%s",
-                                                               *level, Indent (*level), tag_new_literal);
+                                                               *level, *codepage_stag, Indent (*level),
+                                                               tag_new_literal);
                                                off += 1 + tag_len;
                                                len = parse_wbxml_attribute_list (tree, tvb,
-                                                               off, str_tbl, *level);
+                                                               off, str_tbl, *level, codepage_attr);
                                                /* Check that there is still room in packet */
                                                off += len;
                                                if (off >= tvb_len) {
-                                                       DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", *level, off - offset));
+                                                       DebugLog(("STAG: level = %u, ThrowException: "
+                                                                               "len = %u (short frame)\n",
+                                                                               *level, off - offset));
+                                                       /*
+                                                        * TODO - Do we need to free g_malloc()ed memory?
+                                                        */
                                                        THROW(ReportedBoundsError);
                                                }
                                                proto_tree_add_text (tree, tvb, off-1, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| END (Literal Tag)               "
                                                                "| %s/>",
-                                                               *level, Indent (*level));
+                                                               *level, *codepage_stag, Indent (*level));
                                        }
                                } else { /* No Content, No Attribute list */
                                        if (tag_new_known) { /* Known tag */
-                                               if (codepage_stag) { /* Not default code page */
-                                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   | T %3d->0 "
-                                                                       "|   Known Tag 0x%02x           (..) "
-                                                                       "| %s<%s />",
-                                                                       *level, codepage_stag, tag_new_known,
-                                                                       Indent (*level), tag_new_literal);
-                                                       /* Tag string already looked up earlier! */
-                                                       /* Reset code page */
-                                                       codepage_stag = 0;
-                                               } else { /* Code page 0 */
-                                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                                       "  %3d | Tag   |          "
-                                                                       "|   Known Tag 0x%02x           (..) "
-                                                                       "| %s<%s />",
-                                                                       *level, tag_new_known,
-                                                                       Indent (*level), tag_new_literal);
-                                                       /* Tag string already looked up earlier! */
-                                               }
+                                               proto_tree_add_text (tree, tvb, off, 1,
+                                                               "  %3d | Tag   | T %3d    "
+                                                               "|   Known Tag 0x%02x           (..) "
+                                                               "| %s<%s />",
+                                                               *level, *codepage_stag, tag_new_known,
+                                                               Indent (*level), tag_new_literal);
+                                               /* Tag string already looked up earlier! */
                                                off++;
                                        } else { /* LITERAL tag */
                                                proto_tree_add_text (tree, tvb, off, 1,
-                                                               "  %3d | Tag   |          "
+                                                               "  %3d | Tag   | T %3d    "
                                                                "| LITERAL    (Literal Tag)   (..) "
                                                                "| %s<%s />",
-                                                               *level, Indent (*level), tag_new_literal);
+                                                               *level, *codepage_stag, Indent (*level),
+                                                               tag_new_literal);
                                                off += 1 + tag_len;
                                        }
                                }
@@ -3201,7 +3180,8 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
                        }
                } /* if (tag & 0x3F) >= 5 */
        } /* while */
-       DebugLog(("STAG: level = %u, Return: len = %u (end of function body)\n", *level, off - offset));
+       DebugLog(("STAG: level = %u, Return: len = %u (end of function body)\n",
+                               *level, off - offset));
        return (off - offset);
 }
 
@@ -3230,7 +3210,7 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
  */
 static guint32
 parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
-               guint32 offset, guint32 str_tbl, guint8 level,
+               guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr,
                const wbxml_token_map *map)
 {
        guint32 tvb_len = tvb_reported_length (tvb);
@@ -3240,21 +3220,22 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
        guint32 ent;
        guint32 index;
        guint8 peek;
-       guint8 codepage_attr = 0; /* Initial codepage in state = ATTR */
 
-       DebugLog(("parse_wbxml_attr_defined (level = %u, offset = %u)\n", level, offset));
+       DebugLog(("parse_wbxml_attr_defined (level = %u, offset = %u)\n",
+                               level, offset));
        /* Parse attributes */
        while (off < tvb_len) {
                peek = tvb_get_guint8 (tvb, off);
-               DebugLog(("ATTR: (top of while) level = %3u, peek = 0x%02X, off = %u, tvb_len = %u\n", level, peek, off, tvb_len));
+               DebugLog(("ATTR: (top of while) level = %3u, peek = 0x%02X, "
+                                       "off = %u, tvb_len = %u\n", level, peek, off, tvb_len));
                if ((peek & 0x3F) < 5) switch (peek) { /* Global tokens
                                                                                                  in state = ATTR */
                        case 0x00: /* SWITCH_PAGE */
-                               codepage_attr = tvb_get_guint8 (tvb, off+1);
+                               *codepage_attr = tvb_get_guint8 (tvb, off+1);
                                proto_tree_add_text (tree, tvb, off, 2,
-                                               "      |  Attr | A 0->%3d "
+                                               "      |  Attr | A -->%3d "
                                                "| SWITCH_PAGE (Attr code page)    |",
-                                               codepage_attr);
+                                               *codepage_attr);
                                off += 2;
                                break;
                        case 0x01: /* END */
@@ -3264,24 +3245,25 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
                                 *   This is done in the TAG state parser.
                                 */
                                off++;
-                               DebugLog(("ATTR: level = %u, Return: len = %u\n", level, off - offset));
+                               DebugLog(("ATTR: level = %u, Return: len = %u\n",
+                                                       level, off - offset));
                                return (off - offset);
                        case 0x02: /* ENTITY */
                                ent = tvb_get_guintvar (tvb, off+1, &len);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| ENTITY                          "
                                                "|     %s'&#%u;'",
-                                               level, Indent (level), ent);
+                                               level, *codepage_attr, Indent (level), ent);
                                off += 1+len;
                                break;
                        case 0x03: /* STR_I */
                                len = tvb_strsize (tvb, off+1);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| STR_I (Inline string)           "
                                                "|     %s\'%s\'",
-                                               level, Indent (level),
+                                               level, *codepage_attr, Indent (level),
                                                tvb_format_text (tvb, off+1, len-1));
                                off += 1+len;
                                break;
@@ -3289,10 +3271,10 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| LITERAL (Literal Attribute)     "
                                                "|   %s<%s />",
-                                               level, Indent (level),
+                                               level, *codepage_attr, Indent (level),
                                                tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
@@ -3301,25 +3283,13 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
                        case 0x42: /* EXT_I_2 */
                                /* Extension tokens */
                                len = tvb_strsize (tvb, off+1);
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "| EXT_I_%1x    (Extension Token)    "
-                                                       "|     %s(%s: \'%s\')",
-                                                       level, codepage_attr, peek & 0x0f, Indent (level),
-                                                       map_token (map->global, codepage_attr, peek),
-                                                       tvb_format_text (tvb, off+1, len-1));
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d |  Attr |          "
-                                                       "| EXT_I_%1x    (Extension Token)    "
-                                                       "|     %s(%s: \'%s\')",
-                                                       level, peek & 0x0f, Indent (level),
-                                                       map_token (map->global, codepage_attr, peek),
-                                                       tvb_format_text (tvb, off+1, len-1));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1+len,
+                                               "  %3d |  Attr | A %3d    "
+                                               "| EXT_I_%1x    (Extension Token)    "
+                                               "|     %s(%s: \'%s\')",
+                                               level, *codepage_attr, peek & 0x0f, Indent (level),
+                                               map_token (map->global, *codepage_attr, peek),
+                                               tvb_format_text (tvb, off+1, len-1));
                                off += 1+len;
                                break;
                        /* 0x43 impossible in ATTR state */
@@ -3330,35 +3300,23 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
                                /* Extension tokens */
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "| EXT_T_%1x    (Extension Token)    "
-                                                       "|     %s(%s: \'%s\')",
-                                                       level, codepage_attr, peek & 0x0f, Indent (level),
-                                                       map_token (map->global, codepage_attr, peek),
-                                                       tvb_format_text (tvb, str_tbl+index, str_len-1));
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d |  Attr |          "
-                                                       "| EXT_T_%1x    (Extension Token)    "
-                                                       "|     %s(%s: \'%s\')",
-                                                       level, peek & 0x0f, Indent (level),
-                                                       map_token (map->global, codepage_attr, peek),
-                                                       tvb_format_text (tvb, str_tbl+index, str_len-1));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1+len,
+                                               "  %3d |  Attr | A %3d    "
+                                               "| EXT_T_%1x    (Extension Token)    "
+                                               "|     %s(%s: \'%s\')",
+                                               level, *codepage_attr, peek & 0x0f, Indent (level),
+                                               map_token (map->global, *codepage_attr, peek),
+                                               tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
                        case 0x83: /* STR_T */
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| STR_T (Tableref string)         "
                                                "|     %s\'%s\'",
-                                               level, Indent (level),
+                                               level, *codepage_attr, Indent (level),
                                                tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
@@ -3367,99 +3325,69 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
                        case 0xC1: /* EXT_1 */
                        case 0xC2: /* EXT_2 */
                                /* Extension tokens */
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "| EXT_%1x      (Extension Token)    "
-                                                       "|     %s(%s)",
-                                                       level, codepage_attr, peek & 0x0f, Indent (level),
-                                                       map_token (map->global, codepage_attr, peek));
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr |          "
-                                                       "| EXT_%1x      (Extension Token)    "
-                                                       "|     %s(%s)",
-                                                       level, peek & 0x0f, Indent (level),
-                                                       map_token (map->global, codepage_attr, peek));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1,
+                                               "  %3d |  Attr | A %3d    "
+                                               "| EXT_%1x      (Extension Token)    "
+                                               "|     %s(%s)",
+                                               level, *codepage_attr, peek & 0x0f, Indent (level),
+                                               map_token (map->global, *codepage_attr, peek));
                                off++;
                                break;
                        case 0xC3: /* OPAQUE - WBXML 1.1 and newer */
                                if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */
                                        index = tvb_get_guintvar (tvb, off+1, &len);
                                        proto_tree_add_text (tree, tvb, off, 1 + len + index,
-                                                       "  %3d |  Attr |          "
+                                                       "  %3d |  Attr | A %3d    "
                                                        "| OPAQUE (Opaque data)            "
                                                        "|       %s(%d bytes of opaque data)",
-                                                       level, Indent (level), index);
+                                                       level, *codepage_attr, Indent (level), index);
                                        off += 1+len+index;
                                } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */
                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr |          "
+                                                       "  %3d |  Attr | A %3d    "
                                                        "| RESERVED_2     (Invalid Token!) "
                                                        "| WBXML 1.0 parsing stops here.",
-                                                       level);
+                                                       level, *codepage_attr);
                                        /* Stop processing as it is impossible to parse now */
                                        off = tvb_len;
-                                       DebugLog(("ATTR: level = %u, Return: len = %u\n", level, off - offset));
+                                       DebugLog(("ATTR: level = %u, Return: len = %u\n",
+                                                               level, off - offset));
                                        return (off - offset);
                                }
                                break;
                        /* 0xC4 impossible in ATTR state */
                        default:
                                proto_tree_add_text (tree, tvb, off, 1,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| %-10s     (Invalid Token!) "
                                                "| WBXML parsing stops here.",
-                                               level, match_strval (peek, vals_wbxml1x_global_tokens));
+                                               level, *codepage_attr,
+                                               match_strval (peek, vals_wbxml1x_global_tokens));
                                /* Move to end of buffer */
                                off = tvb_len;
                                break;
                } else { /* Known atribute token */
                        if (peek & 0x80) { /* attrValue */
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "|   Known attrValue 0x%02X          "
-                                                       "|       %s%s",
-                                                       level, codepage_attr, peek & 0x7f, Indent (level),
-                                                       map_token (map->attrValue, codepage_attr, peek));
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr |          "
-                                                       "|   Known attrValue 0x%02X          "
-                                                       "|       %s%s",
-                                                       level, peek & 0x7f, Indent (level),
-                                                       map_token (map->attrValue, codepage_attr, peek));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1,
+                                               "  %3d |  Attr | A %3d    "
+                                               "|   Known attrValue 0x%02X          "
+                                               "|       %s%s",
+                                               level, *codepage_attr, peek & 0x7f, Indent (level),
+                                               map_token (map->attrValue, *codepage_attr, peek));
                                off++;
                        } else { /* attrStart */
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "|   Known attrStart 0x%02X          "
-                                                       "|   %s%s",
-                                                       level, codepage_attr, peek & 0x7f, Indent (level),
-                                                       map_token (map->attrStart, codepage_attr, peek));
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr |          "
-                                                       "|   Known attrStart 0x%02X          "
-                                                       "|   %s%s",
-                                                       level, peek & 0x7f, Indent (level),
-                                                       map_token (map->attrStart, codepage_attr, peek));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1,
+                                               "  %3d |  Attr | A %3d    "
+                                               "|   Known attrStart 0x%02X          "
+                                               "|   %s%s",
+                                               level, *codepage_attr, peek & 0x7f, Indent (level),
+                                               map_token (map->attrStart, *codepage_attr, peek));
                                off++;
                        }
                }
        } /* End WHILE */
-       DebugLog(("ATTR: level = %u, Return: len = %u (end of function body)\n", level, off - offset));
+       DebugLog(("ATTR: level = %u, Return: len = %u (end of function body)\n",
+                               level, off - offset));
        return (off - offset);
 }
 
@@ -3474,7 +3402,7 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
  */
 static guint32
 parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
-               guint32 offset, guint32 str_tbl, guint8 level)
+               guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr)
 {
        guint32 tvb_len = tvb_reported_length (tvb);
        guint32 off = offset;
@@ -3483,21 +3411,21 @@ parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
        guint32 ent;
        guint32 index;
        guint8 peek;
-       guint8 codepage_attr = 0; /* Initial codepage in state = ATTR */
 
        DebugLog(("parse_wbxml_attr (level = %u, offset = %u)\n", level, offset));
        /* Parse attributes */
        while (off < tvb_len) {
                peek = tvb_get_guint8 (tvb, off);
-               DebugLog(("ATTR: (top of while) level = %3u, peek = 0x%02X, off = %u, tvb_len = %u\n", level, peek, off, tvb_len));
+               DebugLog(("ATTR: (top of while) level = %3u, peek = 0x%02X, "
+                                       "off = %u, tvb_len = %u\n", level, peek, off, tvb_len));
                if ((peek & 0x3F) < 5) switch (peek) { /* Global tokens
                                                                                                  in state = ATTR */
                        case 0x00: /* SWITCH_PAGE */
-                               codepage_attr = tvb_get_guint8 (tvb, off+1);
+                               *codepage_attr = tvb_get_guint8 (tvb, off+1);
                                proto_tree_add_text (tree, tvb, off, 2,
-                                               "      |  Attr | A 0->%3d "
+                                               "      |  Attr | A -->%3d "
                                                "| SWITCH_PAGE (Attr code page)    |",
-                                               codepage_attr);
+                                               *codepage_attr);
                                off += 2;
                                break;
                        case 0x01: /* END */
@@ -3507,24 +3435,25 @@ parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
                                 *   This is done in the TAG state parser.
                                 */
                                off++;
-                               DebugLog(("ATTR: level = %u, Return: len = %u\n", level, off - offset));
+                               DebugLog(("ATTR: level = %u, Return: len = %u\n",
+                                                       level, off - offset));
                                return (off - offset);
                        case 0x02: /* ENTITY */
                                ent = tvb_get_guintvar (tvb, off+1, &len);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| ENTITY                          "
                                                "|     %s'&#%u;'",
-                                               level, Indent (level), ent);
+                                               level, *codepage_attr, Indent (level), ent);
                                off += 1+len;
                                break;
                        case 0x03: /* STR_I */
                                len = tvb_strsize (tvb, off+1);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| STR_I (Inline string)           "
                                                "|     %s\'%s\'",
-                                               level, Indent (level),
+                                               level, *codepage_attr, Indent (level),
                                                tvb_format_text (tvb, off+1, len-1));
                                off += 1+len;
                                break;
@@ -3532,10 +3461,10 @@ parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| LITERAL (Literal Attribute)     "
                                                "|   %s<%s />",
-                                               level, Indent (level),
+                                               level, *codepage_attr, Indent (level),
                                                tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
@@ -3544,23 +3473,12 @@ parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
                        case 0x42: /* EXT_I_2 */
                                /* Extension tokens */
                                len = tvb_strsize (tvb, off+1);
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "| EXT_I_%1x    (Extension Token)    "
-                                                       "|     %s(Inline string extension: \'%s\')",
-                                                       level, codepage_attr, peek & 0x0f, Indent (level),
-                                                       tvb_format_text (tvb, off+1, len-1));
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d |  Attr |          "
-                                                       "| EXT_I_%1x    (Extension Token)    "
-                                                       "|     %s(Inline string extension: \'%s\')",
-                                                       level, peek & 0x0f, Indent (level),
-                                                       tvb_format_text (tvb, off+1, len-1));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1+len,
+                                               "  %3d |  Attr | A %3d    "
+                                               "| EXT_I_%1x    (Extension Token)    "
+                                               "|     %s(Inline string extension: \'%s\')",
+                                               level, *codepage_attr, peek & 0x0f, Indent (level),
+                                               tvb_format_text (tvb, off+1, len-1));
                                off += 1+len;
                                break;
                        /* 0x43 impossible in ATTR state */
@@ -3571,33 +3489,22 @@ parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
                                /* Extension tokens */
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "| EXT_T_%1x    (Extension Token)    "
-                                                       "|     %s(Tableref string extension: \'%s\')",
-                                                       level, codepage_attr, peek & 0x0f, Indent (level),
-                                                       tvb_format_text (tvb, str_tbl+index, str_len-1));
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1+len,
-                                                       "  %3d |  Attr |          "
-                                                       "| EXT_T_%1x    (Extension Token)    "
-                                                       "|     %s(Tableref string extension: \'%s\')",
-                                                       level, peek & 0x0f, Indent (level),
-                                                       tvb_format_text (tvb, str_tbl+index, str_len-1));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1+len,
+                                               "  %3d |  Attr | A %3d    "
+                                               "| EXT_T_%1x    (Extension Token)    "
+                                               "|     %s(Tableref string extension: \'%s\')",
+                                               level, *codepage_attr, peek & 0x0f, Indent (level),
+                                               tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
                        case 0x83: /* STR_T */
                                index = tvb_get_guintvar (tvb, off+1, &len);
                                str_len = tvb_strsize (tvb, str_tbl+index);
                                proto_tree_add_text (tree, tvb, off, 1+len,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| STR_T (Tableref string)         "
                                                "|     %s\'%s\'",
-                                               level, Indent (level),
+                                               level, *codepage_attr, Indent (level),
                                                tvb_format_text (tvb, str_tbl+index, str_len-1));
                                off += 1+len;
                                break;
@@ -3606,97 +3513,68 @@ parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
                        case 0xC1: /* EXT_1 */
                        case 0xC2: /* EXT_2 */
                                /* Extension tokens */
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "| EXT_%1x      (Extension Token)    "
-                                                       "|     %s(Single-byte extension)",
-                                                       level, codepage_attr, peek & 0x0f, Indent (level));
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr |          "
-                                                       "| EXT_%1x      (Extension Token)    "
-                                                       "|     %s(Single-byte extension)",
-                                                       level, peek & 0x0f, Indent (level));
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1,
+                                               "  %3d |  Attr | A %3d    "
+                                               "| EXT_%1x      (Extension Token)    "
+                                               "|     %s(Single-byte extension)",
+                                               level, *codepage_attr, peek & 0x0f, Indent (level));
                                off++;
                                break;
                        case 0xC3: /* OPAQUE - WBXML 1.1 and newer */
                                if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */
                                        index = tvb_get_guintvar (tvb, off+1, &len);
                                        proto_tree_add_text (tree, tvb, off, 1 + len + index,
-                                                       "  %3d |  Attr |          "
+                                                       "  %3d |  Attr | A %3d    "
                                                        "| OPAQUE (Opaque data)            "
                                                        "|       %s(%d bytes of opaque data)",
-                                                       level, Indent (level), index);
+                                                       level, *codepage_attr, Indent (level), index);
                                        off += 1+len+index;
                                } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */
                                        proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr |          "
+                                                       "  %3d |  Attr | A %3d    "
                                                        "| RESERVED_2     (Invalid Token!) "
                                                        "| WBXML 1.0 parsing stops here.",
-                                                       level);
+                                                       level, *codepage_attr);
                                        /* Stop processing as it is impossible to parse now */
                                        off = tvb_len;
-                                       DebugLog(("ATTR: level = %u, Return: len = %u\n", level, off - offset));
+                                       DebugLog(("ATTR: level = %u, Return: len = %u\n",
+                                                               level, off - offset));
                                        return (off - offset);
                                }
                                break;
                        /* 0xC4 impossible in ATTR state */
                        default:
                                proto_tree_add_text (tree, tvb, off, 1,
-                                               "  %3d |  Attr |          "
+                                               "  %3d |  Attr | A %3d    "
                                                "| %-10s     (Invalid Token!) "
                                                "| WBXML parsing stops here.",
-                                               level, match_strval (peek, vals_wbxml1x_global_tokens));
+                                               level, *codepage_attr,
+                                               match_strval (peek, vals_wbxml1x_global_tokens));
                                /* Move to end of buffer */
                                off = tvb_len;
                                break;
                } else { /* Known atribute token */
                        if (peek & 0x80) { /* attrValue */
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "|   Known attrValue 0x%02X          "
-                                                       "|       %sattrValue_0x%02X",
-                                                       level, codepage_attr, peek & 0x7f, Indent (level),
-                                                       peek);
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr |          "
-                                                       "|   Known attrValue 0x%02X          "
-                                                       "|       %sattrValue_0x%02X",
-                                                       level, peek & 0x7f, Indent (level),
-                                                       peek);
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1,
+                                               "  %3d |  Attr | A %3d    "
+                                               "|   Known attrValue 0x%02X          "
+                                               "|       %sattrValue_0x%02X",
+                                               level, *codepage_attr, peek & 0x7f, Indent (level),
+                                               peek);
                                off++;
                        } else { /* attrStart */
-                               if (codepage_attr) { /* Not default code page */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr | A %3d->0 "
-                                                       "|   Known attrStart 0x%02X          "
-                                                       "|   %sattrStart_0x%02X",
-                                                       level, codepage_attr, peek & 0x7f, Indent (level),
-                                                       peek);
-                                       /* Reset code page */
-                                       codepage_attr = 0;
-                               } else { /* Code page 0 */
-                                       proto_tree_add_text (tree, tvb, off, 1,
-                                                       "  %3d |  Attr |          "
-                                                       "|   Known attrStart 0x%02X          "
-                                                       "|   %sattrStart_0x%02X",
-                                                       level, peek & 0x7f, Indent (level),
-                                                       peek);
-                               }
+                               proto_tree_add_text (tree, tvb, off, 1,
+                                               "  %3d |  Attr | A %3d    "
+                                               "|   Known attrStart 0x%02X          "
+                                               "|   %sattrStart_0x%02X",
+                                               level, *codepage_attr, peek & 0x7f, Indent (level),
+                                               peek);
                                off++;
                        }
                }
        } /* End WHILE */
-       DebugLog(("ATTR: level = %u, Return: len = %u (end of function body)\n", level, off - offset));
+       DebugLog(("ATTR: level = %u, Return: len = %u (end of function body)\n",
+                               level, off - offset));
        return (off - offset);
 }
 
index 8af1493908bc26694cfc85d4af288977950b61d9..649c9a131790ecb2a08852a694bfb459dd54b6be 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Routines to dissect WSP component of WAP traffic.
  *
- * $Id: packet-wsp.c,v 1.94 2003/12/08 20:37:14 obiot Exp $
+ * $Id: packet-wsp.c,v 1.95 2003/12/15 22:38:29 obiot Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -16,6 +16,9 @@
  * notification and macros, extra missing headers, WBXML registration
  * by Olivier Biot <olivier.biot(ad)siemens.com>.
  *
+ * TODO - Move parts of dissection before and other parts after "if (tree)",
+ * for example skip almost all but content type in replies if tree is closed.
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
@@ -69,7 +72,6 @@ static int proto_wsp                                  = HF_EMPTY;
 
 /* WSP header fields and their subfields if available */
 static int hf_hdr_name                                 = HF_EMPTY;
-static int hf_hdr_id                                   = HF_EMPTY;
 static int hf_hdr_accept                               = HF_EMPTY;
 static int hf_hdr_accept_charset               = HF_EMPTY;
 static int hf_hdr_accept_encoding              = HF_EMPTY;
@@ -234,7 +236,6 @@ static int hf_wsp_server_session_id                 = HF_EMPTY;
 static int hf_wsp_header_status                                = HF_EMPTY;
 static int hf_wsp_header_length                                = HF_EMPTY;
 static int hf_wsp_headers_section                      = HF_EMPTY;
-static int hf_wsp_header                               = HF_EMPTY;
 static int hf_wsp_content_type                         = HF_EMPTY;
 static int hf_wsp_content_type_str                     = HF_EMPTY;
 static int hf_wsp_parameter_well_known_charset         = HF_EMPTY;
@@ -2052,7 +2053,7 @@ add_content_type(proto_tree *tree, tvbuff_t *tvb, guint32 val_start,
        *well_known_content = 0;
 
        wkh_1_WellKnownValue;
-               *textual_content = val_to_str(val, vals_content_types,
+               *textual_content = val_to_str(val_id & 0x7F, vals_content_types,
                                "<Unknown media type identifier 0x%X>");
                ti = proto_tree_add_string(tree, hf_hdr_content_type,
                                tvb, hdr_start, offset - hdr_start,
@@ -5207,7 +5208,7 @@ proto_register_wsp(void)
                        {       "Transaction ID",
                                "wsp.TID",
                                 FT_UINT8, BASE_HEX, NULL, 0x00,
-                               "Transaction ID", HFILL
+                               "WSP Transaction ID (for connectionless WSP)", HFILL
                        }
                },
                { &hf_wsp_header_pdu_type,
@@ -5235,14 +5236,14 @@ proto_register_wsp(void)
                        {       "Capability Length",
                                "wsp.capability.length",
                                 FT_UINT32, BASE_DEC, NULL, 0x00,
-                               "Capability Length", HFILL
+                               "Length of Capability field (bytes)", HFILL
                        }
                },
                { &hf_wsp_header_length,
                        {       "Headers Length",
                                "wsp.headers_length",
                                 FT_UINT32, BASE_DEC, NULL, 0x00,
-                               "Headers Length", HFILL
+                               "Length of Headers field (bytes)", HFILL
                        }
                },
                { &hf_wsp_capabilities_section,
@@ -5259,18 +5260,11 @@ proto_register_wsp(void)
                                "Headers", HFILL
                        }
                },
-               { &hf_wsp_header,
-                       {       "Header",
-                               "wsp.headers.header",
-                                FT_NONE, BASE_DEC, NULL, 0x00,
-                               "Header", HFILL
-                       }
-               },
                { &hf_wsp_header_uri_len,
                        {       "URI Length",
                                "wsp.uri_length",
                                 FT_UINT32, BASE_DEC, NULL, 0x00,
-                               "URI Length", HFILL
+                               "Length of URI field", HFILL
                        }
                },
                { &hf_wsp_header_uri,
@@ -5291,19 +5285,19 @@ proto_register_wsp(void)
                        {       "Status",
                                "wsp.reply.status",
                                 FT_UINT8, BASE_HEX, VALS( vals_status ), 0x00,
-                               "Status", HFILL
+                               "Reply Status", HFILL
                        }
                },
                { &hf_wsp_content_type,
                        {       "Content Type",
-                               "wsp.content_type.type",
+                               "wsp.content_type.integer",
                                 FT_UINT8, BASE_HEX, VALS ( vals_content_types ), 0x00,
                                "Content Type", HFILL
                        }
                },
                { &hf_wsp_content_type_str,
                        {       "Content Type",
-                               "wsp.content_type.type.string",
+                               "wsp.content_type.string",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Content Type", HFILL
                        }
@@ -5606,620 +5600,612 @@ proto_register_wsp(void)
                                "Name of the WSP header", HFILL
                        }
                },
-               /* WSP well-known header ID */
-               { &hf_hdr_id,
-                       {       "Header well-known ID",
-                               "wsp.header.id",
-                               FT_STRING, BASE_NONE, NULL, 0x00,
-                               "7-bit identifier of a well-known WSP header", HFILL
-                       }
-               },
                /* WSP headers start here */
                { &hf_hdr_accept,
                        {       "Accept",
-                               "wsp.hdr.accept",
+                               "wsp.header.accept",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Accept", HFILL
                        }
                },
                { &hf_hdr_accept_charset,
                        {       "Accept-Charset",
-                               "wsp.hdr.accept_charset",
+                               "wsp.header.accept_charset",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Accept-Charset", HFILL
                        }
                },
                { &hf_hdr_accept_encoding,
                        {       "Accept-Encoding",
-                               "wsp.hdr.accept_encoding",
+                               "wsp.header.accept_encoding",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Accept-Encoding", HFILL
                        }
                },
                { &hf_hdr_accept_language,
                        {       "Accept-Language",
-                               "wsp.hdr.accept_language",
+                               "wsp.header.accept_language",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Accept-Language", HFILL
                        }
                },
                { &hf_hdr_accept_ranges,
                        {       "Accept-Ranges",
-                               "wsp.hdr.accept_ranges",
+                               "wsp.header.accept_ranges",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Accept-Ranges", HFILL
                        }
                },
                { &hf_hdr_age,
                        {       "Age",
-                               "wsp.hdr.age",
+                               "wsp.header.age",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Age", HFILL
                        }
                },
                { &hf_hdr_allow,
                        {       "Allow",
-                               "wsp.hdr.allow",
+                               "wsp.header.allow",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Allow", HFILL
                        }
                },
                { &hf_hdr_authorization,
                        {       "Authorization",
-                               "wsp.hdr.authorization",
+                               "wsp.header.authorization",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Authorization", HFILL
                        }
                },
                { &hf_hdr_authorization_scheme,
                        {       "Authorization Scheme",
-                               "wsp.hdr.authorization.scheme",
+                               "wsp.header.authorization.scheme",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Authorization: used scheme", HFILL
                        }
                },
                { &hf_hdr_authorization_user_id,
                        {       "User-id",
-                               "wsp.hdr.authorization.user_id",
+                               "wsp.header.authorization.user_id",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Authorization: user ID for basic authorization", HFILL
                        }
                },
                { &hf_hdr_authorization_password,
                        {       "Password",
-                               "wsp.hdr.authorization.password",
+                               "wsp.header.authorization.password",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Authorization: password for basic authorization", HFILL
                        }
                },
                { &hf_hdr_cache_control,
                        {       "Cache-Control",
-                               "wsp.hdr.cache_control",
+                               "wsp.header.cache_control",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Cache-Control", HFILL
                        }
                },
                { &hf_hdr_connection,
                        {       "Connection",
-                               "wsp.hdr.connection",
+                               "wsp.header.connection",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Connection", HFILL
                        }
                },
                { &hf_hdr_content_base,
                        {       "Content-Base",
-                               "wsp.hdr.content_base",
+                               "wsp.header.content_base",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Base", HFILL
                        }
                },
                { &hf_hdr_content_encoding,
                        {       "Content-Encoding",
-                               "wsp.hdr.content_encoding",
+                               "wsp.header.content_encoding",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Encoding", HFILL
                        }
                },
                { &hf_hdr_content_language,
                        {       "Content-Language",
-                               "wsp.hdr.content_language",
+                               "wsp.header.content_language",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Language", HFILL
                        }
                },
                { &hf_hdr_content_length,
                        {       "Content-Length",
-                               "wsp.hdr.content_length",
+                               "wsp.header.content_length",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Length", HFILL
                        }
                },
                { &hf_hdr_content_location,
                        {       "Content-Location",
-                               "wsp.hdr.content_location",
+                               "wsp.header.content_location",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Location", HFILL
                        }
                },
                { &hf_hdr_content_md5,
                        {       "Content-Md5",
-                               "wsp.hdr.content_md5",
+                               "wsp.header.content_md5",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Md5", HFILL
                        }
                },
                { &hf_hdr_content_range,
                        {       "Content-Range",
-                               "wsp.hdr.content_range",
+                               "wsp.header.content_range",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Range", HFILL
                        }
                },
                { &hf_hdr_content_range_first_byte_pos,
                        {       "First-byte-position",
-                               "wsp.hdr.content_range.first_byte_pos",
+                               "wsp.header.content_range.first_byte_pos",
                                FT_UINT32, BASE_DEC, NULL, 0x00,
                                "WSP header Content-Range: position of first byte", HFILL
                        }
                },
                { &hf_hdr_content_range_entity_length,
                        {       "Entity-length",
-                               "wsp.hdr.content_range.entity_length",
+                               "wsp.header.content_range.entity_length",
                                FT_UINT32, BASE_DEC, NULL, 0x00,
                                "WSP header Content-Range: length of the entity", HFILL
                        }
                },
                { &hf_hdr_content_type,
                        {       "Content-Type",
-                               "wsp.hdr.content_type",
+                               "wsp.header.content_type",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Type", HFILL
                        }
                },
                { &hf_hdr_date,
                        {       "Date",
-                               "wsp.hdr.date",
+                               "wsp.header.date",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Date", HFILL
                        }
                },
                { &hf_hdr_etag,
                        {       "ETag",
-                               "wsp.hdr.etag",
+                               "wsp.header.etag",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header ETag", HFILL
                        }
                },
                { &hf_hdr_expires,
                        {       "Expires",
-                               "wsp.hdr.expires",
+                               "wsp.header.expires",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Expires", HFILL
                        }
                },
                { &hf_hdr_from,
                        {       "From",
-                               "wsp.hdr.from",
+                               "wsp.header.from",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header From", HFILL
                        }
                },
                { &hf_hdr_host,
                        {       "Host",
-                               "wsp.hdr.host",
+                               "wsp.header.host",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Host", HFILL
                        }
                },
                { &hf_hdr_if_modified_since,
                        {       "If-Modified-Since",
-                               "wsp.hdr.if_modified_since",
+                               "wsp.header.if_modified_since",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header If-Modified-Since", HFILL
                        }
                },
                { &hf_hdr_if_match,
                        {       "If-Match",
-                               "wsp.hdr.if_match",
+                               "wsp.header.if_match",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header If-Match", HFILL
                        }
                },
                { &hf_hdr_if_none_match,
                        {       "If-None-Match",
-                               "wsp.hdr.if_none_match",
+                               "wsp.header.if_none_match",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header If-None-Match", HFILL
                        }
                },
                { &hf_hdr_if_range,
                        {       "If-Range",
-                               "wsp.hdr.if_range",
+                               "wsp.header.if_range",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header If-Range", HFILL
                        }
                },
                { &hf_hdr_if_unmodified_since,
                        {       "If-Unmodified-Since",
-                               "wsp.hdr.if_unmodified_since",
+                               "wsp.header.if_unmodified_since",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header If-Unmodified-Since", HFILL
                        }
                },
                { &hf_hdr_last_modified,
                        {       "Last-Modified",
-                               "wsp.hdr.last_modified",
+                               "wsp.header.last_modified",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Last-Modified", HFILL
                        }
                },
                { &hf_hdr_location,
                        {       "Location",
-                               "wsp.hdr.location",
+                               "wsp.header.location",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Location", HFILL
                        }
                },
                { &hf_hdr_max_forwards,
                        {       "Max-Forwards",
-                               "wsp.hdr.max_forwards",
+                               "wsp.header.max_forwards",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Max-Forwards", HFILL
                        }
                },
                { &hf_hdr_pragma,
                        {       "Pragma",
-                               "wsp.hdr.pragma",
+                               "wsp.header.pragma",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Pragma", HFILL
                        }
                },
                { &hf_hdr_proxy_authenticate,
                        {       "Proxy-Authenticate",
-                               "wsp.hdr.proxy_authenticate",
+                               "wsp.header.proxy_authenticate",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Proxy-Authenticate", HFILL
                        }
                },
                { &hf_hdr_proxy_authenticate_scheme,
                        {       "Authentication Scheme",
-                               "wsp.hdr.proxy_authenticate.scheme",
+                               "wsp.header.proxy_authenticate.scheme",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Proxy-Authenticate: used scheme", HFILL
                        }
                },
                { &hf_hdr_proxy_authenticate_realm,
                        {       "Authentication Realm",
-                               "wsp.hdr.proxy_authenticate.realm",
+                               "wsp.header.proxy_authenticate.realm",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Proxy-Authenticate: used realm", HFILL
                        }
                },
                { &hf_hdr_proxy_authorization,
                        {       "Proxy-Authorization",
-                               "wsp.hdr.proxy_authorization",
+                               "wsp.header.proxy_authorization",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Proxy-Authorization", HFILL
                        }
                },
                { &hf_hdr_proxy_authorization_scheme,
                        {       "Authorization Scheme",
-                               "wsp.hdr.proxy_authorization.scheme",
+                               "wsp.header.proxy_authorization.scheme",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Proxy-Authorization: used scheme", HFILL
                        }
                },
                { &hf_hdr_proxy_authorization_user_id,
                        {       "User-id",
-                               "wsp.hdr.proxy_authorization.user_id",
+                               "wsp.header.proxy_authorization.user_id",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Proxy-Authorization: user ID for basic authorization", HFILL
                        }
                },
                { &hf_hdr_proxy_authorization_password,
                        {       "Password",
-                               "wsp.hdr.proxy_authorization.password",
+                               "wsp.header.proxy_authorization.password",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Proxy-Authorization: password for basic authorization", HFILL
                        }
                },
                { &hf_hdr_public,
                        {       "Public",
-                               "wsp.hdr.public",
+                               "wsp.header.public",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Public", HFILL
                        }
                },
                { &hf_hdr_range,
                        {       "Range",
-                               "wsp.hdr.range",
+                               "wsp.header.range",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Range", HFILL
                        }
                },
                { &hf_hdr_range_first_byte_pos,
                        {       "First-byte-position",
-                               "wsp.hdr.range.first_byte_pos",
+                               "wsp.header.range.first_byte_pos",
                                FT_UINT32, BASE_DEC, NULL, 0x00,
                                "WSP header Range: position of first byte", HFILL
                        }
                },
                { &hf_hdr_range_last_byte_pos,
                        {       "Last-byte-position",
-                               "wsp.hdr.range.last_byte_pos",
+                               "wsp.header.range.last_byte_pos",
                                FT_UINT32, BASE_DEC, NULL, 0x00,
                                "WSP header Range: position of last byte", HFILL
                        }
                },
                { &hf_hdr_range_suffix_length,
                        {       "Suffix-length",
-                               "wsp.hdr.range.suffix_length",
+                               "wsp.header.range.suffix_length",
                                FT_UINT32, BASE_DEC, NULL, 0x00,
                                "WSP header Range: length of the suffix", HFILL
                        }
                },
                { &hf_hdr_referer,
                        {       "Referer",
-                               "wsp.hdr.referer",
+                               "wsp.header.referer",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Referer", HFILL
                        }
                },
                { &hf_hdr_retry_after,
                        {       "Retry-After",
-                               "wsp.hdr.retry_after",
+                               "wsp.header.retry_after",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Retry-After", HFILL
                        }
                },
                { &hf_hdr_server,
                        {       "Server",
-                               "wsp.hdr.server",
+                               "wsp.header.server",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Server", HFILL
                        }
                },
                { &hf_hdr_transfer_encoding,
                        {       "Transfer-Encoding",
-                               "wsp.hdr.transfer_encoding",
+                               "wsp.header.transfer_encoding",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Transfer-Encoding", HFILL
                        }
                },
                { &hf_hdr_upgrade,
                        {       "Upgrade",
-                               "wsp.hdr.upgrade",
+                               "wsp.header.upgrade",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Upgrade", HFILL
                        }
                },
                { &hf_hdr_user_agent,
                        {       "User-Agent",
-                               "wsp.hdr.user_agent",
+                               "wsp.header.user_agent",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header User-Agent", HFILL
                        }
                },
                { &hf_hdr_vary,
                        {       "Vary",
-                               "wsp.hdr.vary",
+                               "wsp.header.vary",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Vary", HFILL
                        }
                },
                { &hf_hdr_via,
                        {       "Via",
-                               "wsp.hdr.via",
+                               "wsp.header.via",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Via", HFILL
                        }
                },
                { &hf_hdr_warning,
                        {       "Warning",
-                               "wsp.hdr.warning",
+                               "wsp.header.warning",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Warning", HFILL
                        }
                },
                { &hf_hdr_warning_code,
                        {       "Warning code",
-                               "wsp.hdr.warning.code",
+                               "wsp.header.warning.code",
                                FT_UINT8, BASE_HEX, VALS(vals_wsp_warning_code), 0x00,
                                "WSP header Warning code", HFILL
                        }
                },
                { &hf_hdr_warning_agent,
                        {       "Warning agent",
-                               "wsp.hdr.warning.agent",
+                               "wsp.header.warning.agent",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Warning agent", HFILL
                        }
                },
                { &hf_hdr_warning_text,
                        {       "Warning text",
-                               "wsp.hdr.warning.text",
+                               "wsp.header.warning.text",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Warning text", HFILL
                        }
                },
                { &hf_hdr_www_authenticate,
                        {       "Www-Authenticate",
-                               "wsp.hdr.www_authenticate",
+                               "wsp.header.www_authenticate",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Www-Authenticate", HFILL
                        }
                },
                { &hf_hdr_www_authenticate_scheme,
                        {       "Authentication Scheme",
-                               "wsp.hdr.www_authenticate.scheme",
+                               "wsp.header.www_authenticate.scheme",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header WWW-Authenticate: used scheme", HFILL
                        }
                },
                { &hf_hdr_www_authenticate_realm,
                        {       "Authentication Realm",
-                               "wsp.hdr.www_authenticate.realm",
+                               "wsp.header.www_authenticate.realm",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header WWW-Authenticate: used realm", HFILL
                        }
                },
                { &hf_hdr_content_disposition,
                        {       "Content-Disposition",
-                               "wsp.hdr.content_disposition",
+                               "wsp.header.content_disposition",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Disposition", HFILL
                        }
                },
                { &hf_hdr_application_id,
                        {       "Application-Id",
-                               "wsp.hdr.application_id",
+                               "wsp.header.application_id",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Application-Id", HFILL
                        }
                },
                { &hf_hdr_content_uri,
                        {       "Content-Uri",
-                               "wsp.hdr.content_uri",
+                               "wsp.header.content_uri",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Uri", HFILL
                        }
                },
                { &hf_hdr_initiator_uri,
                        {       "Initiator-Uri",
-                               "wsp.hdr.initiator_uri",
+                               "wsp.header.initiator_uri",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Initiator-Uri", HFILL
                        }
                },
                { &hf_hdr_bearer_indication,
                        {       "Bearer-Indication",
-                               "wsp.hdr.bearer_indication",
+                               "wsp.header.bearer_indication",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Bearer-Indication", HFILL
                        }
                },
                { &hf_hdr_push_flag,
                        {       "Push-Flag",
-                               "wsp.hdr.push_flag",
+                               "wsp.header.push_flag",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Push-Flag", HFILL
                        }
                },
                { &hf_hdr_push_flag_auth,
                        {       "Initiator URI is authenticated",
-                               "wsp.hdr.push_flag.authenticated",
+                               "wsp.header.push_flag.authenticated",
                                FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x01,
                                "The X-Wap-Initiator-URI has been authenticated.", HFILL
                        }
                },
                { &hf_hdr_push_flag_trust,
                        {       "Content is trusted",
-                               "wsp.hdr.push_flag.trusted",
+                               "wsp.header.push_flag.trusted",
                                FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x02,
                                "The push content is trusted.", HFILL
                        }
                },
                { &hf_hdr_push_flag_last,
                        {       "Last push message",
-                               "wsp.hdr.push_flag.last",
+                               "wsp.header.push_flag.last",
                                FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x04,
                                "Indicates whether this is the last push message.", HFILL
                        }
                },
                { &hf_hdr_profile,
                        {       "Profile",
-                               "wsp.hdr.profile",
+                               "wsp.header.profile",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Profile", HFILL
                        }
                },
                { &hf_hdr_profile_diff,
                        {       "Profile-Diff",
-                               "wsp.hdr.profile_diff",
+                               "wsp.header.profile_diff",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Profile-Diff", HFILL
                        }
                },
                { &hf_hdr_profile_warning,
                        {       "Profile-Warning",
-                               "wsp.hdr.profile_warning",
+                               "wsp.header.profile_warning",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Profile-Warning", HFILL
                        }
                },
                { &hf_hdr_expect,
                        {       "Expect",
-                               "wsp.hdr.expect",
+                               "wsp.header.expect",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Expect", HFILL
                        }
                },
                { &hf_hdr_te,
                        {       "Te",
-                               "wsp.hdr.te",
+                               "wsp.header.te",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Te", HFILL
                        }
                },
                { &hf_hdr_trailer,
                        {       "Trailer",
-                               "wsp.hdr.trailer",
+                               "wsp.header.trailer",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Trailer", HFILL
                        }
                },
                { &hf_hdr_x_wap_tod,
                        {       "X-Wap-Tod",
-                               "wsp.hdr.x_wap_tod",
+                               "wsp.header.x_wap_tod",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header X-Wap-Tod", HFILL
                        }
                },
                { &hf_hdr_content_id,
                        {       "Content-Id",
-                               "wsp.hdr.content_id",
+                               "wsp.header.content_id",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Content-Id", HFILL
                        }
                },
                { &hf_hdr_set_cookie,
                        {       "Set-Cookie",
-                               "wsp.hdr.set_cookie",
+                               "wsp.header.set_cookie",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Set-Cookie", HFILL
                        }
                },
                { &hf_hdr_cookie,
                        {       "Cookie",
-                               "wsp.hdr.cookie",
+                               "wsp.header.cookie",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Cookie", HFILL
                        }
                },
                { &hf_hdr_encoding_version,
                        {       "Encoding-Version",
-                               "wsp.hdr.encoding_version",
+                               "wsp.header.encoding_version",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Encoding-Version", HFILL
                        }
                },
                { &hf_hdr_x_wap_security,
                        {       "X-Wap-Security",
-                               "wsp.hdr.x_wap_security",
+                               "wsp.header.x_wap_security",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header X-Wap-Security", HFILL
                        }
                },
                { &hf_hdr_x_wap_application_id,
                        {       "X-Wap-Application-Id",
-                               "wsp.hdr.x_wap_application_id",
+                               "wsp.header.x_wap_application_id",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header X-Wap-Application-Id", HFILL
                        }
                },
                { &hf_hdr_accept_application,
                        {       "Accept-Application",
-                               "wsp.hdr.accept_application",
+                               "wsp.header.accept_application",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP header Accept-Application", HFILL
                        }
@@ -6228,47 +6214,48 @@ proto_register_wsp(void)
 
                /*
                 * Openwave headers
+                * Header Code Page: x-up-1
                 */
 
                /* Textual headers */
                { &hf_hdr_openwave_x_up_proxy_operator_domain,
                        {       "x-up-proxy-operator-domain",
-                               "wsp.hdr.openwave.x_up_proxy_operator_domain",
+                               "wsp.header.x_up_1.x_up_proxy_operator_domain",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-operator-domain", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_home_page,
                        {       "x-up-proxy-home-page",
-                               "wsp.hdr.openwave.x_up_proxy_home_page",
+                               "wsp.header.x_up_1.x_up_proxy_home_page",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-home-page", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_uplink_version,
                        {       "x-up-proxy-uplink-version",
-                               "wsp.hdr.openwave.x_up_proxy_uplink_version",
+                               "wsp.header.x_up_1.x_up_proxy_uplink_version",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-uplink-version", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_ba_realm,
                        {       "x-up-proxy-ba-realm",
-                               "wsp.hdr.openwave.x_up_proxy_ba_realm",
+                               "wsp.header.x_up_1.x_up_proxy_ba_realm",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-ba-realm", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_request_uri,
                        {       "x-up-proxy-request-uri",
-                               "wsp.hdr.openwave.x_up_proxy_request_uri",
+                               "wsp.header.x_up_1.x_up_proxy_request_uri",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-request-uri", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_bookmark,
                        {       "x-up-proxy-bookmark",
-                               "wsp.hdr.openwave.x_up_proxy_bookmark",
+                               "wsp.header.x_up_1.x_up_proxy_bookmark",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-bookmark", HFILL
                        }
@@ -6276,147 +6263,147 @@ proto_register_wsp(void)
                /* Integer-value headers */
                { &hf_hdr_openwave_x_up_proxy_push_seq,
                        {       "x-up-proxy-push-seq",
-                               "wsp.hdr.openwave.x_up_proxy_push_seq",
+                               "wsp.header.x_up_1.x_up_proxy_push_seq",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-push-seq", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_notify,
                        {       "x-up-proxy-notify",
-                               "wsp.hdr.openwave.x_up_proxy_notify",
+                               "wsp.header.x_up_1.x_up_proxy_notify",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-notify", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_net_ask,
                        {       "x-up-proxy-net-ask",
-                               "wsp.hdr.openwave.x_up_proxy_net_ask",
+                               "wsp.header.x_up_1.x_up_proxy_net_ask",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-net-ask", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_tod,
                        {       "x-up-proxy-tod",
-                               "wsp.hdr.openwave.x_up_proxy_tod",
+                               "wsp.header.x_up_1.x_up_proxy_tod",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-tod", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_ba_enable,
                        {       "x-up-proxy-ba-enable",
-                               "wsp.hdr.openwave.x_up_proxy_ba_enable",
+                               "wsp.header.x_up_1.x_up_proxy_ba_enable",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-ba-enable", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_redirect_enable,
                        {       "x-up-proxy-redirect-enable",
-                               "wsp.hdr.openwave.x_up_proxy_redirect_enable",
+                               "wsp.header.x_up_1.x_up_proxy_redirect_enable",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-redirect-enable", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_redirect_status,
                        {       "x-up-proxy-redirect-status",
-                               "wsp.hdr.openwave.x_up_proxy_redirect_status",
+                               "wsp.header.x_up_1.x_up_proxy_redirect_status",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-redirect-status", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_linger,
                        {       "x-up-proxy-linger",
-                               "wsp.hdr.openwave.x_up_proxy_linger",
+                               "wsp.header.x_up_1.x_up_proxy_linger",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-linger", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_enable_trust,
                        {       "x-up-proxy-enable-trust",
-                               "wsp.hdr.openwave.x_up_proxy_enable_trust",
+                               "wsp.header.x_up_1.x_up_proxy_enable_trust",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-enable-trust", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_trust,
                        {       "x-up-proxy-trust",
-                               "wsp.hdr.openwave.x_up_proxy_trust",
+                               "wsp.header.x_up_1.x_up_proxy_trust",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-trust", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_has_color,
                        {       "x-up-devcap-has-color",
-                               "wsp.hdr.openwave.x_up_devcap_has_color",
+                               "wsp.header.x_up_1.x_up_devcap_has_color",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-has-color", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_num_softkeys,
                        {       "x-up-devcap-num-softkeys",
-                               "wsp.hdr.openwave.x_up_devcap_num_softkeys",
+                               "wsp.header.x_up_1.x_up_devcap_num_softkeys",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-num-softkeys", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_softkey_size,
                        {       "x-up-devcap-softkey-size",
-                               "wsp.hdr.openwave.x_up_devcap_softkey_size",
+                               "wsp.header.x_up_1.x_up_devcap_softkey_size",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-softkey-size", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_screen_chars,
                        {       "x-up-devcap-screen-chars",
-                               "wsp.hdr.openwave.x_up_devcap_screen_chars",
+                               "wsp.header.x_up_1.x_up_devcap_screen_chars",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-screen-chars", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_screen_pixels,
                        {       "x-up-devcap-screen-pixels",
-                               "wsp.hdr.openwave.x_up_devcap_screen_pixels",
+                               "wsp.header.x_up_1.x_up_devcap_screen_pixels",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-screen-pixels", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_em_size,
                        {       "x-up-devcap-em-size",
-                               "wsp.hdr.openwave.x_up_devcap_em_size",
+                               "wsp.header.x_up_1.x_up_devcap_em_size",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-em-size", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_screen_depth,
                        {       "x-up-devcap-screen-depth",
-                               "wsp.hdr.openwave.x_up_devcap_screen_depth",
+                               "wsp.header.x_up_1.x_up_devcap_screen_depth",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-screen-depth", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_immed_alert,
                        {       "x-up-devcap-immed-alert",
-                               "wsp.hdr.openwave.x_up_devcap_immed_alert",
+                               "wsp.header.x_up_1.x_up_devcap_immed_alert",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-immed-alert", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_devcap_gui,
                        {       "x-up-devcap-gui",
-                               "wsp.hdr.openwave.x_up_devcap_gui",
+                               "wsp.header.x_up_1.x_up_devcap_gui",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-devcap-gui", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_trans_charset,
                        {       "x-up-proxy-trans-charset",
-                               "wsp.hdr.openwave.x_up_proxy_trans_charset",
+                               "wsp.header.x_up_1.x_up_proxy_trans_charset",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-trans-charset", HFILL
                        }
                },
                { &hf_hdr_openwave_x_up_proxy_push_accept,
                        {       "x-up-proxy-push-accept",
-                               "wsp.hdr.openwave.x_up_proxy_push_accept",
+                               "wsp.header.x_up_1.x_up_proxy_push_accept",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-push-accept", HFILL
                        }
@@ -6425,7 +6412,7 @@ proto_register_wsp(void)
                /* Not used for now
                { &hf_hdr_openwave_x_up_proxy_client_id,
                        {       "x-up-proxy-client-id",
-                               "wsp.hdr.openwave.x_up_proxy_client_id",
+                               "wsp.header.x_up_1.x_up_proxy_client_id",
                                FT_STRING, BASE_NONE, NULL, 0x00,
                                "WSP Openwave header x-up-proxy-client-id", HFILL
                        }
@@ -6470,7 +6457,7 @@ proto_register_wsp(void)
        proto_wsp = proto_register_protocol(
                "Wireless Session Protocol",    /* protocol name for use by ethereal */
                "WSP",                          /* short version of name */
-               "wap-wsp"                       /* Abbreviated protocol name,
+               "wsp"                               /* Abbreviated protocol name,
                                                                                   should Match IANA:
            < URL:http://www.isi.edu/in-notes/iana/assignments/port-numbers/ >
                                                                                */
index 69ba6910c68031aeae34ea51c6ec8b3a248198dc..bb9ab14fd0704db822a9876da08d4877b269365a 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Routines to dissect WTLS component of WAP traffic.
  *
- * $Id: packet-wtls.c,v 1.22 2002/08/28 21:00:37 jmayer Exp $
+ * $Id: packet-wtls.c,v 1.23 2003/12/15 22:38:29 obiot Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -126,10 +126,6 @@ static gint ett_wtls_msg_type_item                    = ETT_EMPTY;
 static gint ett_wtls_msg_type_item_sub                        = ETT_EMPTY;
 static gint ett_wtls_msg_type_item_sub_sub            = ETT_EMPTY;
 
-/* Handles for WTP and WSP dissectors */
-static dissector_handle_t wtp_handle;
-static dissector_handle_t wsp_handle;
-
 static const value_string wtls_vals_record_type[] = {
        { 1, "change_cipher_data" },
        { 2, "alert" },
@@ -1112,483 +1108,483 @@ proto_register_wtls(void)
        static hf_register_info hf[] = {
                { &hf_wtls_record,
                        {       "Record",
-                               "wsp.wtls.record",
+                               "wtls.record",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_record_type ), 0x0f,
                                "Record", HFILL
                        }
                },
                { &hf_wtls_record_type,
                        {       "Record Type",
-                               "wsp.wtls.rec_type",
+                               "wtls.rec_type",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_record_type ), 0x0f,
                                "Record Type", HFILL
                        }
                },
                { &hf_wtls_record_length,
                        {       "Record Length",
-                               "wsp.wtls.rec_length",
+                               "wtls.rec_length",
                                 FT_UINT16, BASE_DEC, NULL, 0x00,
                                "Record Length", HFILL
                        }
                },
                { &hf_wtls_record_sequence,
                        {       "Record Sequence",
-                               "wsp.wtls.rec_seq",
+                               "wtls.rec_seq",
                                 FT_UINT16, BASE_DEC, NULL, 0x00,
                                "Record Sequence", HFILL
                        }
                },
                { &hf_wtls_record_ciphered,
                        {       "Record Ciphered",
-                               "wsp.wtls.rec_cipher",
+                               "wtls.rec_cipher",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Record Ciphered", HFILL
                        }
                },
                { &hf_wtls_hands,
                        {       "Handshake",
-                               "wsp.wtls.handshake",
+                               "wtls.handshake",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_handshake_type ), 0x00,
                                "Handshake", HFILL
                        }
                },
                { &hf_wtls_hands_type,
                        {       "Type",
-                               "wsp.wtls.handshake.type",
+                               "wtls.handshake.type",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_handshake_type ), 0x00,
                                "Type", HFILL
                        }
                },
                { &hf_wtls_hands_length,
                        {       "Length",
-                               "wsp.wtls.handshake.length",
+                               "wtls.handshake.length",
                                 FT_UINT16, BASE_DEC, NULL, 0x00,
                                "Length", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello,
                        {       "Client Hello",
-                               "wsp.wtls.handshake.client_hello",
+                               "wtls.handshake.client_hello",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Client Hello", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_version,
                        {       "Version",
-                               "wsp.wtls.handshake.client_hello.version",
+                               "wtls.handshake.client_hello.version",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Version", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_gmt,
                        {       "Time GMT",
-                               "wsp.wtls.handshake.client_hello.gmt",
+                               "wtls.handshake.client_hello.gmt",
                                 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
                                "Time GMT", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_random,
                        {       "Random",
-                               "wsp.wtls.handshake.client_hello.random",
+                               "wtls.handshake.client_hello.random",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Random", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_session,
                        {       "Session ID",
-                               "wsp.wtls.handshake.client_hello.sessionid",
+                               "wtls.handshake.client_hello.sessionid",
                                 FT_UINT32, BASE_DEC, NULL, 0x00,
                                "Session ID", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_session_str,
                        {       "Session ID",
-                               "wsp.wtls.handshake.client_hello.session.str",
+                               "wtls.handshake.client_hello.session.str",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Session ID", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_cli_key_id,
                        {       "Client Keys",
-                               "wsp.wtls.handshake.client_hello.client_keys_id",
+                               "wtls.handshake.client_hello.client_keys_id",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Client Keys"     , HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_cli_key_len,
                        {       "Length",
-                               "wsp.wtls.handshake.client_hello.client_keys_len",
+                               "wtls.handshake.client_hello.client_keys_len",
                                 FT_UINT16, BASE_DEC, NULL, 0x00,
                                "Length"          , HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_trust_key_id,
                        {       "Trusted Keys",
-                               "wsp.wtls.handshake.client_hello.trusted_keys_id",
+                               "wtls.handshake.client_hello.trusted_keys_id",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Trusted Keys"          , HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_exchange,
                        {       "Key Exchange",
-                               "wsp.wtls.handshake.client_hello.key.key_exchange",
+                               "wtls.handshake.client_hello.key.key_exchange",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_key_exchange_suite ), 0x00,
                                "Key Exchange", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_exchange_suite,
                        {       "Suite",
-                               "wsp.wtls.handshake.client_hello.key.key_exchange.suite",
+                               "wtls.handshake.client_hello.key.key_exchange.suite",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_key_exchange_suite ), 0x00,
                                "Suite", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_parameter_index,
                        {       "Parameter Index",
-                               "wsp.wtls.handshake.client_hello.parameter_index",
+                               "wtls.handshake.client_hello.parameter_index",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Parameter Index", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_parameter_set,
                        {       "Parameter Set",
-                               "wsp.wtls.handshake.client_hello.parameter",
+                               "wtls.handshake.client_hello.parameter",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Parameter Set", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_identifier_type,
                        {       "Identifier Type",
-                               "wsp.wtls.handshake.client_hello.ident_type",
+                               "wtls.handshake.client_hello.ident_type",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_identifier_type ), 0x00,
                                "Identifier Type", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_identifier_charset,
                        {       "Identifier CharSet",
-                               "wsp.wtls.handshake.client_hello.ident_charset",
+                               "wtls.handshake.client_hello.ident_charset",
                                 FT_UINT16, BASE_HEX, VALS ( vals_character_sets ), 0x00,
                                "Identifier CharSet", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_identifier_size,
                        {       "Identifier Size",
-                               "wsp.wtls.handshake.client_hello.ident_size",
+                               "wtls.handshake.client_hello.ident_size",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Identifier Size", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_identifier,
                        {       "Identifier",
-                               "wsp.wtls.handshake.client_hello.identifier",
+                               "wtls.handshake.client_hello.identifier",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Identifier", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_identifier_str,
                        {       "Identifier Name",
-                               "wsp.wtls.handshake.client_hello.ident_name",
+                               "wtls.handshake.client_hello.ident_name",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Identifier Name", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_cipher_suite,
                        {       "Cipher Suites",
-                               "wsp.wtls.handshake.client_hello.ciphers",
+                               "wtls.handshake.client_hello.ciphers",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Cipher Suite", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_cipher_suite_item,
                        {       "Cipher",
-                               "wsp.wtls.handshake.client_hello.cipher",
+                               "wtls.handshake.client_hello.cipher",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Cipher", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_compression_methods,
                        {       "Compression Methods",
-                               "wsp.wtls.handshake.client_hello.comp_methods",
+                               "wtls.handshake.client_hello.comp_methods",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Compression Methods", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_compression,
                        {       "Compression",
-                               "wsp.wtls.handshake.client_hello.compression",
+                               "wtls.handshake.client_hello.compression",
                                 FT_UINT8, BASE_HEX, VALS ( wtls_vals_compression ), 0x00,
                                "Compression", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_sequence_mode,
                        {       "Sequence Mode",
-                               "wsp.wtls.handshake.client_hello.sequence_mode",
+                               "wtls.handshake.client_hello.sequence_mode",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_sequence_mode ), 0x00,
                                "Sequence Mode", HFILL
                        }
                },
                { &hf_wtls_hands_cli_hello_key_refresh,
                        {       "Refresh",
-                               "wsp.wtls.handshake.client_hello.refresh",
+                               "wtls.handshake.client_hello.refresh",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Refresh", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello,
                        {       "Server Hello",
-                               "wsp.wtls.handshake.server_hello",
+                               "wtls.handshake.server_hello",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Server Hello", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_version,
                        {       "Version",
-                               "wsp.wtls.handshake.server_hello.version",
+                               "wtls.handshake.server_hello.version",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Version", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_gmt,
                        {       "Time GMT",
-                               "wsp.wtls.handshake.server_hello.gmt",
+                               "wtls.handshake.server_hello.gmt",
                                 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
                                "Time GMT", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_random,
                        {       "Random",
-                               "wsp.wtls.handshake.server_hello.random",
+                               "wtls.handshake.server_hello.random",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Random", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_session,
                        {       "Session ID",
-                               "wsp.wtls.handshake.server_hello.sessionid",
+                               "wtls.handshake.server_hello.sessionid",
                                 FT_UINT32, BASE_DEC, NULL, 0x00,
                                "Session ID", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_session_str,
                        {       "Session ID",
-                               "wsp.wtls.handshake.server_hello.session.str",
+                               "wtls.handshake.server_hello.session.str",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Session ID", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_cli_key_id,
                        {       "Client Key ID",
-                               "wsp.wtls.handshake.server_hello.key",
+                               "wtls.handshake.server_hello.key",
                                 FT_UINT8, BASE_HEX, NULL, 0x00,
                                "Client Key ID", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_cipher_suite_item,
                        {       "Cipher",
-                               "wsp.wtls.handshake.server_hello.cipher",
+                               "wtls.handshake.server_hello.cipher",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Cipher", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_cipher_bulk,
                        {       "Cipher Bulk",
-                               "wsp.wtls.handshake.server_hello.cipher.bulk",
+                               "wtls.handshake.server_hello.cipher.bulk",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_cipher_bulk ), 0x00,
                                "Cipher Bulk", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_cipher_mac,
                        {       "Cipher MAC",
-                               "wsp.wtls.handshake.server_hello.cipher.mac",
+                               "wtls.handshake.server_hello.cipher.mac",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_cipher_mac ), 0x00,
                                "Cipher MAC", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_compression,
                        {       "Compression",
-                               "wsp.wtls.handshake.server_hello.compression",
+                               "wtls.handshake.server_hello.compression",
                                 FT_UINT8, BASE_HEX, VALS ( wtls_vals_compression ), 0x00,
                                "Compression", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_sequence_mode,
                        {       "Sequence Mode",
-                               "wsp.wtls.handshake.server_hello.sequence_mode",
+                               "wtls.handshake.server_hello.sequence_mode",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_sequence_mode ), 0x00,
                                "Sequence Mode", HFILL
                        }
                },
                { &hf_wtls_hands_serv_hello_key_refresh,
                        {       "Refresh",
-                               "wsp.wtls.handshake.server_hello.refresh",
+                               "wtls.handshake.server_hello.refresh",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Refresh", HFILL
                        }
                },
                { &hf_wtls_hands_certificates,
                        {       "Certificates",
-                               "wsp.wtls.handshake.certificates",
+                               "wtls.handshake.certificates",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Certificates", HFILL
                        }
                },
                { &hf_wtls_hands_certificate,
                        {       "Certificate",
-                               "wsp.wtls.handshake.certificate",
+                               "wtls.handshake.certificate",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Certificate", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_type,
                        {       "Type",
-                               "wsp.wtls.handshake.certificate.type",
+                               "wtls.handshake.certificate.type",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_certificate_type ), 0x00,
                                "Type", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_version,
                        {       "Version",
-                               "wsp.wtls.handshake.certificate.version",
+                               "wtls.handshake.certificate.version",
                                 FT_UINT8, BASE_HEX, NULL, 0x00,
                                "Version", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_signature_type,
                        {       "Signature Type",
-                               "wsp.wtls.handshake.certificate.signature.type",
+                               "wtls.handshake.certificate.signature.type",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_certificate_signature ), 0x00,
                                "Signature Type", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_signature,
                        {       "Signature Size",
-                               "wsp.wtls.handshake.certificate.signature.signature",
+                               "wtls.handshake.certificate.signature.signature",
                                 FT_UINT32, BASE_DEC, NULL, 0x00,
                                "Signature Size", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_issuer_type,
                        {       "Issuer",
-                               "wsp.wtls.handshake.certificate.issuer.type",
+                               "wtls.handshake.certificate.issuer.type",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_identifier_type ), 0x00,
                                "Issuer", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_issuer_charset,
                        {       "Charset",
-                               "wsp.wtls.handshake.certificate.issuer.charset",
+                               "wtls.handshake.certificate.issuer.charset",
                                 FT_UINT16, BASE_HEX, VALS ( vals_character_sets ), 0x00,
                                "Charset", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_issuer_size,
                        {       "Size",
-                               "wsp.wtls.handshake.certificate.issuer.size",
+                               "wtls.handshake.certificate.issuer.size",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Size", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_issuer_name,
                        {       "Name",
-                               "wsp.wtls.handshake.certificate.issuer.name",
+                               "wtls.handshake.certificate.issuer.name",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Name", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_valid_not_before,
                        {       "Valid not before",
-                               "wsp.wtls.handshake.certificate.before",
+                               "wtls.handshake.certificate.before",
                                 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
                                "Valid not before", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_valid_not_after,
                        {       "Valid not after",
-                               "wsp.wtls.handshake.certificate.after",
+                               "wtls.handshake.certificate.after",
                                 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
                                "Valid not after", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_subject_type,
                        {       "Subject",
-                               "wsp.wtls.handshake.certificate.subject.type",
+                               "wtls.handshake.certificate.subject.type",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_identifier_type ), 0x00,
                                "Subject", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_subject_charset,
                        {       "Charset",
-                               "wsp.wtls.handshake.certificate.subject.charset",
+                               "wtls.handshake.certificate.subject.charset",
                                 FT_UINT16, BASE_HEX, VALS ( vals_character_sets ), 0x00,
                                "Charset", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_subject_size,
                        {       "Size",
-                               "wsp.wtls.handshake.certificate.subject.size",
+                               "wtls.handshake.certificate.subject.size",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Size", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_subject_name,
                        {       "Name",
-                               "wsp.wtls.handshake.certificate.subject.name",
+                               "wtls.handshake.certificate.subject.name",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Name", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_public_key_type,
                        {       "Public Key Type",
-                               "wsp.wtls.handshake.certificate.public.type",
+                               "wtls.handshake.certificate.public.type",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_public_key_type ), 0x00,
                                "Public Key Type", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_key_parameter_index,
                        {       "Parameter Index",
-                               "wsp.wtls.handshake.certificate.parameter_index",
+                               "wtls.handshake.certificate.parameter_index",
                                 FT_UINT8, BASE_DEC, NULL, 0x00,
                                "Parameter Index", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_key_parameter_set,
                        {       "Parameter Set",
-                               "wsp.wtls.handshake.certificate.parameter",
+                               "wtls.handshake.certificate.parameter",
                                 FT_STRING, BASE_NONE, NULL, 0x00,
                                "Parameter Set", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_rsa_exponent,
                        {       "RSA Exponent Size",
-                               "wsp.wtls.handshake.certificate.rsa.exponent",
+                               "wtls.handshake.certificate.rsa.exponent",
                                 FT_UINT32, BASE_DEC, NULL, 0x00,
                                "RSA Exponent Size", HFILL
                        }
                },
                { &hf_wtls_hands_certificate_wtls_rsa_modules,
                        {       "RSA Modulus Size",
-                               "wsp.wtls.handshake.certificate.rsa.modules",
+                               "wtls.handshake.certificate.rsa.modules",
                                 FT_UINT32, BASE_DEC, NULL, 0x00,
                                "RSA Modulus Size", HFILL
                        }
                },
                { &hf_wtls_alert,
                        {       "Alert",
-                               "wsp.wtls.alert",
+                               "wtls.alert",
                                 FT_NONE, BASE_NONE, NULL, 0x00,
                                "Alert", HFILL
                        }
                },
                { &hf_wtls_alert_level,
                        {       "Level",
-                               "wsp.wtls.alert.level",
+                               "wtls.alert.level",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_alert_level ), 0x00,
                                "Level", HFILL
                        }
                },
                { &hf_wtls_alert_description,
                        {       "Description",
-                               "wsp.wtls.alert.description",
+                               "wtls.alert.description",
                                 FT_UINT8, BASE_DEC, VALS ( wtls_vals_alert_description ), 0x00,
                                "Description", HFILL
                        }
@@ -1609,7 +1605,7 @@ proto_register_wtls(void)
        proto_wtls = proto_register_protocol(
                "Wireless Transport Layer Security",    /* protocol name for use by ethereal */
                "WTLS",                          /* short version of name */
-               "wap-wtls"                      /* Abbreviated protocol name, should Match IANA
+               "wtls"                          /* Abbreviated protocol name, should Match IANA
                                                    < URL:http://www.isi.edu/in-notes/iana/assignments/port-numbers/ >
                                                  */
        );
@@ -1624,12 +1620,6 @@ proto_reg_handoff_wtls(void)
 {
        dissector_handle_t wtls_handle;
 
-       /*
-        * Get handles for the WTP and connectionless WSP dissectors.
-        */
-       wtp_handle = find_dissector("wtp");
-       wsp_handle = find_dissector("wsp-cl");
-
        wtls_handle = create_dissector_handle(dissect_wtls, proto_wtls);
        dissector_add("udp.port", UDP_PORT_WTLS_WSP,     wtls_handle);
        dissector_add("udp.port", UDP_PORT_WTLS_WTP_WSP, wtls_handle);
index a08de7d73e8e14b60d38c9f8cf23df5f975f73e3..e76300dedd37f0505bc1e2509db0f25d28d68097 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Routines to dissect WTP component of WAP traffic.
  *
- * $Id: packet-wtp.c,v 1.53 2003/11/05 04:23:59 guy Exp $
+ * $Id: packet-wtp.c,v 1.54 2003/12/15 22:38:29 obiot Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -699,7 +699,7 @@ dissect_wtp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
  * XXX - can this be called from any other dissector?
  */
 static void
-dissect_wtp_fromwap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+dissect_wtp_fromwtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
     if (check_col(pinfo->cinfo, COL_PROTOCOL))
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "WTLS+WTP+WSP" );
@@ -959,7 +959,7 @@ proto_register_wtp(void)
     proto_wtp = proto_register_protocol(
        "Wireless Transaction Protocol",   /* protocol name for use by ethereal */
        "WTP",                             /* short version of name */
-       "wap-wsp-wtp"                      /* Abbreviated protocol name, should Match IANA
+       "wtp"                      /* Abbreviated protocol name, should Match IANA
                                            < URL:http://www.isi.edu/in-notes/iana/assignments/port-numbers/ >
                                            */
     );
@@ -968,7 +968,7 @@ proto_register_wtp(void)
     proto_register_field_array(proto_wtp, hf, array_length(hf));
     proto_register_subtree_array(ett, array_length(ett));
 
-    register_dissector("wtp", dissect_wtp_fromwap, proto_wtp);
+    register_dissector("wtp-wtls", dissect_wtp_fromwtls, proto_wtp);
     register_dissector("wtp-udp", dissect_wtp_fromudp, proto_wtp);
     register_init_routine(wtp_defragment_init);
 };