Minor cleanup:
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 14 Dec 2010 01:50:31 +0000 (01:50 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 14 Dec 2010 01:50:31 +0000 (01:50 +0000)
- Initialize a few static global variables;
- Remove two unnecessary calls to g_hash_table_foreach_remove;
- Do whitespace cleanup and use consistent indentation;
- Fix a few typos and fix up several comments.

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

epan/dissectors/packet-bootp.c
epan/dissectors/packet-fw1.c
epan/dissectors/packet-gtp.c
epan/dissectors/packet-ieee80211.c
epan/dissectors/packet-iuup.c
epan/dissectors/packet-ssl.c
epan/dissectors/packet-x11.c
epan/dissectors/packet-zbee-aps.c

index 3c1f32a17382d38011fc6a68bafd3f1b88ce2402..6ec65c1d5085c0660e90581e01e81c1426e4a2ae 100644 (file)
@@ -1443,7 +1443,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff,
                                                ip_to_str(tvb_get_ptr(tvb, i, 4)));
                                }
                        }
-               }
+               }
                break;
 
        case 94: {      /* Client network interface identifier */
@@ -1951,7 +1951,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff,
 
                if (vs != NULL) {
                        proto_item_append_text(vti, " = %s",
-                            val_to_str(vd, vs, "Unknown (%u)"));
+                                              val_to_str(vd, vs, "Unknown (%u)"));
                } else
                        proto_item_append_text(vti, " = %u", vd);
 
@@ -2231,7 +2231,7 @@ dissect_vendor_pxeclient_suboption(proto_tree *v_tree, tvbuff_t *tvb,
 
        if (subopt == 0) {
                proto_tree_add_text(v_tree, tvb, optoff, 1, "Padding");
-                return (suboptoff);
+               return (suboptoff);
        } else if (subopt == 255) {     /* End Option */
                proto_tree_add_text(v_tree, tvb, optoff, 1, "End PXEClient option");
                /* Make sure we skip any junk left this option */
@@ -2551,7 +2551,7 @@ dissect_vendor_cablelabs_suboption(proto_tree *v_tree, tvbuff_t *tvb,
 
        if (subopt == 0) {
                proto_tree_add_text(v_tree, tvb, optoff, 1, "Padding");
-                return (suboptoff);
+               return (suboptoff);
        } else if (subopt == 255) {     /* End Option */
                proto_tree_add_text(v_tree, tvb, optoff, 1, "End CableLabs option");
                /* Make sure we skip any junk left this option */
@@ -2595,7 +2595,7 @@ dissect_vendor_cablelabs_suboption(proto_tree *v_tree, tvbuff_t *tvb,
                                } else {
                                        proto_tree_add_text(v_tree, tvb, optoff, subopt_len+2,
                                                "Suboption %d: suboption length isn't 3 or 6", subopt);
-                                }
+                               }
                                break;
                        } else if ( subopt == 11 ) { /* Address Realm */
                                if (subopt_len != 1) {
@@ -2931,8 +2931,8 @@ dissect_vendor_tr111_suboption(proto_tree *v_tree, tvbuff_t *tvb,
        guint8 subopt_len;
 
        /* Reference: TR-111 DHCP Option 125 Sub-Option Data Fields
-           Page 10.
-         */
+          Page 10.
+       */
 
        static struct opt_info o125_tr111_opt[]= {
                /* 0 */ {"nop", special, NULL}, /* dummy */
@@ -3695,310 +3695,310 @@ static const value_string docs_cm_ussymrate_vals[] = {
 static void
 display_uint_with_range_checking(proto_item *ti, guint8 val_byte, guint16 val_uint16, int min_value, int max_value)
 {
-  guint16 value;
-
-  if (0 != val_byte)
-  {
-    value = val_byte;
-  }
-  else
-  {
-    value = val_uint16;
-  }
-  proto_item_append_text(ti, "%i", value);
-  if ((value < min_value) ||
-      (value > max_value))
-  {
-    proto_item_append_text(ti, " (Value Out-of-Range [%i..%i])", min_value, max_value);
-  }
+       guint16 value;
+
+       if (0 != val_byte)
+       {
+               value = val_byte;
+       }
+       else
+       {
+               value = val_uint16;
+       }
+       proto_item_append_text(ti, "%i", value);
+       if ((value < min_value) ||
+           (value > max_value))
+       {
+               proto_item_append_text(ti, " (Value Out-of-Range [%i..%i])", min_value, max_value);
+       }
 }
 
 static void get_opt125_tlv(tvbuff_t *tvb, guint off, guint8 *tlvtype, guint8 *tlvlen, guint8 **value)
 {
-  /* Type */
-  *tlvtype = tvb_get_guint8(tvb, off);
-  /* Length */
-  *tlvlen  = tvb_get_guint8(tvb, off+1);
-  /* Value */
-  *value = ep_tvb_memdup(tvb, off + 2, *tlvlen);
+       /* Type */
+       *tlvtype = tvb_get_guint8(tvb, off);
+       /* Length */
+       *tlvlen  = tvb_get_guint8(tvb, off+1);
+       /* Value */
+       *value = ep_tvb_memdup(tvb, off + 2, *tlvlen);
 }
 
 static void get_opt60_tlv(tvbuff_t *tvb, guint off, guint8 *tlvtype, guint8 *tlvlen, guint8 **value)
 {
-  guint  i;
-  guint8  *val_asc;
-  val_asc = (guint8 *)ep_alloc0(4);
-  /* Type */
-  tvb_memcpy(tvb, val_asc, off, 2);
-  *tlvtype = (guint8)strtoul((gchar*)val_asc, NULL, 16);
-  /* Length */
-  tvb_memcpy(tvb, val_asc, off + 2, 2);
-  *tlvlen = (guint8)strtoul((gchar*)val_asc, NULL, 16);
-  /* Value */
-  *value = (guint8 *)ep_alloc0(*tlvlen);
-  for (i=0; i<*tlvlen; i++)
-  {
-    memset(val_asc, 0, sizeof (val_asc));
-    tvb_memcpy(tvb, val_asc, off + ((i*2) + 4), 2);
-    (*value)[i] = (guint8)strtoul((gchar*)val_asc, NULL, 16);
-  }
+       guint  i;
+       guint8  *val_asc;
+       val_asc = (guint8 *)ep_alloc0(4);
+       /* Type */
+       tvb_memcpy(tvb, val_asc, off, 2);
+       *tlvtype = (guint8)strtoul((gchar*)val_asc, NULL, 16);
+       /* Length */
+       tvb_memcpy(tvb, val_asc, off + 2, 2);
+       *tlvlen = (guint8)strtoul((gchar*)val_asc, NULL, 16);
+       /* Value */
+       *value = (guint8 *)ep_alloc0(*tlvlen);
+       for (i=0; i<*tlvlen; i++)
+       {
+               memset(val_asc, 0, sizeof (val_asc));
+               tvb_memcpy(tvb, val_asc, off + ((i*2) + 4), 2);
+               (*value)[i] = (guint8)strtoul((gchar*)val_asc, NULL, 16);
+       }
 }
 
 static void
 dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, gboolean opt125)
 {
-        guint8 *asc_val;
-        guint i;
-        proto_item *ti;
-        proto_tree *subtree;
-        char bit_fld[64];
-        guint8 tlv_type;
-        guint8 tlv_len;
-        guint8 val_byte = 0;
-        guint16 val_uint16 = 0;
-        guint8 *val_other = NULL;
-        guint off = voff;
-
-        asc_val = ep_alloc0(4);
-
-        if (opt125)
-        {
-          /* Option 125 is formatted as uint8's */
-          /* Type */
-          tlv_type = tvb_get_guint8(tvb, off);
-          /* Length */
-          tlv_len  = tvb_get_guint8(tvb, off+1);
-          proto_tree_add_uint_format_value(v_tree, hf_bootp_docsis_cmcap_len, tvb, off+1, 1,
-            tlv_len, "%d", tlv_len);
-        }
-        else
-        {
-         /* Option 60 is formatted as an ascii string.
-            Since the capabilities are the same for both options
-            I am converting the Option 60 values from ascii to
-            uint8s to allow the same parser to work for both */
-          off += DOCS_CM_TLV_OFF;
-          tvb_memcpy (tvb, asc_val, off, 2);
-          tlv_len = (guint8)strtoul((gchar*)asc_val, NULL, 16);
-          proto_tree_add_uint_format_value(v_tree, hf_bootp_docsis_cmcap_len, tvb, off+2, 2,
-            tlv_len, "%d", tlv_len);
-        }
-
-        off+=2;
-
-        while (off - ((guint) voff) < ((guint) len))
-        {
-          tlv_type = 0;
-          tlv_len = 0;
-          val_byte = 0;
-          val_uint16 = 0;
-
-          if (opt125)
-          {
-            get_opt125_tlv(tvb, off, &tlv_type, &tlv_len, &val_other);
-            ti = proto_tree_add_text(v_tree, tvb, off,
-                                     tlv_len + 2,
-                                     "0x%02x: %s = ",
-                                     tlv_type,
-                                     val_to_str(tlv_type, docs_cm_type_vals, "unknown"));
-          }
-          else
-          {
-           /* Option 60 is formatted as an ascii string.  Since the capabilities
-              are the same for both options I am converting the Option 60 values
-              from ascii to uint8s to allow the same parser to work for both */
-            get_opt60_tlv(tvb, off, &tlv_type, &tlv_len, &val_other);
-            ti = proto_tree_add_text(v_tree, tvb, off,
-                                     (tlv_len * 2) + 4,
-                                     "0x%02x: %s = ",
-                                     tlv_type,
-                                     val_to_str(tlv_type, docs_cm_type_vals, "unknown"));
-          }
-
-          if (tlv_len == 1)
-          {
-            /* The value refers to a byte. */
-            val_byte = val_other[0];
-          }
-          else
-          {
-            if (tlv_len == 2)
-            {
-              /* The value refers to a uint16. */
-              val_uint16 = (val_other[0] << 8) + val_other[1];
-            }
-          }
-
-         switch (tlv_type)
-         {
-           case DOCS_CM_CONCAT_SUP:
-           case DOCS_CM_FRAG_SUP:
-           case DOCS_CM_PHS_SUP:
-           case DOCS_CM_IGMP_SUP:
-           case DOCS_CM_DCC_SUP:
-           case DOCS_CM_EXPUNI_SPACE:
-           case DOCS_CM_DUTFILT_SUP:
-           case DOCS_CM_SACM2_SUP:
-           case DOCS_CM_SACM2HOP_SUP:
-           case DOCS_CM_IPV6_SUP:
-               proto_item_append_text(ti,
-                   "%s",
-                   val_to_str(val_byte, docs_cm_supported_vals, "Reserved"));
-               break;
-           case DOCS_CM_DOCSIS_VER:
-               proto_item_append_text(ti,
-                   "%s",
-                   val_to_str(val_byte, docs_cm_version_vals, "Reserved"));
-               break;
-           case DOCS_CM_PRIV_SUP:
-               proto_item_append_text(ti,
-                   "%s",
-                   val_to_str(val_byte, docs_cm_privacy_vals, "Reserved"));
-               break;
-           case DOCS_CM_FILT_SUP:
-               proto_item_append_text(ti,
-                   "%s",
-                   val_to_str(val_byte, docs_cm_filt_vals, "Reserved"));
-               break;
-           case DOCS_CM_L2VPN_SUP:
-               proto_item_append_text(ti,
-                   "%s",
-                   val_to_str(val_byte, docs_cm_l2vpn_vals, "Reserved"));
-               break;
-           case DOCS_CM_L2VPN_HOST_SUP:
-               proto_item_append_text(ti,
-                   "eSAFE ifIndex %s (%i)/eSAFE MAC %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
-                   val_to_str(val_other[0], docs_cm_map_l2vpn_esafe_index_support_vals, "Reserved"),
-                   val_other[0],
-                   val_other[1],
-                   val_other[2],
-                   val_other[3],
-                   val_other[4],
-                   val_other[5],
-                   val_other[6]);
-               break;
-            case DOCS_CM_USFREQRNG_SUP:
-               proto_item_append_text(ti,
-                   "%s",
-                   val_to_str(val_byte, docs_cm_usfreqrng_vals, "Reserved"));
-               break;
-            case DOCS_CM_MAPUCDRECEIPT_SUP:
-               proto_item_append_text(ti,
-                   "%s",
-                   val_to_str(val_byte, docs_cm_map_ucd_receipt_vals, "Reserved"));
-               break;
-            case DOCS_CM_DPV_SUP:
-               proto_item_append_text(ti,
-                   "%s",
-                   val_to_str(val_byte, docs_cm_map_dpv_support_vals, "Reserved"));
-               break;
-            case DOCS_CM_DSAID_SUP:
-            case DOCS_CM_MULTTXCHAN_SUP:
-            case DOCS_CM_512USTXCHAN_SUP:
-            case DOCS_CM_256USTXCHAN_SUP:
-            case DOCS_CM_TOTALSIDCLU_SUP:
-            case DOCS_CM_MULTRXCHAN_SUP:
-            case DOCS_CM_UGSPERUSFLOW_SUP:
-               display_uint_with_range_checking(ti, val_byte, val_uint16, 0, 255);
-               break;
-            case DOCS_CM_USID_SUP:
-               display_uint_with_range_checking(ti, val_byte, val_uint16,1, 255);
-               break;
-            case DOCS_CM_RESEQDSID_SUP:
-            case DOCS_CM_MULTDSID_SUP:
-               display_uint_with_range_checking(ti, val_byte, val_uint16, 16, 255);
-               break;
-            case DOCS_CM_SIDCLUPERSF_SUP:
-               display_uint_with_range_checking(ti, val_byte, val_uint16, 2, 8);
-               break;
-            case DOCS_CM_TOTALDSID_SUP:
-               display_uint_with_range_checking(ti, val_byte, val_uint16, 3, 255);
-               break;
-            case DOCS_CM_TET:
-               display_uint_with_range_checking(ti, val_byte, val_uint16, 8, 64);
-               break;
-            case DOCS_CM_TET_MI:
-               if ((val_byte == 1) ||
-                   (val_byte == 2) ||
-                   (val_byte == 4))
+       guint8 *asc_val;
+       guint i;
+       proto_item *ti;
+       proto_tree *subtree;
+       char bit_fld[64];
+       guint8 tlv_type;
+       guint8 tlv_len;
+       guint8 val_byte = 0;
+       guint16 val_uint16 = 0;
+       guint8 *val_other = NULL;
+       guint off = voff;
+
+       asc_val = ep_alloc0(4);
+
+       if (opt125)
+       {
+               /* Option 125 is formatted as uint8's */
+               /* Type */
+               tlv_type = tvb_get_guint8(tvb, off);
+               /* Length */
+               tlv_len  = tvb_get_guint8(tvb, off+1);
+               proto_tree_add_uint_format_value(v_tree, hf_bootp_docsis_cmcap_len, tvb, off+1, 1,
+                                                tlv_len, "%d", tlv_len);
+       }
+       else
+       {
+               /* Option 60 is formatted as an ascii string.
+                  Since the capabilities are the same for both options
+                  I am converting the Option 60 values from ascii to
+                  uint8s to allow the same parser to work for both */
+               off += DOCS_CM_TLV_OFF;
+               tvb_memcpy (tvb, asc_val, off, 2);
+               tlv_len = (guint8)strtoul((gchar*)asc_val, NULL, 16);
+               proto_tree_add_uint_format_value(v_tree, hf_bootp_docsis_cmcap_len, tvb, off+2, 2,
+                                                tlv_len, "%d", tlv_len);
+       }
+
+       off+=2;
+
+       while (off - ((guint) voff) < ((guint) len))
+       {
+               tlv_type = 0;
+               tlv_len = 0;
+               val_byte = 0;
+               val_uint16 = 0;
+
+               if (opt125)
                {
-                 proto_item_append_text(ti,
-                       " %i",
-                       val_byte);
+                       get_opt125_tlv(tvb, off, &tlv_type, &tlv_len, &val_other);
+                       ti = proto_tree_add_text(v_tree, tvb, off,
+                                                tlv_len + 2,
+                                                "0x%02x: %s = ",
+                                                tlv_type,
+                                                val_to_str(tlv_type, docs_cm_type_vals, "unknown"));
                }
                else
                {
-                 proto_item_append_text(ti,
-                        " (Invalid Value %i : Should be [1,2,4]",
-                        val_byte);
+                       /* Option 60 is formatted as an ascii string.  Since the capabilities
+                          are the same for both options I am converting the Option 60 values
+                          from ascii to uint8s to allow the same parser to work for both */
+                       get_opt60_tlv(tvb, off, &tlv_type, &tlv_len, &val_other);
+                       ti = proto_tree_add_text(v_tree, tvb, off,
+                                                (tlv_len * 2) + 4,
+                                                "0x%02x: %s = ",
+                                                tlv_type,
+                                                val_to_str(tlv_type, docs_cm_type_vals, "unknown"));
                }
-               break;
-           case DOCS_CM_IPFILT_SUP:
-           case DOCS_CM_USDROPCLASSIF_SUP:
-               display_uint_with_range_checking(ti, val_byte, val_uint16, 64, 65535);
-               break;
-           case DOCS_CM_LLCFILT_SUP:
-               display_uint_with_range_checking(ti, val_byte, val_uint16, 10, 65535);
-               break;
-           case DOCS_CM_RNGHLDOFF_SUP:
-               proto_item_append_text(ti,
-                       "Ranging ID ");
-               proto_item_append_text(ti,
-                       "(0x%04x)", (val_other[0] << sizeof(guint8)) + val_other[1]);
-               proto_item_append_text(ti,
-                       " Component Bit Mask ");
-               proto_item_append_text(ti,
-                       "(0x%04x)", (val_other[2] << sizeof(guint8)) + val_other[3]);
-               break;
-           case DOCS_CM_USSYMRATE_SUP:
-               proto_item_append_text(ti,
-                       "0x%02x", val_byte);
-               break;
-           case DOCS_CM_FCTF_SUP:
-               proto_item_append_text(ti,
-                       "%s",
-                       val_to_str(val_byte, docs_cm_map_fctfc_support_vals, "Reserved"));
-               break;
-           case DOCS_CM_MULTDSIDFW_SUP:
-               proto_item_append_text(ti,
-                       "%s",
-                       val_to_str(val_byte, docs_cm_map_multDsidForward_support_vals, "Reserved"));
-               break;
-         }
-
-     subtree = proto_item_add_subtree(ti, ett_bootp_option);
-     if (tlv_type == DOCS_CM_RNGHLDOFF_SUP)
-     {
-       for (i = 0 ; i < 4; i++)
-       {
-         decode_bitfield_value(bit_fld,
-                               (val_other[2] << sizeof(guint8)) + val_other[3],
-                               docs_cm_ranging_hold_off_vals[i].value,
-                               16);
-         proto_tree_add_text(subtree, tvb, off + 1, 4, "%s%s",
-                               bit_fld, docs_cm_ranging_hold_off_vals[i].strptr);
-       }
-     }
-     if (tlv_type == DOCS_CM_USSYMRATE_SUP)
-     {
-       for (i = 0 ; i < 6; i++)
-       {
-         decode_bitfield_value(bit_fld, val_byte,docs_cm_ussymrate_vals[i].value, 16);
-         proto_tree_add_text(subtree, tvb, off + 1, 4, "%s%s",
-                             bit_fld, docs_cm_ussymrate_vals[i].strptr);
-
-       }
-     }
-     if (opt125)
-     {
-       off += (tlv_len) + 2;
-     }
-     else
-     {
-       off += (tlv_len *2) + 4;
-     }
-
-   }
+
+               if (tlv_len == 1)
+               {
+                       /* The value refers to a byte. */
+                       val_byte = val_other[0];
+               }
+               else
+               {
+                       if (tlv_len == 2)
+                       {
+                               /* The value refers to a uint16. */
+                               val_uint16 = (val_other[0] << 8) + val_other[1];
+                       }
+               }
+
+               switch (tlv_type)
+               {
+               case DOCS_CM_CONCAT_SUP:
+               case DOCS_CM_FRAG_SUP:
+               case DOCS_CM_PHS_SUP:
+               case DOCS_CM_IGMP_SUP:
+               case DOCS_CM_DCC_SUP:
+               case DOCS_CM_EXPUNI_SPACE:
+               case DOCS_CM_DUTFILT_SUP:
+               case DOCS_CM_SACM2_SUP:
+               case DOCS_CM_SACM2HOP_SUP:
+               case DOCS_CM_IPV6_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_supported_vals, "Reserved"));
+                       break;
+               case DOCS_CM_DOCSIS_VER:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_version_vals, "Reserved"));
+                       break;
+               case DOCS_CM_PRIV_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_privacy_vals, "Reserved"));
+                       break;
+               case DOCS_CM_FILT_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_filt_vals, "Reserved"));
+                       break;
+               case DOCS_CM_L2VPN_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_l2vpn_vals, "Reserved"));
+                       break;
+               case DOCS_CM_L2VPN_HOST_SUP:
+                       proto_item_append_text(ti,
+                                              "eSAFE ifIndex %s (%i)/eSAFE MAC %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
+                                              val_to_str(val_other[0], docs_cm_map_l2vpn_esafe_index_support_vals, "Reserved"),
+                                              val_other[0],
+                                              val_other[1],
+                                              val_other[2],
+                                              val_other[3],
+                                              val_other[4],
+                                              val_other[5],
+                                              val_other[6]);
+                       break;
+               case DOCS_CM_USFREQRNG_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_usfreqrng_vals, "Reserved"));
+                       break;
+               case DOCS_CM_MAPUCDRECEIPT_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_map_ucd_receipt_vals, "Reserved"));
+                       break;
+               case DOCS_CM_DPV_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_map_dpv_support_vals, "Reserved"));
+                       break;
+               case DOCS_CM_DSAID_SUP:
+               case DOCS_CM_MULTTXCHAN_SUP:
+               case DOCS_CM_512USTXCHAN_SUP:
+               case DOCS_CM_256USTXCHAN_SUP:
+               case DOCS_CM_TOTALSIDCLU_SUP:
+               case DOCS_CM_MULTRXCHAN_SUP:
+               case DOCS_CM_UGSPERUSFLOW_SUP:
+                       display_uint_with_range_checking(ti, val_byte, val_uint16, 0, 255);
+                       break;
+               case DOCS_CM_USID_SUP:
+                       display_uint_with_range_checking(ti, val_byte, val_uint16,1, 255);
+                       break;
+               case DOCS_CM_RESEQDSID_SUP:
+               case DOCS_CM_MULTDSID_SUP:
+                       display_uint_with_range_checking(ti, val_byte, val_uint16, 16, 255);
+                       break;
+               case DOCS_CM_SIDCLUPERSF_SUP:
+                       display_uint_with_range_checking(ti, val_byte, val_uint16, 2, 8);
+                       break;
+               case DOCS_CM_TOTALDSID_SUP:
+                       display_uint_with_range_checking(ti, val_byte, val_uint16, 3, 255);
+                       break;
+               case DOCS_CM_TET:
+                       display_uint_with_range_checking(ti, val_byte, val_uint16, 8, 64);
+                       break;
+               case DOCS_CM_TET_MI:
+                       if ((val_byte == 1) ||
+                           (val_byte == 2) ||
+                           (val_byte == 4))
+                       {
+                               proto_item_append_text(ti,
+                                                      " %i",
+                                                      val_byte);
+                       }
+                       else
+                       {
+                               proto_item_append_text(ti,
+                                                      " (Invalid Value %i : Should be [1,2,4]",
+                                                      val_byte);
+                       }
+                       break;
+               case DOCS_CM_IPFILT_SUP:
+               case DOCS_CM_USDROPCLASSIF_SUP:
+                       display_uint_with_range_checking(ti, val_byte, val_uint16, 64, 65535);
+                       break;
+               case DOCS_CM_LLCFILT_SUP:
+                       display_uint_with_range_checking(ti, val_byte, val_uint16, 10, 65535);
+                       break;
+               case DOCS_CM_RNGHLDOFF_SUP:
+                       proto_item_append_text(ti,
+                                              "Ranging ID ");
+                       proto_item_append_text(ti,
+                                              "(0x%04x)", (val_other[0] << sizeof(guint8)) + val_other[1]);
+                       proto_item_append_text(ti,
+                                              " Component Bit Mask ");
+                       proto_item_append_text(ti,
+                                              "(0x%04x)", (val_other[2] << sizeof(guint8)) + val_other[3]);
+                       break;
+               case DOCS_CM_USSYMRATE_SUP:
+                       proto_item_append_text(ti,
+                                              "0x%02x", val_byte);
+                       break;
+               case DOCS_CM_FCTF_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_map_fctfc_support_vals, "Reserved"));
+                       break;
+               case DOCS_CM_MULTDSIDFW_SUP:
+                       proto_item_append_text(ti,
+                                              "%s",
+                                              val_to_str(val_byte, docs_cm_map_multDsidForward_support_vals, "Reserved"));
+                       break;
+               }
+
+               subtree = proto_item_add_subtree(ti, ett_bootp_option);
+               if (tlv_type == DOCS_CM_RNGHLDOFF_SUP)
+               {
+                       for (i = 0 ; i < 4; i++)
+                       {
+                               decode_bitfield_value(bit_fld,
+                                                     (val_other[2] << sizeof(guint8)) + val_other[3],
+                                                     docs_cm_ranging_hold_off_vals[i].value,
+                                                     16);
+                               proto_tree_add_text(subtree, tvb, off + 1, 4, "%s%s",
+                                                   bit_fld, docs_cm_ranging_hold_off_vals[i].strptr);
+                       }
+               }
+               if (tlv_type == DOCS_CM_USSYMRATE_SUP)
+               {
+                       for (i = 0 ; i < 6; i++)
+                       {
+                               decode_bitfield_value(bit_fld, val_byte,docs_cm_ussymrate_vals[i].value, 16);
+                               proto_tree_add_text(subtree, tvb, off + 1, 4, "%s%s",
+                                                   bit_fld, docs_cm_ussymrate_vals[i].strptr);
+
+                       }
+               }
+               if (opt125)
+               {
+                       off += (tlv_len) + 2;
+               }
+               else
+               {
+                       off += (tlv_len *2) + 4;
+               }
+
+       }
 }
 
 /* Definitions specific to PKT-SP-PROV-I05-021127 begin with "PKT_CCC_I05".
@@ -4707,7 +4707,7 @@ bootp_init_protocol(void)
                if (bootp_opt[ii].ftype == special) continue;    /* don't mess with specials.  Go again       */
                bootp_opt[ii].text = se_strdup(optiondetail[1]); /* store a permanent ("seasonal") copy       */
                type = optiondetail[2];                          /* A string to be converted to an ftype enum */
-               /* XXX This if statement could be extended to allow for additinonal types */
+               /* XXX This if statement could be extended to allow for additional types */
                if (g_ascii_strcasecmp(type,"string") == 0)
                {
                        bootp_opt[ii].ftype = string;
@@ -4727,223 +4727,223 @@ bootp_init_protocol(void)
 void
 proto_register_bootp(void)
 {
-    static hf_register_info hf[] = {
-        { &hf_bootp_dhcp,
-          { "Frame is DHCP",            "bootp.dhcp",    FT_BOOLEAN,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_type,
-          { "Message type",            "bootp.type",    FT_UINT8,
-            BASE_DEC,                  VALS(op_vals),   0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_hw_type,
-          { "Hardware type",           "bootp.hw.type", FT_UINT8,
-            BASE_HEX,                  NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_hw_len,
-          { "Hardware address length", "bootp.hw.len",  FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_hops,
-          { "Hops",                    "bootp.hops",    FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_id,
-          { "Transaction ID",          "bootp.id",      FT_UINT32,
-            BASE_HEX,                   NULL,           0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_secs,
-          { "Seconds elapsed",         "bootp.secs",    FT_UINT16,
-            BASE_DEC,                   NULL,           0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_flags,
-          { "Bootp flags",             "bootp.flags",   FT_UINT16,
-            BASE_HEX,                  NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_flags_broadcast,
-          { "Broadcast flag",          "bootp.flags.bc", FT_BOOLEAN,
-            16,                        TFS(&flag_set_broadcast), BOOTP_BC,
-            NULL, HFILL }},
-
-        { &hf_bootp_flags_reserved,
-          { "Reserved flags",          "bootp.flags.reserved", FT_UINT16,
-            BASE_HEX,                  NULL,           BOOTP_MBZ,
-            NULL, HFILL }},
-
-        { &hf_bootp_ip_client,
-          { "Client IP address",       "bootp.ip.client",FT_IPv4,
-            BASE_NONE,                 NULL,             0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_ip_your,
-          { "Your (client) IP address",        "bootp.ip.your",  FT_IPv4,
-            BASE_NONE,                 NULL,             0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_ip_server,
-          { "Next server IP address",  "bootp.ip.server",FT_IPv4,
-            BASE_NONE,                 NULL,             0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_ip_relay,
-          { "Relay agent IP address",  "bootp.ip.relay", FT_IPv4,
-            BASE_NONE,                 NULL,             0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_hw_addr,
-          { "Client hardware address", "bootp.hw.addr", FT_BYTES,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_hw_addr_padding,
-          { "Client hardware address padding", "bootp.hw.addr_padding", FT_BYTES,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_hw_ether_addr,
-          { "Client MAC address",      "bootp.hw.mac_addr", FT_ETHER,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_server,
-          { "Server host name",                "bootp.server",  FT_STRING,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_file,
-          { "Boot file name",          "bootp.file",    FT_STRING,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_cookie,
-          { "Magic cookie",            "bootp.cookie",  FT_IPv4,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_vendor,
-          { "Bootp Vendor Options",    "bootp.vendor",  FT_BYTES,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_fqdn_s,
-          { "Server",                  "bootp.fqdn.s",  FT_BOOLEAN,
-            8,                 TFS(&tfs_fqdn_s),       F_FQDN_S,
-            "If true, server should do DDNS update", HFILL }},
-
-        { &hf_bootp_fqdn_o,
-          { "Server overrides",                "bootp.fqdn.o",  FT_BOOLEAN,
-            8,                       TFS(&tfs_fqdn_o),  F_FQDN_O,
-            "If true, server insists on doing DDNS update", HFILL }},
-
-        { &hf_bootp_fqdn_e,
-          { "Encoding",                        "bootp.fqdn.e",  FT_BOOLEAN,
-            8,                       TFS(&tfs_fqdn_e),  F_FQDN_E,
-            "If true, name is binary encoded", HFILL }},
-
-        { &hf_bootp_fqdn_n,
-          { "Server DDNS",             "bootp.fqdn.n",  FT_BOOLEAN,
-            8,                       TFS(&tfs_fqdn_n),  F_FQDN_N,
-            "If true, server should not do any DDNS updates", HFILL }},
-
-        { &hf_bootp_fqdn_mbz,
-          { "Reserved flags",          "bootp.fqdn.mbz",FT_UINT8,
-            BASE_HEX,                  NULL,            F_FQDN_MBZ,
-            NULL, HFILL }},
-
-        { &hf_bootp_fqdn_rcode1,
-          { "A-RR result",             "bootp.fqdn.rcode1", FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            "Result code of A-RR update", HFILL }},
-
-        { &hf_bootp_fqdn_rcode2,
-          { "PTR-RR result",           "bootp.fqdn.rcode2", FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            "Result code of PTR-RR update", HFILL }},
-
-        { &hf_bootp_fqdn_name,
-          { "Client name",             "bootp.fqdn.name", FT_STRING,
-            BASE_NONE,                 NULL,            0x0,
-            "Name to register via DDNS", HFILL }},
-
-        { &hf_bootp_fqdn_asciiname,
-          { "Client name",             "bootp.fqdn.name", FT_STRING,
-            BASE_NONE,                 NULL,            0x0,
-            "Name to register via DDNS", HFILL }},
-
-        { &hf_bootp_pkt_mtacap_len,
-          { "MTA DC Length",           "bootp.vendor.pktc.mtacap_len", FT_UINT8,
-            BASE_DEC,                   NULL,           0x0,
-            "PacketCable MTA Device Capabilities Length", HFILL }},
-
-        { &hf_bootp_docsis_cmcap_len,
-          { "CM DC Length",            "bootp.vendor.docsis.cmcap_len", FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            "DOCSIS Cable Modem Device Capabilities Length", HFILL }},
-
-        { &hf_bootp_alu_vid,
-          { "Voice VLAN ID",   "bootp.vendor.alu.vid", FT_UINT16,
-            BASE_DEC,                  NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_alu_tftp1,
-          { "Spatial Redundancy TFTP1",        "bootp.vendor.alu.tftp1", FT_IPv4,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_alu_tftp2,
-          { "Spatial Redundancy TFTP2",        "bootp.vendor.alu.tftp2", FT_IPv4,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_alu_app_type,
-          { "Application Type",        "bootp.vendor.alu.app_type", FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_alu_sip_url,
-          { "SIP URL",                 "bootp.vendor.alu.sip_url", FT_STRING,
-            BASE_NONE,                 NULL,            0x0,
-            NULL, HFILL }},
-
-        { &hf_bootp_client_identifier_uuid,
-          { "Client Identifier (UUID)",        "bootp.client_id_uuid", FT_GUID,
-            BASE_NONE,                 NULL,            0x0,
-            "Client Machine Identifier (UUID)", HFILL }},
-
-        { &hf_bootp_client_network_id_major_ver,
-          { "Client Network ID Major Version", "bootp.client_network_id_major", FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            "Client Machine Identifier, Major Version", HFILL }},
-
-        { &hf_bootp_client_network_id_minor_ver,
-          { "Client Network ID Minor Version", "bootp.client_network_id_minor", FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            "Client Machine Identifier, Major Version", HFILL }},
-
-        { &hf_bootp_option_type,
-          { "Option",  "bootp.option.type", FT_UINT8,
-            BASE_DEC,                   NULL,           0x0,
-            "Bootp/Dhcp option type", HFILL }},
-
-        { &hf_bootp_option_length,
-          { "Length",  "bootp.option.length", FT_UINT8,
-            BASE_DEC,                  NULL,            0x0,
-            "Bootp/Dhcp option length", HFILL }},
-
-        { &hf_bootp_option_value,
-          { "Value",   "bootp.option.value", FT_BYTES,
-            BASE_NONE,                         NULL,            0x0,
-            "Bootp/Dhcp option value", HFILL }},
-
-    };
+       static hf_register_info hf[] = {
+               { &hf_bootp_dhcp,
+                 { "Frame is DHCP",            "bootp.dhcp",    FT_BOOLEAN,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_type,
+                 { "Message type",             "bootp.type",    FT_UINT8,
+                   BASE_DEC,                   VALS(op_vals),   0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_hw_type,
+                 { "Hardware type",            "bootp.hw.type", FT_UINT8,
+                   BASE_HEX,                   NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_hw_len,
+                 { "Hardware address length",  "bootp.hw.len",  FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_hops,
+                 { "Hops",                     "bootp.hops",    FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_id,
+                 { "Transaction ID",           "bootp.id",      FT_UINT32,
+                   BASE_HEX,                    NULL,           0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_secs,
+                 { "Seconds elapsed",          "bootp.secs",    FT_UINT16,
+                   BASE_DEC,                    NULL,           0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_flags,
+                 { "Bootp flags",              "bootp.flags",   FT_UINT16,
+                   BASE_HEX,                   NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_flags_broadcast,
+                 { "Broadcast flag",           "bootp.flags.bc", FT_BOOLEAN,
+                   16,                 TFS(&flag_set_broadcast), BOOTP_BC,
+                   NULL, HFILL }},
+
+               { &hf_bootp_flags_reserved,
+                 { "Reserved flags",           "bootp.flags.reserved", FT_UINT16,
+                   BASE_HEX,                   NULL,           BOOTP_MBZ,
+                   NULL, HFILL }},
+
+               { &hf_bootp_ip_client,
+                 { "Client IP address",        "bootp.ip.client",FT_IPv4,
+                   BASE_NONE,                  NULL,             0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_ip_your,
+                 { "Your (client) IP address", "bootp.ip.your",  FT_IPv4,
+                   BASE_NONE,                  NULL,             0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_ip_server,
+                 { "Next server IP address",   "bootp.ip.server",FT_IPv4,
+                   BASE_NONE,                  NULL,             0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_ip_relay,
+                 { "Relay agent IP address",   "bootp.ip.relay", FT_IPv4,
+                   BASE_NONE,                  NULL,             0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_hw_addr,
+                 { "Client hardware address",  "bootp.hw.addr", FT_BYTES,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_hw_addr_padding,
+                 { "Client hardware address padding",  "bootp.hw.addr_padding", FT_BYTES,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_hw_ether_addr,
+                 { "Client MAC address",       "bootp.hw.mac_addr", FT_ETHER,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_server,
+                 { "Server host name",         "bootp.server",  FT_STRING,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_file,
+                 { "Boot file name",           "bootp.file",    FT_STRING,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_cookie,
+                 { "Magic cookie",             "bootp.cookie",  FT_IPv4,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_vendor,
+                 { "Bootp Vendor Options",     "bootp.vendor",  FT_BYTES,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_fqdn_s,
+                 { "Server",                   "bootp.fqdn.s",  FT_BOOLEAN,
+                   8,                  TFS(&tfs_fqdn_s),       F_FQDN_S,
+                   "If true, server should do DDNS update", HFILL }},
+
+               { &hf_bootp_fqdn_o,
+                 { "Server overrides",         "bootp.fqdn.o",  FT_BOOLEAN,
+                   8,                        TFS(&tfs_fqdn_o),  F_FQDN_O,
+                   "If true, server insists on doing DDNS update", HFILL }},
+
+               { &hf_bootp_fqdn_e,
+                 { "Encoding",                 "bootp.fqdn.e",  FT_BOOLEAN,
+                   8,                        TFS(&tfs_fqdn_e),  F_FQDN_E,
+                   "If true, name is binary encoded", HFILL }},
+
+               { &hf_bootp_fqdn_n,
+                 { "Server DDNS",              "bootp.fqdn.n",  FT_BOOLEAN,
+                   8,                        TFS(&tfs_fqdn_n),  F_FQDN_N,
+                   "If true, server should not do any DDNS updates", HFILL }},
+
+               { &hf_bootp_fqdn_mbz,
+                 { "Reserved flags",           "bootp.fqdn.mbz",FT_UINT8,
+                   BASE_HEX,                   NULL,            F_FQDN_MBZ,
+                   NULL, HFILL }},
+
+               { &hf_bootp_fqdn_rcode1,
+                 { "A-RR result",              "bootp.fqdn.rcode1", FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   "Result code of A-RR update", HFILL }},
+
+               { &hf_bootp_fqdn_rcode2,
+                 { "PTR-RR result",            "bootp.fqdn.rcode2", FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   "Result code of PTR-RR update", HFILL }},
+
+               { &hf_bootp_fqdn_name,
+                 { "Client name",              "bootp.fqdn.name", FT_STRING,
+                   BASE_NONE,                  NULL,            0x0,
+                   "Name to register via DDNS", HFILL }},
+
+               { &hf_bootp_fqdn_asciiname,
+                 { "Client name",              "bootp.fqdn.name", FT_STRING,
+                   BASE_NONE,                  NULL,            0x0,
+                   "Name to register via DDNS", HFILL }},
+
+               { &hf_bootp_pkt_mtacap_len,
+                 { "MTA DC Length",            "bootp.vendor.pktc.mtacap_len", FT_UINT8,
+                   BASE_DEC,                    NULL,           0x0,
+                   "PacketCable MTA Device Capabilities Length", HFILL }},
+
+               { &hf_bootp_docsis_cmcap_len,
+                 { "CM DC Length",             "bootp.vendor.docsis.cmcap_len", FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   "DOCSIS Cable Modem Device Capabilities Length", HFILL }},
+
+               { &hf_bootp_alu_vid,
+                 { "Voice VLAN ID",    "bootp.vendor.alu.vid", FT_UINT16,
+                   BASE_DEC,                   NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_alu_tftp1,
+                 { "Spatial Redundancy TFTP1", "bootp.vendor.alu.tftp1", FT_IPv4,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_alu_tftp2,
+                 { "Spatial Redundancy TFTP2", "bootp.vendor.alu.tftp2", FT_IPv4,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_alu_app_type,
+                 { "Application Type", "bootp.vendor.alu.app_type", FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_alu_sip_url,
+                 { "SIP URL",                  "bootp.vendor.alu.sip_url", FT_STRING,
+                   BASE_NONE,                  NULL,            0x0,
+                   NULL, HFILL }},
+
+               { &hf_bootp_client_identifier_uuid,
+                 { "Client Identifier (UUID)", "bootp.client_id_uuid", FT_GUID,
+                   BASE_NONE,                  NULL,            0x0,
+                   "Client Machine Identifier (UUID)", HFILL }},
+
+               { &hf_bootp_client_network_id_major_ver,
+                 { "Client Network ID Major Version", "bootp.client_network_id_major", FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   "Client Machine Identifier, Major Version", HFILL }},
+
+               { &hf_bootp_client_network_id_minor_ver,
+                 { "Client Network ID Minor Version", "bootp.client_network_id_minor", FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   "Client Machine Identifier, Major Version", HFILL }},
+
+               { &hf_bootp_option_type,
+                 { "Option",   "bootp.option.type", FT_UINT8,
+                   BASE_DEC,                    NULL,           0x0,
+                   "Bootp/Dhcp option type", HFILL }},
+
+               { &hf_bootp_option_length,
+                 { "Length",   "bootp.option.length", FT_UINT8,
+                   BASE_DEC,                   NULL,            0x0,
+                   "Bootp/Dhcp option length", HFILL }},
+
+               { &hf_bootp_option_value,
+                 { "Value",    "bootp.option.value", FT_BYTES,
+                   BASE_NONE,                  NULL,            0x0,
+                   "Bootp/Dhcp option value", HFILL }},
+
+       };
 
        static gint *ett[] = {
                &ett_bootp,
index 72d7baa67ea9020ed861df29f1adb7e0781e16d6..07b1362d91fe799a9abd3f6ea798602c7bc8f5fe 100644 (file)
@@ -111,16 +111,16 @@ static int hf_fw1_trailer = -1;
 /* Initialize the subtree pointers */
 static gint ett_fw1 = -1;
 
-#define ETH_HEADER_SIZE        14
+#define ETH_HEADER_SIZE 14
 
-#define        MAX_INTERFACES  20
-static char    *p_interfaces[MAX_INTERFACES];
-static int     interface_anzahl=0;
+#define MAX_INTERFACES  20
+static char     *p_interfaces[MAX_INTERFACES];
+static int      interface_anzahl=0;
 
 static void
 fw1_init(void)
 {
-  int          i;
+  int           i;
 
   for (i=0; i<interface_anzahl; i++) {
     g_free(p_interfaces[i]);
@@ -134,15 +134,15 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   /* Set up structures needed to add the protocol subtree and manage it */
   proto_item    *ti;
   proto_tree    *volatile fh_tree = NULL;
-  char         direction;
-  char chain;
-  char         *interface_name;
-  guint32      iface_len = 10;
-  guint16      etype;
-  emem_strbuf_t        *header;
-  int          i;
-  gboolean     found;
-  static const char    fw1_header[] = "FW1 Monitor";
+  char          direction;
+  char  chain;
+  char          *interface_name;
+  guint32       iface_len = 10;
+  guint16       etype;
+  emem_strbuf_t *header;
+  int           i;
+  gboolean      found;
+  static const char     fw1_header[] = "FW1 Monitor";
 
   header = ep_strbuf_new_label(fw1_header);
 
@@ -157,12 +157,12 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   direction = tvb_get_guint8(tvb, 0);
 
   if (!fw1_iflist_with_chain)
-       chain = ' ';
+    chain = ' ';
   else
-       chain = tvb_get_guint8(tvb, 1);
+    chain = tvb_get_guint8(tvb, 1);
 
   if (fw1_with_uuid)
-       iface_len = 6;
+    iface_len = 6;
 
   interface_name=ep_alloc(iface_len+1);
   tvb_get_nstringz0(tvb, 2, iface_len+1, interface_name);
@@ -183,15 +183,15 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   /* display all interfaces always in the same order */
   for (i=0; i<interface_anzahl; i++) {
     if ( strcmp(p_interfaces[i], interface_name) == 0 ) {
-               ep_strbuf_append_printf(header, "  %c%c %s %c%c",
-                       direction == 'i' ? 'i' : (direction == 'O' ? 'O' : ' '),
-                       (direction == 'i' || direction == 'O') ? chain : ' ',
-                       p_interfaces[i],
-                       direction == 'I' ? 'I' : (direction == 'o' ? 'o' : ' '),
-                       (direction == 'I' || direction == 'o') ? chain : ' '
-               );
+      ep_strbuf_append_printf(header, "  %c%c %s %c%c",
+                              direction == 'i' ? 'i' : (direction == 'O' ? 'O' : ' '),
+                              (direction == 'i' || direction == 'O') ? chain : ' ',
+                              p_interfaces[i],
+                              direction == 'I' ? 'I' : (direction == 'o' ? 'o' : ' '),
+                              (direction == 'I' || direction == 'o') ? chain : ' '
+        );
     } else {
-       ep_strbuf_append_printf(header, "    %s  ", p_interfaces[i]);
+      ep_strbuf_append_printf(header, "    %s  ", p_interfaces[i]);
     }
   }
 
@@ -227,28 +227,29 @@ void
 proto_register_fw1(void)
 {
   static hf_register_info hf[] = {
-       { &hf_fw1_direction,
-       { "Direction",  "fw1.direction", FT_STRING, BASE_NONE, NULL, 0x0,
-               NULL, HFILL }},
-       { &hf_fw1_chain,
-       { "Chain Position",     "fw1.chain", FT_STRING, BASE_NONE, NULL, 0x0,
-               NULL, HFILL }},
-       { &hf_fw1_interface,
-       { "Interface",  "fw1.interface", FT_STRING, BASE_NONE, NULL, 0x0,
-               NULL, HFILL }},
-       { &hf_fw1_uuid,
-       { "UUID",       "fw1.uuid", FT_UINT32, BASE_DEC, NULL, 0x0,
-               NULL, HFILL }},
-               /* registered here but handled in ethertype.c */
-       { &hf_fw1_type,
-       { "Type",               "fw1.type", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
-               NULL, HFILL }},
+    { &hf_fw1_direction,
+      { "Direction",    "fw1.direction", FT_STRING, BASE_NONE, NULL, 0x0,
+        NULL, HFILL }},
+    { &hf_fw1_chain,
+      { "Chain Position",       "fw1.chain", FT_STRING, BASE_NONE, NULL, 0x0,
+        NULL, HFILL }},
+    { &hf_fw1_interface,
+      { "Interface",    "fw1.interface", FT_STRING, BASE_NONE, NULL, 0x0,
+        NULL, HFILL }},
+    { &hf_fw1_uuid,
+      { "UUID", "fw1.uuid", FT_UINT32, BASE_DEC, NULL, 0x0,
+        NULL, HFILL }},
+    /* registered here but handled in ethertype.c */
+    { &hf_fw1_type,
+      { "Type",         "fw1.type", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
+        NULL, HFILL }},
   };
   /* Setup protocol subtree array */
   static gint *ett[] = {
-       &ett_fw1,
+    &ett_fw1,
   };
   module_t *fw1_module;
+  int       i;
 
   /* Register the protocol name and description */
   proto_fw1 = proto_register_protocol("Checkpoint FW-1", "FW-1", "fw1");
@@ -259,19 +260,22 @@ proto_register_fw1(void)
   /* Register configuration preferences */
   fw1_module = prefs_register_protocol(proto_fw1, NULL);
   prefs_register_bool_preference(fw1_module, "summary_in_tree",
-            "Show FireWall-1 summary in protocol tree",
-           "Whether the FireWall-1 summary line should be shown in the protocol tree",
-            &fw1_summary_in_tree);
+                                 "Show FireWall-1 summary in protocol tree",
+                                 "Whether the FireWall-1 summary line should be shown in the protocol tree",
+                                 &fw1_summary_in_tree);
   prefs_register_bool_preference(fw1_module, "with_uuid",
-            "Monitor file includes UUID",
-           "Whether the Firewall-1 monitor file includes UUID information",
-            &fw1_with_uuid);
+                                 "Monitor file includes UUID",
+                                 "Whether the Firewall-1 monitor file includes UUID information",
+                                 &fw1_with_uuid);
   prefs_register_bool_preference(fw1_module, "iflist_with_chain",
-            "Interface list includes chain position",
-           "Whether the interface list includes the chain position",
-            &fw1_iflist_with_chain);
+                                 "Interface list includes chain position",
+                                 "Whether the interface list includes the chain position",
+                                 &fw1_iflist_with_chain);
 
   register_dissector("fw1", dissect_fw1, proto_fw1);
 
+  for (i=0; i<interface_anzahl; i++) {
+    p_interfaces[i] = NULL;
+  }
   register_init_routine(fw1_init);
 }
index 80c5e6ba1ab4513ec6cf9a7e218aa6b5804eab57..e6872b9b68738107023cec6f223bf8a3e9c4e16e 100644 (file)
@@ -398,10 +398,10 @@ static const value_string message_type[] = {
     {GTP_MSG_NODE_ALIVE_RESP,     "Node alive response"},
     {GTP_MSG_REDIR_REQ,           "Redirection request"},
     {GTP_MSG_REDIR_RESP,          "Redirection response"},
-       /*
-        * 8-15 For future use. Shall not be sent. If received,
-        * shall be treated as an Unknown message.
-        */
+    /*
+     * 8-15 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
 #if 0
     {   8,                        "Unknown message(For future use)"},
     {   9,                        "Unknown message(For future use)"},
@@ -412,7 +412,7 @@ static const value_string message_type[] = {
     {  14,                        "Unknown message(For future use)"},
     {  15,                        "Unknown message(For future use)"},
 #endif
-       {GTP_MSG_CREATE_PDP_REQ,      "Create PDP context request"},
+    {GTP_MSG_CREATE_PDP_REQ,      "Create PDP context request"},
     {GTP_MSG_CREATE_PDP_RESP,     "Create PDP context response"},
     {GTP_MSG_UPDATE_PDP_REQ,      "Update PDP context request"},
     {GTP_MSG_UPDATE_PDP_RESP,     "Update PDP context response"},
@@ -434,9 +434,9 @@ static const value_string message_type[] = {
     {GTP_MSG_FAIL_REP_RESP,       "Failure report response"},
     {GTP_MSG_MS_PRESENT_REQ,      "Note MS GPRS present request"},
     {GTP_MSG_MS_PRESENT_RESP,     "Note MS GPRS present response"},
-       /* 38-47 For future use. Shall not be sent. If received,
-        * shall be treated as an Unknown message.
-        */
+    /* 38-47 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
 #if 0
     {  38,                        "Unknown message(For future use)"},
     {  39,                        "Unknown message(For future use)"},
@@ -462,9 +462,9 @@ static const value_string message_type[] = {
     {GTP_MSG_FORW_SRNS_CNTXT,     "Forward SRNS context"},
     {GTP_MSG_FORW_RELOC_ACK,      "Forward relocation complete acknowledge"},
     {GTP_MSG_FORW_SRNS_CNTXT_ACK, "Forward SRNS context acknowledge"},
-       /* 61-69 For future use. Shall not be sent. If received,
-        * shall be treated as an Unknown message.
-        */
+    /* 61-69 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
 #if 0
     {  61,                        "Unknown message(For future use)"},
     {  62,                        "Unknown message(For future use)"},
@@ -477,9 +477,9 @@ static const value_string message_type[] = {
     {  69,                        "Unknown message(For future use)"},
 #endif
     {GTP_MSG_RAN_INFO_RELAY,      "RAN Information Relay"},
-       /* 71-95 For future use. Shall not be sent. If received,
-        * shall be treated as an Unknown message.
-        */
+    /* 71-95 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
 #if 0
     {  71,                        "Unknown message(For future use)"},
     {  72,                        "Unknown message(For future use)"},
@@ -517,9 +517,9 @@ static const value_string message_type[] = {
     {GTP_UPD_MBMS_CNTXT_RES,      "Update MBMS Context Response"},
     {GTP_DEL_MBMS_CNTXT_REQ,      "Delete MBMS Context Request"},
     {GTP_DEL_MBMS_CNTXT_RES,      "Delete MBMS Context Response"},
-       /* 106 - 111 For future use. Shall not be sent. If received,
-        * shall be treated as an Unknown message.
-        */
+    /* 106 - 111 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
     {GTP_MBMS_REG_REQ,            "MBMS Registration Request"},
     {GTP_MBMS_REG_RES,            "MBMS Registration Response"},
     {GTP_MBMS_DE_REG_REQ,         "MBMS De-Registration Request"},
@@ -536,13 +536,13 @@ static const value_string message_type[] = {
     {GTP_MS_INFO_CNG_NOT_REQ,     "MS Info Change Notification Request"},
     {GTP_MS_INFO_CNG_NOT_RES,     "MS Info Change Notification Response"},
     /* 130-239 For future use. Shall not be sent. If received,
-        * shall be treated as an Unknown message.
-        */
+     * shall be treated as an Unknown message.
+     */
     {GTP_MSG_DATA_TRANSF_REQ,     "Data record transfer request"},
     {GTP_MSG_DATA_TRANSF_RESP,    "Data record transfer response"},
-       /* 242-253 For future use. Shall not be sent. If received,
-        * shall be treated as an Unknown message.
-        */
+    /* 242-253 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
     {GTP_MSG_END_MARKER,          "End Marker"},
     {GTP_MSG_TPDU,                "T-PDU"},
     {0, NULL}
@@ -887,26 +887,26 @@ static const value_string cause_type[] = {
     {  3, "No identity needed"},
     {  4, "MS refuses"},
     {  5, "MS is not GPRS responding"},
-       /* For future use 6-48 */
-       /* Cause values reserved for GPRS charging
-        * protocol use (see GTP' in 3GPP TS 32.295 [33])
-        * 49-63
-        */
+    /* For future use 6-48 */
+    /* Cause values reserved for GPRS charging
+     * protocol use (see GTP' in 3GPP TS 32.295 [33])
+     * 49-63
+     */
     { 59, "System failure"}, /* charging */
     { 60, "The transmit buffers are becoming full"}, /* charging */
     { 61, "The receive buffers are becoming full"},  /* charging */
     { 62, "Another node is about to go down"},       /* charging */
     { 63, "This node is about to go down"},          /* charging */
-       /* For future use 64-127 */
+    /* For future use 64-127 */
     {128, "Request accepted"},
     {129, "New PDP type due to network preference"},
     {130, "New PDP type due to single address bearer only"},
-       /* For future use 131-176 */
-       /* Cause values reserved for GPRS charging
-        * protocol use (see GTP' in 3GPP TS 32.295 [33])
-        * 177-191
-        */
-       {192, "Non-existent"},
+    /* For future use 131-176 */
+    /* Cause values reserved for GPRS charging
+     * protocol use (see GTP' in 3GPP TS 32.295 [33])
+     * 177-191
+     */
+    {192, "Non-existent"},
     {193, "Invalid message format"},
     {194, "IMSI not known"},
     {195, "MS is GPRS detached"},
@@ -943,11 +943,11 @@ static const value_string cause_type[] = {
     {226, "MBMS Bearer Context Superseded"},
     {227, "Bearer Control Mode violation"},
     {228, "Collision with network initiated request"},
-       /* For future use 229-240 */
-       /* Cause values reserved for GPRS charging
-        * protocol use (see GTP' in 3GPP TS 32.295 [33])
-        * 241-255
-        */
+    /* For future use 229-240 */
+    /* Cause values reserved for GPRS charging
+     * protocol use (see GTP' in 3GPP TS 32.295 [33])
+     * 241-255
+     */
     {252, "Request related to possibly duplicated packets already fulfilled"},  /* charging */
     {253, "Request already fulfilled"}, /* charging */
     {254, "Sequence numbers of released/cancelled packets IE incorrect"},   /* charging */
@@ -2738,7 +2738,7 @@ typedef struct gtp_conv_info_t {
     GHashTable *matched;
 } gtp_conv_info_t;
 
-static gtp_conv_info_t *gtp_info_items;
+static gtp_conv_info_t *gtp_info_items = NULL;
 
 static guint gtp_sn_hash(gconstpointer k)
 {
@@ -6476,18 +6476,18 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
         tf = proto_tree_add_uint(gtp_tree, hf_gtp_flags, tvb, 0, 1, gtp_hdr.flags);
         flags_tree = proto_item_add_subtree(tf, ett_gtp_flags);
 
-               if(gtp_prime==0){
-               proto_tree_add_uint(flags_tree, hf_gtp_flags_ver, tvb, 0, 1, gtp_hdr.flags);
-               }else{
-               proto_tree_add_uint(flags_tree, hf_gtp_prime_flags_ver, tvb, 0, 1, gtp_hdr.flags);
-               }
+        if(gtp_prime==0){
+            proto_tree_add_uint(flags_tree, hf_gtp_flags_ver, tvb, 0, 1, gtp_hdr.flags);
+        }else{
+            proto_tree_add_uint(flags_tree, hf_gtp_prime_flags_ver, tvb, 0, 1, gtp_hdr.flags);
+        }
 
         proto_tree_add_uint(flags_tree, hf_gtp_flags_pt, tvb, 0, 1, gtp_hdr.flags);
 
         if((gtp_prime==1)||(gtp_version==0)){
             proto_tree_add_uint(flags_tree, hf_gtp_flags_spare1, tvb, 0, 1, gtp_hdr.flags);
             proto_tree_add_boolean(flags_tree, hf_gtp_flags_snn, tvb, 0, 1, gtp_hdr.flags);
-               }else{
+        }else{
             proto_tree_add_uint(flags_tree, hf_gtp_flags_spare2, tvb, 0, 1, gtp_hdr.flags);
             proto_tree_add_boolean(flags_tree, hf_gtp_flags_e, tvb, 0, 1, gtp_hdr.flags);
             proto_tree_add_boolean(flags_tree, hf_gtp_flags_s, tvb, 0, 1, gtp_hdr.flags);
@@ -6690,31 +6690,31 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
 static void dissect_gtpprim(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
 
-       dissect_gtp_common(tvb, pinfo, tree);
+    dissect_gtp_common(tvb, pinfo, tree);
 }
 
 static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
-       guint8 version;
-        /*
-         * If this is GTPv2-C call the gtpv2 dissector if present
-         * Should this be moved to after the conversation stuff to retain that functionality for GTPv2 ???
-         */
-        version = tvb_get_guint8(tvb,0)>>5;
-        if (version==2) {
-                /* GTPv2-C 3GPP TS 29.274 */
-                if (gtpv2_handle) {
-                        call_dissector(gtpv2_handle, tvb, pinfo, tree);
-                        return;
-                }
-        }
-        if(version>2){
-                proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version,
-                                    val_to_str_const(version, ver_types, "Unknown"));
-                return;
+    guint8 version;
+    /*
+     * If this is GTPv2-C call the gtpv2 dissector if present
+     * Should this be moved to after the conversation stuff to retain that functionality for GTPv2 ???
+     */
+    version = tvb_get_guint8(tvb,0)>>5;
+    if (version==2) {
+        /* GTPv2-C 3GPP TS 29.274 */
+        if (gtpv2_handle) {
+            call_dissector(gtpv2_handle, tvb, pinfo, tree);
+            return;
         }
+    }
+    if(version>2){
+        proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version,
+                            val_to_str_const(version, ver_types, "Unknown"));
+        return;
+    }
 
-               dissect_gtp_common(tvb, pinfo, tree);
+    dissect_gtp_common(tvb, pinfo, tree);
 
 }
 
@@ -6781,7 +6781,7 @@ void proto_register_gtp(void)
          {"Version", "gtp.prim.flags.version",
           FT_UINT8, BASE_DEC,NULL, GTP_VER_MASK,
           "GTP' Version", HFILL}
-               },
+        },
         {&hf_gtp_flags_pt,
          {"Protocol type", "gtp.flags.payload",
           FT_UINT8, BASE_DEC, VALS(pt_types), GTP_PT_MASK,
@@ -7218,7 +7218,7 @@ void proto_reg_handoff_gtp(void)
 
     if (!Initialized) {
         gtp_handle = find_dissector("gtp");
-               gtp_prim_handle = find_dissector("gtpprim");
+        gtp_prim_handle = find_dissector("gtpprim");
         ppp_subdissector_table = find_dissector_table("ppp.protocol");
 
         radius_register_avp_dissector(VENDOR_THE3GPP, 5, dissect_radius_qos_umts);
index be6ebbdd70ae67ca26cbe05ae516dfed15585658..bffd010f892ad29ab3253442ae70c19caff98d8d 100644 (file)
@@ -4640,9 +4640,9 @@ dissect_mmie(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
 
   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, TRUE);
   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
-                     TRUE);
+                      TRUE);
   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
-                     FALSE);
+                      FALSE);
 }
 
 static void
@@ -5483,7 +5483,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
       break;
 
     case TAG_DS_PARAMETER:
-               /* The length of the dot11CurrentChannelNumber parameter is 1 octet */
+      /* The length of the dot11CurrentChannelNumber parameter is 1 octet */
       if (tag_len != 1)
       {
         proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u wrong, must be = 1",
@@ -6124,14 +6124,14 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
 #endif /* MESH_OVERRIDES */
 
     case TAG_SUPPORTED_CHANNELS:
-               /* 7.3.2.19 Supported Channels element */
+      /* 7.3.2.19 Supported Channels element */
       {
         proto_item *chan_item;
         proto_tree *chan_tree;
         guint i;
 
         offset += 2;
-               if (tag_len % 2 == 1) {
+        if (tag_len % 2 == 1) {
           proto_tree_add_text (tree, tvb, offset -1, 1,
                                "Supported Channels: Error: Tag length %u must be even",tag_len);
         }
@@ -6727,7 +6727,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
     {
       guint tag_offset;
       guint8 current_field;
-         guint i;
+      guint i;
 
       if (tag_len < 2) {
         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
@@ -7680,8 +7680,8 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo,
 
 #ifdef MESH_OVERRIDES
       if (tree &&
-         (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4 ||
-          FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2))
+          (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4 ||
+           FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2))
       {
         proto_item *msh_fields;
         proto_tree *msh_tree;
@@ -8713,12 +8713,6 @@ wlan_defragment_init(void)
 }
 
 /* ------------- */
-static gboolean
-free_all(gpointer key_arg _U_, gpointer value _U_, gpointer user_data _U_)
-{
-  return TRUE;
-}
-
 static guint
 retransmit_hash(gconstpointer k)
 {
@@ -8766,13 +8760,11 @@ static void
 wlan_retransmit_init(void)
 {
   if ( fc_analyse_retransmit_table ){
-      g_hash_table_foreach_remove(fc_analyse_retransmit_table,free_all, NULL);
       g_hash_table_destroy(fc_analyse_retransmit_table);
       fc_analyse_retransmit_table = NULL;
   }
 
   if( fc_first_frame_table ){
-      g_hash_table_foreach_remove(fc_first_frame_table,free_all, NULL);
       g_hash_table_destroy(fc_first_frame_table);
       fc_first_frame_table = NULL;
   }
index 0bbc0c91f698904002d3b024df19d4cdcb02196a..534e933bfb38705aed64b0a193cddc9b98c20262 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 
 /*
    Patch by Polystar (Peter Vestman, Petter Edblom):
-       Corrected rfci handling in rate control messages
-       Added crc6 and crc10 checks for header and payload
+      Corrected rfci handling in rate control messages
+      Added crc6 and crc10 checks for header and payload
 */
 
 #ifdef HAVE_CONFIG_H
@@ -58,7 +58,7 @@ typedef struct _iuup_rfci_t {
 } iuup_rfci_t;
 
 typedef struct {
-    guint32 id; 
+    guint32 id;
     guint num_of_subflows;
     iuup_rfci_t* rfcis;
     iuup_rfci_t* last_rfci;
@@ -68,7 +68,7 @@ static int proto_iuup = -1;
 
 static int hf_iuup_direction = -1;
 static int hf_iuup_circuit_id = -1;
-                    
+
 static int hf_iuup_pdu_type = -1;
 static int hf_iuup_frame_number = -1;
 static int hf_iuup_fqc = -1;
@@ -124,7 +124,7 @@ static int hf_iuup_init_rfci_flow_len[64][8] = {
     {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
     {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
     {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
-    {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1}    
+    {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1}
 };
 
 static int hf_iuup_init_rfci_li[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
@@ -139,7 +139,7 @@ static int hf_iuup_rfci_subflow[64][8] = {
     {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
     {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
     {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
-    {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1}    
+    {-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1}
 };
 
 static int hf_iuup_rfci_ratectl[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
@@ -330,23 +330,23 @@ iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, in
     int i;
 
     DISSECTOR_ASSERT(bit_offset < 8);
-    
+
     shifted_buffer = ep_tvb_memdup(tvb,offset,len+1);
-    
+
     for(i = 0; i < len; i++) {
         shifted_buffer[i] <<= bit_offset;
-        shifted_buffer[i] |= (shifted_buffer[i+1] & masks[bit_offset]) >> (8 - bit_offset); 
+        shifted_buffer[i] |= (shifted_buffer[i+1] & masks[bit_offset]) >> (8 - bit_offset);
     }
 
     shifted_buffer[len] <<=  bit_offset;
     shifted_buffer[len] &= masks[(bits + bit_offset)%8];
-    
+
     if (buf)
         *buf = shifted_buffer;
-    
+
     pi = proto_tree_add_bytes(tree, hf, tvb, offset, len + ((bits + bit_offset) % 8 ? 1 : 0) , shifted_buffer);
     proto_item_append_text(pi, " (%i Bits)", bits);
-    
+
     return pi;
 }
 
@@ -356,9 +356,9 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
     int last_offset = tvb_length(tvb) - 1;
     guint bit_offset = 0;
     proto_item* pi;
-    
+
     pi = proto_tree_add_item(tree,hf_iuup_payload,tvb,offset,-1,FALSE);
-    
+
     if ( ! dissect_fields ) {
         return;
     } else if ( ! pinfo->circuit_id
@@ -366,11 +366,11 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
         proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN);
         return;
     }
-    
+
     for(rfci = iuup_circuit->rfcis; rfci; rfci = rfci->next)
         if ( rfci->id == rfci_id )
             break;
-    
+
     if (!rfci) {
         proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN);
         return;
@@ -383,28 +383,28 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
         guint i;
         guint subflows = rfci->num_of_subflows;
         proto_tree* flow_tree;
-        
+
         pi = proto_tree_add_text(tree,tvb,offset,-1,"Payload Frame");
         flow_tree = proto_item_add_subtree(pi,ett_payload_subflows);
 
         bit_offset = 0;
 
         for(i = 0; i < subflows; i++) {
-            
+
             if (! rfci->subflow[i].len)
                 continue;
-            
+
             iuup_proto_tree_add_bits(flow_tree, hf_iuup_rfci_subflow[rfci->id][i], tvb,
                                 offset + (bit_offset/8),
                                 bit_offset % 8,
                                 rfci->subflow[i].len,
                                 NULL);
-            
+
             bit_offset += rfci->subflow[i].len;
         }
-        
+
         offset += (bit_offset / 8) + (bit_offset % 8 ? 1 : 0);
-        
+
     } while (offset <= last_offset);
 }
 
@@ -418,53 +418,53 @@ static guint dissect_rfcis(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tr
     do {
         iuup_rfci_t *rfci = se_alloc0(sizeof(iuup_rfci_t));
         guint len = 0;
-        
+
         DISSECTOR_ASSERT(c < 64);
 
         pi = proto_tree_add_item(tree,hf_iuup_init_rfci_ind,tvb,*offset,-1,FALSE);
         pt = proto_item_add_subtree(pi,ett_rfci);
-        
+
         proto_tree_add_item(pt,hf_iuup_init_rfci_lri[c],tvb,*offset,1,FALSE);
         proto_tree_add_item(pt,hf_iuup_init_rfci_li[c],tvb,*offset,1,FALSE);
         proto_tree_add_item(pt,hf_iuup_init_rfci[c],tvb,*offset,1,FALSE);
-        
+
         oct = tvb_get_guint8(tvb,*offset);
         rfci->id = oct & 0x3f;
         rfci->num_of_subflows = iuup_circuit->num_of_subflows;
-        
+
         len = (oct & 0x40) ? 2 : 1;
         proto_item_set_text(pi,"RFCI %i Initialization",rfci->id);
         proto_item_set_len(pi,(len*iuup_circuit->num_of_subflows)+1);
-        
+
         (*offset)++;
-        
+
         for(i = 0; i < iuup_circuit->num_of_subflows; i++) {
             guint subflow_len;
-            
+
             if (len == 2) {
                 subflow_len = tvb_get_ntohs(tvb,*offset);
             } else {
                 subflow_len = tvb_get_guint8(tvb,*offset);
             }
-            
+
             rfci->subflow[i].len = subflow_len;
             rfci->sum_len += subflow_len;
-            
+
             proto_tree_add_uint(pt,hf_iuup_init_rfci_flow_len[c][i],tvb,*offset,len,subflow_len);
 
             (*offset) += len;
         }
-        
-        
+
+
         if (iuup_circuit->last_rfci) {
             iuup_circuit->last_rfci = iuup_circuit->last_rfci->next = rfci;
         } else {
             iuup_circuit->last_rfci = iuup_circuit->rfcis = rfci;
         }
-        
+
         c++;
     } while ( ! (oct & 0x80) );
-    
+
     return c - 1;
 }
 
@@ -479,71 +479,71 @@ static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre
     proto_tree* support_tree = NULL;
     proto_tree* iptis_tree;
     iuup_circuit_t* iuup_circuit = NULL;
-    
+
     if (pinfo->circuit_id) {
         iuup_circuit = g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id));
-    
+
         if (iuup_circuit) {
             g_hash_table_remove(circuits,GUINT_TO_POINTER(pinfo->circuit_id));
         }
-    
+
         iuup_circuit = se_alloc0(sizeof(iuup_circuit_t));
     } else {
         iuup_circuit = ep_alloc0(sizeof(iuup_circuit_t));
     }
-    
+
     iuup_circuit->id = pinfo->circuit_id;
     iuup_circuit->num_of_subflows = n;
     iuup_circuit->rfcis = NULL;
     iuup_circuit->last_rfci = NULL;
-    
+
     if (pinfo->circuit_id) {
         g_hash_table_insert(circuits,GUINT_TO_POINTER(iuup_circuit->id),iuup_circuit);
     }
-    
+
     if (tree) {
         proto_tree_add_item(tree,hf_iuup_spare_e0,tvb,offset,1,FALSE);
         proto_tree_add_item(tree,hf_iuup_init_ti,tvb,offset,1,FALSE);
         proto_tree_add_item(tree,hf_iuup_init_subflows_per_rfci,tvb,offset,1,FALSE);
         proto_tree_add_item(tree,hf_iuup_init_chain_ind,tvb,offset,1,FALSE);
     }
-    
+
     offset++;
 
     rfcis = dissect_rfcis(tvb, pinfo, tree, &offset, iuup_circuit);
 
     if (!tree) return;
-    
+
     if (ti) {
         pi = proto_tree_add_text(tree,tvb,offset,(rfcis/2)+(rfcis%2),"IPTIs");
         iptis_tree = proto_item_add_subtree(pi,ett_ipti);
-        
+
         for (i = 0; i <= rfcis; i++) {
             proto_tree_add_item(iptis_tree,hf_iuup_init_ipti[i],tvb,offset,1,FALSE);
             if ((i%2)) {
                 offset++;
             }
         }
-        
+
         if ((i%2)) {
             offset++;
         }
     }
-    
+
     if (tree) {
         pi = proto_tree_add_item(tree,hf_iuup_mode_versions,tvb,offset,2,FALSE);
         support_tree = proto_item_add_subtree(pi,ett_support);
-        
+
         for (i = 0; i < 16; i++) {
             proto_tree_add_item(support_tree,hf_iuup_mode_versions_a[i],tvb,offset,2,FALSE);
         }
-        
+
     }
-        
+
     offset += 2;
-    
+
     proto_tree_add_item(tree,hf_iuup_data_pdu_type,tvb,offset,1,FALSE);
-    
+
 }
 
 static void dissect_iuup_ratectl(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree) {
@@ -552,15 +552,15 @@ static void dissect_iuup_ratectl(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
     proto_item* pi;
     proto_tree* inds_tree;
     int offset = 4;
-    
+
     pi = proto_tree_add_item(tree,hf_iuup_num_rfci_ind,tvb,4,1,FALSE);
     inds_tree = proto_item_add_subtree(pi,ett_rfciinds);
-    
+
     for (i = 0; i < num; i++) {
         if (! (i % 8) ) offset++;
         proto_tree_add_item(inds_tree,hf_iuup_rfci_ratectl[i],tvb,offset,1,FALSE);
     }
-    
+
 }
 
 static proto_item *add_hdr_crc(tvbuff_t* tvb, packet_info* pinfo, proto_item* iuup_tree, guint16 crccheck)
@@ -608,60 +608,60 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
     guint16  hdrcrc6;
     guint16  crccheck;
     tvbuff_t* tvb = tvb_in;
-    
+
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "IuUP");
 
     if (two_byte_pseudoheader) {
         int len = tvb_length(tvb_in) - 2;
-        
+
         phdr = tvb_get_ntohs(tvb,0);
 
         proto_tree_add_item(tree,hf_iuup_direction,tvb,0,2,FALSE);
         proto_tree_add_item(tree,hf_iuup_circuit_id,tvb,0,2,FALSE);
-        
+
         phdr &= 0x7fff;
-        
+
         pinfo->circuit_id = phdr;
-        
+
         tvb = tvb_new_subset(tvb_in,2,len,len);
     }
-    
+
     first_octet =  tvb_get_guint8(tvb,0);
     second_octet =  tvb_get_guint8(tvb,1);
     hdrcrc6 = tvb_get_guint8(tvb, 2) >> 2;
     crccheck = update_crc6_by_bytes(hdrcrc6, first_octet, second_octet);
-    
+
     pdutype = ( first_octet & PDUTYPE_MASK ) >> 4;
-    
+
     if (tree) {
         iuup_item = proto_tree_add_item(tree,proto_iuup,tvb,0,-1,FALSE);
         iuup_tree = proto_item_add_subtree(iuup_item,ett_iuup);
-        
+
         pdutype_item = proto_tree_add_item(iuup_tree,hf_iuup_pdu_type,tvb,0,1,FALSE);
     }
 
     if (check_col(pinfo->cinfo, COL_INFO)) {
         col_add_str(pinfo->cinfo, COL_INFO, val_to_str(pdutype, iuup_colinfo_pdu_types, "Unknown PDU Type(%u) "));
     }
-    
+
     switch(pdutype) {
         case PDUTYPE_DATA_WITH_CRC:
             if (check_col(pinfo->cinfo, COL_INFO)) {
                 col_append_fstr(pinfo->cinfo, COL_INFO,"FN: %x RFCI: %u", (guint)(first_octet & 0x0f) ,(guint)(second_octet & 0x3f));
             }
-                
+
             if (!tree) return;
             proto_tree_add_item(iuup_tree,hf_iuup_frame_number,tvb,0,1,FALSE);
             pi = proto_tree_add_item(iuup_tree,hf_iuup_fqc,tvb,1,1,FALSE);
-            
+
             if (first_octet & FQC_MASK) {
                 proto_item_set_expert_flags(pi, PI_RESPONSE_CODE, PI_WARN);
                 proto_item_set_expert_flags(iuup_item, PI_RESPONSE_CODE, PI_WARN);
             }
-                
+
             proto_tree_add_item(iuup_tree,hf_iuup_rfci,tvb,1,1,FALSE);
-           add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
-           add_payload_crc(tvb, pinfo, iuup_tree);
+            add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
+            add_payload_crc(tvb, pinfo, iuup_tree);
             dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,4);
             return;
         case PDUTYPE_DATA_NO_CRC:
@@ -676,9 +676,9 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
                 proto_item_set_expert_flags(pi, PI_RESPONSE_CODE, PI_WARN);
                 proto_item_set_expert_flags(iuup_item, PI_RESPONSE_CODE, PI_WARN);
             }
-                
+
             proto_tree_add_item(iuup_tree,hf_iuup_rfci,tvb,1,1,FALSE);
-           add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
+            add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
             dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,3);
             return;
         case PDUTYPE_DATA_CONTROL_PROC:
@@ -687,19 +687,19 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
                 proto_tree_add_item(iuup_tree,hf_iuup_frame_number_t14,tvb,0,1,FALSE);
                 proto_tree_add_item(iuup_tree,hf_iuup_mode_version,tvb,1,1,FALSE);
                 proc_item = proto_tree_add_item(iuup_tree,hf_iuup_procedure_indicator,tvb,1,1,FALSE);
-               add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
+                add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
             }
-            
+
             if (check_col(pinfo->cinfo, COL_INFO)) {
                 col_append_str(pinfo->cinfo, COL_INFO,
                                val_to_str(first_octet & ACKNACK_MASK,
                                           iuup_colinfo_acknack_vals, "[action:%u] "));
-                
+
                 col_append_str(pinfo->cinfo, COL_INFO,
                                val_to_str(second_octet & PROCEDURE_MASK,
                                           iuup_colinfo_procedures, "[proc:%u] "));
             }
-            
+
             switch ( first_octet & ACKNACK_MASK ) {
                 case ACKNACK_ACK:
                     switch(second_octet & PROCEDURE_MASK) {
@@ -709,9 +709,9 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
                             proto_tree_add_item(iuup_tree,hf_iuup_spare_ff,tvb,3,1,FALSE);
                             return;
                         case PROC_RATE:
-                           if (!tree) return;
-                           dissect_iuup_ratectl(tvb,pinfo,iuup_tree);
-                           return;
+                            if (!tree) return;
+                            dissect_iuup_ratectl(tvb,pinfo,iuup_tree);
+                            return;
                         case PROC_TIME:
                         case PROC_ERROR:
                             break;
@@ -733,7 +733,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
                 case ACKNACK_PROC:
                     break;
             }
-            
+
             switch( second_octet & PROCEDURE_MASK ) {
                 case PROC_INIT:
                     if (tree) add_payload_crc(tvb, pinfo, iuup_tree);
@@ -752,10 +752,10 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
                     if (!tree) return;
 
                     ta = tvb_get_guint8(tvb,4);
-                    
+
                     pi = proto_tree_add_item(iuup_tree,hf_iuup_time_align,tvb,4,1,FALSE);
                     time_tree = proto_item_add_subtree(pi,ett_time);
-                    
+
                     if (ta >= 1 && ta <= 80) {
                         pi = proto_tree_add_uint(time_tree,hf_iuup_delay,tvb,4,1,ta * 500);
                         PROTO_ITEM_SET_GENERATED(pi);
@@ -769,7 +769,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
                     } else {
                         proto_item_set_expert_flags(pi, PI_MALFORMED, PI_ERROR);
                     }
-                    
+
                     proto_tree_add_item(iuup_tree,hf_iuup_spare_bytes,tvb,5,-1,FALSE);
                     return;
                 }
@@ -798,13 +798,13 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
 
 static gboolean dissect_iuup_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
     int len = tvb_length(tvb);
-       
+
     guint8 first_octet =  tvb_get_guint8(tvb,0);
     guint8 second_octet =  tvb_get_guint8(tvb,1);
     guint16 hdrcrc6 = tvb_get_guint8(tvb, 2) >> 2;
-       
+
     if (update_crc6_by_bytes(hdrcrc6, first_octet, second_octet)) return FALSE;
-       
+
     switch ( first_octet & 0xf0 ) {
         case 0x00: {
             if (len<7) return FALSE;
@@ -821,7 +821,7 @@ static gboolean dissect_iuup_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree
         default:
             return FALSE;
     }
-       
+
     dissect_iuup(tvb, pinfo, tree);
     return TRUE;
 }
@@ -830,7 +830,7 @@ static gboolean dissect_iuup_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree
 static void find_iuup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
     int len = tvb_length(tvb);
     int offset = 0;
-       
+
     while (len > 3) {
         if ( dissect_iuup_heur(tvb_new_subset_remaining(tvb,offset), pinfo, tree) )
             return;
@@ -838,7 +838,7 @@ static void find_iuup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
         offset++;
         len--;
     }
-       
+
     call_dissector(data_handle, tvb, pinfo, tree);
 }
 
@@ -866,7 +866,7 @@ void proto_reg_handoff_iuup(void) {
     }
 
     saved_dynamic_payload_type = global_dynamic_payload_type;
-    
+
     if ( global_dynamic_payload_type > 95 ) {
         dissector_add("rtp.pt", global_dynamic_payload_type, iuup_handle);
     }
@@ -906,8 +906,8 @@ void proto_register_iuup(void) {
         { &hf_iuup_frame_number, { "Frame Number", "iuup.framenum", FT_UINT8, BASE_DEC, NULL,0x0F,NULL,HFILL}},
         { &hf_iuup_fqc, { "FQC", "iuup.fqc", FT_UINT8, BASE_DEC, VALS(iuup_fqcs),0xc0,"Frame Quality Classification",HFILL}},
         { &hf_iuup_rfci, { "RFCI", "iuup.rfci", FT_UINT8, BASE_HEX, NULL, 0x3f, "RAB sub-Flow Combination Indicator",HFILL}},
-        { &hf_iuup_hdr_crc, { "Header CRC", "iuup.header_crc", FT_UINT8, BASE_HEX, NULL,0xfc,NULL,HFILL}},        
-        { &hf_iuup_hdr_crc_error, { "Header CRC [incorrect]", "iuup.header_crc", FT_UINT8, BASE_HEX, NULL,0xfc,NULL,HFILL}},        
+        { &hf_iuup_hdr_crc, { "Header CRC", "iuup.header_crc", FT_UINT8, BASE_HEX, NULL,0xfc,NULL,HFILL}},
+        { &hf_iuup_hdr_crc_error, { "Header CRC [incorrect]", "iuup.header_crc", FT_UINT8, BASE_HEX, NULL,0xfc,NULL,HFILL}},
         { &hf_iuup_payload_crc, { "Payload CRC", "iuup.payload_crc", FT_UINT16, BASE_HEX, NULL,0x03FF,NULL,HFILL}},
         { &hf_iuup_payload_crc_error, { "Payload CRC [incorrect]", "iuup.payload_crc", FT_UINT16, BASE_HEX, NULL,0x03FF,NULL,HFILL}},
         { &hf_iuup_ack_nack, { "Ack/Nack", "iuup.ack", FT_UINT8, BASE_DEC, VALS(iuup_acknack_vals),0x0c,NULL,HFILL}},
@@ -926,7 +926,7 @@ void proto_register_iuup(void) {
         { &hf_iuup_spare_e0, { "Spare", "iuup.spare", FT_UINT8, BASE_HEX, NULL,0xe0,NULL,HFILL}},
         { &hf_iuup_spare_ff, { "Spare", "iuup.spare", FT_UINT8, BASE_HEX, NULL,0xff,NULL,HFILL}},
         { &hf_iuup_spare_bytes, { "Spare", "iuup.spare_bytes", FT_BYTES, BASE_NONE, NULL,0x0,NULL,HFILL}},
-        
+
         { &hf_iuup_delay, { "Delay", "iuup.delay", FT_UINT32, BASE_HEX, NULL,0x0,NULL,HFILL}},
         { &hf_iuup_advance, { "Advance", "iuup.advance", FT_UINT32, BASE_HEX, NULL,0x0,NULL,HFILL}},
         { &hf_iuup_delta, { "Delta Time", "iuup.delta", FT_FLOAT, BASE_NONE, NULL,0x0,NULL,HFILL}},
@@ -938,7 +938,7 @@ void proto_register_iuup(void) {
 
 
         { &hf_iuup_mode_versions, { "Iu UP Mode Versions Supported", "iuup.support_mode", FT_UINT16, BASE_HEX, NULL,0x0,NULL,HFILL}},
-        
+
         { &hf_iuup_mode_versions_a[ 0], { "Version 16", "iuup.support_mode.version16", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x8000,NULL,HFILL}},
         { &hf_iuup_mode_versions_a[ 1], { "Version 15", "iuup.support_mode.version15", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x4000,NULL,HFILL}},
         { &hf_iuup_mode_versions_a[ 2], { "Version 14", "iuup.support_mode.version14", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x2000,NULL,HFILL}},
@@ -954,7 +954,7 @@ void proto_register_iuup(void) {
         { &hf_iuup_mode_versions_a[12], { "Version  4", "iuup.support_mode.version4", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0008,NULL,HFILL}},
         { &hf_iuup_mode_versions_a[13], { "Version  3", "iuup.support_mode.version3", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0004,NULL,HFILL}},
         { &hf_iuup_mode_versions_a[14], { "Version  2", "iuup.support_mode.version2", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0002,NULL,HFILL}},
-        { &hf_iuup_mode_versions_a[15], { "Version  1", "iuup.support_mode.version1", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0001,NULL,HFILL}}, 
+        { &hf_iuup_mode_versions_a[15], { "Version  1", "iuup.support_mode.version1", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0001,NULL,HFILL}},
 
         { &hf_iuup_num_rfci_ind, { "Number of RFCI Indicators", "iuup.p", FT_UINT8, BASE_HEX, NULL,0x3f,NULL,HFILL}},
         { &hf_iuup_init_rfci_ind, { "RFCI Initialization", "iuup.rfci.init", FT_BYTES, BASE_NONE, NULL,0x0,NULL,HFILL}},
@@ -967,9 +967,9 @@ void proto_register_iuup(void) {
         HFS_RFCI(40),HFS_RFCI(41),HFS_RFCI(42),HFS_RFCI(43),HFS_RFCI(44),HFS_RFCI(45),HFS_RFCI(46),HFS_RFCI(47),
         HFS_RFCI(48),HFS_RFCI(49),HFS_RFCI(50),HFS_RFCI(51),HFS_RFCI(52),HFS_RFCI(53),HFS_RFCI(54),HFS_RFCI(55),
         HFS_RFCI(56),HFS_RFCI(57),HFS_RFCI(58),HFS_RFCI(59),HFS_RFCI(60),HFS_RFCI(61),HFS_RFCI(62),HFS_RFCI(63)
-        
+
     };
-    
+
 
     gint* ett[] = {
         &ett_iuup,
@@ -984,31 +984,31 @@ void proto_register_iuup(void) {
 
     module_t* iuup_module;
 
-    
+
     proto_iuup = proto_register_protocol("IuUP", "IuUP", "iuup");
     proto_register_field_array(proto_iuup, hf, array_length(hf));
     proto_register_subtree_array(ett, array_length(ett));
     register_dissector("iuup", dissect_iuup, proto_iuup);
     register_dissector("find_iuup", find_iuup, proto_iuup);
-       
+
     register_init_routine(&init_iuup);
-    
+
     iuup_module = prefs_register_protocol(proto_iuup, proto_reg_handoff_iuup);
-    
+
     prefs_register_bool_preference(iuup_module, "dissect_payload",
                                    "Dissect IuUP Payload bits",
                                    "Whether IuUP Payload bits should be dissected",
                                    &dissect_fields);
-    
+
     prefs_register_bool_preference(iuup_module, "two_byte_pseudoheader",
                                    "Two byte pseudoheader",
                                    "The payload contains a two byte pseudoheader indicating direction and circuit_id",
                                    &two_byte_pseudoheader);
-    
+
     prefs_register_uint_preference(iuup_module, "dynamic.payload.type",
-                                                                  "IuUP dynamic payload type",
-                                                                  "The dynamic payload type which will be interpreted as IuUP",
-                                                                  10,
-                                                                  &global_dynamic_payload_type);
+                                   "IuUP dynamic payload type",
+                                   "The dynamic payload type which will be interpreted as IuUP",
+                                   10,
+                                   &global_dynamic_payload_type);
 }
 
index d689ae4aa949ac0ad6a8a06b0d78309a9c303b92..b780cef798385353dc7c6293e4b9552d471e4607 100644 (file)
  *
  * See
  *
- *     http://www.netscape.com/eng/security/SSL_2.html
+ *    http://www.netscape.com/eng/security/SSL_2.html
  *
  * for SSL 2.0 specs.
  *
  * See
  *
- *     http://www.netscape.com/eng/ssl3/
+ *    http://www.netscape.com/eng/ssl3/
  *
  * for SSL 3.0 specs.
  *
  *
  * See (among other places)
  *
- *     http://www.graphcomp.com/info/specs/ms/pct.htm
+ *    http://www.graphcomp.com/info/specs/ms/pct.htm
  *
  * for PCT 1 draft specs.
  *
  * See
  *
- *     http://research.sun.com/projects/crypto/draft-ietf-tls-ecc-05.txt
+ *    http://research.sun.com/projects/crypto/draft-ietf-tls-ecc-05.txt
  *
  * for Elliptic Curve Cryptography cipher suites.
  *
  * See
  *
- *     http://www.ietf.org/internet-drafts/draft-ietf-tls-camellia-04.txt
+ *    http://www.ietf.org/internet-drafts/draft-ietf-tls-camellia-04.txt
  *
  * for Camellia-based cipher suites.
  *
  *    - Decryption is supported only for session that use RSA key exchange,
  *      if the host private key is provided via preference.
  *
- *    - Decryption need to be performed 'sequentially', so it's done
- *      at packet reception time. This may cause a significative packet capture
- *      slow down. This also cause do dissect some ssl info that in previous
- *      dissector version were dissected only when a proto_tree context was
+ *    - Decryption needs to be performed 'sequentially', so it's done
+ *      at packet reception time. This may cause a significant packet capture
+ *      slow down. This also causes dissection of some ssl info that in previous
+ *      dissector versions was dissected only when a proto_tree context was
  *      available
  *
  *     We are at Packet reception if time pinfo->fd->flags.visited == 0
@@ -175,11 +175,11 @@ static gint hf_ssl_handshake_extensions_len   = -1;
 static gint hf_ssl_handshake_extension_type   = -1;
 static gint hf_ssl_handshake_extension_len    = -1;
 static gint hf_ssl_handshake_extension_data   = -1;
-static gint hf_ssl_handshake_extension_elliptic_curves_len = -1;
-static gint hf_ssl_handshake_extension_elliptic_curves = -1;
-static gint hf_ssl_handshake_extension_elliptic_curve = -1;
+static gint hf_ssl_handshake_extension_elliptic_curves_len  = -1;
+static gint hf_ssl_handshake_extension_elliptic_curves      = -1;
+static gint hf_ssl_handshake_extension_elliptic_curve       = -1;
 static gint hf_ssl_handshake_extension_ec_point_formats_len = -1;
-static gint hf_ssl_handshake_extension_ec_point_format = -1;
+static gint hf_ssl_handshake_extension_ec_point_format      = -1;
 static gint hf_ssl_handshake_certificates_len = -1;
 static gint hf_ssl_handshake_certificates     = -1;
 static gint hf_ssl_handshake_certificate      = -1;
@@ -257,33 +257,33 @@ static gint ett_ssl_segment           = -1;
    them anyways to comply with the api (which was aimed for ip fragment
    reassembly) */
 static const fragment_items ssl_segment_items = {
-       &ett_ssl_segment,
-       &ett_ssl_segments,
-       &hf_ssl_segments,
-       &hf_ssl_segment,
-       &hf_ssl_segment_overlap,
-       &hf_ssl_segment_overlap_conflict,
-       &hf_ssl_segment_multiple_tails,
-       &hf_ssl_segment_too_long_fragment,
-       &hf_ssl_segment_error,
-       &hf_ssl_reassembled_in,
-       &hf_ssl_reassembled_length,
-       "Segments"
+    &ett_ssl_segment,
+    &ett_ssl_segments,
+    &hf_ssl_segments,
+    &hf_ssl_segment,
+    &hf_ssl_segment_overlap,
+    &hf_ssl_segment_overlap_conflict,
+    &hf_ssl_segment_multiple_tails,
+    &hf_ssl_segment_too_long_fragment,
+    &hf_ssl_segment_error,
+    &hf_ssl_reassembled_in,
+    &hf_ssl_reassembled_length,
+    "Segments"
 };
 
-static GHashTable *ssl_session_hash = NULL;
-static GHashTable *ssl_key_hash = NULL;
-static GTree* ssl_associations = NULL;
-static dissector_handle_t ssl_handle = NULL;
+static GHashTable *ssl_session_hash   = NULL;
+static GHashTable *ssl_key_hash       = NULL;
+static GTree* ssl_associations        = NULL;
+static dissector_handle_t ssl_handle  = NULL;
 static StringInfo ssl_compressed_data = {NULL, 0};
-static StringInfo ssl_decrypted_data = {NULL, 0};
-static gint ssl_decrypted_data_avail = 0;
+static StringInfo ssl_decrypted_data  = {NULL, 0};
+static gint ssl_decrypted_data_avail  = 0;
 
 static gchar* ssl_keys_list = NULL;
 static gchar* ssl_psk = NULL;
 
 #if defined(SSL_DECRYPT_DEBUG) || defined(HAVE_LIBGNUTLS)
-static gchar* ssl_debug_file_name = NULL;
+static gchar* ssl_debug_file_name     = NULL;
 #endif
 
 
@@ -296,16 +296,16 @@ static GHashTable *ssl_fragment_table = NULL;
 static void
 ssl_fragment_init(void)
 {
-  fragment_table_init(&ssl_fragment_table);
+    fragment_table_init(&ssl_fragment_table);
 }
 
 /* initialize/reset per capture state data (ssl sessions cache) */
 static void
 ssl_init(void)
 {
-  ssl_common_init(&ssl_session_hash, &ssl_decrypted_data, &ssl_compressed_data);
-  ssl_fragment_init();
-  ssl_debug_flush();
+    ssl_common_init(&ssl_session_hash, &ssl_decrypted_data, &ssl_compressed_data);
+    ssl_fragment_init();
+    ssl_debug_flush();
 }
 
 /* parse ssl related preferences (private keys and ports association strings) */
@@ -363,7 +363,7 @@ ssl_parse(void)
             ssl_parse_key_list(ssl_keys_list,ssl_key_hash,ssl_associations,ssl_handle,TRUE);
         }
     }
-       ssl_debug_flush();
+    ssl_debug_flush();
 }
 
 /*********************************************************************
@@ -378,11 +378,11 @@ ssl_parse(void)
  */
 /* record layer dissector */
 static gint dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo,
-                               proto_tree *tree, guint32 offset,
-                               guint *conv_version,
-                               gboolean *need_desegmentation,
-                               SslDecryptSession *conv_data,
-                               const gboolean first_record_in_frame);
+                                proto_tree *tree, guint32 offset,
+                                guint *conv_version,
+                                gboolean *need_desegmentation,
+                                SslDecryptSession *conv_data,
+                                const gboolean first_record_in_frame);
 
 /* change cipher spec dissector */
 static void dissect_ssl3_change_cipher_spec(tvbuff_t *tvb,
@@ -439,10 +439,10 @@ static void dissect_ssl3_hnd_finished(tvbuff_t *tvb,
 
 /* record layer dissector */
 static gint dissect_ssl2_record(tvbuff_t *tvb, packet_info *pinfo,
-                               proto_tree *tree, guint32 offset,
-                               guint *conv_version,
-                               gboolean *need_desegmentation,
-                               SslDecryptSession* ssl, gboolean first_record_in_frame);
+                                proto_tree *tree, guint32 offset,
+                                guint *conv_version,
+                                gboolean *need_desegmentation,
+                                SslDecryptSession* ssl, gboolean first_record_in_frame);
 
 /* client hello dissector */
 static void dissect_ssl2_hnd_client_hello(tvbuff_t *tvb, packet_info *pinfo,
@@ -459,25 +459,25 @@ static void dissect_ssl2_hnd_client_master_key(tvbuff_t *tvb,
                                                proto_tree *tree,
                                                guint32 offset);
 static void dissect_pct_msg_client_master_key(tvbuff_t *tvb,
-                                             proto_tree *tree,
-                                             guint32 offset);
+                                              proto_tree *tree,
+                                              guint32 offset);
 
 /* server hello dissector */
 static void dissect_ssl2_hnd_server_hello(tvbuff_t *tvb,
                                           proto_tree *tree,
                                           guint32 offset, packet_info *pinfo);
 static void dissect_pct_msg_server_hello(tvbuff_t *tvb,
-                                        proto_tree *tree,
-                                        guint32 offset, packet_info *pinfo);
+                                         proto_tree *tree,
+                                         guint32 offset, packet_info *pinfo);
 
 
 static void dissect_pct_msg_server_verify(tvbuff_t *tvb,
-                                             proto_tree *tree,
-                                             guint32 offset);
+                                          proto_tree *tree,
+                                          guint32 offset);
 
 static void dissect_pct_msg_error(tvbuff_t *tvb,
-                                             proto_tree *tree,
-                                             guint32 offset);
+                                  proto_tree *tree,
+                                  guint32 offset);
 
 /*
  * Support Functions
@@ -742,8 +742,8 @@ decrypt_ssl3_record(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
      * is successful*/
     ssl_decrypted_data_avail = ssl_decrypted_data.data_len;
     if (ssl_decrypt_record(ssl, decoder,
-          content_type, tvb_get_ptr(tvb, offset, record_length),
-          record_length, &ssl_compressed_data, &ssl_decrypted_data, &ssl_decrypted_data_avail) == 0)
+                           content_type, tvb_get_ptr(tvb, offset, record_length),
+                           record_length, &ssl_compressed_data, &ssl_decrypted_data, &ssl_decrypted_data_avail) == 0)
         ret = 1;
     /*  */
     if (!ret) {
@@ -760,459 +760,459 @@ decrypt_ssl3_record(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
 
 static void
 process_ssl_payload(tvbuff_t *tvb, volatile int offset, packet_info *pinfo,
-                   proto_tree *tree, SslAssociation* association);
+                    proto_tree *tree, SslAssociation* association);
 
 static void
 desegment_ssl(tvbuff_t *tvb, packet_info *pinfo, int offset,
-               guint32 seq, guint32 nxtseq,
-               SslAssociation* association,
-               proto_tree *root_tree, proto_tree *tree,
-               SslFlow *flow)
+              guint32 seq, guint32 nxtseq,
+              SslAssociation* association,
+              proto_tree *root_tree, proto_tree *tree,
+              SslFlow *flow)
 {
-       fragment_data *ipfd_head;
-       gboolean must_desegment;
-       gboolean called_dissector;
-       int another_pdu_follows;
-       int deseg_offset;
-       guint32 deseg_seq;
-       gint nbytes;
-       proto_item *item;
-       proto_item *frag_tree_item;
-       proto_item *ssl_tree_item;
+    fragment_data *ipfd_head;
+    gboolean must_desegment;
+    gboolean called_dissector;
+    int another_pdu_follows;
+    int deseg_offset;
+    guint32 deseg_seq;
+    gint nbytes;
+    proto_item *item;
+    proto_item *frag_tree_item;
+    proto_item *ssl_tree_item;
     struct tcp_multisegment_pdu *msp;
 
 again:
-       ipfd_head=NULL;
-       must_desegment = FALSE;
-       called_dissector = FALSE;
-       another_pdu_follows = 0;
-       msp=NULL;
-
-       /*
-        * Initialize these to assume no desegmentation.
-        * If that's not the case, these will be set appropriately
-        * by the subdissector.
-        */
-       pinfo->desegment_offset = 0;
-       pinfo->desegment_len = 0;
-
-       /*
-        * Initialize this to assume that this segment will just be
-        * added to the middle of a desegmented chunk of data, so
-        * that we should show it all as data.
-        * If that's not the case, it will be set appropriately.
-        */
-       deseg_offset = offset;
-
-       /* find the most previous PDU starting before this sequence number */
-       msp=se_tree_lookup32_le(flow->multisegment_pdus, seq-1);
-       if(msp && msp->seq<=seq && msp->nxtpdu>seq){
-               int len;
-
-               if(!pinfo->fd->flags.visited){
-                       msp->last_frame=pinfo->fd->num;
-                       msp->last_frame_time=pinfo->fd->abs_ts;
-               }
-
-               /* OK, this PDU was found, which means the segment continues
-                  a higher-level PDU and that we must desegment it.
-               */
-               if(msp->flags&MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT){
-                       /* The dissector asked for the entire segment */
-                       len=tvb_length_remaining(tvb, offset);
-               } else {
-                       len=MIN(nxtseq, msp->nxtpdu) - seq;
-               }
-
-               ipfd_head = fragment_add(tvb, offset, pinfo, msp->first_frame,
-                       ssl_fragment_table,
-                       seq - msp->seq,
-                       len,
-                       (LT_SEQ (nxtseq,msp->nxtpdu)) );
-
-               if(msp->flags&MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT){
-                       msp->flags&=(~MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT);
-
-                       /* If we consumed the entire segment there is no
-                        * other pdu starting anywhere inside this segment.
-                        * So update nxtpdu to point at least to the start
-                        * of the next segment.
-                        * (If the subdissector asks for even more data we
-                        * will advance nxtpdu even furhter later down in
-                        * the code.)
-                        */
-                       msp->nxtpdu=nxtseq;
-               }
-
-               if( (msp->nxtpdu<nxtseq)
-               &&  (msp->nxtpdu>=seq)
-               &&  (len>0) ){
-                       another_pdu_follows=msp->nxtpdu-seq;
-               }
-       } else {
-               /* This segment was not found in our table, so it doesn't
-                  contain a continuation of a higher-level PDU.
-                  Call the normal subdissector.
-               */
-               process_ssl_payload(tvb, offset, pinfo, tree, association);
-               called_dissector = TRUE;
-
-               /* Did the subdissector ask us to desegment some more data
-                  before it could handle the packet?
-                  If so we have to create some structures in our table but
-                  this is something we only do the first time we see this
-                  packet.
-               */
-               if(pinfo->desegment_len) {
-                       if (!pinfo->fd->flags.visited)
-                               must_desegment = TRUE;
-
-                       /*
-                        * Set "deseg_offset" to the offset in "tvb"
-                        * of the first byte of data that the
-                        * subdissector didn't process.
-                        */
-                       deseg_offset = offset + pinfo->desegment_offset;
-               }
-
-               /* Either no desegmentation is necessary, or this is
-                  segment contains the beginning but not the end of
-                  a higher-level PDU and thus isn't completely
-                  desegmented.
-               */
-               ipfd_head = NULL;
-       }
-
-
-       /* is it completely desegmented? */
-       if(ipfd_head){
-               /*
-                * Yes, we think it is.
-                * We only call subdissector for the last segment.
-                * Note that the last segment may include more than what
-                * we needed.
-                */
-               if(ipfd_head->reassembled_in==pinfo->fd->num){
-                       /*
-                        * OK, this is the last segment.
-                        * Let's call the subdissector with the desegmented
-                        * data.
-                        */
-                       tvbuff_t *next_tvb;
-                       int old_len;
-
-                       /* create a new TVB structure for desegmented data */
-                       next_tvb = tvb_new_child_real_data(tvb, ipfd_head->data,
-                                       ipfd_head->datalen, ipfd_head->datalen);
-
-                       /* add desegmented data to the data source list */
-                       add_new_data_source(pinfo, next_tvb, "Reassembled SSL");
-
-                       /* call subdissector */
-                       process_ssl_payload(next_tvb, 0, pinfo, tree, association);
-                       called_dissector = TRUE;
-
-                       /*
-                        * OK, did the subdissector think it was completely
-                        * desegmented, or does it think we need even more
-                        * data?
-                        */
-                       old_len=(int)(tvb_reported_length(next_tvb)-tvb_reported_length_remaining(tvb, offset));
-                       if(pinfo->desegment_len &&
-                           pinfo->desegment_offset<=old_len){
-                               /*
-                                * "desegment_len" isn't 0, so it needs more
-                                * data for something - and "desegment_offset"
-                                * is before "old_len", so it needs more data
-                                * to dissect the stuff we thought was
-                                * completely desegmented (as opposed to the
-                                * stuff at the beginning being completely
-                                * desegmented, but the stuff at the end
-                                * being a new higher-level PDU that also
-                                * needs desegmentation).
-                                */
-                               fragment_set_partial_reassembly(pinfo,msp->first_frame,ssl_fragment_table);
-                               /* Update msp->nxtpdu to point to the new next
-                                * pdu boundary.
-                                */
-                               if(pinfo->desegment_len==DESEGMENT_ONE_MORE_SEGMENT){
-                                       /* We want reassembly of at least one
-                                        * more segment so set the nxtpdu
-                                        * boundary to one byte into the next
-                                        * segment.
-                                        * This means that the next segment
-                                        * will complete reassembly even if it
-                                        * is only one single byte in length.
-                                        */
-                                       msp->nxtpdu=seq+tvb_reported_length_remaining(tvb, offset) + 1;
-                                       msp->flags|=MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT;
-                               } else {
-                                       msp->nxtpdu=seq+tvb_reported_length_remaining(tvb, offset) + pinfo->desegment_len;
-                               }
-                               /* Since we need at least some more data
-                                * there can be no pdu following in the
-                                * tail of this segment.
-                                */
-                               another_pdu_follows=0;
-                       } else {
-                               /*
-                                * Show the stuff in this TCP segment as
-                                * just raw TCP segment data.
-                                */
-                               nbytes =
-                                   tvb_reported_length_remaining(tvb, offset);
-                               proto_tree_add_text(tree, tvb, offset, -1,
-                                   "SSL segment data (%u byte%s)", nbytes,
-                                   plurality(nbytes, "", "s"));
-
-                               /*
-                                * The subdissector thought it was completely
-                                * desegmented (although the stuff at the
-                                * end may, in turn, require desegmentation),
-                                * so we show a tree with all segments.
-                                */
-                               show_fragment_tree(ipfd_head, &ssl_segment_items,
-                                       root_tree, pinfo, next_tvb, &frag_tree_item);
-                               /*
-                                * The toplevel fragment subtree is now
-                                * behind all desegmented data; move it
-                                * right behind the TCP tree.
-                                */
-                               ssl_tree_item = proto_tree_get_parent(tree);
-                               if(frag_tree_item && ssl_tree_item) {
-                                       proto_tree_move_item(root_tree, ssl_tree_item, frag_tree_item);
-                               }
-
-                               /* Did the subdissector ask us to desegment
-                                  some more data?  This means that the data
-                                  at the beginning of this segment completed
-                                  a higher-level PDU, but the data at the
-                                  end of this segment started a higher-level
-                                  PDU but didn't complete it.
-
-                                  If so, we have to create some structures
-                                  in our table, but this is something we
-                                  only do the first time we see this packet.
-                               */
-                               if(pinfo->desegment_len) {
-                                       if (!pinfo->fd->flags.visited)
-                                               must_desegment = TRUE;
-
-                                       /* The stuff we couldn't dissect
-                                          must have come from this segment,
-                                          so it's all in "tvb".
-
-                                          "pinfo->desegment_offset" is
-                                          relative to the beginning of
-                                          "next_tvb"; we want an offset
-                                          relative to the beginning of "tvb".
-
-                                          First, compute the offset relative
-                                          to the *end* of "next_tvb" - i.e.,
-                                          the number of bytes before the end
-                                          of "next_tvb" at which the
-                                          subdissector stopped.  That's the
-                                          length of "next_tvb" minus the
-                                          offset, relative to the beginning
-                                          of "next_tvb, at which the
-                                          subdissector stopped.
-                                       */
-                                       deseg_offset =
-                                           ipfd_head->datalen - pinfo->desegment_offset;
-
-                                       /* "tvb" and "next_tvb" end at the
-                                          same byte of data, so the offset
-                                          relative to the end of "next_tvb"
-                                          of the byte at which we stopped
-                                          is also the offset relative to
-                                          the end of "tvb" of the byte at
-                                          which we stopped.
-
-                                          Convert that back into an offset
-                                          relative to the beginninng of
-                                          "tvb", by taking the length of
-                                          "tvb" and subtracting the offset
-                                          relative to the end.
-                                       */
-                                       deseg_offset=tvb_reported_length(tvb) - deseg_offset;
-                               }
-                       }
-               }
-       }
-
-       if (must_desegment) {
-           /* If the dissector requested "reassemble until FIN"
-            * just set this flag for the flow and let reassembly
-            * proceed at normal.  We will check/pick up these
-            * reassembled PDUs later down in dissect_tcp() when checking
-            * for the FIN flag.
-            */
-           if(pinfo->desegment_len==DESEGMENT_UNTIL_FIN){
-                 flow->flags|=TCP_FLOW_REASSEMBLE_UNTIL_FIN;
-           }
-           /*
-            * The sequence number at which the stuff to be desegmented
-            * starts is the sequence number of the byte at an offset
-            * of "deseg_offset" into "tvb".
-            *
-            * The sequence number of the byte at an offset of "offset"
-            * is "seq", i.e. the starting sequence number of this
-            * segment, so the sequence number of the byte at
-            * "deseg_offset" is "seq + (deseg_offset - offset)".
-            */
-           deseg_seq = seq + (deseg_offset - offset);
-
-           if( ((nxtseq - deseg_seq) <= 1024*1024)
-           &&  (!pinfo->fd->flags.visited) ){
-               if(pinfo->desegment_len==DESEGMENT_ONE_MORE_SEGMENT){
-                       /* The subdissector asked to reassemble using the
-                        * entire next segment.
-                        * Just ask reassembly for one more byte
-                        * but set this msp flag so we can pick it up
-                        * above.
-                        */
-                       msp = pdu_store_sequencenumber_of_next_pdu(pinfo,
-                               deseg_seq, nxtseq+1, flow->multisegment_pdus);
-                       msp->flags|=MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT;
-               } else {
-                       msp = pdu_store_sequencenumber_of_next_pdu(pinfo,
-                               deseg_seq, nxtseq+pinfo->desegment_len, flow->multisegment_pdus);
-               }
-
-               /* add this segment as the first one for this new pdu */
-               fragment_add(tvb, deseg_offset, pinfo, msp->first_frame,
-                       ssl_fragment_table,
-                       0,
-                       nxtseq - deseg_seq,
-                       LT_SEQ(nxtseq, msp->nxtpdu));
-               }
-       }
-
-       if (!called_dissector || pinfo->desegment_len != 0) {
-               if (ipfd_head != NULL && ipfd_head->reassembled_in != 0 &&
-                   !(ipfd_head->flags & FD_PARTIAL_REASSEMBLY)) {
-                       /*
-                        * We know what frame this PDU is reassembled in;
-                        * let the user know.
-                        */
-                       item=proto_tree_add_uint(tree, *ssl_segment_items.hf_reassembled_in,
-                           tvb, 0, 0, ipfd_head->reassembled_in);
-                       PROTO_ITEM_SET_GENERATED(item);
-               }
-
-               /*
-                * Either we didn't call the subdissector at all (i.e.,
-                * this is a segment that contains the middle of a
-                * higher-level PDU, but contains neither the beginning
-                * nor the end), or the subdissector couldn't dissect it
-                * all, as some data was missing (i.e., it set
-                * "pinfo->desegment_len" to the amount of additional
-                * data it needs).
-                */
-               if (pinfo->desegment_offset == 0) {
-                       /*
-                        * It couldn't, in fact, dissect any of it (the
-                        * first byte it couldn't dissect is at an offset
-                        * of "pinfo->desegment_offset" from the beginning
-                        * of the payload, and that's 0).
-                        * Just mark this as SSL.
-                        */
-                       col_set_str(pinfo->cinfo, COL_PROTOCOL, "SSL");
-                       col_set_str(pinfo->cinfo, COL_INFO, "[SSL segment of a reassembled PDU]");
-               }
-
-               /*
-                * Show what's left in the packet as just raw TCP segment
-                * data.
-                * XXX - remember what protocol the last subdissector
-                * was, and report it as a continuation of that, instead?
-                */
-               nbytes = tvb_reported_length_remaining(tvb, deseg_offset);
-               proto_tree_add_text(tree, tvb, deseg_offset, -1,
-                   "SSL segment data (%u byte%s)", nbytes,
-                   plurality(nbytes, "", "s"));
-       }
-       pinfo->can_desegment=0;
-       pinfo->desegment_offset = 0;
-       pinfo->desegment_len = 0;
-
-       if(another_pdu_follows){
-               /* there was another pdu following this one. */
-               pinfo->can_desegment=2;
-               /* we also have to prevent the dissector from changing the
-                * PROTOCOL and INFO colums since what follows may be an
-                * incomplete PDU and we dont want it be changed back from
-                *  <Protocol>   to <TCP>
-                * XXX There is no good way to block the PROTOCOL column
-                * from being changed yet so we set the entire row unwritable.
-                */
-               col_set_fence(pinfo->cinfo, COL_INFO);
-               col_set_writable(pinfo->cinfo, FALSE);
-               offset += another_pdu_follows;
-               seq += another_pdu_follows;
-               goto again;
-       }
+    ipfd_head=NULL;
+    must_desegment = FALSE;
+    called_dissector = FALSE;
+    another_pdu_follows = 0;
+    msp=NULL;
+
+    /*
+     * Initialize these to assume no desegmentation.
+     * If that's not the case, these will be set appropriately
+     * by the subdissector.
+     */
+    pinfo->desegment_offset = 0;
+    pinfo->desegment_len = 0;
+
+    /*
+     * Initialize this to assume that this segment will just be
+     * added to the middle of a desegmented chunk of data, so
+     * that we should show it all as data.
+     * If that's not the case, it will be set appropriately.
+     */
+    deseg_offset = offset;
+
+    /* find the most previous PDU starting before this sequence number */
+    msp=se_tree_lookup32_le(flow->multisegment_pdus, seq-1);
+    if(msp && msp->seq<=seq && msp->nxtpdu>seq){
+        int len;
+
+        if(!pinfo->fd->flags.visited){
+            msp->last_frame=pinfo->fd->num;
+            msp->last_frame_time=pinfo->fd->abs_ts;
+        }
+
+        /* OK, this PDU was found, which means the segment continues
+           a higher-level PDU and that we must desegment it.
+        */
+        if(msp->flags&MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT){
+            /* The dissector asked for the entire segment */
+            len=tvb_length_remaining(tvb, offset);
+        } else {
+            len=MIN(nxtseq, msp->nxtpdu) - seq;
+        }
+
+        ipfd_head = fragment_add(tvb, offset, pinfo, msp->first_frame,
+                                 ssl_fragment_table,
+                                 seq - msp->seq,
+                                 len,
+                                 (LT_SEQ (nxtseq,msp->nxtpdu)) );
+
+        if(msp->flags&MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT){
+            msp->flags&=(~MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT);
+
+            /* If we consumed the entire segment there is no
+             * other pdu starting anywhere inside this segment.
+             * So update nxtpdu to point at least to the start
+             * of the next segment.
+             * (If the subdissector asks for even more data we
+             * will advance nxtpdu even furhter later down in
+             * the code.)
+             */
+            msp->nxtpdu=nxtseq;
+        }
+
+        if( (msp->nxtpdu<nxtseq)
+            &&  (msp->nxtpdu>=seq)
+            &&  (len>0) ){
+            another_pdu_follows=msp->nxtpdu-seq;
+        }
+    } else {
+        /* This segment was not found in our table, so it doesn't
+           contain a continuation of a higher-level PDU.
+           Call the normal subdissector.
+        */
+        process_ssl_payload(tvb, offset, pinfo, tree, association);
+        called_dissector = TRUE;
+
+        /* Did the subdissector ask us to desegment some more data
+           before it could handle the packet?
+           If so we have to create some structures in our table but
+           this is something we only do the first time we see this
+           packet.
+        */
+        if(pinfo->desegment_len) {
+            if (!pinfo->fd->flags.visited)
+                must_desegment = TRUE;
+
+            /*
+             * Set "deseg_offset" to the offset in "tvb"
+             * of the first byte of data that the
+             * subdissector didn't process.
+             */
+            deseg_offset = offset + pinfo->desegment_offset;
+        }
+
+        /* Either no desegmentation is necessary, or this is
+           segment contains the beginning but not the end of
+           a higher-level PDU and thus isn't completely
+           desegmented.
+        */
+        ipfd_head = NULL;
+    }
+
+
+    /* is it completely desegmented? */
+    if(ipfd_head){
+        /*
+         * Yes, we think it is.
+         * We only call subdissector for the last segment.
+         * Note that the last segment may include more than what
+         * we needed.
+         */
+        if(ipfd_head->reassembled_in==pinfo->fd->num){
+            /*
+             * OK, this is the last segment.
+             * Let's call the subdissector with the desegmented
+             * data.
+             */
+            tvbuff_t *next_tvb;
+            int old_len;
+
+            /* create a new TVB structure for desegmented data */
+            next_tvb = tvb_new_child_real_data(tvb, ipfd_head->data,
+                                               ipfd_head->datalen, ipfd_head->datalen);
+
+            /* add desegmented data to the data source list */
+            add_new_data_source(pinfo, next_tvb, "Reassembled SSL");
+
+            /* call subdissector */
+            process_ssl_payload(next_tvb, 0, pinfo, tree, association);
+            called_dissector = TRUE;
+
+            /*
+             * OK, did the subdissector think it was completely
+             * desegmented, or does it think we need even more
+             * data?
+             */
+            old_len=(int)(tvb_reported_length(next_tvb)-tvb_reported_length_remaining(tvb, offset));
+            if(pinfo->desegment_len &&
+               pinfo->desegment_offset<=old_len){
+                /*
+                 * "desegment_len" isn't 0, so it needs more
+                 * data for something - and "desegment_offset"
+                 * is before "old_len", so it needs more data
+                 * to dissect the stuff we thought was
+                 * completely desegmented (as opposed to the
+                 * stuff at the beginning being completely
+                 * desegmented, but the stuff at the end
+                 * being a new higher-level PDU that also
+                 * needs desegmentation).
+                 */
+                fragment_set_partial_reassembly(pinfo,msp->first_frame,ssl_fragment_table);
+                /* Update msp->nxtpdu to point to the new next
+                 * pdu boundary.
+                 */
+                if(pinfo->desegment_len==DESEGMENT_ONE_MORE_SEGMENT){
+                    /* We want reassembly of at least one
+                     * more segment so set the nxtpdu
+                     * boundary to one byte into the next
+                     * segment.
+                     * This means that the next segment
+                     * will complete reassembly even if it
+                     * is only one single byte in length.
+                     */
+                    msp->nxtpdu=seq+tvb_reported_length_remaining(tvb, offset) + 1;
+                    msp->flags|=MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT;
+                } else {
+                    msp->nxtpdu=seq+tvb_reported_length_remaining(tvb, offset) + pinfo->desegment_len;
+                }
+                /* Since we need at least some more data
+                 * there can be no pdu following in the
+                 * tail of this segment.
+                 */
+                another_pdu_follows=0;
+            } else {
+                /*
+                 * Show the stuff in this TCP segment as
+                 * just raw TCP segment data.
+                 */
+                nbytes =
+                    tvb_reported_length_remaining(tvb, offset);
+                proto_tree_add_text(tree, tvb, offset, -1,
+                                    "SSL segment data (%u byte%s)", nbytes,
+                                    plurality(nbytes, "", "s"));
+
+                /*
+                 * The subdissector thought it was completely
+                 * desegmented (although the stuff at the
+                 * end may, in turn, require desegmentation),
+                 * so we show a tree with all segments.
+                 */
+                show_fragment_tree(ipfd_head, &ssl_segment_items,
+                                   root_tree, pinfo, next_tvb, &frag_tree_item);
+                /*
+                 * The toplevel fragment subtree is now
+                 * behind all desegmented data; move it
+                 * right behind the TCP tree.
+                 */
+                ssl_tree_item = proto_tree_get_parent(tree);
+                if(frag_tree_item && ssl_tree_item) {
+                    proto_tree_move_item(root_tree, ssl_tree_item, frag_tree_item);
+                }
+
+                /* Did the subdissector ask us to desegment
+                   some more data?  This means that the data
+                   at the beginning of this segment completed
+                   a higher-level PDU, but the data at the
+                   end of this segment started a higher-level
+                   PDU but didn't complete it.
+
+                   If so, we have to create some structures
+                   in our table, but this is something we
+                   only do the first time we see this packet.
+                */
+                if(pinfo->desegment_len) {
+                    if (!pinfo->fd->flags.visited)
+                        must_desegment = TRUE;
+
+                    /* The stuff we couldn't dissect
+                       must have come from this segment,
+                       so it's all in "tvb".
+
+                       "pinfo->desegment_offset" is
+                       relative to the beginning of
+                       "next_tvb"; we want an offset
+                       relative to the beginning of "tvb".
+
+                       First, compute the offset relative
+                       to the *end* of "next_tvb" - i.e.,
+                       the number of bytes before the end
+                       of "next_tvb" at which the
+                       subdissector stopped.  That's the
+                       length of "next_tvb" minus the
+                       offset, relative to the beginning
+                       of "next_tvb, at which the
+                       subdissector stopped.
+                    */
+                    deseg_offset =
+                        ipfd_head->datalen - pinfo->desegment_offset;
+
+                    /* "tvb" and "next_tvb" end at the
+                       same byte of data, so the offset
+                       relative to the end of "next_tvb"
+                       of the byte at which we stopped
+                       is also the offset relative to
+                       the end of "tvb" of the byte at
+                       which we stopped.
+
+                       Convert that back into an offset
+                       relative to the beginninng of
+                       "tvb", by taking the length of
+                       "tvb" and subtracting the offset
+                       relative to the end.
+                    */
+                    deseg_offset=tvb_reported_length(tvb) - deseg_offset;
+                }
+            }
+        }
+    }
+
+    if (must_desegment) {
+        /* If the dissector requested "reassemble until FIN"
+         * just set this flag for the flow and let reassembly
+         * proceed at normal.  We will check/pick up these
+         * reassembled PDUs later down in dissect_tcp() when checking
+         * for the FIN flag.
+         */
+        if(pinfo->desegment_len==DESEGMENT_UNTIL_FIN){
+            flow->flags|=TCP_FLOW_REASSEMBLE_UNTIL_FIN;
+        }
+        /*
+         * The sequence number at which the stuff to be desegmented
+         * starts is the sequence number of the byte at an offset
+         * of "deseg_offset" into "tvb".
+         *
+         * The sequence number of the byte at an offset of "offset"
+         * is "seq", i.e. the starting sequence number of this
+         * segment, so the sequence number of the byte at
+         * "deseg_offset" is "seq + (deseg_offset - offset)".
+         */
+        deseg_seq = seq + (deseg_offset - offset);
+
+        if( ((nxtseq - deseg_seq) <= 1024*1024)
+            &&  (!pinfo->fd->flags.visited) ){
+            if(pinfo->desegment_len==DESEGMENT_ONE_MORE_SEGMENT){
+                /* The subdissector asked to reassemble using the
+                 * entire next segment.
+                 * Just ask reassembly for one more byte
+                 * but set this msp flag so we can pick it up
+                 * above.
+                 */
+                msp = pdu_store_sequencenumber_of_next_pdu(pinfo,
+                                                           deseg_seq, nxtseq+1, flow->multisegment_pdus);
+                msp->flags|=MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT;
+            } else {
+                msp = pdu_store_sequencenumber_of_next_pdu(pinfo,
+                                                           deseg_seq, nxtseq+pinfo->desegment_len, flow->multisegment_pdus);
+            }
+
+            /* add this segment as the first one for this new pdu */
+            fragment_add(tvb, deseg_offset, pinfo, msp->first_frame,
+                         ssl_fragment_table,
+                         0,
+                         nxtseq - deseg_seq,
+                         LT_SEQ(nxtseq, msp->nxtpdu));
+        }
+    }
+
+    if (!called_dissector || pinfo->desegment_len != 0) {
+        if (ipfd_head != NULL && ipfd_head->reassembled_in != 0 &&
+            !(ipfd_head->flags & FD_PARTIAL_REASSEMBLY)) {
+            /*
+             * We know what frame this PDU is reassembled in;
+             * let the user know.
+             */
+            item=proto_tree_add_uint(tree, *ssl_segment_items.hf_reassembled_in,
+                                     tvb, 0, 0, ipfd_head->reassembled_in);
+            PROTO_ITEM_SET_GENERATED(item);
+        }
+
+        /*
+         * Either we didn't call the subdissector at all (i.e.,
+         * this is a segment that contains the middle of a
+         * higher-level PDU, but contains neither the beginning
+         * nor the end), or the subdissector couldn't dissect it
+         * all, as some data was missing (i.e., it set
+         * "pinfo->desegment_len" to the amount of additional
+         * data it needs).
+         */
+        if (pinfo->desegment_offset == 0) {
+            /*
+             * It couldn't, in fact, dissect any of it (the
+             * first byte it couldn't dissect is at an offset
+             * of "pinfo->desegment_offset" from the beginning
+             * of the payload, and that's 0).
+             * Just mark this as SSL.
+             */
+            col_set_str(pinfo->cinfo, COL_PROTOCOL, "SSL");
+            col_set_str(pinfo->cinfo, COL_INFO, "[SSL segment of a reassembled PDU]");
+        }
+
+        /*
+         * Show what's left in the packet as just raw TCP segment
+         * data.
+         * XXX - remember what protocol the last subdissector
+         * was, and report it as a continuation of that, instead?
+         */
+        nbytes = tvb_reported_length_remaining(tvb, deseg_offset);
+        proto_tree_add_text(tree, tvb, deseg_offset, -1,
+                            "SSL segment data (%u byte%s)", nbytes,
+                            plurality(nbytes, "", "s"));
+    }
+    pinfo->can_desegment=0;
+    pinfo->desegment_offset = 0;
+    pinfo->desegment_len = 0;
+
+    if(another_pdu_follows){
+        /* there was another pdu following this one. */
+        pinfo->can_desegment=2;
+        /* we also have to prevent the dissector from changing the
+         * PROTOCOL and INFO colums since what follows may be an
+         * incomplete PDU and we dont want it be changed back from
+         *  <Protocol>   to <TCP>
+         * XXX There is no good way to block the PROTOCOL column
+         * from being changed yet so we set the entire row unwritable.
+         */
+        col_set_fence(pinfo->cinfo, COL_INFO);
+        col_set_writable(pinfo->cinfo, FALSE);
+        offset += another_pdu_follows;
+        seq += another_pdu_follows;
+        goto again;
+    }
 }
 
 static void
 process_ssl_payload(tvbuff_t *tvb, volatile int offset, packet_info *pinfo,
-                   proto_tree *tree, SslAssociation* association)
+                    proto_tree *tree, SslAssociation* association)
 {
-  tvbuff_t *next_tvb;
+    tvbuff_t *next_tvb;
 
-  next_tvb = tvb_new_subset_remaining(tvb, offset);
+    next_tvb = tvb_new_subset_remaining(tvb, offset);
 
-  if (association && association->handle) {
-    ssl_debug_printf("dissect_ssl3_record found association %p\n", (void *)association);
-    call_dissector(association->handle, next_tvb, pinfo, proto_tree_get_root(tree));
-  }
+    if (association && association->handle) {
+        ssl_debug_printf("dissect_ssl3_record found association %p\n", (void *)association);
+        call_dissector(association->handle, next_tvb, pinfo, proto_tree_get_root(tree));
+    }
 }
 
 void
 dissect_ssl_payload(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, SslAssociation* association)
 {
-  gboolean save_fragmented;
-  guint16 save_can_desegment;
-  SslDataInfo *appl_data;
-  tvbuff_t *next_tvb;
-
-  /* Preserve current desegmentation ability to prevent the subdissector
-   * from messing up the ssl desegmentation */
-  save_can_desegment = pinfo->can_desegment;
-
-  /* show decrypted data info, if available */
-  appl_data = ssl_get_data_info(proto_ssl, pinfo, TVB_RAW_OFFSET(tvb)+offset);
-  if (!appl_data || !appl_data->plain_data.data_len) return;
-
-  /* try to dissect decrypted data*/
-  ssl_debug_printf("dissect_ssl3_record decrypted len %d\n", appl_data->plain_data.data_len);
-  ssl_print_text_data("decrypted app data fragment", appl_data->plain_data.data, appl_data->plain_data.data_len);
-
-  /* create a new TVB structure for desegmented data */
-  next_tvb = tvb_new_child_real_data(tvb, appl_data->plain_data.data, appl_data->plain_data.data_len, appl_data->plain_data.data_len);
-
-  /* add desegmented data to the data source list */
-  add_new_data_source(pinfo, next_tvb, "Decrypted SSL data");
-
-  /* Can we desegment this segment? */
-  if (ssl_desegment_app_data) {
-    /* Yes. */
-    pinfo->can_desegment = 2;
-    desegment_ssl(next_tvb, pinfo, 0, appl_data->seq, appl_data->nxtseq, association, proto_tree_get_root(tree), tree, appl_data->flow);
-  } else if (association && association->handle) {
-    /* No - just call the subdissector.
-       Mark this as fragmented, so if somebody throws an exception,
-       we don't report it as a malformed frame. */
-    pinfo->can_desegment = 0;
-    save_fragmented = pinfo->fragmented;
-    pinfo->fragmented = TRUE;
-
-    process_ssl_payload(next_tvb, 0, pinfo, tree, association);
-    pinfo->fragmented = save_fragmented;
-  }
-
-  /* restore desegmentation ability */
-  pinfo->can_desegment = save_can_desegment;
+    gboolean save_fragmented;
+    guint16 save_can_desegment;
+    SslDataInfo *appl_data;
+    tvbuff_t *next_tvb;
+
+    /* Preserve current desegmentation ability to prevent the subdissector
+     * from messing up the ssl desegmentation */
+    save_can_desegment = pinfo->can_desegment;
+
+    /* show decrypted data info, if available */
+    appl_data = ssl_get_data_info(proto_ssl, pinfo, TVB_RAW_OFFSET(tvb)+offset);
+    if (!appl_data || !appl_data->plain_data.data_len) return;
+
+    /* try to dissect decrypted data*/
+    ssl_debug_printf("dissect_ssl3_record decrypted len %d\n", appl_data->plain_data.data_len);
+    ssl_print_text_data("decrypted app data fragment", appl_data->plain_data.data, appl_data->plain_data.data_len);
+
+    /* create a new TVB structure for desegmented data */
+    next_tvb = tvb_new_child_real_data(tvb, appl_data->plain_data.data, appl_data->plain_data.data_len, appl_data->plain_data.data_len);
+
+    /* add desegmented data to the data source list */
+    add_new_data_source(pinfo, next_tvb, "Decrypted SSL data");
+
+    /* Can we desegment this segment? */
+    if (ssl_desegment_app_data) {
+        /* Yes. */
+        pinfo->can_desegment = 2;
+        desegment_ssl(next_tvb, pinfo, 0, appl_data->seq, appl_data->nxtseq, association, proto_tree_get_root(tree), tree, appl_data->flow);
+    } else if (association && association->handle) {
+        /* No - just call the subdissector.
+           Mark this as fragmented, so if somebody throws an exception,
+           we don't report it as a malformed frame. */
+        pinfo->can_desegment = 0;
+        save_fragmented = pinfo->fragmented;
+        pinfo->fragmented = TRUE;
+
+        process_ssl_payload(next_tvb, 0, pinfo, tree, association);
+        pinfo->fragmented = save_fragmented;
+    }
+
+    /* restore desegmentation ability */
+    pinfo->can_desegment = save_can_desegment;
 }
 
 
@@ -1843,7 +1843,7 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo,
                         char input[2];
 
                         if (!ssl_psk || (ssl_psk[0] == 0)) {
-                               ssl_debug_printf("dissect_ssl3_handshake can't find pre-shared-key\n");
+                            ssl_debug_printf("dissect_ssl3_handshake can't find pre-shared-key\n");
                             break;
                         }
 
@@ -1906,7 +1906,7 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo,
                         /* get encrypted data, on tls1 we have to skip two bytes
                          * (it's the encrypted len and should be equal to record len - 2)
                          * in case of rsa1024 that would be 128 + 2 = 130; for psk not neccessary
-                                                */
+                         */
                         if (ssl->version == SSL_VER_TLS||ssl->version == SSL_VER_TLSv1DOT1||ssl->version == SSL_VER_TLSv1DOT2)
                         {
                             encrlen  = tvb_get_ntohs(tvb, offset);
@@ -1929,7 +1929,7 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo,
 
                         /* go with ssl key processessing; encrypted_pre_master
                          * will be used for master secret store
-                                                */
+                         */
                         ret = ssl_decrypt_pre_master_secret(ssl, &encrypted_pre_master, ssl->private_key);
                         if (ret < 0) {
                             ssl_debug_printf("dissect_ssl3_handshake can't decrypt pre master secret\n");
@@ -2082,20 +2082,20 @@ dissect_ssl3_hnd_hello_ext(tvbuff_t *tvb,
         offset += 2;
 
         switch (ext_type) {
-            case SSL_HND_HELLO_EXT_ELLIPTIC_CURVES:
-                offset = dissect_ssl3_hnd_hello_ext_elliptic_curves(tvb, ext_tree, offset);
-                break;
-            case SSL_HND_HELLO_EXT_EC_POINT_FORMATS:
-                offset = dissect_ssl3_hnd_hello_ext_ec_point_formats(tvb, ext_tree, offset);
-                break;
-            default:
-                proto_tree_add_bytes_format(ext_tree, hf_ssl_handshake_extension_data,
-                    tvb, offset, ext_len,
-                    tvb_get_ptr(tvb, offset, ext_len),
-                    "Data (%u byte%s)",
-                    ext_len, plurality(ext_len, "", "s"));
-                offset += ext_len;
-                break;
+        case SSL_HND_HELLO_EXT_ELLIPTIC_CURVES:
+            offset = dissect_ssl3_hnd_hello_ext_elliptic_curves(tvb, ext_tree, offset);
+            break;
+        case SSL_HND_HELLO_EXT_EC_POINT_FORMATS:
+            offset = dissect_ssl3_hnd_hello_ext_ec_point_formats(tvb, ext_tree, offset);
+            break;
+        default:
+            proto_tree_add_bytes_format(ext_tree, hf_ssl_handshake_extension_data,
+                                        tvb, offset, ext_len,
+                                        tvb_get_ptr(tvb, offset, ext_len),
+                                        "Data (%u byte%s)",
+                                        ext_len, plurality(ext_len, "", "s"));
+            offset += ext_len;
+            break;
         }
 
         left -= 2 + 2 + ext_len;
@@ -2119,11 +2119,11 @@ dissect_ssl3_hnd_hello_ext_elliptic_curves(tvbuff_t *tvb,
     offset += 2;
     tvb_ensure_bytes_exist(tvb, offset, curves_length);
     ti = proto_tree_add_none_format(tree,
-                                            hf_ssl_handshake_extension_elliptic_curves,
-                                            tvb, offset, curves_length,
-                                            "Elliptic curves (%d curve%s)",
-                                            curves_length / 2,
-                                            plurality(curves_length/2, "", "s"));
+                                    hf_ssl_handshake_extension_elliptic_curves,
+                                    tvb, offset, curves_length,
+                                    "Elliptic curves (%d curve%s)",
+                                    curves_length / 2,
+                                    plurality(curves_length/2, "", "s"));
 
     /* make this a subtree */
     curves_tree = proto_item_add_subtree(ti, ett_ssl_extension_curves);
@@ -2154,10 +2154,10 @@ dissect_ssl3_hnd_hello_ext_ec_point_formats(tvbuff_t *tvb,
     offset += 1;
     tvb_ensure_bytes_exist(tvb, offset, ecpf_length);
     ti = proto_tree_add_none_format(tree,
-                                            hf_ssl_handshake_extension_elliptic_curves,
-                                            tvb, offset, ecpf_length,
-                                            "Elliptic curves point formats (%d)",
-                                            ecpf_length);
+                                    hf_ssl_handshake_extension_elliptic_curves,
+                                    tvb, offset, ecpf_length,
+                                    "Elliptic curves point formats (%d)",
+                                    ecpf_length);
 
     /* make this a subtree */
     ecpf_tree = proto_item_add_subtree(ti, ett_ssl_extension_curves_point_formats);
@@ -2284,15 +2284,15 @@ dissect_ssl3_hnd_cli_hello(tvbuff_t *tvb, packet_info *pinfo,
                 compression_method = tvb_get_guint8(tvb, offset);
                 if (compression_method < 64)
                     proto_tree_add_uint(cs_tree, hf_ssl_handshake_comp_method,
-                                    tvb, offset, 1, compression_method);
+                                        tvb, offset, 1, compression_method);
                 else if (compression_method > 63 && compression_method < 193)
                     proto_tree_add_text(cs_tree, tvb, offset, 1,
-                      "Compression Method: Reserved - to be assigned by IANA (%u)",
-                      compression_method);
+                                        "Compression Method: Reserved - to be assigned by IANA (%u)",
+                                        compression_method);
                 else
                     proto_tree_add_text(cs_tree, tvb, offset, 1,
-                       "Compression Method: Private use range (%u)",
-                       compression_method);
+                                        "Compression Method: Private use range (%u)",
+                                        compression_method);
                 offset++;
                 compression_methods_length--;
             }
@@ -2301,8 +2301,7 @@ dissect_ssl3_hnd_cli_hello(tvbuff_t *tvb, packet_info *pinfo,
         if (length > offset - start_offset)
         {
             dissect_ssl3_hnd_hello_ext(tvb, tree, offset,
-                length -
-                (offset - start_offset));
+                                       length - (offset - start_offset));
         }
     }
 }
@@ -2327,8 +2326,8 @@ dissect_ssl3_hnd_srv_hello(tvbuff_t *tvb,
     {
         /* show the server version */
         if (tree)
-                proto_tree_add_item(tree, hf_ssl_handshake_server_version, tvb,
-                            offset, 2, FALSE);
+            proto_tree_add_item(tree, hf_ssl_handshake_server_version, tvb,
+                                offset, 2, FALSE);
         offset += 2;
 
         /* first display the elements conveniently in
@@ -2361,7 +2360,7 @@ no_cipher:
 
         /* now the server-selected cipher suite */
         proto_tree_add_item(tree, hf_ssl_handshake_cipher_suite,
-                    tvb, offset, 2, FALSE);
+                            tvb, offset, 2, FALSE);
         offset += 2;
 
         if (ssl) {
@@ -2376,8 +2375,7 @@ no_cipher:
         if (length > offset - start_offset)
         {
             dissect_ssl3_hnd_hello_ext(tvb, tree, offset,
-                length -
-                (offset - start_offset));
+                                       length - (offset - start_offset));
         }
     }
 }
@@ -2414,8 +2412,7 @@ dissect_ssl3_hnd_cert(tvbuff_t *tvb,
                                             tvb, offset, certificate_list_length,
                                             "Certificates (%u byte%s)",
                                             certificate_list_length,
-                                            plurality(certificate_list_length,
-                                              "", "s"));
+                                            plurality(certificate_list_length, "", "s"));
 
             /* make it a subtree */
             subtree = proto_item_add_subtree(ti, ett_ssl_certs);
@@ -2785,16 +2782,16 @@ dissect_ssl2_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
          * record layer version 0x0002
          */
         ti = proto_tree_add_uint(ssl_record_tree,
-                 hf_ssl_record_version, tvb,
-                 initial_offset, 0, 0x0002);
+                                 hf_ssl_record_version, tvb,
+                                 initial_offset, 0, 0x0002);
         PROTO_ITEM_SET_GENERATED(ti);
 
         /* add the record length */
         tvb_ensure_bytes_exist(tvb, offset, record_length_length);
         proto_tree_add_uint (ssl_record_tree,
-                                  hf_ssl_record_length, tvb,
-                                  initial_offset, record_length_length,
-                                  record_length);
+                             hf_ssl_record_length, tvb,
+                             initial_offset, record_length_length,
+                             record_length);
     }
     if (ssl_record_tree && is_escape != -1)
     {
@@ -2941,12 +2938,12 @@ dissect_ssl2_hnd_client_hello(tvbuff_t *tvb, packet_info *pinfo,
             proto_tree_add_item(tree, hf_ssl2_handshake_session_id_len,
                             tvb, offset, 2, FALSE);
         if (session_id_length > SSLV2_MAX_SESSION_ID_LENGTH_IN_BYTES) {
-                proto_tree_add_text(tree, tvb, offset, 2,
-                    "Invalid session ID length: %d", session_id_length);
-                expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR,
-                    "Session ID length (%u) must be less than %u.",
-                    session_id_length, SSLV2_MAX_SESSION_ID_LENGTH_IN_BYTES);
-                return;
+            proto_tree_add_text(tree, tvb, offset, 2,
+                                "Invalid session ID length: %d", session_id_length);
+            expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR,
+                                   "Session ID length (%u) must be less than %u.",
+                                   session_id_length, SSLV2_MAX_SESSION_ID_LENGTH_IN_BYTES);
+            return;
         }
         offset += 2;
 
@@ -2961,9 +2958,9 @@ dissect_ssl2_hnd_client_hello(tvbuff_t *tvb, packet_info *pinfo,
             /* tell the user how many cipher specs they've won */
             tvb_ensure_bytes_exist(tvb, offset, cipher_spec_length);
             ti = proto_tree_add_none_format(tree, hf_ssl_handshake_cipher_suites,
-                                        tvb, offset, cipher_spec_length,
-                                        "Cipher Specs (%u specs)",
-                                        cipher_spec_length/3);
+                                            tvb, offset, cipher_spec_length,
+                                            "Cipher Specs (%u specs)",
+                                            cipher_spec_length/3);
 
             /* make this a subtree and expand the actual specs below */
             cs_tree = proto_item_add_subtree(ti, ett_ssl_cipher_suites);
@@ -2990,12 +2987,12 @@ dissect_ssl2_hnd_client_hello(tvbuff_t *tvb, packet_info *pinfo,
             {
                 tvb_ensure_bytes_exist(tvb, offset, session_id_length);
                 proto_tree_add_bytes_format(tree,
-                                             hf_ssl_handshake_session_id,
-                                             tvb, offset, session_id_length,
-                                             tvb_get_ptr(tvb, offset, session_id_length),
-                                             "Session ID (%u byte%s)",
-                                             session_id_length,
-                                             plurality(session_id_length, "", "s"));
+                                            hf_ssl_handshake_session_id,
+                                            tvb, offset, session_id_length,
+                                            tvb_get_ptr(tvb, offset, session_id_length),
+                                            "Session ID (%u byte%s)",
+                                            session_id_length,
+                                            plurality(session_id_length, "", "s"));
             }
 
             /* PAOLO: get session id and reset session state for key [re]negotiation */
@@ -3024,8 +3021,7 @@ dissect_ssl2_hnd_client_hello(tvbuff_t *tvb, packet_info *pinfo,
                 gint max;
                 max = challenge_length > 32? 32: challenge_length;
 
-                ssl_debug_printf("client random len: %d padded to 32\n",
-                    challenge_length);
+                ssl_debug_printf("client random len: %d padded to 32\n", challenge_length);
 
                 /* client random is padded with zero and 'right' aligned */
                 memset(ssl->client_random.data, 0, 32 - max);
@@ -3040,340 +3036,340 @@ dissect_ssl2_hnd_client_hello(tvbuff_t *tvb, packet_info *pinfo,
 
 static void
 dissect_pct_msg_client_hello(tvbuff_t *tvb,
-                                                       proto_tree *tree, guint32 offset)
+                             proto_tree *tree, guint32 offset)
 {
-       guint16 CH_CLIENT_VERSION, CH_OFFSET, CH_CIPHER_SPECS_LENGTH, CH_HASH_SPECS_LENGTH, CH_CERT_SPECS_LENGTH, CH_EXCH_SPECS_LENGTH, CH_KEY_ARG_LENGTH;
-       proto_item *CH_CIPHER_SPECS_ti, *CH_HASH_SPECS_ti, *CH_CERT_SPECS_ti, *CH_EXCH_SPECS_ti;
-       proto_tree *CH_CIPHER_SPECS_tree, *CH_HASH_SPECS_tree, *CH_CERT_SPECS_tree, *CH_EXCH_SPECS_tree;
-       gint i;
-
-       CH_CLIENT_VERSION = tvb_get_ntohs(tvb, offset);
-       if(CH_CLIENT_VERSION != PCT_VERSION_1)
-               proto_tree_add_text(tree, tvb, offset, 2, "Client Version, should be %x in PCT version 1", PCT_VERSION_1);
-       else
-               proto_tree_add_text(tree, tvb, offset, 2, "Client Version (%x)", PCT_VERSION_1);
-       offset += 2;
-
-       proto_tree_add_text(tree, tvb, offset, 1, "PAD");
-       offset += 1;
-
-       proto_tree_add_text(tree, tvb, offset, 32, "Client Session ID Data (32 bytes)");
-       offset += 32;
-
-       proto_tree_add_text(tree, tvb, offset, 32, "Challenge Data(32 bytes)");
-       offset += 32;
-
-       CH_OFFSET = tvb_get_ntohs(tvb, offset);
-       if(CH_OFFSET != PCT_CH_OFFSET_V1)
-               proto_tree_add_text(tree, tvb, offset, 2, "CH_OFFSET: %d, should be %d in PCT version 1", CH_OFFSET, PCT_CH_OFFSET_V1);
-       else
-               proto_tree_add_text(tree, tvb, offset, 2, "CH_OFFSET: %d", CH_OFFSET);
-       offset += 2;
-
-       CH_CIPHER_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "CIPHER_SPECS Length: %d", CH_CIPHER_SPECS_LENGTH);
-       offset += 2;
-
-       CH_HASH_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "HASH_SPECS Length: %d", CH_HASH_SPECS_LENGTH);
-       offset += 2;
-
-       CH_CERT_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "CERT_SPECS Length: %d", CH_CERT_SPECS_LENGTH);
-       offset += 2;
-
-       CH_EXCH_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "EXCH_SPECS Length: %d", CH_EXCH_SPECS_LENGTH);
-       offset += 2;
-
-       CH_KEY_ARG_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "IV Length: %d", CH_KEY_ARG_LENGTH);
-       offset += 2;
-
-       if(CH_CIPHER_SPECS_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CH_CIPHER_SPECS_LENGTH);
-               CH_CIPHER_SPECS_ti = proto_tree_add_item(tree, hf_pct_handshake_cipher_spec, tvb, offset, CH_CIPHER_SPECS_LENGTH, FALSE);
-               CH_CIPHER_SPECS_tree = proto_item_add_subtree(CH_CIPHER_SPECS_ti, ett_pct_cipher_suites);
-
-               for(i=0; i<(CH_CIPHER_SPECS_LENGTH/4); i++) {
-                       proto_tree_add_item(CH_CIPHER_SPECS_tree, hf_pct_handshake_cipher, tvb, offset, 2, FALSE);
-                       offset += 2;
-                       proto_tree_add_text(CH_CIPHER_SPECS_tree, tvb, offset, 1, "Encryption key length: %d", tvb_get_guint8(tvb, offset));
-                       offset += 1;
-                       proto_tree_add_text(CH_CIPHER_SPECS_tree, tvb, offset, 1, "MAC key length in bits: %d", tvb_get_guint8(tvb, offset) + 64);
-                       offset += 1;
-               }
-       }
-
-       if(CH_HASH_SPECS_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CH_HASH_SPECS_LENGTH);
-               CH_HASH_SPECS_ti = proto_tree_add_item(tree, hf_pct_handshake_hash_spec, tvb, offset, CH_HASH_SPECS_LENGTH, FALSE);
-               CH_HASH_SPECS_tree = proto_item_add_subtree(CH_HASH_SPECS_ti, ett_pct_hash_suites);
-
-               for(i=0; i<(CH_HASH_SPECS_LENGTH/2); i++) {
-                       proto_tree_add_item(CH_HASH_SPECS_tree, hf_pct_handshake_hash, tvb, offset, 2, FALSE);
-                       offset += 2;
-               }
-       }
-
-       if(CH_CERT_SPECS_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CH_CERT_SPECS_LENGTH);
-               CH_CERT_SPECS_ti = proto_tree_add_item(tree, hf_pct_handshake_cert_spec, tvb, offset, CH_CERT_SPECS_LENGTH, FALSE);
-               CH_CERT_SPECS_tree = proto_item_add_subtree(CH_CERT_SPECS_ti, ett_pct_cert_suites);
-
-               for(i=0; i< (CH_CERT_SPECS_LENGTH/2); i++) {
-                       proto_tree_add_item(CH_CERT_SPECS_tree, hf_pct_handshake_cert, tvb, offset, 2, FALSE);
-                       offset += 2;
-               }
-       }
-
-       if(CH_EXCH_SPECS_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CH_EXCH_SPECS_LENGTH);
-               CH_EXCH_SPECS_ti = proto_tree_add_item(tree, hf_pct_handshake_exch_spec, tvb, offset, CH_EXCH_SPECS_LENGTH, FALSE);
-               CH_EXCH_SPECS_tree = proto_item_add_subtree(CH_EXCH_SPECS_ti, ett_pct_exch_suites);
-
-               for(i=0; i<(CH_EXCH_SPECS_LENGTH/2); i++) {
-                       proto_tree_add_item(CH_EXCH_SPECS_tree, hf_pct_handshake_exch, tvb, offset, 2, FALSE);
-                       offset += 2;
-               }
-       }
-
-       if(CH_KEY_ARG_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CH_KEY_ARG_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, CH_KEY_ARG_LENGTH, "IV data (%d bytes)", CH_KEY_ARG_LENGTH);
-       }
+    guint16 CH_CLIENT_VERSION, CH_OFFSET, CH_CIPHER_SPECS_LENGTH, CH_HASH_SPECS_LENGTH, CH_CERT_SPECS_LENGTH, CH_EXCH_SPECS_LENGTH, CH_KEY_ARG_LENGTH;
+    proto_item *CH_CIPHER_SPECS_ti, *CH_HASH_SPECS_ti, *CH_CERT_SPECS_ti, *CH_EXCH_SPECS_ti;
+    proto_tree *CH_CIPHER_SPECS_tree, *CH_HASH_SPECS_tree, *CH_CERT_SPECS_tree, *CH_EXCH_SPECS_tree;
+    gint i;
+
+    CH_CLIENT_VERSION = tvb_get_ntohs(tvb, offset);
+    if(CH_CLIENT_VERSION != PCT_VERSION_1)
+        proto_tree_add_text(tree, tvb, offset, 2, "Client Version, should be %x in PCT version 1", PCT_VERSION_1);
+    else
+        proto_tree_add_text(tree, tvb, offset, 2, "Client Version (%x)", PCT_VERSION_1);
+    offset += 2;
+
+    proto_tree_add_text(tree, tvb, offset, 1, "PAD");
+    offset += 1;
+
+    proto_tree_add_text(tree, tvb, offset, 32, "Client Session ID Data (32 bytes)");
+    offset += 32;
+
+    proto_tree_add_text(tree, tvb, offset, 32, "Challenge Data(32 bytes)");
+    offset += 32;
+
+    CH_OFFSET = tvb_get_ntohs(tvb, offset);
+    if(CH_OFFSET != PCT_CH_OFFSET_V1)
+        proto_tree_add_text(tree, tvb, offset, 2, "CH_OFFSET: %d, should be %d in PCT version 1", CH_OFFSET, PCT_CH_OFFSET_V1);
+    else
+        proto_tree_add_text(tree, tvb, offset, 2, "CH_OFFSET: %d", CH_OFFSET);
+    offset += 2;
+
+    CH_CIPHER_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "CIPHER_SPECS Length: %d", CH_CIPHER_SPECS_LENGTH);
+    offset += 2;
+
+    CH_HASH_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "HASH_SPECS Length: %d", CH_HASH_SPECS_LENGTH);
+    offset += 2;
+
+    CH_CERT_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "CERT_SPECS Length: %d", CH_CERT_SPECS_LENGTH);
+    offset += 2;
+
+    CH_EXCH_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "EXCH_SPECS Length: %d", CH_EXCH_SPECS_LENGTH);
+    offset += 2;
+
+    CH_KEY_ARG_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "IV Length: %d", CH_KEY_ARG_LENGTH);
+    offset += 2;
+
+    if(CH_CIPHER_SPECS_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CH_CIPHER_SPECS_LENGTH);
+        CH_CIPHER_SPECS_ti = proto_tree_add_item(tree, hf_pct_handshake_cipher_spec, tvb, offset, CH_CIPHER_SPECS_LENGTH, FALSE);
+        CH_CIPHER_SPECS_tree = proto_item_add_subtree(CH_CIPHER_SPECS_ti, ett_pct_cipher_suites);
+
+        for(i=0; i<(CH_CIPHER_SPECS_LENGTH/4); i++) {
+            proto_tree_add_item(CH_CIPHER_SPECS_tree, hf_pct_handshake_cipher, tvb, offset, 2, FALSE);
+            offset += 2;
+            proto_tree_add_text(CH_CIPHER_SPECS_tree, tvb, offset, 1, "Encryption key length: %d", tvb_get_guint8(tvb, offset));
+            offset += 1;
+            proto_tree_add_text(CH_CIPHER_SPECS_tree, tvb, offset, 1, "MAC key length in bits: %d", tvb_get_guint8(tvb, offset) + 64);
+            offset += 1;
+        }
+    }
+
+    if(CH_HASH_SPECS_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CH_HASH_SPECS_LENGTH);
+        CH_HASH_SPECS_ti = proto_tree_add_item(tree, hf_pct_handshake_hash_spec, tvb, offset, CH_HASH_SPECS_LENGTH, FALSE);
+        CH_HASH_SPECS_tree = proto_item_add_subtree(CH_HASH_SPECS_ti, ett_pct_hash_suites);
+
+        for(i=0; i<(CH_HASH_SPECS_LENGTH/2); i++) {
+            proto_tree_add_item(CH_HASH_SPECS_tree, hf_pct_handshake_hash, tvb, offset, 2, FALSE);
+            offset += 2;
+        }
+    }
+
+    if(CH_CERT_SPECS_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CH_CERT_SPECS_LENGTH);
+        CH_CERT_SPECS_ti = proto_tree_add_item(tree, hf_pct_handshake_cert_spec, tvb, offset, CH_CERT_SPECS_LENGTH, FALSE);
+        CH_CERT_SPECS_tree = proto_item_add_subtree(CH_CERT_SPECS_ti, ett_pct_cert_suites);
+
+        for(i=0; i< (CH_CERT_SPECS_LENGTH/2); i++) {
+            proto_tree_add_item(CH_CERT_SPECS_tree, hf_pct_handshake_cert, tvb, offset, 2, FALSE);
+            offset += 2;
+        }
+    }
+
+    if(CH_EXCH_SPECS_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CH_EXCH_SPECS_LENGTH);
+        CH_EXCH_SPECS_ti = proto_tree_add_item(tree, hf_pct_handshake_exch_spec, tvb, offset, CH_EXCH_SPECS_LENGTH, FALSE);
+        CH_EXCH_SPECS_tree = proto_item_add_subtree(CH_EXCH_SPECS_ti, ett_pct_exch_suites);
+
+        for(i=0; i<(CH_EXCH_SPECS_LENGTH/2); i++) {
+            proto_tree_add_item(CH_EXCH_SPECS_tree, hf_pct_handshake_exch, tvb, offset, 2, FALSE);
+            offset += 2;
+        }
+    }
+
+    if(CH_KEY_ARG_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CH_KEY_ARG_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, CH_KEY_ARG_LENGTH, "IV data (%d bytes)", CH_KEY_ARG_LENGTH);
+    }
 }
 
 static void
 dissect_pct_msg_server_hello(tvbuff_t *tvb, proto_tree *tree, guint32 offset, packet_info *pinfo)
 {
 /* structure:
-char SH_MSG_SERVER_HELLO
-char SH_PAD
-char SH_SERVER_VERSION_MSB
-char SH_SERVER_VERSION_LSB
-char SH_RESTART_SESSION_OK
-char SH_CLIENT_AUTH_REQ
-char SH_CIPHER_SPECS_DATA[4]
-char SH_HASH_SPECS_DATA[2]
-char SH_CERT_SPECS_DATA[2]
-char SH_EXCH_SPECS_DATA[2]
-char SH_CONNECTION_ID_DATA[32]
-char SH_CERTIFICATE_LENGTH_MSB
-char SH_CERTIFICATE_LENGTH_LSB
-char SH_CLIENT_CERT_SPECS_LENGTH_MSB
-char SH_CLIENT_CERT_SPECS_LENGTH_LSB
-char SH_CLIENT_SIG_SPECS_LENGTH_MSB
-char SH_CLIENT_SIG_SPECS_LENGTH_LSB
-char SH_RESPONSE_LENGTH_MSB
-char SH_RESPONSE_LENGTH_LSB
-char SH_CERTIFICATE_DATA[MSB<<8|LSB]
-char SH_CLIENT_CERT_SPECS_DATA[MSB<<8|LSB]
-char SH_CLIENT_SIG_SPECS_DATA[MSB<<8|LSB]
-char SH_RESPONSE_DATA[MSB<<8|LSB]
+   char SH_MSG_SERVER_HELLO
+   char SH_PAD
+   char SH_SERVER_VERSION_MSB
+   char SH_SERVER_VERSION_LSB
+   char SH_RESTART_SESSION_OK
+   char SH_CLIENT_AUTH_REQ
+   char SH_CIPHER_SPECS_DATA[4]
+   char SH_HASH_SPECS_DATA[2]
+   char SH_CERT_SPECS_DATA[2]
+   char SH_EXCH_SPECS_DATA[2]
+   char SH_CONNECTION_ID_DATA[32]
+   char SH_CERTIFICATE_LENGTH_MSB
+   char SH_CERTIFICATE_LENGTH_LSB
+   char SH_CLIENT_CERT_SPECS_LENGTH_MSB
+   char SH_CLIENT_CERT_SPECS_LENGTH_LSB
+   char SH_CLIENT_SIG_SPECS_LENGTH_MSB
+   char SH_CLIENT_SIG_SPECS_LENGTH_LSB
+   char SH_RESPONSE_LENGTH_MSB
+   char SH_RESPONSE_LENGTH_LSB
+   char SH_CERTIFICATE_DATA[MSB<<8|LSB]
+   char SH_CLIENT_CERT_SPECS_DATA[MSB<<8|LSB]
+   char SH_CLIENT_SIG_SPECS_DATA[MSB<<8|LSB]
+   char SH_RESPONSE_DATA[MSB<<8|LSB]
 
 */
 
-       guint16 SH_SERVER_VERSION, SH_CERT_LENGTH, SH_CERT_SPECS_LENGTH, SH_CLIENT_SIG_LENGTH, SH_RESPONSE_LENGTH;
-       asn1_ctx_t asn1_ctx;
-       asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
+    guint16 SH_SERVER_VERSION, SH_CERT_LENGTH, SH_CERT_SPECS_LENGTH, SH_CLIENT_SIG_LENGTH, SH_RESPONSE_LENGTH;
+    asn1_ctx_t asn1_ctx;
+    asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
 
-       proto_tree_add_text(tree, tvb, offset, 1, "PAD");
-       offset += 1;
+    proto_tree_add_text(tree, tvb, offset, 1, "PAD");
+    offset += 1;
 
-       SH_SERVER_VERSION = tvb_get_ntohs(tvb, offset);
-       if(SH_SERVER_VERSION != PCT_VERSION_1)
-               proto_tree_add_text(tree, tvb, offset, 2, "Server Version, should be %x in PCT version 1", PCT_VERSION_1);
-       else
-               proto_tree_add_text(tree, tvb, offset, 2, "Server Version (%x)", PCT_VERSION_1);
-       offset += 2;
+    SH_SERVER_VERSION = tvb_get_ntohs(tvb, offset);
+    if(SH_SERVER_VERSION != PCT_VERSION_1)
+        proto_tree_add_text(tree, tvb, offset, 2, "Server Version, should be %x in PCT version 1", PCT_VERSION_1);
+    else
+        proto_tree_add_text(tree, tvb, offset, 2, "Server Version (%x)", PCT_VERSION_1);
+    offset += 2;
 
-       proto_tree_add_text(tree, tvb, offset, 1, "SH_RESTART_SESSION_OK flag");
-       offset += 1;
+    proto_tree_add_text(tree, tvb, offset, 1, "SH_RESTART_SESSION_OK flag");
+    offset += 1;
 
-       proto_tree_add_text(tree, tvb, offset, 1, "SH_CLIENT_AUTH_REQ flag");
-       offset += 1;
+    proto_tree_add_text(tree, tvb, offset, 1, "SH_CLIENT_AUTH_REQ flag");
+    offset += 1;
 
-       proto_tree_add_item(tree, hf_pct_handshake_cipher, tvb, offset, 2, FALSE);
-       offset += 2;
-       proto_tree_add_text(tree, tvb, offset, 1, "Encryption key length: %d", tvb_get_guint8(tvb, offset));
-       offset += 1;
-       proto_tree_add_text(tree, tvb, offset, 1, "MAC key length in bits: %d", tvb_get_guint8(tvb, offset) + 64);
-       offset += 1;
+    proto_tree_add_item(tree, hf_pct_handshake_cipher, tvb, offset, 2, FALSE);
+    offset += 2;
+    proto_tree_add_text(tree, tvb, offset, 1, "Encryption key length: %d", tvb_get_guint8(tvb, offset));
+    offset += 1;
+    proto_tree_add_text(tree, tvb, offset, 1, "MAC key length in bits: %d", tvb_get_guint8(tvb, offset) + 64);
+    offset += 1;
 
-       proto_tree_add_item(tree, hf_pct_handshake_hash, tvb, offset, 2, FALSE);
-       offset += 2;
+    proto_tree_add_item(tree, hf_pct_handshake_hash, tvb, offset, 2, FALSE);
+    offset += 2;
 
-       proto_tree_add_item(tree, hf_pct_handshake_cert, tvb, offset, 2, FALSE);
-       offset += 2;
+    proto_tree_add_item(tree, hf_pct_handshake_cert, tvb, offset, 2, FALSE);
+    offset += 2;
 
-       proto_tree_add_item(tree, hf_pct_handshake_exch, tvb, offset, 2, FALSE);
-       offset += 2;
+    proto_tree_add_item(tree, hf_pct_handshake_exch, tvb, offset, 2, FALSE);
+    offset += 2;
 
-       proto_tree_add_text(tree, tvb, offset, 32, "Connection ID Data (32 bytes)");
-       offset += 32;
+    proto_tree_add_text(tree, tvb, offset, 32, "Connection ID Data (32 bytes)");
+    offset += 32;
 
-       SH_CERT_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Server Certificate Length: %d", SH_CERT_LENGTH);
-       offset += 2;
+    SH_CERT_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Server Certificate Length: %d", SH_CERT_LENGTH);
+    offset += 2;
 
-       SH_CERT_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Client CERT_SPECS Length: %d", SH_CERT_SPECS_LENGTH);
-       offset += 2;
+    SH_CERT_SPECS_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Client CERT_SPECS Length: %d", SH_CERT_SPECS_LENGTH);
+    offset += 2;
 
-       SH_CLIENT_SIG_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Client SIG_SPECS Length: %d", SH_CLIENT_SIG_LENGTH);
-       offset += 2;
+    SH_CLIENT_SIG_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Client SIG_SPECS Length: %d", SH_CLIENT_SIG_LENGTH);
+    offset += 2;
 
-       SH_RESPONSE_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Response Length: %d", SH_RESPONSE_LENGTH);
-       offset += 2;
+    SH_RESPONSE_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Response Length: %d", SH_RESPONSE_LENGTH);
+    offset += 2;
 
-       if(SH_CERT_LENGTH) {
-               dissect_x509af_Certificate(FALSE, tvb, offset, &asn1_ctx, tree, hf_pct_handshake_server_cert);
-               offset += SH_CERT_LENGTH;
-       }
+    if(SH_CERT_LENGTH) {
+        dissect_x509af_Certificate(FALSE, tvb, offset, &asn1_ctx, tree, hf_pct_handshake_server_cert);
+        offset += SH_CERT_LENGTH;
+    }
 
-       if(SH_CERT_SPECS_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, SH_CERT_SPECS_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, SH_CERT_SPECS_LENGTH, "Client CERT_SPECS (%d bytes)", SH_CERT_SPECS_LENGTH);
-               offset += SH_CERT_SPECS_LENGTH;
-       }
+    if(SH_CERT_SPECS_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, SH_CERT_SPECS_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, SH_CERT_SPECS_LENGTH, "Client CERT_SPECS (%d bytes)", SH_CERT_SPECS_LENGTH);
+        offset += SH_CERT_SPECS_LENGTH;
+    }
 
-       if(SH_CLIENT_SIG_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, SH_CLIENT_SIG_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, SH_CLIENT_SIG_LENGTH, "Client Signature (%d bytes)", SH_CLIENT_SIG_LENGTH);
-               offset += SH_CLIENT_SIG_LENGTH;
-       }
+    if(SH_CLIENT_SIG_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, SH_CLIENT_SIG_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, SH_CLIENT_SIG_LENGTH, "Client Signature (%d bytes)", SH_CLIENT_SIG_LENGTH);
+        offset += SH_CLIENT_SIG_LENGTH;
+    }
 
-       if(SH_RESPONSE_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, SH_RESPONSE_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, SH_RESPONSE_LENGTH, "Server Response (%d bytes)", SH_RESPONSE_LENGTH);
-       }
+    if(SH_RESPONSE_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, SH_RESPONSE_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, SH_RESPONSE_LENGTH, "Server Response (%d bytes)", SH_RESPONSE_LENGTH);
+    }
 
 }
 
 static void
 dissect_pct_msg_client_master_key(tvbuff_t *tvb, proto_tree *tree, guint32 offset)
 {
-       guint16 CMK_CLEAR_KEY_LENGTH, CMK_ENCRYPTED_KEY_LENGTH, CMK_KEY_ARG_LENGTH, CMK_VERIFY_PRELUDE, CMK_CLIENT_CERT_LENGTH, CMK_RESPONSE_LENGTH;
-
-       proto_tree_add_text(tree, tvb, offset, 1, "PAD");
-       offset += 1;
-
-       proto_tree_add_item(tree, hf_pct_handshake_cert, tvb, offset, 2, FALSE);
-       offset += 2;
-
-       proto_tree_add_item(tree, hf_pct_handshake_sig, tvb, offset, 2, FALSE);
-       offset += 2;
-
-       CMK_CLEAR_KEY_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Clear Key Length: %d",CMK_CLEAR_KEY_LENGTH);
-       offset += 2;
-
-       CMK_ENCRYPTED_KEY_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Encrypted Key Length: %d",CMK_ENCRYPTED_KEY_LENGTH);
-       offset += 2;
-
-       CMK_KEY_ARG_LENGTH= tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "IV Length: %d",CMK_KEY_ARG_LENGTH);
-       offset += 2;
-
-       CMK_VERIFY_PRELUDE = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Verify Prelude Length: %d",CMK_VERIFY_PRELUDE);
-       offset += 2;
-
-       CMK_CLIENT_CERT_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Client Cert Length: %d",CMK_CLIENT_CERT_LENGTH);
-       offset += 2;
-
-       CMK_RESPONSE_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Response Length: %d",CMK_RESPONSE_LENGTH);
-       offset += 2;
-
-       if(CMK_CLEAR_KEY_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CMK_CLEAR_KEY_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, CMK_CLEAR_KEY_LENGTH, "Clear Key data (%d bytes)", CMK_CLEAR_KEY_LENGTH);
-               offset += CMK_CLEAR_KEY_LENGTH;
-       }
-       if(CMK_ENCRYPTED_KEY_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CMK_ENCRYPTED_KEY_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, CMK_ENCRYPTED_KEY_LENGTH, "Encrypted Key data (%d bytes)", CMK_ENCRYPTED_KEY_LENGTH);
-               offset += CMK_ENCRYPTED_KEY_LENGTH;
-       }
-       if(CMK_KEY_ARG_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CMK_KEY_ARG_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, CMK_KEY_ARG_LENGTH, "IV data (%d bytes)", CMK_KEY_ARG_LENGTH);
-               offset += CMK_KEY_ARG_LENGTH;
-       }
-       if(CMK_VERIFY_PRELUDE) {
-                tvb_ensure_bytes_exist(tvb, offset, CMK_VERIFY_PRELUDE);
-               proto_tree_add_text(tree, tvb, offset, CMK_VERIFY_PRELUDE, "Verify Prelude data (%d bytes)", CMK_VERIFY_PRELUDE);
-               offset += CMK_VERIFY_PRELUDE;
-       }
-       if(CMK_CLIENT_CERT_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CMK_CLIENT_CERT_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, CMK_CLIENT_CERT_LENGTH, "Client Certificate data (%d bytes)", CMK_CLIENT_CERT_LENGTH);
-               offset += CMK_CLIENT_CERT_LENGTH;
-       }
-       if(CMK_RESPONSE_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, CMK_RESPONSE_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, CMK_RESPONSE_LENGTH, "Response data (%d bytes)", CMK_RESPONSE_LENGTH);
-       }
+    guint16 CMK_CLEAR_KEY_LENGTH, CMK_ENCRYPTED_KEY_LENGTH, CMK_KEY_ARG_LENGTH, CMK_VERIFY_PRELUDE, CMK_CLIENT_CERT_LENGTH, CMK_RESPONSE_LENGTH;
+
+    proto_tree_add_text(tree, tvb, offset, 1, "PAD");
+    offset += 1;
+
+    proto_tree_add_item(tree, hf_pct_handshake_cert, tvb, offset, 2, FALSE);
+    offset += 2;
+
+    proto_tree_add_item(tree, hf_pct_handshake_sig, tvb, offset, 2, FALSE);
+    offset += 2;
+
+    CMK_CLEAR_KEY_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Clear Key Length: %d",CMK_CLEAR_KEY_LENGTH);
+    offset += 2;
+
+    CMK_ENCRYPTED_KEY_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Encrypted Key Length: %d",CMK_ENCRYPTED_KEY_LENGTH);
+    offset += 2;
+
+    CMK_KEY_ARG_LENGTH= tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "IV Length: %d",CMK_KEY_ARG_LENGTH);
+    offset += 2;
+
+    CMK_VERIFY_PRELUDE = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Verify Prelude Length: %d",CMK_VERIFY_PRELUDE);
+    offset += 2;
+
+    CMK_CLIENT_CERT_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Client Cert Length: %d",CMK_CLIENT_CERT_LENGTH);
+    offset += 2;
+
+    CMK_RESPONSE_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Response Length: %d",CMK_RESPONSE_LENGTH);
+    offset += 2;
+
+    if(CMK_CLEAR_KEY_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CMK_CLEAR_KEY_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, CMK_CLEAR_KEY_LENGTH, "Clear Key data (%d bytes)", CMK_CLEAR_KEY_LENGTH);
+        offset += CMK_CLEAR_KEY_LENGTH;
+    }
+    if(CMK_ENCRYPTED_KEY_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CMK_ENCRYPTED_KEY_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, CMK_ENCRYPTED_KEY_LENGTH, "Encrypted Key data (%d bytes)", CMK_ENCRYPTED_KEY_LENGTH);
+        offset += CMK_ENCRYPTED_KEY_LENGTH;
+    }
+    if(CMK_KEY_ARG_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CMK_KEY_ARG_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, CMK_KEY_ARG_LENGTH, "IV data (%d bytes)", CMK_KEY_ARG_LENGTH);
+        offset += CMK_KEY_ARG_LENGTH;
+    }
+    if(CMK_VERIFY_PRELUDE) {
+        tvb_ensure_bytes_exist(tvb, offset, CMK_VERIFY_PRELUDE);
+        proto_tree_add_text(tree, tvb, offset, CMK_VERIFY_PRELUDE, "Verify Prelude data (%d bytes)", CMK_VERIFY_PRELUDE);
+        offset += CMK_VERIFY_PRELUDE;
+    }
+    if(CMK_CLIENT_CERT_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CMK_CLIENT_CERT_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, CMK_CLIENT_CERT_LENGTH, "Client Certificate data (%d bytes)", CMK_CLIENT_CERT_LENGTH);
+        offset += CMK_CLIENT_CERT_LENGTH;
+    }
+    if(CMK_RESPONSE_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, CMK_RESPONSE_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, CMK_RESPONSE_LENGTH, "Response data (%d bytes)", CMK_RESPONSE_LENGTH);
+    }
 }
 
 static void
 dissect_pct_msg_server_verify(tvbuff_t *tvb,
-                                                       proto_tree *tree, guint32 offset)
+                              proto_tree *tree, guint32 offset)
 {
-       guint16 SV_RESPONSE_LENGTH;
+    guint16 SV_RESPONSE_LENGTH;
 
-       proto_tree_add_text(tree, tvb, offset, 1, "PAD");
-       offset += 1;
+    proto_tree_add_text(tree, tvb, offset, 1, "PAD");
+    offset += 1;
 
-       proto_tree_add_text(tree, tvb, offset, 32, "Server Session ID data (32 bytes)");
-       offset += 32;
+    proto_tree_add_text(tree, tvb, offset, 32, "Server Session ID data (32 bytes)");
+    offset += 32;
 
-       SV_RESPONSE_LENGTH = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Server Response Length: %d", SV_RESPONSE_LENGTH);
-       offset += 2;
+    SV_RESPONSE_LENGTH = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Server Response Length: %d", SV_RESPONSE_LENGTH);
+    offset += 2;
 
-       if(SV_RESPONSE_LENGTH) {
-                tvb_ensure_bytes_exist(tvb, offset, SV_RESPONSE_LENGTH);
-               proto_tree_add_text(tree, tvb, offset, SV_RESPONSE_LENGTH, "Server Response (%d bytes)", SV_RESPONSE_LENGTH);
-       }
+    if(SV_RESPONSE_LENGTH) {
+        tvb_ensure_bytes_exist(tvb, offset, SV_RESPONSE_LENGTH);
+        proto_tree_add_text(tree, tvb, offset, SV_RESPONSE_LENGTH, "Server Response (%d bytes)", SV_RESPONSE_LENGTH);
+    }
 }
 
 static void
 dissect_pct_msg_error(tvbuff_t *tvb,
-                                                       proto_tree *tree, guint32 offset)
+                      proto_tree *tree, guint32 offset)
 {
-       guint16 ERROR_CODE, INFO_LEN;
-
-       ERROR_CODE = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_item(tree, hf_pct_msg_error_type, tvb, offset, 2, FALSE);
-       offset += 2;
-
-       INFO_LEN = tvb_get_ntohs(tvb, offset);
-       proto_tree_add_text(tree, tvb, offset, 2, "Error Information Length: %d", INFO_LEN);
-       offset += 2;
-       if (ERROR_CODE == PCT_ERR_SPECS_MISMATCH && INFO_LEN == 6)
-       {
-               proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_CIPHER");
-               offset += 1;
-               proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_HASH");
-               offset += 1;
-               proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_CERT");
-               offset += 1;
-               proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_EXCH");
-               offset += 1;
-               proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_CLIENT_CERT");
-               offset += 1;
-               proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_CLIENT_SIG");
-       }
-       else if(INFO_LEN) {
-               proto_tree_add_text(tree, tvb, offset, INFO_LEN, "Error Information data (%d bytes)", INFO_LEN);
-       }
+    guint16 ERROR_CODE, INFO_LEN;
+
+    ERROR_CODE = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_item(tree, hf_pct_msg_error_type, tvb, offset, 2, FALSE);
+    offset += 2;
+
+    INFO_LEN = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(tree, tvb, offset, 2, "Error Information Length: %d", INFO_LEN);
+    offset += 2;
+    if (ERROR_CODE == PCT_ERR_SPECS_MISMATCH && INFO_LEN == 6)
+    {
+        proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_CIPHER");
+        offset += 1;
+        proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_HASH");
+        offset += 1;
+        proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_CERT");
+        offset += 1;
+        proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_EXCH");
+        offset += 1;
+        proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_CLIENT_CERT");
+        offset += 1;
+        proto_tree_add_text(tree, tvb, offset, 1, "SPECS_MISMATCH_CLIENT_SIG");
+    }
+    else if(INFO_LEN) {
+        proto_tree_add_text(tree, tvb, offset, INFO_LEN, "Error Information data (%d bytes)", INFO_LEN);
+    }
 }
 
 static void
@@ -3576,130 +3572,130 @@ void ssl_set_master_secret(guint32 frame_num, address *addr_srv, address *addr_c
                            const guchar *_client_random, const guchar *_server_random,
                            guint32 client_seq, guint32 server_seq)
 {
-  conversation_t *conversation = NULL;
-  void *conv_data = NULL;
-  SslDecryptSession *ssl = NULL;
-  guint iv_len;
-
-  ssl_debug_printf("\nssl_set_master_secret enter frame #%u\n", frame_num);
-
-  conversation = find_conversation(frame_num, addr_srv, addr_cli, ptype, port_srv, port_cli, 0);
-
-  if (!conversation) {
-    /* create a new conversation */
-    conversation = conversation_new(frame_num, addr_srv, addr_cli, ptype, port_srv, port_cli, 0);
-    ssl_debug_printf("  new conversation = %p created\n", (void *)conversation);
-  }
-  conv_data = conversation_get_proto_data(conversation, proto_ssl);
-
-  if (conv_data) {
-    ssl = conv_data;
-  } else {
-    ssl = se_alloc0(sizeof(SslDecryptSession));
-    ssl_session_init(ssl);
-    ssl->version = SSL_VER_UNKNOWN;
-    conversation_add_proto_data(conversation, proto_ssl, ssl);
-  }
-
-  ssl_debug_printf("  conversation = %p, ssl_session = %p\n", (void *)conversation, (void *)ssl);
-
-  ssl_set_server(ssl, addr_srv, ptype, port_srv);
-
-  /* version */
-  if ((ssl->version==SSL_VER_UNKNOWN) && (version!=SSL_VER_UNKNOWN)) {
-    switch (version) {
-      case SSL_VER_SSLv3:
-        ssl->version = SSL_VER_SSLv3;
-        ssl->version_netorder = SSLV3_VERSION;
-        ssl->state |= SSL_VERSION;
-        ssl_debug_printf("ssl_set_master_secret set version 0x%04X -> state 0x%02X\n", ssl->version_netorder, ssl->state);
-        break;
+    conversation_t *conversation = NULL;
+    void *conv_data = NULL;
+    SslDecryptSession *ssl = NULL;
+    guint iv_len;
 
-      case SSL_VER_TLS:
-        ssl->version = SSL_VER_TLS;
-        ssl->version_netorder = TLSV1_VERSION;
-        ssl->state |= SSL_VERSION;
-        ssl_debug_printf("ssl_set_master_secret set version 0x%04X -> state 0x%02X\n", ssl->version_netorder, ssl->state);
-        break;
+    ssl_debug_printf("\nssl_set_master_secret enter frame #%u\n", frame_num);
 
-      case SSL_VER_TLSv1DOT1:
-        ssl->version = SSL_VER_TLSv1DOT1;
-        ssl->version_netorder = TLSV1DOT1_VERSION;
-        ssl->state |= SSL_VERSION;
-        ssl_debug_printf("ssl_set_master_secret set version 0x%04X -> state 0x%02X\n", ssl->version_netorder, ssl->state);
-        break;
+    conversation = find_conversation(frame_num, addr_srv, addr_cli, ptype, port_srv, port_cli, 0);
 
-      case SSL_VER_TLSv1DOT2:
-        ssl->version = SSL_VER_TLSv1DOT2;
-        ssl->version_netorder = TLSV1DOT2_VERSION;
-        ssl->state |= SSL_VERSION;
-        ssl_debug_printf("ssl_set_master_secret set version 0x%04X -> state 0x%02X\n", ssl->version_netorder, ssl->state);
-        break;
+    if (!conversation) {
+        /* create a new conversation */
+        conversation = conversation_new(frame_num, addr_srv, addr_cli, ptype, port_srv, port_cli, 0);
+        ssl_debug_printf("  new conversation = %p created\n", (void *)conversation);
     }
-  }
+    conv_data = conversation_get_proto_data(conversation, proto_ssl);
 
-  /* cipher */
-  if (cipher > 0) {
-    ssl->cipher = cipher;
-    if (ssl_find_cipher(ssl->cipher,&ssl->cipher_suite) < 0) {
-        ssl_debug_printf("ssl_set_master_secret can't find cipher suite 0x%X\n", ssl->cipher);
+    if (conv_data) {
+        ssl = conv_data;
     } else {
-        ssl->state |= SSL_CIPHER;
-        ssl_debug_printf("ssl_set_master_secret set CIPHER 0x%04X -> state 0x%02X\n", ssl->cipher, ssl->state);
+        ssl = se_alloc0(sizeof(SslDecryptSession));
+        ssl_session_init(ssl);
+        ssl->version = SSL_VER_UNKNOWN;
+        conversation_add_proto_data(conversation, proto_ssl, ssl);
+    }
+
+    ssl_debug_printf("  conversation = %p, ssl_session = %p\n", (void *)conversation, (void *)ssl);
+
+    ssl_set_server(ssl, addr_srv, ptype, port_srv);
+
+    /* version */
+    if ((ssl->version==SSL_VER_UNKNOWN) && (version!=SSL_VER_UNKNOWN)) {
+        switch (version) {
+        case SSL_VER_SSLv3:
+            ssl->version = SSL_VER_SSLv3;
+            ssl->version_netorder = SSLV3_VERSION;
+            ssl->state |= SSL_VERSION;
+            ssl_debug_printf("ssl_set_master_secret set version 0x%04X -> state 0x%02X\n", ssl->version_netorder, ssl->state);
+            break;
+
+        case SSL_VER_TLS:
+            ssl->version = SSL_VER_TLS;
+            ssl->version_netorder = TLSV1_VERSION;
+            ssl->state |= SSL_VERSION;
+            ssl_debug_printf("ssl_set_master_secret set version 0x%04X -> state 0x%02X\n", ssl->version_netorder, ssl->state);
+            break;
+
+        case SSL_VER_TLSv1DOT1:
+            ssl->version = SSL_VER_TLSv1DOT1;
+            ssl->version_netorder = TLSV1DOT1_VERSION;
+            ssl->state |= SSL_VERSION;
+            ssl_debug_printf("ssl_set_master_secret set version 0x%04X -> state 0x%02X\n", ssl->version_netorder, ssl->state);
+            break;
+
+        case SSL_VER_TLSv1DOT2:
+            ssl->version = SSL_VER_TLSv1DOT2;
+            ssl->version_netorder = TLSV1DOT2_VERSION;
+            ssl->state |= SSL_VERSION;
+            ssl_debug_printf("ssl_set_master_secret set version 0x%04X -> state 0x%02X\n", ssl->version_netorder, ssl->state);
+            break;
+        }
+    }
+
+    /* cipher */
+    if (cipher > 0) {
+        ssl->cipher = cipher;
+        if (ssl_find_cipher(ssl->cipher,&ssl->cipher_suite) < 0) {
+            ssl_debug_printf("ssl_set_master_secret can't find cipher suite 0x%X\n", ssl->cipher);
+        } else {
+            ssl->state |= SSL_CIPHER;
+            ssl_debug_printf("ssl_set_master_secret set CIPHER 0x%04X -> state 0x%02X\n", ssl->cipher, ssl->state);
+        }
+    }
+
+    /* client random */
+    if (_client_random) {
+        ssl_data_set(&ssl->client_random, _client_random, 32);
+        ssl->state |= SSL_CLIENT_RANDOM;
+        ssl_debug_printf("ssl_set_master_secret set CLIENT RANDOM -> state 0x%02X\n", ssl->state);
+    }
+
+    /* server random */
+    if (_server_random) {
+        ssl_data_set(&ssl->server_random, _server_random, 32);
+        ssl->state |= SSL_SERVER_RANDOM;
+        ssl_debug_printf("ssl_set_master_secret set SERVER RANDOM -> state 0x%02X\n", ssl->state);
+    }
+
+    /* master secret */
+    if (_master_secret) {
+        ssl_data_set(&ssl->master_secret, _master_secret, 48);
+        ssl->state |= SSL_MASTER_SECRET;
+        ssl_debug_printf("ssl_set_master_secret set MASTER SECRET -> state 0x%02X\n", ssl->state);
+    }
+
+    ssl_debug_printf("ssl_set_master_secret trying to generate keys\n");
+    if (ssl_generate_keyring_material(ssl)<0) {
+        ssl_debug_printf("ssl_set_master_secret can't generate keyring material\n");
+        return;
+    }
+
+    /* change ciphers immediately */
+    ssl_change_cipher(ssl, TRUE);
+    ssl_change_cipher(ssl, FALSE);
+
+    /* update seq numbers if available */
+    if (ssl->client && (client_seq != (guint32)-1)) {
+        ssl->client->seq = client_seq;
+        ssl_debug_printf("ssl_set_master_secret client->seq updated to %u\n", ssl->client->seq);
+    }
+    if (ssl->server && (server_seq != (guint32)-1)) {
+        ssl->server->seq = server_seq;
+        ssl_debug_printf("ssl_set_master_secret server->seq updated to %u\n", ssl->server->seq);
+    }
+
+    /* update IV from last data */
+    iv_len = (ssl->cipher_suite.block>1) ? ssl->cipher_suite.block : 8;
+    if (ssl->client && ((ssl->client->seq > 0) || (ssl->client_data_for_iv.data_len > iv_len))) {
+        ssl_cipher_setiv(&ssl->client->evp, ssl->client_data_for_iv.data + ssl->client_data_for_iv.data_len - iv_len, iv_len);
+        ssl_print_data("ssl_set_master_secret client IV updated",ssl->client_data_for_iv.data + ssl->client_data_for_iv.data_len - iv_len, iv_len);
+    }
+    if (ssl->server && ((ssl->server->seq > 0) || (ssl->server_data_for_iv.data_len > iv_len))) {
+        ssl_cipher_setiv(&ssl->server->evp, ssl->server_data_for_iv.data + ssl->server_data_for_iv.data_len - iv_len, iv_len);
+        ssl_print_data("ssl_set_master_secret server IV updated",ssl->server_data_for_iv.data + ssl->server_data_for_iv.data_len - iv_len, iv_len);
     }
-  }
-
-  /* client random */
-  if (_client_random) {
-    ssl_data_set(&ssl->client_random, _client_random, 32);
-    ssl->state |= SSL_CLIENT_RANDOM;
-    ssl_debug_printf("ssl_set_master_secret set CLIENT RANDOM -> state 0x%02X\n", ssl->state);
-  }
-
-  /* server random */
-  if (_server_random) {
-    ssl_data_set(&ssl->server_random, _server_random, 32);
-    ssl->state |= SSL_SERVER_RANDOM;
-    ssl_debug_printf("ssl_set_master_secret set SERVER RANDOM -> state 0x%02X\n", ssl->state);
-  }
-
-  /* master secret */
-  if (_master_secret) {
-    ssl_data_set(&ssl->master_secret, _master_secret, 48);
-    ssl->state |= SSL_MASTER_SECRET;
-    ssl_debug_printf("ssl_set_master_secret set MASTER SECRET -> state 0x%02X\n", ssl->state);
-  }
-
-  ssl_debug_printf("ssl_set_master_secret trying to generate keys\n");
-  if (ssl_generate_keyring_material(ssl)<0) {
-      ssl_debug_printf("ssl_set_master_secret can't generate keyring material\n");
-      return;
-  }
-
-  /* change ciphers immediately */
-  ssl_change_cipher(ssl, TRUE);
-  ssl_change_cipher(ssl, FALSE);
-
-  /* update seq numbers if available */
-  if (ssl->client && (client_seq != (guint32)-1)) {
-    ssl->client->seq = client_seq;
-    ssl_debug_printf("ssl_set_master_secret client->seq updated to %u\n", ssl->client->seq);
-  }
-  if (ssl->server && (server_seq != (guint32)-1)) {
-    ssl->server->seq = server_seq;
-    ssl_debug_printf("ssl_set_master_secret server->seq updated to %u\n", ssl->server->seq);
-  }
-
-  /* update IV from last data */
-  iv_len = (ssl->cipher_suite.block>1) ? ssl->cipher_suite.block : 8;
-  if (ssl->client && ((ssl->client->seq > 0) || (ssl->client_data_for_iv.data_len > iv_len))) {
-    ssl_cipher_setiv(&ssl->client->evp, ssl->client_data_for_iv.data + ssl->client_data_for_iv.data_len - iv_len, iv_len);
-    ssl_print_data("ssl_set_master_secret client IV updated",ssl->client_data_for_iv.data + ssl->client_data_for_iv.data_len - iv_len, iv_len);
-  }
-  if (ssl->server && ((ssl->server->seq > 0) || (ssl->server_data_for_iv.data_len > iv_len))) {
-    ssl_cipher_setiv(&ssl->server->evp, ssl->server_data_for_iv.data + ssl->server_data_for_iv.data_len - iv_len, iv_len);
-    ssl_print_data("ssl_set_master_secret server IV updated",ssl->server_data_for_iv.data + ssl->server_data_for_iv.data_len - iv_len, iv_len);
-  }
 }
 
 
@@ -4353,94 +4349,103 @@ proto_register_ssl(void)
         },
         { &hf_pct_handshake_cipher_spec,
           { "Cipher Spec", "pct.handshake.cipherspec",
-                FT_NONE, BASE_NONE, NULL, 0x0,
-                "PCT Cipher specification", HFILL }
+            FT_NONE, BASE_NONE, NULL, 0x0,
+            "PCT Cipher specification", HFILL }
         },
         { &hf_pct_handshake_cipher,
           { "Cipher", "pct.handshake.cipher",
-                FT_UINT16, BASE_HEX, VALS(pct_cipher_type), 0x0,
-                "PCT Ciper", HFILL }
+            FT_UINT16, BASE_HEX, VALS(pct_cipher_type), 0x0,
+            "PCT Ciper", HFILL }
         },
         { &hf_pct_handshake_hash_spec,
           { "Hash Spec", "pct.handshake.hashspec",
-                FT_NONE, BASE_NONE, NULL, 0x0,
-                "PCT Hash specification", HFILL }
+            FT_NONE, BASE_NONE, NULL, 0x0,
+            "PCT Hash specification", HFILL }
         },
         { &hf_pct_handshake_hash,
           { "Hash", "pct.handshake.hash",
-                FT_UINT16, BASE_HEX, VALS(pct_hash_type), 0x0,
-                "PCT Hash", HFILL }
+            FT_UINT16, BASE_HEX, VALS(pct_hash_type), 0x0,
+            "PCT Hash", HFILL }
         },
         { &hf_pct_handshake_cert_spec,
           { "Cert Spec", "pct.handshake.certspec",
-                FT_NONE, BASE_NONE, NULL, 0x0,
-                "PCT Certificate specification", HFILL }
+            FT_NONE, BASE_NONE, NULL, 0x0,
+            "PCT Certificate specification", HFILL }
         },
         { &hf_pct_handshake_cert,
           { "Cert", "pct.handshake.cert",
-                FT_UINT16, BASE_HEX, VALS(pct_cert_type), 0x0,
-                "PCT Certificate", HFILL }
+            FT_UINT16, BASE_HEX, VALS(pct_cert_type), 0x0,
+            "PCT Certificate", HFILL }
         },
         { &hf_pct_handshake_exch_spec,
           { "Exchange Spec", "pct.handshake.exchspec",
-                FT_NONE, BASE_NONE, NULL, 0x0,
-                "PCT Exchange specification", HFILL }
+            FT_NONE, BASE_NONE, NULL, 0x0,
+            "PCT Exchange specification", HFILL }
         },
         { &hf_pct_handshake_exch,
           { "Exchange", "pct.handshake.exch",
-                FT_UINT16, BASE_HEX, VALS(pct_exch_type), 0x0,
-                "PCT Exchange", HFILL }
+            FT_UINT16, BASE_HEX, VALS(pct_exch_type), 0x0,
+            "PCT Exchange", HFILL }
         },
         { &hf_pct_handshake_sig,
           { "Sig Spec", "pct.handshake.sig",
-                FT_UINT16, BASE_HEX, VALS(pct_sig_type), 0x0,
-                "PCT Signature", HFILL }
+            FT_UINT16, BASE_HEX, VALS(pct_sig_type), 0x0,
+            "PCT Signature", HFILL }
         },
         { &hf_pct_msg_error_type,
           { "PCT Error Code", "pct.msg_error_code",
-                FT_UINT16, BASE_HEX, VALS(pct_error_code), 0x0,
-                NULL, HFILL }
+            FT_UINT16, BASE_HEX, VALS(pct_error_code), 0x0,
+            NULL, HFILL }
         },
         { &hf_pct_handshake_server_cert,
           { "Server Cert", "pct.handshake.server_cert",
-                FT_NONE, BASE_NONE, NULL , 0x0,
-                "PCT Server Certificate", HFILL }
+            FT_NONE, BASE_NONE, NULL , 0x0,
+            "PCT Server Certificate", HFILL }
         },
-               { &hf_ssl_segment_overlap,
-               { "Segment overlap",    "ssl.segment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
-                       "Segment overlaps with other segments", HFILL }},
+        { &hf_ssl_segment_overlap,
+          { "Segment overlap", "ssl.segment.overlap",
+            FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+            "Segment overlaps with other segments", HFILL }},
 
-               { &hf_ssl_segment_overlap_conflict,
-               { "Conflicting data in segment overlap",        "ssl.segment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
-                       "Overlapping segments contained conflicting data", HFILL }},
+        { &hf_ssl_segment_overlap_conflict,
+          { "Conflicting data in segment overlap", "ssl.segment.overlap.conflict",
+            FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+            "Overlapping segments contained conflicting data", HFILL }},
 
-               { &hf_ssl_segment_multiple_tails,
-               { "Multiple tail segments found",       "ssl.segment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
-                       "Several tails were found when reassembling the pdu", HFILL }},
+        { &hf_ssl_segment_multiple_tails,
+          { "Multiple tail segments found", "ssl.segment.multipletails",
+            FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+            "Several tails were found when reassembling the pdu", HFILL }},
 
-               { &hf_ssl_segment_too_long_fragment,
-               { "Segment too long",   "ssl.segment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
-                       "Segment contained data past end of the pdu", HFILL }},
+        { &hf_ssl_segment_too_long_fragment,
+          { "Segment too long", "ssl.segment.toolongfragment",
+            FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+            "Segment contained data past end of the pdu", HFILL }},
 
-               { &hf_ssl_segment_error,
-               { "Reassembling error", "ssl.segment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
-                       "Reassembling error due to illegal segments", HFILL }},
+        { &hf_ssl_segment_error,
+          { "Reassembling error", "ssl.segment.error",
+            FT_FRAMENUM, BASE_NONE, NULL, 0x0,
+            "Reassembling error due to illegal segments", HFILL }},
 
-               { &hf_ssl_segment,
-               { "SSL Segment", "ssl.segment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
-                       NULL, HFILL }},
+        { &hf_ssl_segment,
+          { "SSL Segment", "ssl.segment",
+            FT_FRAMENUM, BASE_NONE, NULL, 0x0,
+            NULL, HFILL }},
 
-               { &hf_ssl_segments,
-               { "Reassembled SSL Segments", "ssl.segments", FT_NONE, BASE_NONE, NULL, 0x0,
-                       "SSL Segments", HFILL }},
+        { &hf_ssl_segments,
+          { "Reassembled SSL Segments", "ssl.segments",
+            FT_NONE, BASE_NONE, NULL, 0x0,
+            "SSL Segments", HFILL }},
 
-               { &hf_ssl_reassembled_in,
-               { "Reassembled PDU in frame", "ssl.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
-                       "The PDU that doesn't end in this segment is reassembled in this frame", HFILL }},
+        { &hf_ssl_reassembled_in,
+          { "Reassembled PDU in frame", "ssl.reassembled_in",
+            FT_FRAMENUM, BASE_NONE, NULL, 0x0,
+            "The PDU that doesn't end in this segment is reassembled in this frame", HFILL }},
 
-               { &hf_ssl_reassembled_length,
-               { "Reassembled PDU length", "ssl.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
-                       "The total length of the reassembled payload", HFILL }},
+        { &hf_ssl_reassembled_length,
+          { "Reassembled PDU length", "ssl.reassembled.length",
+            FT_UINT32, BASE_DEC, NULL, 0x0,
+            "The total length of the reassembled payload", HFILL }},
     };
 
     /* Setup protocol subtree array */
@@ -4532,12 +4537,12 @@ proto_reg_handoff_ssl(void)
 void
 ssl_dissector_add(guint port, const gchar *protocol, gboolean tcp)
 {
-       SslAssociation *assoc;
+    SslAssociation *assoc;
 
-       assoc = ssl_association_find(ssl_associations, port, tcp);
-       if (assoc) {
-               ssl_association_remove(ssl_associations, assoc);
-       }
+    assoc = ssl_association_find(ssl_associations, port, tcp);
+    if (assoc) {
+        ssl_association_remove(ssl_associations, assoc);
+    }
 
     ssl_association_add(ssl_associations, ssl_handle, port, protocol, tcp, FALSE);
 }
@@ -4545,10 +4550,10 @@ ssl_dissector_add(guint port, const gchar *protocol, gboolean tcp)
 void
 ssl_dissector_delete(guint port, const gchar *protocol, gboolean tcp)
 {
-       SslAssociation *assoc;
+    SslAssociation *assoc;
 
-       assoc = ssl_association_find(ssl_associations, port, tcp);
-       if (assoc && (assoc->handle == find_dissector(protocol))) {
-               ssl_association_remove(ssl_associations, assoc);
-       }
+    assoc = ssl_association_find(ssl_associations, port, tcp);
+    if (assoc && (assoc->handle == find_dissector(protocol))) {
+        ssl_association_remove(ssl_associations, assoc);
+    }
 }
index d48be62c051512c305c39a462243a5e12e72c512..02011927fd23ae7a7e0209ec96097a8362c501ca 100644 (file)
  * a reply.
  *
  */
-#define NOTHING_SEEN           -3
-#define NOTHING_EXPECTED       -2
-#define INITIAL_CONN           -1
+#define NOTHING_SEEN            -3
+#define NOTHING_EXPECTED        -2
+#define INITIAL_CONN            -1
 #define UNKNOWN_OPCODE           0
 
-#define MAX_OPCODES            (255 + 1) /* 255 + INITIAL_CONN */
-#define LastExtensionError     255
-#define LastExtensionEvent     127
+#define MAX_OPCODES             (255 + 1) /* 255 + INITIAL_CONN */
+#define LastExtensionError      255
+#define LastExtensionEvent      127
 
-#define BYTE_ORDER_BE          0
-#define BYTE_ORDER_LE          1
-#define BYTE_ORDER_UNKNOWN     -1
+#define BYTE_ORDER_BE           0
+#define BYTE_ORDER_LE           1
+#define BYTE_ORDER_UNKNOWN      -1
 
 static const char *modifiers[] = {
-    "Shift",
-    "Lock",
-    "Control",
-    "Mod1",
-    "Mod2",
-    "Mod3",
-    "Mod4",
-    "Mod5"
+      "Shift",
+      "Lock",
+      "Control",
+      "Mod1",
+      "Mod2",
+      "Mod3",
+      "Mod4",
+      "Mod5"
 };
 
 /* Keymasks.  From <X11/X.h>. */
-#define ShiftMask              (1<<0)
-#define LockMask               (1<<1)
-#define ControlMask            (1<<2)
-#define Mod1Mask               (1<<3)
-#define Mod2Mask               (1<<4)
-#define Mod3Mask               (1<<5)
-#define Mod4Mask               (1<<6)
-#define Mod5Mask               (1<<7)
+#define ShiftMask               (1<<0)
+#define LockMask                (1<<1)
+#define ControlMask             (1<<2)
+#define Mod1Mask                (1<<3)
+#define Mod2Mask                (1<<4)
+#define Mod3Mask                (1<<5)
+#define Mod4Mask                (1<<6)
+#define Mod5Mask                (1<<7)
 
 static const int modifiermask[] = { ShiftMask, LockMask, ControlMask,
 Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask };
@@ -128,37 +128,37 @@ Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask };
 
 typedef struct _x11_conv_data {
       struct _x11_conv_data *next;
-      GHashTable *seqtable;    /* hashtable of sequencenumber <-> opcode. */
-      GHashTable *valtable;/* hashtable of sequencenumber <-> &opcode_vals */
+      GHashTable *seqtable;            /* hashtable of sequencenumber <-> opcode. */
+      GHashTable *valtable;            /* hashtable of sequencenumber <-> &opcode_vals */
       /* major opcodes including extensions (NULL terminated) */
       value_string opcode_vals[MAX_OPCODES+1];
       /* error codes including extensions (NULL terminated) */
       value_string errorcode_vals[LastExtensionError + 2];
       /* event codes including extensions (NULL terminated) */
       value_string eventcode_vals[LastExtensionEvent + 2];
-      GHashTable *eventcode_funcs;     /* hashtable of eventcode <-> dissect_event() */
-      GHashTable *reply_funcs;         /* hashtable of opcode <-> dissect_reply() */
+      GHashTable *eventcode_funcs;      /* hashtable of eventcode <-> dissect_event() */
+      GHashTable *reply_funcs;          /* hashtable of opcode <-> dissect_reply() */
 
-      int      sequencenumber; /* sequencenumber of current packet.       */
-      guint32  iconn_frame;    /* frame # of initial connection request   */
-      guint32  iconn_reply;    /* frame # of initial connection reply     */
-      int      byte_order;     /* byte order of connection */
-      gboolean  resync;  /* resynchronization of sequence number performed */
+      int       sequencenumber;   /* sequencenumber of current packet.       */
+      guint32   iconn_frame;      /* frame # of initial connection request   */
+      guint32   iconn_reply;      /* frame # of initial connection reply     */
+      int       byte_order;       /* byte order of connection */
+      gboolean  resync;           /* resynchronization of sequence number performed */
 
-      int      *keycodemap[256]; /* keycode to keysymvalue map. */
-      int      keysyms_per_keycode;
-      int      first_keycode;
-      int      *modifiermap[array_length(modifiers)];/* modifier to keycode.*/
-      int      keycodes_per_modifier;
+      int       *keycodemap[256]; /* keycode to keysymvalue map. */
+      int       keysyms_per_keycode;
+      int       first_keycode;
+      int       *modifiermap[array_length(modifiers)];/* modifier to keycode.*/
+      int       keycodes_per_modifier;
 
       union {
-       struct {
-               int     first_keycode;
-       } GetKeyboardMapping;
+            struct {
+                  int   first_keycode;
+            } GetKeyboardMapping;
       } request;
 } x11_conv_data_t;
 
-static x11_conv_data_t *x11_conv_data_list;
+static x11_conv_data_t *x11_conv_data_list = NULL;
 
 static GHashTable *extension_table; /* hashtable of extension name <-> dispatch function */
 static GHashTable *event_table;     /* hashtable of extension name <-> event info list */
@@ -193,28 +193,28 @@ static gint ett_x11_segment = -1;
 static gint ett_x11_list_of_string8 = -1;
 static gint ett_x11_list_of_text_item = -1;
 static gint ett_x11_text_item = -1;
-static gint ett_x11_gc_value_mask = -1;                /* XXX - unused */
-static gint ett_x11_event_mask = -1;           /* XXX - unused */
-static gint ett_x11_do_not_propagate_mask = -1;        /* XXX - unused */
+static gint ett_x11_gc_value_mask = -1;         /* XXX - unused */
+static gint ett_x11_event_mask = -1;            /* XXX - unused */
+static gint ett_x11_do_not_propagate_mask = -1; /* XXX - unused */
 static gint ett_x11_set_of_key_mask = -1;
-static gint ett_x11_pointer_event_mask = -1;   /* XXX - unused */
-static gint ett_x11_window_value_mask = -1;    /* XXX - unused */
-static gint ett_x11_configure_window_mask = -1;        /* XXX - unused */
-static gint ett_x11_keyboard_value_mask = -1;  /* XXX - unused */
+static gint ett_x11_pointer_event_mask = -1;    /* XXX - unused */
+static gint ett_x11_window_value_mask = -1;     /* XXX - unused */
+static gint ett_x11_configure_window_mask = -1; /* XXX - unused */
+static gint ett_x11_keyboard_value_mask = -1;   /* XXX - unused */
 static gint ett_x11_same_screen_focus = -1;
 static gint ett_x11_event = -1;
 
 /* desegmentation of X11 messages */
 static gboolean x11_desegment = TRUE;
 
-#define TCP_PORT_X11                   6000
-#define TCP_PORT_X11_2                 6001
-#define TCP_PORT_X11_3                 6002
+#define TCP_PORT_X11                    6000
+#define TCP_PORT_X11_2                  6001
+#define TCP_PORT_X11_3                  6002
 
 /*
  * Round a length to a multiple of 4 bytes.
  */
-#define ROUND_LENGTH(n)        ((((n) + 3)/4) * 4)
+#define ROUND_LENGTH(n) ((((n) + 3)/4) * 4)
 
 /************************************************************************
  ***                                                                  ***
@@ -223,15 +223,15 @@ static gboolean x11_desegment = TRUE;
  ************************************************************************/
 
 static const value_string byte_order_vals[] = {
-     { 'B', "Big-endian" },
-     { 'l', "Little-endian" },
-     { 0,   NULL }
+      { 'B', "Big-endian" },
+      { 'l', "Little-endian" },
+      { 0,   NULL }
 };
 
 static const value_string image_byte_order_vals[] = {
-     { 0, "LSBFirst" },
-     { 1, "MSBFirst" },
-     { 0,   NULL }
+      { 0, "LSBFirst" },
+      { 1, "MSBFirst" },
+      { 0,   NULL }
 };
 
 static const value_string access_mode_vals[] = {
@@ -426,9 +426,9 @@ static const value_string event_detail_vals[] = {
       { 0, NULL }
 };
 
-#define FAMILY_INTERNET        0
-#define FAMILY_DECNET  1
-#define FAMILY_CHAOS   2
+#define FAMILY_INTERNET 0
+#define FAMILY_DECNET   1
+#define FAMILY_CHAOS    2
 
 static const value_string family_vals[] = {
       { FAMILY_INTERNET, "Internet" },
@@ -721,8 +721,8 @@ static const value_string mapping_request_vals[] = {
 #define X_SetModifierMapping           118
 #define X_GetModifierMapping           119
 #define X_NoOperation                  127
-#define X_FirstExtension                      128
-#define X_LastExtension                       255
+#define X_FirstExtension               128
+#define X_LastExtension                255
 
 static const value_string opcode_vals[] = {
       { INITIAL_CONN,                   "Initial connection request" },
@@ -850,125 +850,125 @@ static const value_string opcode_vals[] = {
 };
 
 /* Eventscodes.  From <X11/X.h>. */
-#define KeyPress               2
-#define KeyRelease             3
-#define ButtonPress            4
-#define ButtonRelease          5
-#define MotionNotify           6
-#define EnterNotify            7
-#define LeaveNotify            8
-#define FocusIn                        9
-#define FocusOut               10
-#define KeymapNotify           11
-#define Expose                 12
-#define GraphicsExpose         13
-#define NoExpose               14
-#define VisibilityNotify       15
-#define CreateNotify           16
-#define DestroyNotify          17
-#define UnmapNotify            18
-#define MapNotify              19
-#define MapRequest             20
-#define ReparentNotify         21
-#define ConfigureNotify                22
-#define ConfigureRequest       23
-#define GravityNotify          24
-#define ResizeRequest          25
-#define CirculateNotify                26
-#define CirculateRequest       27
-#define PropertyNotify         28
-#define SelectionClear         29
-#define SelectionRequest       30
-#define SelectionNotify                31
-#define ColormapNotify         32
-#define ClientMessage          33
-#define MappingNotify          34
+#define KeyPress                2
+#define KeyRelease              3
+#define ButtonPress             4
+#define ButtonRelease           5
+#define MotionNotify            6
+#define EnterNotify             7
+#define LeaveNotify             8
+#define FocusIn                 9
+#define FocusOut                10
+#define KeymapNotify            11
+#define Expose                  12
+#define GraphicsExpose          13
+#define NoExpose                14
+#define VisibilityNotify        15
+#define CreateNotify            16
+#define DestroyNotify           17
+#define UnmapNotify             18
+#define MapNotify               19
+#define MapRequest              20
+#define ReparentNotify          21
+#define ConfigureNotify         22
+#define ConfigureRequest        23
+#define GravityNotify           24
+#define ResizeRequest           25
+#define CirculateNotify         26
+#define CirculateRequest        27
+#define PropertyNotify          28
+#define SelectionClear          29
+#define SelectionRequest        30
+#define SelectionNotify         31
+#define ColormapNotify          32
+#define ClientMessage           33
+#define MappingNotify           34
 
 static const value_string eventcode_vals[] = {
-       { KeyPress,          "KeyPress" },
-       { KeyRelease,        "KeyRelease" },
-       { ButtonPress,       "ButtonPress" },
-       { ButtonRelease,     "ButtonRelease" },
-       { MotionNotify,      "MotionNotify" },
-       { EnterNotify,       "EnterNotify" },
-       { LeaveNotify,       "LeaveNotify" },
-       { FocusIn,           "FocusIn" },
-       { FocusOut,          "FocusOut" },
-       { KeymapNotify,      "KeymapNotify" },
-       { Expose,            "Expose" },
-       { GraphicsExpose,    "GraphicsExpose" },
-       { NoExpose,          "NoExpose" },
-       { VisibilityNotify,  "VisibilityNotify" },
-       { CreateNotify,      "CreateNotify" },
-       { DestroyNotify,     "DestroyNotify" },
-       { UnmapNotify,       "UnmapNotify" },
-       { MapNotify,         "MapNotify" },
-       { MapRequest,        "MapRequest" },
-       { ReparentNotify,    "ReparentNotify" },
-       { ConfigureNotify,   "ConfigureNotify" },
-       { ConfigureRequest,  "ConfigureRequest" },
-       { GravityNotify,     "GravityNotify" },
-       { ResizeRequest,     "ResizeRequest" },
-       { CirculateNotify,   "CirculateNotify" },
-       { CirculateRequest,  "CirculateRequest" },
-       { PropertyNotify,    "PropertyNotify" },
-       { SelectionClear,    "SelectionClear" },
-       { SelectionRequest,  "SelectionRequest" },
-       { SelectionNotify,   "SelectionNotify" },
-       { ColormapNotify,    "ColormapNotify" },
-       { ClientMessage,     "ClientMessage" },
-       { MappingNotify,     "MappingNotify" },
-       { 0,                 NULL }
+      { KeyPress,          "KeyPress" },
+      { KeyRelease,        "KeyRelease" },
+      { ButtonPress,       "ButtonPress" },
+      { ButtonRelease,     "ButtonRelease" },
+      { MotionNotify,      "MotionNotify" },
+      { EnterNotify,       "EnterNotify" },
+      { LeaveNotify,       "LeaveNotify" },
+      { FocusIn,           "FocusIn" },
+      { FocusOut,          "FocusOut" },
+      { KeymapNotify,      "KeymapNotify" },
+      { Expose,            "Expose" },
+      { GraphicsExpose,    "GraphicsExpose" },
+      { NoExpose,          "NoExpose" },
+      { VisibilityNotify,  "VisibilityNotify" },
+      { CreateNotify,      "CreateNotify" },
+      { DestroyNotify,     "DestroyNotify" },
+      { UnmapNotify,       "UnmapNotify" },
+      { MapNotify,         "MapNotify" },
+      { MapRequest,        "MapRequest" },
+      { ReparentNotify,    "ReparentNotify" },
+      { ConfigureNotify,   "ConfigureNotify" },
+      { ConfigureRequest,  "ConfigureRequest" },
+      { GravityNotify,     "GravityNotify" },
+      { ResizeRequest,     "ResizeRequest" },
+      { CirculateNotify,   "CirculateNotify" },
+      { CirculateRequest,  "CirculateRequest" },
+      { PropertyNotify,    "PropertyNotify" },
+      { SelectionClear,    "SelectionClear" },
+      { SelectionRequest,  "SelectionRequest" },
+      { SelectionNotify,   "SelectionNotify" },
+      { ColormapNotify,    "ColormapNotify" },
+      { ClientMessage,     "ClientMessage" },
+      { MappingNotify,     "MappingNotify" },
+      { 0,                 NULL }
 };
 
 /* Errorcodes.  From <X11/X.h> */
-#define Success                        0       /* everything's okay */
-#define BadRequest             1       /* bad request code */
-#define BadValue               2       /* int parameter out of range */
-#define BadWindow              3       /* parameter not a Window */
-#define BadPixmap              4       /* parameter not a Pixmap */
-#define BadAtom                        5       /* parameter not an Atom */
-#define BadCursor              6       /* parameter not a Cursor */
-#define BadFont                        7       /* parameter not a Font */
-#define BadMatch               8       /* parameter mismatch */
-#define BadDrawable            9       /* parameter not a Pixmap or Window */
-#define BadAccess              10      /* depending on context:
-                                        - key/button already grabbed
-                                        - attempt to free an illegal
-                                          cmap entry
-                                       - attempt to store into a read-only
-                                          color map entry.
-                                       - attempt to modify the access control
-                                          list from other than the local host.
-                                       */
-#define BadAlloc               11      /* insufficient resources */
-#define BadColor               12      /* no such colormap */
-#define BadGC                  13      /* parameter not a GC */
-#define BadIDChoice            14      /* choice not in range or already used */
-#define BadName                        15      /* font or color name doesn't exist */
-#define BadLength              16      /* Request length incorrect */
-#define BadImplementation      17      /* server is defective */
+#define Success                 0       /* everything's okay */
+#define BadRequest              1       /* bad request code */
+#define BadValue                2       /* int parameter out of range */
+#define BadWindow               3       /* parameter not a Window */
+#define BadPixmap               4       /* parameter not a Pixmap */
+#define BadAtom                 5       /* parameter not an Atom */
+#define BadCursor               6       /* parameter not a Cursor */
+#define BadFont                 7       /* parameter not a Font */
+#define BadMatch                8       /* parameter mismatch */
+#define BadDrawable             9       /* parameter not a Pixmap or Window */
+#define BadAccess               10      /* depending on context:
+                                         - key/button already grabbed
+                                         - attempt to free an illegal
+                                           cmap entry
+                                        - attempt to store into a read-only
+                                           color map entry.
+                                        - attempt to modify the access control
+                                           list from other than the local host.
+                                        */
+#define BadAlloc                11      /* insufficient resources */
+#define BadColor                12      /* no such colormap */
+#define BadGC                   13      /* parameter not a GC */
+#define BadIDChoice             14      /* choice not in range or already used */
+#define BadName                 15      /* font or color name doesn't exist */
+#define BadLength               16      /* Request length incorrect */
+#define BadImplementation       17      /* server is defective */
 
 static const value_string errorcode_vals[] = {
-       { Success,               "Success" },
-       { BadRequest,            "BadRequest" },
-       { BadValue,              "BadValue" },
-       { BadWindow,             "BadWindow" },
-       { BadPixmap,             "BadPixmap" },
-       { BadAtom,               "BadAtom" },
-       { BadCursor,             "BadCursor" },
-       { BadFont,               "BadFont" },
-       { BadMatch,              "BadMatch" },
-       { BadDrawable,           "BadDrawable" },
-       { BadAccess,             "BadAccess" },
-       { BadAlloc,              "BadAlloc" },
-       { BadColor,              "BadColor" },
-       { BadGC,                 "BadGC" },
-       { BadIDChoice,           "BadIDChoice" },
-       { BadName,               "BadName" },
-       { BadLength,             "BadLength" },
-       { BadImplementation,     "BadImplementation" },
-       { 0,                     NULL }
+      { Success,               "Success" },
+      { BadRequest,            "BadRequest" },
+      { BadValue,              "BadValue" },
+      { BadWindow,             "BadWindow" },
+      { BadPixmap,             "BadPixmap" },
+      { BadAtom,               "BadAtom" },
+      { BadCursor,             "BadCursor" },
+      { BadFont,               "BadFont" },
+      { BadMatch,              "BadMatch" },
+      { BadDrawable,           "BadDrawable" },
+      { BadAccess,             "BadAccess" },
+      { BadAlloc,              "BadAlloc" },
+      { BadColor,              "BadColor" },
+      { BadGC,                 "BadGC" },
+      { BadIDChoice,           "BadIDChoice" },
+      { BadName,               "BadName" },
+      { BadLength,             "BadLength" },
+      { BadImplementation,     "BadImplementation" },
+      { 0,                     NULL }
 };
 
 static const value_string ordering_vals[] = {
@@ -1057,7 +1057,7 @@ static const value_string zero_is_none_vals[] = {
 
 /* we have not seen packet before. */
 #define PACKET_IS_NEW(pinfo) \
-       (!((pinfo)->fd->flags.visited))
+      (!((pinfo)->fd->flags.visited))
 
 /************************************************************************
  ***                                                                  ***
@@ -1075,26 +1075,26 @@ static const value_string zero_is_none_vals[] = {
 #define FIELD16(name) (field16(tvb, offsetp, t, hf_x11_##name, little_endian))
 #define FIELD32(name) (field32(tvb, offsetp, t, hf_x11_##name, little_endian))
 
-#define BITFIELD(TYPE, position, name) {\
-  int unused;\
-  int save = *offsetp;\
-  proto_tree_add_item(bitmask_tree, hf_x11_##position##_##name, tvb, bitmask_offset, \
-                      bitmask_size, little_endian); \
-  if (bitmask_value & proto_registrar_get_nth(hf_x11_##position##_##name) -> bitmask) {\
-       TYPE(name);\
-       unused = save + 4 - *offsetp;\
-       if (unused)\
-           proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, unused, little_endian);\
-       *offsetp = save + 4;\
}\
+#define BITFIELD(TYPE, position, name) {        \
+      int unused;                                                 \
+      int save = *offsetp;                                              \
+      proto_tree_add_item(bitmask_tree, hf_x11_##position##_##name, tvb, bitmask_offset, \
+                          bitmask_size, little_endian);                 \
+      if (bitmask_value & proto_registrar_get_nth(hf_x11_##position##_##name) -> bitmask) { \
+            TYPE(name);                                                 \
+            unused = save + 4 - *offsetp;                               \
+            if (unused)                                                 \
+                  proto_tree_add_item(t, hf_x11_unused, tvb, *offsetp, unused, little_endian); \
+            *offsetp = save + 4;                                        \
     }                                                                 \
 }
 
 #define FLAG(position, name) {\
-       proto_tree_add_boolean(bitmask_tree, hf_x11_##position##_mask##_##name, tvb, bitmask_offset, bitmask_size, bitmask_value); }
+      proto_tree_add_boolean(bitmask_tree, hf_x11_##position##_mask##_##name, tvb, bitmask_offset, bitmask_size, bitmask_value); }
 
 #define FLAG_IF_NONZERO(position, name) do {\
-  if (bitmask_value & proto_registrar_get_nth(hf_x11_##position##_mask##_##name) -> bitmask)\
-       proto_tree_add_boolean(bitmask_tree, hf_x11_##position##_mask##_##name, tvb, bitmask_offset, bitmask_size, bitmask_value); } while (0)
+      if (bitmask_value & proto_registrar_get_nth(hf_x11_##position##_mask##_##name) -> bitmask) \
+            proto_tree_add_boolean(bitmask_tree, hf_x11_##position##_mask##_##name, tvb, bitmask_offset, bitmask_size, bitmask_value); } while (0)
 
 #define ATOM(name)     { atom(tvb, offsetp, t, hf_x11_##name, little_endian); }
 #define BITGRAVITY(name) { gravity(tvb, offsetp, t, hf_x11_##name, "Forget"); }
@@ -1105,16 +1105,16 @@ static const value_string zero_is_none_vals[] = {
       int bitmask_size; \
       proto_tree *bitmask_tree; \
       bitmask_value = ((size == 1) ? (guint32)VALUE8(tvb, *offsetp) : \
-                      ((size == 2) ? (guint32)VALUE16(tvb, *offsetp) : \
-                                     (guint32)VALUE32(tvb, *offsetp))); \
+                       ((size == 2) ? (guint32)VALUE16(tvb, *offsetp) : \
+                                      (guint32)VALUE32(tvb, *offsetp))); \
       bitmask_offset = *offsetp; \
       bitmask_size = size; \
       bitmask_ti = proto_tree_add_uint(t, hf_x11_##name##_mask, tvb, *offsetp, size, bitmask_value); \
       bitmask_tree = proto_item_add_subtree(bitmask_ti, ett_x11_##name##_mask); \
       *offsetp += size;
-#define ENDBITMASK     }
-#define BITMASK8(name) BITMASK(name, 1);
-#define BITMASK16(name)        BITMASK(name, 2);
+#define ENDBITMASK      }
+#define BITMASK8(name)  BITMASK(name, 1);
+#define BITMASK16(name) BITMASK(name, 2);
 #define BITMASK32(name) BITMASK(name, 4);
 #define BOOL(name)     (add_boolean(tvb, offsetp, t, hf_x11_##name))
 #define BUTTON(name)   FIELD8(name)
@@ -1134,36 +1134,36 @@ static const value_string zero_is_none_vals[] = {
 #define INT16(name)    FIELD16(name)
 #define INT32(name)    FIELD32(name)
 #define KEYCODE(name)  FIELD8(name)
-#define KEYCODE_DECODED(name, keycode, mask)  do {                     \
-       proto_tree_add_uint_format(t, hf_x11_##name, tvb, offset, 1,    \
-       keycode, "keycode: %d (%s)",                                    \
-       keycode,  keycode2keysymString(state->keycodemap,               \
-       state->first_keycode, state->keysyms_per_keycode,               \
-       state->modifiermap, state->keycodes_per_modifier,               \
-       keycode, mask));                                                \
-       ++offset;                                                       \
+#define KEYCODE_DECODED(name, keycode, mask)  do {                    \
+      proto_tree_add_uint_format(t, hf_x11_##name, tvb, offset, 1,    \
+      keycode, "keycode: %d (%s)",                                    \
+      keycode,  keycode2keysymString(state->keycodemap,               \
+      state->first_keycode, state->keysyms_per_keycode,               \
+      state->modifiermap, state->keycodes_per_modifier,               \
+      keycode, mask));                                                \
+      ++offset;                                                       \
 } while (0)
 #define EVENT() do { \
-       tvbuff_t *next_tvb;                                             \
-       unsigned char eventcode;                                        \
-       const char *sent;                                               \
-       proto_item *event_ti;                                           \
-       proto_tree *event_proto_tree;                                   \
-       next_tvb = tvb_new_subset(tvb, offset, next_offset - offset,    \
-                                 next_offset - offset);                \
-       eventcode = tvb_get_guint8(next_tvb, 0);                        \
-       sent = (eventcode & 0x80) ? "Sent-" : "";                       \
-       event_ti = proto_tree_add_text(t, next_tvb, 0, -1,              \
-                               "event: %d (%s)",                       \
-                                eventcode,                             \
-                                val_to_str(eventcode & 0x7F,           \
-                                           state->eventcode_vals,      \
-                                           "<Unknown eventcode %u>")); \
-       event_proto_tree = proto_item_add_subtree(event_ti,             \
-                                                 ett_x11_event);       \
-       decode_x11_event(next_tvb, eventcode, sent, event_proto_tree,   \
-                        state, little_endian);                         \
-       offset = next_offset;                                           \
+      tvbuff_t *next_tvb;                                             \
+      unsigned char eventcode;                                        \
+      const char *sent;                                               \
+      proto_item *event_ti;                                           \
+      proto_tree *event_proto_tree;                                   \
+      next_tvb = tvb_new_subset(tvb, offset, next_offset - offset,    \
+                                next_offset - offset);                \
+      eventcode = tvb_get_guint8(next_tvb, 0);                        \
+      sent = (eventcode & 0x80) ? "Sent-" : "";                       \
+      event_ti = proto_tree_add_text(t, next_tvb, 0, -1,              \
+                              "event: %d (%s)",                       \
+                               eventcode,                             \
+                               val_to_str(eventcode & 0x7F,           \
+                                          state->eventcode_vals,      \
+                                          "<Unknown eventcode %u>")); \
+      event_proto_tree = proto_item_add_subtree(event_ti,             \
+                                                ett_x11_event);       \
+      decode_x11_event(next_tvb, eventcode, sent, event_proto_tree,   \
+                       state, little_endian);                         \
+      offset = next_offset;                                           \
 } while (0)
 
 #define LISTofARC(name) { listOfArc(tvb, offsetp, t, hf_x11_##name, (next_offset - *offsetp) / 12, little_endian); }
@@ -1184,12 +1184,12 @@ static const value_string zero_is_none_vals[] = {
 #define LISTofSTRING8(name, length) { listOfString8(tvb, offsetp, t, hf_x11_##name, hf_x11_##name##_string, (length), little_endian); }
 #define LISTofTEXTITEM8(name) { listOfTextItem(tvb, offsetp, t, hf_x11_##name, FALSE, next_offset, little_endian); }
 #define LISTofTEXTITEM16(name) { listOfTextItem(tvb, offsetp, t, hf_x11_##name, TRUE, next_offset, little_endian); }
-#define OPCODE() {                                             \
-    opcode = VALUE8(tvb, *offsetp);                            \
-    proto_tree_add_uint_format(t, hf_x11_opcode, tvb, *offsetp,        \
-           1, opcode,  "opcode: %u (%s)", opcode,              \
-           val_to_str(opcode, state->opcode_vals, "Unknown")); \
-    *offsetp += 1;                                             \
+#define OPCODE() {                                                \
+      opcode = VALUE8(tvb, *offsetp);                             \
+      proto_tree_add_uint_format(t, hf_x11_opcode, tvb, *offsetp, \
+            1, opcode,  "opcode: %u (%s)", opcode,                \
+            val_to_str(opcode, state->opcode_vals, "Unknown"));   \
+      *offsetp += 1;                                              \
   }
 
 #define PIXMAP(name)   { FIELD32(name); }
@@ -1210,106 +1210,106 @@ static const value_string zero_is_none_vals[] = {
 
 #define VISUALID(name) { gint32 v = VALUE32(tvb, *offsetp); \
     proto_tree_add_uint_format(t, hf_x11_##name, tvb, *offsetp, 4, v, "Visualid: 0x%08x%s", v, \
-                              v ? "" : " (CopyFromParent)"); *offsetp += 4; }
+                               v ? "" : " (CopyFromParent)"); *offsetp += 4; }
 #define REPLY(name)       FIELD8(name);
 #define REPLYLENGTH(name) FIELD32(name);
 
-#define EVENTCONTENTS_COMMON() do {                                         \
-                       TIMESTAMP(time);                                     \
-                       WINDOW(rootwindow);                                  \
-                       WINDOW(eventwindow);                                 \
-                       WINDOW(childwindow);                                 \
-                       INT16(root_x);                                       \
-                       INT16(root_y);                                       \
-                       INT16(event_x);                                      \
-                       INT16(event_y);                                      \
-                       setOfKeyButMask(tvb, offsetp, t, little_endian, 1);  \
+#define EVENTCONTENTS_COMMON() do {                          \
+      TIMESTAMP(time);                                       \
+      WINDOW(rootwindow);                                    \
+      WINDOW(eventwindow);                                   \
+      WINDOW(childwindow);                                   \
+      INT16(root_x);                                         \
+      INT16(root_y);                                         \
+      INT16(event_x);                                        \
+      INT16(event_y);                                        \
+      setOfKeyButMask(tvb, offsetp, t, little_endian, 1);    \
 } while (0)
 
-#define SEQUENCENUMBER_REPLY(name) do {                                        \
-       guint16 seqno;                                                  \
-                                                                               \
-       seqno = VALUE16(tvb, *offsetp);                                 \
-       proto_tree_add_uint_format(t, hf_x11_reply_##name, tvb,         \
-       *offsetp, sizeof(seqno), seqno,                                 \
-       "sequencenumber: %d (%s)",                                      \
-       (int)seqno,                                                     \
-       val_to_str(opcode & 0xFF, state->opcode_vals, "<Unknown opcode %d>"));  \
-       *offsetp += sizeof(seqno);                                      \
+#define SEQUENCENUMBER_REPLY(name) do {                                       \
+      guint16 seqno;                                                          \
+                                                                              \
+      seqno = VALUE16(tvb, *offsetp);                                         \
+      proto_tree_add_uint_format(t, hf_x11_reply_##name, tvb,                 \
+      *offsetp, sizeof(seqno), seqno,                                         \
+      "sequencenumber: %d (%s)",                                              \
+      (int)seqno,                                                             \
+      val_to_str(opcode & 0xFF, state->opcode_vals, "<Unknown opcode %d>"));  \
+      *offsetp += sizeof(seqno);                                              \
 } while (0)
 
-#define REPLYCONTENTS_COMMON() do {                                    \
-       REPLY(reply);                                                   \
-       proto_tree_add_item(t, hf_x11_undecoded, tvb, *offsetp,         \
-       1, little_endian);                                              \
-       ++(*offsetp);                                                   \
-       SEQUENCENUMBER_REPLY(sequencenumber);                           \
-       REPLYLENGTH(replylength);                                       \
-       proto_tree_add_item(t, hf_x11_undecoded, tvb, *offsetp,         \
-       tvb_reported_length_remaining(tvb, *offsetp), little_endian);   \
-       *offsetp += tvb_reported_length_remaining(tvb, *offsetp);       \
+#define REPLYCONTENTS_COMMON() do {                                   \
+      REPLY(reply);                                                   \
+      proto_tree_add_item(t, hf_x11_undecoded, tvb, *offsetp,         \
+      1, little_endian);                                              \
+      ++(*offsetp);                                                   \
+      SEQUENCENUMBER_REPLY(sequencenumber);                           \
+      REPLYLENGTH(replylength);                                       \
+      proto_tree_add_item(t, hf_x11_undecoded, tvb, *offsetp,         \
+      tvb_reported_length_remaining(tvb, *offsetp), little_endian);   \
+      *offsetp += tvb_reported_length_remaining(tvb, *offsetp);       \
 } while (0)
 
 
-#define HANDLE_REPLY(plen, length_remaining, str, func) do {           \
-       if (length_remaining < plen) {                                  \
-               if (x11_desegment && pinfo->can_desegment) {            \
-                       pinfo->desegment_offset = offset;               \
-                       pinfo->desegment_len    = plen - length_remaining;\
-                       return;                                         \
-               } else {                                                \
-                       ; /* XXX yes, what then?  Need to skip/join. */ \
-               }                                                       \
-       }                                                               \
-       if (length_remaining > plen)                                    \
-               length_remaining = plen;                                \
-       next_tvb = tvb_new_subset(tvb, offset, length_remaining, plen); \
-                                                                       \
-       if (sep == NULL) {                                              \
-          if (check_col(pinfo->cinfo, COL_INFO))                       \
-                  col_set_str(pinfo->cinfo, COL_INFO, str);            \
-          sep = ":";                                                   \
-       }                                                               \
-                                                                       \
-       TRY {                                                           \
-               func(next_tvb, pinfo, tree, sep, state, little_endian); \
-       }                                                               \
-                                                                       \
-       CATCH(BoundsError) {                                            \
-               RETHROW;                                                \
-       }                                                               \
-       CATCH(ReportedBoundsError) {                                    \
-               show_reported_bounds_error(next_tvb, pinfo, tree);      \
-       }                                                               \
-       ENDTRY;                                                         \
-                                                                       \
-       sep = ",";                                                      \
+#define HANDLE_REPLY(plen, length_remaining, str, func) do {          \
+      if (length_remaining < plen) {                                  \
+            if (x11_desegment && pinfo->can_desegment) {              \
+                  pinfo->desegment_offset = offset;                   \
+                  pinfo->desegment_len    = plen - length_remaining;  \
+                  return;                                             \
+            } else {                                                  \
+                  ; /* XXX yes, what then?  Need to skip/join. */     \
+            }                                                         \
+      }                                                               \
+      if (length_remaining > plen)                                    \
+            length_remaining = plen;                                  \
+      next_tvb = tvb_new_subset(tvb, offset, length_remaining, plen); \
+                                                                      \
+      if (sep == NULL) {                                              \
+            if (check_col(pinfo->cinfo, COL_INFO))                    \
+                  col_set_str(pinfo->cinfo, COL_INFO, str);           \
+            sep = ":";                                                \
+      }                                                               \
+                                                                      \
+      TRY {                                                           \
+            func(next_tvb, pinfo, tree, sep, state, little_endian);   \
+      }                                                               \
+                                                                      \
+      CATCH(BoundsError) {                                            \
+            RETHROW;                                                  \
+      }                                                               \
+      CATCH(ReportedBoundsError) {                                    \
+            show_reported_bounds_error(next_tvb, pinfo, tree);        \
+      }                                                               \
+      ENDTRY;                                                         \
+                                                                      \
+      sep = ",";                                                      \
 } while (0)
 
 static void
 dissect_x11_initial_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                 const char *sep, x11_conv_data_t *volatile state,
-                 gboolean little_endian);
+                  const char *sep, x11_conv_data_t *volatile state,
+                  gboolean little_endian);
 
 static void
 dissect_x11_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                 const char *volatile sep, x11_conv_data_t *volatile state,
-                 gboolean little_endian);
+                  const char *volatile sep, x11_conv_data_t *volatile state,
+                  gboolean little_endian);
 
 static void
 dissect_x11_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                 const char *volatile sep, x11_conv_data_t *volatile state,
-                 gboolean little_endian);
+                  const char *volatile sep, x11_conv_data_t *volatile state,
+                  gboolean little_endian);
 
 static void
 dissect_x11_event(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                 const char *volatile sep, x11_conv_data_t *volatile state,
-                 gboolean little_endian);
+                  const char *volatile sep, x11_conv_data_t *volatile state,
+                  gboolean little_endian);
 
 static void
 decode_x11_event(tvbuff_t *tvb, unsigned char eventcode, const char *sent,
-                proto_tree *t, x11_conv_data_t *volatile state,
-                gboolean little_endian);
+                 proto_tree *t, x11_conv_data_t *volatile state,
+                 gboolean little_endian);
 
 static x11_conv_data_t *
 x11_stateinit(conversation_t *conversation);
@@ -1325,23 +1325,23 @@ keysymString(guint32 v);
  ************************************************************************/
 
 static void atom(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                gboolean little_endian)
+                 gboolean little_endian)
 {
       const char *interpretation = NULL;
 
       guint32 v = VALUE32(tvb, *offsetp);
       if (v >= 1 && v < array_length(atom_predefined_interpretation))
-           interpretation = atom_predefined_interpretation[v];
+            interpretation = atom_predefined_interpretation[v];
       else if (v)
-           interpretation = "Not a predefined atom";
+            interpretation = "Not a predefined atom";
       else {
-           header_field_info *hfi = proto_registrar_get_nth(hf);
-           if (hfi -> strings)
-                 interpretation = match_strval(v, cVALS(hfi -> strings));
+            header_field_info *hfi = proto_registrar_get_nth(hf);
+            if (hfi -> strings)
+                  interpretation = match_strval(v, cVALS(hfi -> strings));
       }
       if (!interpretation) interpretation = "error in Xlib client program ?";
       proto_tree_add_uint_format(t, hf, tvb, *offsetp, 4, v, "%s: %u (%s)",
-                                proto_registrar_get_nth(hf) -> name, v, interpretation);
+                                 proto_registrar_get_nth(hf) -> name, v, interpretation);
       *offsetp += 4;
 }
 
@@ -1360,109 +1360,109 @@ static void colorFlags(tvbuff_t *tvb, int *offsetp, proto_tree *t)
       proto_tree *tt;
 
       if (do_red_green_blue) {
-           int sep = FALSE;
-           emem_strbuf_t *buffer = ep_strbuf_new_label("flags: ");
-
-           if (do_red_green_blue & 0x1) {
-                 ep_strbuf_append(buffer, "DoRed");
-                 sep = TRUE;
-           }
-
-           if (do_red_green_blue & 0x2) {
-                 if (sep) ep_strbuf_append(buffer, " | ");
-                 ep_strbuf_append(buffer, "DoGreen");
-                 sep = TRUE;
-           }
-
-           if (do_red_green_blue & 0x4) {
-                 if (sep) ep_strbuf_append(buffer, " | ");
-                 ep_strbuf_append(buffer, "DoBlue");
-                 sep = TRUE;
-           }
-
-           if (do_red_green_blue & 0xf8) {
-                 if (sep) ep_strbuf_append(buffer, " + trash");
-           }
-
-           ti = proto_tree_add_uint_format(t, hf_x11_coloritem_flags, tvb, *offsetp, 1, do_red_green_blue,
-                                           "%s", buffer->str);
-           tt = proto_item_add_subtree(ti, ett_x11_color_flags);
-           if (do_red_green_blue & 0x1)
-                 proto_tree_add_boolean(tt, hf_x11_coloritem_flags_do_red, tvb, *offsetp, 1,
-                                        do_red_green_blue & 0x1);
-           if (do_red_green_blue & 0x2)
-                 proto_tree_add_boolean(tt, hf_x11_coloritem_flags_do_green, tvb, *offsetp, 1,
-                                        do_red_green_blue & 0x2);
-           if (do_red_green_blue & 0x4)
-                 proto_tree_add_boolean(tt, hf_x11_coloritem_flags_do_blue, tvb, *offsetp, 1,
-                                        do_red_green_blue & 0x4);
-           if (do_red_green_blue & 0xf8)
-                 proto_tree_add_boolean(tt, hf_x11_coloritem_flags_unused, tvb, *offsetp, 1,
-                                        do_red_green_blue & 0xf8);
+            int sep = FALSE;
+            emem_strbuf_t *buffer = ep_strbuf_new_label("flags: ");
+
+            if (do_red_green_blue & 0x1) {
+                  ep_strbuf_append(buffer, "DoRed");
+                  sep = TRUE;
+            }
+
+            if (do_red_green_blue & 0x2) {
+                  if (sep) ep_strbuf_append(buffer, " | ");
+                  ep_strbuf_append(buffer, "DoGreen");
+                  sep = TRUE;
+            }
+
+            if (do_red_green_blue & 0x4) {
+                  if (sep) ep_strbuf_append(buffer, " | ");
+                  ep_strbuf_append(buffer, "DoBlue");
+                  sep = TRUE;
+            }
+
+            if (do_red_green_blue & 0xf8) {
+                  if (sep) ep_strbuf_append(buffer, " + trash");
+            }
+
+            ti = proto_tree_add_uint_format(t, hf_x11_coloritem_flags, tvb, *offsetp, 1, do_red_green_blue,
+                                            "%s", buffer->str);
+            tt = proto_item_add_subtree(ti, ett_x11_color_flags);
+            if (do_red_green_blue & 0x1)
+                  proto_tree_add_boolean(tt, hf_x11_coloritem_flags_do_red, tvb, *offsetp, 1,
+                                         do_red_green_blue & 0x1);
+            if (do_red_green_blue & 0x2)
+                  proto_tree_add_boolean(tt, hf_x11_coloritem_flags_do_green, tvb, *offsetp, 1,
+                                         do_red_green_blue & 0x2);
+            if (do_red_green_blue & 0x4)
+                  proto_tree_add_boolean(tt, hf_x11_coloritem_flags_do_blue, tvb, *offsetp, 1,
+                                         do_red_green_blue & 0x4);
+            if (do_red_green_blue & 0xf8)
+                  proto_tree_add_boolean(tt, hf_x11_coloritem_flags_unused, tvb, *offsetp, 1,
+                                         do_red_green_blue & 0xf8);
       } else
-           proto_tree_add_uint_format(t, hf_x11_coloritem_flags, tvb, *offsetp, 1, do_red_green_blue,
-                                      "flags: none");
+            proto_tree_add_uint_format(t, hf_x11_coloritem_flags, tvb, *offsetp, 1, do_red_green_blue,
+                                       "flags: none");
       *offsetp += 1;
 }
 
 static void gravity(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-    int hf, const char *nullInterpretation)
+                    int hf, const char *nullInterpretation)
 {
       guint8 v = VALUE8(tvb, *offsetp);
 
       if (!v)
-           proto_tree_add_uint_format(t, hf, tvb, *offsetp, 1, v, "%s: 0 (%s)",
-                                      proto_registrar_get_nth(hf) -> name,
-                                      nullInterpretation);
+            proto_tree_add_uint_format(t, hf, tvb, *offsetp, 1, v, "%s: 0 (%s)",
+                                       proto_registrar_get_nth(hf) -> name,
+                                       nullInterpretation);
       else
-           proto_tree_add_uint(t, hf, tvb, *offsetp, 1, v);
+            proto_tree_add_uint(t, hf, tvb, *offsetp, 1, v);
       *offsetp += 1;
 }
 
 static void listOfArc(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                     int length, gboolean little_endian)
+                      int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 8, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_arc);
       while(length--) {
-           gint16 x = VALUE16(tvb, *offsetp);
-           gint16 y = VALUE16(tvb, *offsetp + 2);
-           guint16 width = VALUE16(tvb, *offsetp + 4);
-           guint16 height = VALUE16(tvb, *offsetp + 6);
-           gint16 angle1 = VALUE16(tvb, *offsetp + 8);
-           gint16 angle2 = VALUE16(tvb, *offsetp + 10);
-
-           proto_item *tti = proto_tree_add_none_format(tt, hf_x11_arc, tvb, *offsetp, 12,
-                                                            "arc: %dx%d+%d+%d, angle %d -> %d (%f degrees -> %f degrees)",
-                                                            width, height, x, y, angle1, angle2,
-                                                            angle1 / 64.0, angle2 / 64.0);
-           proto_tree *ttt = proto_item_add_subtree(tti, ett_x11_arc);
-           proto_tree_add_int(ttt, hf_x11_arc_x, tvb, *offsetp, 2, x);
-           *offsetp += 2;
-           proto_tree_add_int(ttt, hf_x11_arc_y, tvb, *offsetp, 2, y);
-           *offsetp += 2;
-           proto_tree_add_uint(ttt, hf_x11_arc_width, tvb, *offsetp, 2, y);
-           *offsetp += 2;
-           proto_tree_add_uint(ttt, hf_x11_arc_height, tvb, *offsetp, 2, y);
-           *offsetp += 2;
-           proto_tree_add_int(ttt, hf_x11_arc_angle1, tvb, *offsetp, 2, y);
-           *offsetp += 2;
-           proto_tree_add_int(ttt, hf_x11_arc_angle2, tvb, *offsetp, 2, y);
-           *offsetp += 2;
+            gint16 x = VALUE16(tvb, *offsetp);
+            gint16 y = VALUE16(tvb, *offsetp + 2);
+            guint16 width = VALUE16(tvb, *offsetp + 4);
+            guint16 height = VALUE16(tvb, *offsetp + 6);
+            gint16 angle1 = VALUE16(tvb, *offsetp + 8);
+            gint16 angle2 = VALUE16(tvb, *offsetp + 10);
+
+            proto_item *tti = proto_tree_add_none_format(tt, hf_x11_arc, tvb, *offsetp, 12,
+                                                             "arc: %dx%d+%d+%d, angle %d -> %d (%f degrees -> %f degrees)",
+                                                             width, height, x, y, angle1, angle2,
+                                                             angle1 / 64.0, angle2 / 64.0);
+            proto_tree *ttt = proto_item_add_subtree(tti, ett_x11_arc);
+            proto_tree_add_int(ttt, hf_x11_arc_x, tvb, *offsetp, 2, x);
+            *offsetp += 2;
+            proto_tree_add_int(ttt, hf_x11_arc_y, tvb, *offsetp, 2, y);
+            *offsetp += 2;
+            proto_tree_add_uint(ttt, hf_x11_arc_width, tvb, *offsetp, 2, y);
+            *offsetp += 2;
+            proto_tree_add_uint(ttt, hf_x11_arc_height, tvb, *offsetp, 2, y);
+            *offsetp += 2;
+            proto_tree_add_int(ttt, hf_x11_arc_angle1, tvb, *offsetp, 2, y);
+            *offsetp += 2;
+            proto_tree_add_int(ttt, hf_x11_arc_angle2, tvb, *offsetp, 2, y);
+            *offsetp += 2;
       }
 }
 
 static void listOfAtom(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                      int length, gboolean little_endian)
+                       int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 4, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_atom);
       while(length--)
-           atom(tvb, offsetp, tt, hf_x11_properties_item, little_endian);
+            atom(tvb, offsetp, tt, hf_x11_properties_item, little_endian);
 }
 
 static void listOfByte(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                      int length, gboolean little_endian)
+                       int length, gboolean little_endian)
 {
       if (length <= 0) length = 1;
       proto_tree_add_item(t, hf, tvb, *offsetp, length, little_endian);
@@ -1470,115 +1470,115 @@ static void listOfByte(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
 }
 
 static void listOfCard16(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                        int hf_item, int length, gboolean little_endian)
+                         int hf_item, int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 2, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_card32);
       while(length--) {
-           proto_tree_add_uint(tt, hf_item, tvb, *offsetp, 2, VALUE16(tvb, *offsetp));
-           *offsetp += 2;
+            proto_tree_add_uint(tt, hf_item, tvb, *offsetp, 2, VALUE16(tvb, *offsetp));
+            *offsetp += 2;
       }
 }
 
 static void listOfInt16(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                        int hf_item, int length, gboolean little_endian)
+                         int hf_item, int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 2, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_card32);
       while(length--) {
-           proto_tree_add_int(tt, hf_item, tvb, *offsetp, 2, VALUE16(tvb, *offsetp));
-           *offsetp += 2;
+            proto_tree_add_int(tt, hf_item, tvb, *offsetp, 2, VALUE16(tvb, *offsetp));
+            *offsetp += 2;
       }
 }
 
 static void listOfCard32(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                        int hf_item, int length, gboolean little_endian)
+                         int hf_item, int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 4, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_card32);
       while(length--) {
-           proto_tree_add_uint(tt, hf_item, tvb, *offsetp, 4, VALUE32(tvb, *offsetp));
-           *offsetp += 4;
+            proto_tree_add_uint(tt, hf_item, tvb, *offsetp, 4, VALUE32(tvb, *offsetp));
+            *offsetp += 4;
       }
 }
 
 static void listOfInt32(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                        int hf_item, int length, gboolean little_endian)
+                         int hf_item, int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 4, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_card32);
       while(length--) {
-           proto_tree_add_int(tt, hf_item, tvb, *offsetp, 4, VALUE32(tvb, *offsetp));
-           *offsetp += 4;
+            proto_tree_add_int(tt, hf_item, tvb, *offsetp, 4, VALUE32(tvb, *offsetp));
+            *offsetp += 4;
       }
 }
 
 static void listOfFloat(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                        int hf_item, int length, gboolean little_endian)
+                         int hf_item, int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 4, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_float);
       while(length--) {
-           proto_tree_add_float(tt, hf_item, tvb, *offsetp, 4, FLOAT(tvb, *offsetp));
-           *offsetp += 4;
+            proto_tree_add_float(tt, hf_item, tvb, *offsetp, 4, FLOAT(tvb, *offsetp));
+            *offsetp += 4;
       }
 }
 
 static void listOfDouble(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                        int hf_item, int length, gboolean little_endian)
+                         int hf_item, int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 8, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_double);
       while(length--) {
-           proto_tree_add_double(tt, hf_item, tvb, *offsetp, 8, DOUBLE(tvb, *offsetp));
-           *offsetp += 8;
+            proto_tree_add_double(tt, hf_item, tvb, *offsetp, 8, DOUBLE(tvb, *offsetp));
+            *offsetp += 8;
       }
 }
 
 static void listOfColorItem(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                           int length, gboolean little_endian)
+                            int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 8, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_color_item);
       while(length--) {
-           proto_item *tti;
-           proto_tree *ttt;
-           unsigned do_red_green_blue;
-           guint16 red, green, blue;
-           emem_strbuf_t *buffer;
-           const char *sep;
-
-           buffer=ep_strbuf_new_label("colorItem ");
-           red = VALUE16(tvb, *offsetp + 4);
-           green = VALUE16(tvb, *offsetp + 6);
-           blue = VALUE16(tvb, *offsetp + 8);
-           do_red_green_blue = VALUE8(tvb, *offsetp + 10);
-
-           sep = "";
-           if (do_red_green_blue & 0x1) {
-               ep_strbuf_append_printf(buffer, "red = %d", red);
-               sep = ", ";
-           }
-           if (do_red_green_blue & 0x2) {
-               ep_strbuf_append_printf(buffer, "%sgreen = %d", sep, green);
-               sep = ", ";
-           }
-           if (do_red_green_blue & 0x4)
-               ep_strbuf_append_printf(buffer, "%sblue = %d", sep, blue);
-
-           tti = proto_tree_add_none_format(tt, hf_x11_coloritem, tvb, *offsetp, 12, "%s", buffer->str);
-           ttt = proto_item_add_subtree(tti, ett_x11_color_item);
-           proto_tree_add_item(ttt, hf_x11_coloritem_pixel, tvb, *offsetp, 4, little_endian);
-           *offsetp += 4;
-           proto_tree_add_item(ttt, hf_x11_coloritem_red, tvb, *offsetp, 2, little_endian);
-           *offsetp += 2;
-           proto_tree_add_item(ttt, hf_x11_coloritem_green, tvb, *offsetp, 2, little_endian);
-           *offsetp += 2;
-           proto_tree_add_item(ttt, hf_x11_coloritem_blue, tvb, *offsetp, 2, little_endian);
-           *offsetp += 2;
-           colorFlags(tvb, offsetp, ttt);
-           proto_tree_add_item(ttt, hf_x11_coloritem_unused, tvb, *offsetp, 1, little_endian);
-           *offsetp += 1;
+            proto_item *tti;
+            proto_tree *ttt;
+            unsigned do_red_green_blue;
+            guint16 red, green, blue;
+            emem_strbuf_t *buffer;
+            const char *sep;
+
+            buffer=ep_strbuf_new_label("colorItem ");
+            red = VALUE16(tvb, *offsetp + 4);
+            green = VALUE16(tvb, *offsetp + 6);
+            blue = VALUE16(tvb, *offsetp + 8);
+            do_red_green_blue = VALUE8(tvb, *offsetp + 10);
+
+            sep = "";
+            if (do_red_green_blue & 0x1) {
+                ep_strbuf_append_printf(buffer, "red = %d", red);
+                sep = ", ";
+            }
+            if (do_red_green_blue & 0x2) {
+                ep_strbuf_append_printf(buffer, "%sgreen = %d", sep, green);
+                sep = ", ";
+            }
+            if (do_red_green_blue & 0x4)
+                ep_strbuf_append_printf(buffer, "%sblue = %d", sep, blue);
+
+            tti = proto_tree_add_none_format(tt, hf_x11_coloritem, tvb, *offsetp, 12, "%s", buffer->str);
+            ttt = proto_item_add_subtree(tti, ett_x11_color_item);
+            proto_tree_add_item(ttt, hf_x11_coloritem_pixel, tvb, *offsetp, 4, little_endian);
+            *offsetp += 4;
+            proto_tree_add_item(ttt, hf_x11_coloritem_red, tvb, *offsetp, 2, little_endian);
+            *offsetp += 2;
+            proto_tree_add_item(ttt, hf_x11_coloritem_green, tvb, *offsetp, 2, little_endian);
+            *offsetp += 2;
+            proto_tree_add_item(ttt, hf_x11_coloritem_blue, tvb, *offsetp, 2, little_endian);
+            *offsetp += 2;
+            colorFlags(tvb, offsetp, ttt);
+            proto_tree_add_item(ttt, hf_x11_coloritem_unused, tvb, *offsetp, 1, little_endian);
+            *offsetp += 1;
       }
 }
 
@@ -1596,277 +1596,277 @@ XConvertCase(register int sym, int *lower, int *upper)
     *upper = sym;
     switch(sym >> 8) {
     case 0: /* Latin 1 */
-       if ((sym >= XK_A) && (sym <= XK_Z))
-           *lower += (XK_a - XK_A);
-       else if ((sym >= XK_a) && (sym <= XK_z))
-           *upper -= (XK_a - XK_A);
-       else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
-           *lower += (XK_agrave - XK_Agrave);
-       else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis))
-           *upper -= (XK_agrave - XK_Agrave);
-       else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn))
-           *lower += (XK_oslash - XK_Ooblique);
-       else if ((sym >= XK_oslash) && (sym <= XK_thorn))
-           *upper -= (XK_oslash - XK_Ooblique);
-       break;
+        if ((sym >= XK_A) && (sym <= XK_Z))
+            *lower += (XK_a - XK_A);
+        else if ((sym >= XK_a) && (sym <= XK_z))
+            *upper -= (XK_a - XK_A);
+        else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
+            *lower += (XK_agrave - XK_Agrave);
+        else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis))
+            *upper -= (XK_agrave - XK_Agrave);
+        else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn))
+            *lower += (XK_oslash - XK_Ooblique);
+        else if ((sym >= XK_oslash) && (sym <= XK_thorn))
+            *upper -= (XK_oslash - XK_Ooblique);
+        break;
     case 1: /* Latin 2 */
-       /* Assume the KeySym is a legal value (ignore discontinuities) */
-       if (sym == XK_Aogonek)
-           *lower = XK_aogonek;
-       else if (sym >= XK_Lstroke && sym <= XK_Sacute)
-           *lower += (XK_lstroke - XK_Lstroke);
-       else if (sym >= XK_Scaron && sym <= XK_Zacute)
-           *lower += (XK_scaron - XK_Scaron);
-       else if (sym >= XK_Zcaron && sym <= XK_Zabovedot)
-           *lower += (XK_zcaron - XK_Zcaron);
-       else if (sym == XK_aogonek)
-           *upper = XK_Aogonek;
-       else if (sym >= XK_lstroke && sym <= XK_sacute)
-           *upper -= (XK_lstroke - XK_Lstroke);
-       else if (sym >= XK_scaron && sym <= XK_zacute)
-           *upper -= (XK_scaron - XK_Scaron);
-       else if (sym >= XK_zcaron && sym <= XK_zabovedot)
-           *upper -= (XK_zcaron - XK_Zcaron);
-       else if (sym >= XK_Racute && sym <= XK_Tcedilla)
-           *lower += (XK_racute - XK_Racute);
-       else if (sym >= XK_racute && sym <= XK_tcedilla)
-           *upper -= (XK_racute - XK_Racute);
-       break;
+        /* Assume the KeySym is a legal value (ignore discontinuities) */
+        if (sym == XK_Aogonek)
+            *lower = XK_aogonek;
+        else if (sym >= XK_Lstroke && sym <= XK_Sacute)
+            *lower += (XK_lstroke - XK_Lstroke);
+        else if (sym >= XK_Scaron && sym <= XK_Zacute)
+            *lower += (XK_scaron - XK_Scaron);
+        else if (sym >= XK_Zcaron && sym <= XK_Zabovedot)
+            *lower += (XK_zcaron - XK_Zcaron);
+        else if (sym == XK_aogonek)
+            *upper = XK_Aogonek;
+        else if (sym >= XK_lstroke && sym <= XK_sacute)
+            *upper -= (XK_lstroke - XK_Lstroke);
+        else if (sym >= XK_scaron && sym <= XK_zacute)
+            *upper -= (XK_scaron - XK_Scaron);
+        else if (sym >= XK_zcaron && sym <= XK_zabovedot)
+            *upper -= (XK_zcaron - XK_Zcaron);
+        else if (sym >= XK_Racute && sym <= XK_Tcedilla)
+            *lower += (XK_racute - XK_Racute);
+        else if (sym >= XK_racute && sym <= XK_tcedilla)
+            *upper -= (XK_racute - XK_Racute);
+        break;
     case 2: /* Latin 3 */
-       /* Assume the KeySym is a legal value (ignore discontinuities) */
-       if (sym >= XK_Hstroke && sym <= XK_Hcircumflex)
-           *lower += (XK_hstroke - XK_Hstroke);
-       else if (sym >= XK_Gbreve && sym <= XK_Jcircumflex)
-           *lower += (XK_gbreve - XK_Gbreve);
-       else if (sym >= XK_hstroke && sym <= XK_hcircumflex)
-           *upper -= (XK_hstroke - XK_Hstroke);
-       else if (sym >= XK_gbreve && sym <= XK_jcircumflex)
-           *upper -= (XK_gbreve - XK_Gbreve);
-       else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex)
-           *lower += (XK_cabovedot - XK_Cabovedot);
-       else if (sym >= XK_cabovedot && sym <= XK_scircumflex)
-           *upper -= (XK_cabovedot - XK_Cabovedot);
-       break;
+        /* Assume the KeySym is a legal value (ignore discontinuities) */
+        if (sym >= XK_Hstroke && sym <= XK_Hcircumflex)
+            *lower += (XK_hstroke - XK_Hstroke);
+        else if (sym >= XK_Gbreve && sym <= XK_Jcircumflex)
+            *lower += (XK_gbreve - XK_Gbreve);
+        else if (sym >= XK_hstroke && sym <= XK_hcircumflex)
+            *upper -= (XK_hstroke - XK_Hstroke);
+        else if (sym >= XK_gbreve && sym <= XK_jcircumflex)
+            *upper -= (XK_gbreve - XK_Gbreve);
+        else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex)
+            *lower += (XK_cabovedot - XK_Cabovedot);
+        else if (sym >= XK_cabovedot && sym <= XK_scircumflex)
+            *upper -= (XK_cabovedot - XK_Cabovedot);
+        break;
     case 3: /* Latin 4 */
-       /* Assume the KeySym is a legal value (ignore discontinuities) */
-       if (sym >= XK_Rcedilla && sym <= XK_Tslash)
-           *lower += (XK_rcedilla - XK_Rcedilla);
-       else if (sym >= XK_rcedilla && sym <= XK_tslash)
-           *upper -= (XK_rcedilla - XK_Rcedilla);
-       else if (sym == XK_ENG)
-           *lower = XK_eng;
-       else if (sym == XK_eng)
-           *upper = XK_ENG;
-       else if (sym >= XK_Amacron && sym <= XK_Umacron)
-           *lower += (XK_amacron - XK_Amacron);
-       else if (sym >= XK_amacron && sym <= XK_umacron)
-           *upper -= (XK_amacron - XK_Amacron);
-       break;
+        /* Assume the KeySym is a legal value (ignore discontinuities) */
+        if (sym >= XK_Rcedilla && sym <= XK_Tslash)
+            *lower += (XK_rcedilla - XK_Rcedilla);
+        else if (sym >= XK_rcedilla && sym <= XK_tslash)
+            *upper -= (XK_rcedilla - XK_Rcedilla);
+        else if (sym == XK_ENG)
+            *lower = XK_eng;
+        else if (sym == XK_eng)
+            *upper = XK_ENG;
+        else if (sym >= XK_Amacron && sym <= XK_Umacron)
+            *lower += (XK_amacron - XK_Amacron);
+        else if (sym >= XK_amacron && sym <= XK_umacron)
+            *upper -= (XK_amacron - XK_Amacron);
+        break;
     case 6: /* Cyrillic */
-       /* Assume the KeySym is a legal value (ignore discontinuities) */
-       if (sym >= XK_Serbian_DJE && sym <= XK_Serbian_DZE)
-           *lower -= (XK_Serbian_DJE - XK_Serbian_dje);
-       else if (sym >= XK_Serbian_dje && sym <= XK_Serbian_dze)
-           *upper += (XK_Serbian_DJE - XK_Serbian_dje);
-       else if (sym >= XK_Cyrillic_YU && sym <= XK_Cyrillic_HARDSIGN)
-           *lower -= (XK_Cyrillic_YU - XK_Cyrillic_yu);
-       else if (sym >= XK_Cyrillic_yu && sym <= XK_Cyrillic_hardsign)
-           *upper += (XK_Cyrillic_YU - XK_Cyrillic_yu);
+        /* Assume the KeySym is a legal value (ignore discontinuities) */
+        if (sym >= XK_Serbian_DJE && sym <= XK_Serbian_DZE)
+            *lower -= (XK_Serbian_DJE - XK_Serbian_dje);
+        else if (sym >= XK_Serbian_dje && sym <= XK_Serbian_dze)
+            *upper += (XK_Serbian_DJE - XK_Serbian_dje);
+        else if (sym >= XK_Cyrillic_YU && sym <= XK_Cyrillic_HARDSIGN)
+            *lower -= (XK_Cyrillic_YU - XK_Cyrillic_yu);
+        else if (sym >= XK_Cyrillic_yu && sym <= XK_Cyrillic_hardsign)
+            *upper += (XK_Cyrillic_YU - XK_Cyrillic_yu);
         break;
     case 7: /* Greek */
-       /* Assume the KeySym is a legal value (ignore discontinuities) */
-       if (sym >= XK_Greek_ALPHAaccent && sym <= XK_Greek_OMEGAaccent)
-           *lower += (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
-       else if (sym >= XK_Greek_alphaaccent && sym <= XK_Greek_omegaaccent &&
-                sym != XK_Greek_iotaaccentdieresis &&
-                sym != XK_Greek_upsilonaccentdieresis)
-           *upper -= (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
-       else if (sym >= XK_Greek_ALPHA && sym <= XK_Greek_OMEGA)
-           *lower += (XK_Greek_alpha - XK_Greek_ALPHA);
-       else if (sym >= XK_Greek_alpha && sym <= XK_Greek_omega &&
-                sym != XK_Greek_finalsmallsigma)
-           *upper -= (XK_Greek_alpha - XK_Greek_ALPHA);
+        /* Assume the KeySym is a legal value (ignore discontinuities) */
+        if (sym >= XK_Greek_ALPHAaccent && sym <= XK_Greek_OMEGAaccent)
+            *lower += (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
+        else if (sym >= XK_Greek_alphaaccent && sym <= XK_Greek_omegaaccent &&
+                 sym != XK_Greek_iotaaccentdieresis &&
+                 sym != XK_Greek_upsilonaccentdieresis)
+            *upper -= (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
+        else if (sym >= XK_Greek_ALPHA && sym <= XK_Greek_OMEGA)
+            *lower += (XK_Greek_alpha - XK_Greek_ALPHA);
+        else if (sym >= XK_Greek_alpha && sym <= XK_Greek_omega &&
+                 sym != XK_Greek_finalsmallsigma)
+            *upper -= (XK_Greek_alpha - XK_Greek_ALPHA);
         break;
     }
 }
 
 static const char *
 keycode2keysymString(int *keycodemap[256], int first_keycode,
-                    int keysyms_per_keycode,
-                    int *modifiermap[array_length(modifiers)],
-                    int keycodes_per_modifier,
-                    guint32 keycode, guint32 bitmask)
+                     int keysyms_per_keycode,
+                     int *modifiermap[array_length(modifiers)],
+                     int keycodes_per_modifier,
+                     guint32 keycode, guint32 bitmask)
 {
-       int *syms;
-       int groupmodkc, numlockkc, numlockmod, groupmod;
-       int lockmod_is_capslock = 0, lockmod_is_shiftlock = 0;
-       int lockmod_is_nosymbol = 1;
-       int modifier, kc, keysym;
-
-       if ((syms = keycodemap[keycode]) == NULL)
-               return "<Unknown>";
-
-       for (kc = first_keycode, groupmodkc = numlockkc = -1; kc < 256; ++kc)
-               for (keysym = 0; keysym < keysyms_per_keycode; ++keysym) {
-                       if (keycodemap[kc] == NULL)
-                               return "<Unknown>";
-                       switch (keycodemap[kc][keysym]) {
-                               case 0xff7e:
-                                       groupmodkc = kc;
-                                       break;
-
-                               case 0xff7f:
-                                       numlockkc = kc;
-                                       break;
-
-                               case 0xffe5:
-                                       lockmod_is_capslock = kc;
-                                       break;
-
-                               case 0xffe6:
-                                       lockmod_is_shiftlock = kc;
-                                       break;
-                       }
-               }
-
-
-       /*
-        * If we have not seen the modifiermap we don't know what the
-        * keycode translates to, but we do know it's one of the keys
-        * in syms (give or take a case-conversion), so we could in
-        * theory list them all.
-        */
-       if (modifiermap[array_length(modifiers) - 1] == NULL) /* all or none */
-               return "<Unknown>";
-
-       /* find out what the numlockmodifer and groupmodifier is. */
-       for (modifier = 0, numlockmod = groupmod = -1;
-           modifier < (int)array_length(modifiers) && numlockmod == -1;
-           ++modifier)
-               for (kc = 0; kc < keycodes_per_modifier; ++kc)
-                       if (modifiermap[modifier][kc] == numlockkc)
-                               numlockmod = modifier;
-                       else if (modifiermap[modifier][kc] == groupmodkc)
-                               groupmod = modifier;
-
-       /*
-        * ... and what the lockmodifier is interpreted as.
-        * (X11v4r6 ref, keyboard and pointers section.)
-        */
-       for (kc = 0; kc < keycodes_per_modifier; ++kc)
-               if (modifiermap[1][kc] == lockmod_is_capslock) {
-                       lockmod_is_shiftlock = lockmod_is_nosymbol = 0;
-                       break;
-               }
-               else if (modifiermap[0][kc] == lockmod_is_shiftlock) {
-                       lockmod_is_capslock = lockmod_is_nosymbol = 0;
-                       break;
-               }
+      int *syms;
+      int groupmodkc, numlockkc, numlockmod, groupmod;
+      int lockmod_is_capslock = 0, lockmod_is_shiftlock = 0;
+      int lockmod_is_nosymbol = 1;
+      int modifier, kc, keysym;
+
+      if ((syms = keycodemap[keycode]) == NULL)
+            return "<Unknown>";
+
+      for (kc = first_keycode, groupmodkc = numlockkc = -1; kc < 256; ++kc)
+            for (keysym = 0; keysym < keysyms_per_keycode; ++keysym) {
+                  if (keycodemap[kc] == NULL)
+                        return "<Unknown>";
+                  switch (keycodemap[kc][keysym]) {
+                        case 0xff7e:
+                              groupmodkc = kc;
+                              break;
+
+                        case 0xff7f:
+                              numlockkc = kc;
+                              break;
+
+                        case 0xffe5:
+                              lockmod_is_capslock = kc;
+                              break;
+
+                        case 0xffe6:
+                              lockmod_is_shiftlock = kc;
+                              break;
+                  }
+            }
+
+
+      /*
+       * If we have not seen the modifiermap we don't know what the
+       * keycode translates to, but we do know it's one of the keys
+       * in syms (give or take a case-conversion), so we could in
+       * theory list them all.
+       */
+      if (modifiermap[array_length(modifiers) - 1] == NULL) /* all or none */
+            return "<Unknown>";
+
+      /* find out what the numlockmodifer and groupmodifier is. */
+      for (modifier = 0, numlockmod = groupmod = -1;
+           modifier < (int)array_length(modifiers) && numlockmod == -1;
+           ++modifier)
+            for (kc = 0; kc < keycodes_per_modifier; ++kc)
+                  if (modifiermap[modifier][kc] == numlockkc)
+                        numlockmod = modifier;
+                  else if (modifiermap[modifier][kc] == groupmodkc)
+                        groupmod = modifier;
+
+      /*
+       * ... and what the lockmodifier is interpreted as.
+       * (X11v4r6 ref, keyboard and pointers section.)
+       */
+      for (kc = 0; kc < keycodes_per_modifier; ++kc)
+            if (modifiermap[1][kc] == lockmod_is_capslock) {
+                  lockmod_is_shiftlock = lockmod_is_nosymbol = 0;
+                  break;
+            }
+            else if (modifiermap[0][kc] == lockmod_is_shiftlock) {
+                  lockmod_is_capslock = lockmod_is_nosymbol = 0;
+                  break;
+            }
 
 #if 0
-       /*
-        * This is (how I understand) the X11v4R6 protocol description given
-        * in A. Nye's book.  It is quite different from the
-        * code in _XTranslateKey() in the file
-        * "$XConsortium: KeyBind.c /main/55 1996/02/02 14:08:55 kaleb $"
-        * as shipped with XFree, and doesn't work correctly, nor do I see
-        * how it could (e.g. the case of lower/uppercase-letters).
-        * -- Michael Shuldman
-        */
-
-       if (numlockmod >= 0 && (bitmask & modifiermask[numlockmod])
-           && ((syms[1] >= 0xff80
-            && syms[1] <= 0xffbd)
-            || (syms[1] >= 0x11000000
-             && syms[1] <= 0x1100ffff))) {
-               if ((bitmask & ShiftMask) || lockmod_is_shiftlock)
-                       return keysymString(syms[groupmod + 0]);
-               else
-                       if (syms[groupmod + 1] == NoSymbol)
-                               return keysymString(syms[groupmod + 0]);
-                       else
-                               return keysymString(syms[groupmod + 1]);
-       }
-       else if (!(bitmask & ShiftMask) && !(bitmask & LockMask))
-               return keysymString(syms[groupmod + 0]);
-       else if (!(bitmask & ShiftMask)
-           && ((bitmask & LockMask) && lockmod_is_capslock))
-               if (islower(syms[groupmod + 0]))
-/*                     return toupper(keysymString(syms[groupmod + 0])); */
-                       return "Uppercase"; /* XXX */
-               else
-                       return keysymString(syms[groupmod + 0]);
-
-       else if ((bitmask & ShiftMask)
-           && ((bitmask & LockMask) && lockmod_is_capslock))
-               if (islower(syms[groupmod + 1]))
-/*                     return toupper(keysymString(syms[groupmod + 1])); */
-                       return "Uppercase"; /* XXX */
-               else
-                       return keysymString(syms[groupmod + 1]);
-
-       else if ((bitmask & ShiftMask)
-           ||  ((bitmask & LockMask) && lockmod_is_shiftlock))
-                       return keysymString(syms[groupmod + 1]);
+      /*
+       * This is (how I understand) the X11v4R6 protocol description given
+       * in A. Nye's book.  It is quite different from the
+       * code in _XTranslateKey() in the file
+       * "$XConsortium: KeyBind.c /main/55 1996/02/02 14:08:55 kaleb $"
+       * as shipped with XFree, and doesn't work correctly, nor do I see
+       * how it could (e.g. the case of lower/uppercase-letters).
+       * -- Michael Shuldman
+       */
+
+      if (numlockmod >= 0 && (bitmask & modifiermask[numlockmod])
+          && ((syms[1] >= 0xff80
+               && syms[1] <= 0xffbd)
+              || (syms[1] >= 0x11000000
+                  && syms[1] <= 0x1100ffff))) {
+            if ((bitmask & ShiftMask) || lockmod_is_shiftlock)
+                  return keysymString(syms[groupmod + 0]);
+            else
+                  if (syms[groupmod + 1] == NoSymbol)
+                        return keysymString(syms[groupmod + 0]);
+                  else
+                        return keysymString(syms[groupmod + 1]);
+      }
+      else if (!(bitmask & ShiftMask) && !(bitmask & LockMask))
+            return keysymString(syms[groupmod + 0]);
+      else if (!(bitmask & ShiftMask)
+               && ((bitmask & LockMask) && lockmod_is_capslock))
+            if (islower(syms[groupmod + 0]))
+/*                      return toupper(keysymString(syms[groupmod + 0])); */
+                  return "Uppercase"; /* XXX */
+            else
+                  return keysymString(syms[groupmod + 0]);
+
+      else if ((bitmask & ShiftMask)
+               && ((bitmask & LockMask) && lockmod_is_capslock))
+            if (islower(syms[groupmod + 1]))
+/*                      return toupper(keysymString(syms[groupmod + 1])); */
+                  return "Uppercase"; /* XXX */
+            else
+                  return keysymString(syms[groupmod + 1]);
+
+      else if ((bitmask & ShiftMask)
+               ||  ((bitmask & LockMask) && lockmod_is_shiftlock))
+            return keysymString(syms[groupmod + 1]);
 #else /* _XTranslateKey() based code. */
 
-       while (keysyms_per_keycode > 2
-           && keycodemap[keysyms_per_keycode - 1] == NoSymbol)
-               --keysyms_per_keycode;
-       if (keysyms_per_keycode > 2
-           && (groupmod >= 0 && (modifiermask[groupmod] & bitmask))) {
-               syms += 2;
-               keysyms_per_keycode -= 2;
-       }
-
-       if (numlockmod >= 0 && (bitmask & modifiermask[numlockmod])
-           && keysyms_per_keycode > 1
-           && ((syms[1] >= 0xff80 && syms[1] <= 0xffbd)
-            || (syms[1] >= 0x11000000 && syms[1] <= 0x1100ffff))) {
-               if ((bitmask & ShiftMask)
-                   || (bitmask & LockMask && lockmod_is_shiftlock))
-                       keysym = syms[0];
-               else
-                       keysym = syms[1];
-       }
-       else if (!(bitmask & ShiftMask)
-           && (!(bitmask & LockMask) || lockmod_is_nosymbol)) {
-               if (keysyms_per_keycode == 1
-                   || (keysyms_per_keycode > 1 && syms[1] == NoSymbol)) {
-                       int usym;
-
-                       XConvertCase(syms[0], &keysym, &usym);
-               }
-               else
-                       keysym = syms[0];
-       }
-       else if (!(bitmask & LockMask) || !lockmod_is_capslock) {
-               int lsym, usym;
-
-               if (keysyms_per_keycode == 1
-                   || (keysyms_per_keycode > 1 && (usym = syms[1]) == NoSymbol))
-                       XConvertCase(syms[0], &lsym, &usym);
-               keysym = usym;
-       }
-       else {
-               int lsym, usym;
-
-               if (keysyms_per_keycode == 1
-                   || (keysyms_per_keycode > 1 && syms[1] == NoSymbol))
-                       keysym = syms[0];
-
-               XConvertCase(keysym, &lsym, &usym);
-
-               if (!(bitmask & ShiftMask) && keysym != syms[0]
-               && ((keysym != usym) || (lsym == usym)))
-                       XConvertCase(syms[0], &lsym, &usym);
-               keysym = usym;
-       }
-
-       if (keysym == XK_VoidSymbol)
-               keysym = NoSymbol;
-
-       return ep_strdup_printf("%d, \"%s\"", keysym, keysymString(keysym));
+      while (keysyms_per_keycode > 2
+             && keycodemap[keysyms_per_keycode - 1] == NoSymbol)
+            --keysyms_per_keycode;
+      if (keysyms_per_keycode > 2
+          && (groupmod >= 0 && (modifiermask[groupmod] & bitmask))) {
+            syms += 2;
+            keysyms_per_keycode -= 2;
+      }
+
+      if (numlockmod >= 0 && (bitmask & modifiermask[numlockmod])
+          && keysyms_per_keycode > 1
+          && ((syms[1] >= 0xff80 && syms[1] <= 0xffbd)
+              || (syms[1] >= 0x11000000 && syms[1] <= 0x1100ffff))) {
+            if ((bitmask & ShiftMask)
+                || (bitmask & LockMask && lockmod_is_shiftlock))
+                  keysym = syms[0];
+            else
+                  keysym = syms[1];
+      }
+      else if (!(bitmask & ShiftMask)
+               && (!(bitmask & LockMask) || lockmod_is_nosymbol)) {
+            if (keysyms_per_keycode == 1
+                || (keysyms_per_keycode > 1 && syms[1] == NoSymbol)) {
+                  int usym;
+
+                  XConvertCase(syms[0], &keysym, &usym);
+            }
+            else
+                  keysym = syms[0];
+      }
+      else if (!(bitmask & LockMask) || !lockmod_is_capslock) {
+            int lsym, usym;
+
+            if (keysyms_per_keycode == 1
+                || (keysyms_per_keycode > 1 && (usym = syms[1]) == NoSymbol))
+                  XConvertCase(syms[0], &lsym, &usym);
+            keysym = usym;
+      }
+      else {
+            int lsym, usym;
+
+            if (keysyms_per_keycode == 1
+                || (keysyms_per_keycode > 1 && syms[1] == NoSymbol))
+                  keysym = syms[0];
+
+            XConvertCase(keysym, &lsym, &usym);
+
+            if (!(bitmask & ShiftMask) && keysym != syms[0]
+                && ((keysym != usym) || (lsym == usym)))
+                  XConvertCase(syms[0], &lsym, &usym);
+            keysym = usym;
+      }
+
+      if (keysym == XK_VoidSymbol)
+            keysym = NoSymbol;
+
+      return ep_strdup_printf("%d, \"%s\"", keysym, keysymString(keysym));
 #endif
 }
 
@@ -1877,18 +1877,18 @@ static const char *keysymString(guint32 v)
 
             /* This table is so big that we built it only if necessary */
 
-           const value_string *p = keysym_vals_source;
-           keysymTable = g_tree_new(compareGuint32);
-           for(; p -> strptr; p++)
-                 g_tree_insert(keysymTable, GINT_TO_POINTER(p -> value), (gpointer) (p -> strptr) );
+            const value_string *p = keysym_vals_source;
+            keysymTable = g_tree_new(compareGuint32);
+            for(; p -> strptr; p++)
+                  g_tree_insert(keysymTable, GINT_TO_POINTER(p -> value), (gpointer) (p -> strptr) );
       }
       res = g_tree_lookup(keysymTable, GINT_TO_POINTER(v));
       return res ? res : "<Unknown>";
 }
 
 static void listOfKeycode(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                         int *modifiermap[], int keycodes_per_modifier,
-                         gboolean little_endian)
+                          int *modifiermap[], int keycodes_per_modifier,
+                          gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp,
         array_length(modifiers) * keycodes_per_modifier, little_endian);
@@ -1897,31 +1897,31 @@ static void listOfKeycode(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
 
       for (m = 0; m < array_length(modifiers);
         ++m, *offsetp += keycodes_per_modifier) {
-           const guint8 *p;
-           proto_item *tikc;
-           int i;
+            const guint8 *p;
+            proto_item *tikc;
+            int i;
 
-           p = tvb_get_ptr(tvb, *offsetp, keycodes_per_modifier);
-           modifiermap[m] =
-               g_malloc(sizeof(*modifiermap[m]) * keycodes_per_modifier);
+            p = tvb_get_ptr(tvb, *offsetp, keycodes_per_modifier);
+            modifiermap[m] =
+                g_malloc(sizeof(*modifiermap[m]) * keycodes_per_modifier);
 
-           tikc = proto_tree_add_bytes_format(tt, hf_x11_keycodes_item, tvb,
-               *offsetp, keycodes_per_modifier, p, "item: ");
-           for(i = 0; i < keycodes_per_modifier; ++i) {
-               guchar c = p[i];
+            tikc = proto_tree_add_bytes_format(tt, hf_x11_keycodes_item, tvb,
+                *offsetp, keycodes_per_modifier, p, "item: ");
+            for(i = 0; i < keycodes_per_modifier; ++i) {
+                guchar c = p[i];
 
-               if (c)
-                   proto_item_append_text(tikc, " %s=%d", modifiers[m], c);
+                if (c)
+                    proto_item_append_text(tikc, " %s=%d", modifiers[m], c);
 
-               modifiermap[m][i] = c;
-           }
+                modifiermap[m][i] = c;
+            }
       }
 }
 
 static void listOfKeysyms(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                         int hf_item, int *keycodemap[256],
-                         int keycode_first, int keycode_count,
-                         int keysyms_per_keycode, gboolean little_endian)
+                          int hf_item, int *keycodemap[256],
+                          int keycode_first, int keycode_count,
+                          int keysyms_per_keycode, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, keycode_count * keysyms_per_keycode * 4, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_keysyms);
@@ -1934,143 +1934,143 @@ static void listOfKeysyms(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
 
       for (keycode = keycode_first; keycode_count > 0;
            ++keycode, --keycode_count) {
-           if (keycode >= 256) {
-               proto_tree_add_text(tt, tvb, *offsetp, 4 * keysyms_per_keycode,
-                   "keycode value %d is out of range", keycode);
-               *offsetp += 4 * keysyms_per_keycode;
-               continue;
-           }
-           tti = proto_tree_add_none_format(tt, hf_item, tvb, *offsetp,
-               4 * keysyms_per_keycode, "keysyms (keycode %d):", keycode);
-
-           ttt = proto_item_add_subtree(tti, ett_x11_keysym);
-
-           tvb_ensure_bytes_exist(tvb, *offsetp, 4 * keysyms_per_keycode);
-           keycodemap[keycode]
-               = g_malloc(sizeof(*keycodemap[keycode]) * keysyms_per_keycode);
-
-           for(i = 0; i < keysyms_per_keycode; ++i) {
-                 /* keysymvalue = byte3 * 256 + byte4. */
-                 guint32 v = VALUE32(tvb, *offsetp);
-
-                 proto_item_append_text(tti, " %s", keysymString(v));
-                 proto_tree_add_uint_format(ttt, hf_x11_keysyms_item_keysym,
-                     tvb, *offsetp, 4, v,
-                     "keysym (keycode %d): 0x%08x (%s)",
-                     keycode, v, keysymString(v));
-
-                 keycodemap[keycode][i] = v;
-                 *offsetp += 4;
-           }
-
-           for (i = 1; i < keysyms_per_keycode; ++i)
-               if (keycodemap[keycode][i] != NoSymbol)
-                       break;
-
-           if (i == keysyms_per_keycode) {
-               /* all but (possibly) first were NoSymbol. */
-               if (keysyms_per_keycode == 4) {
-                       keycodemap[keycode][1] = NoSymbol;
-                       keycodemap[keycode][2] = keycodemap[keycode][0];
-                       keycodemap[keycode][3] = NoSymbol;
-               }
-
-               continue;
-           }
-
-           for (i = 2; i < keysyms_per_keycode; ++i)
-               if (keycodemap[keycode][i] != NoSymbol)
-                       break;
-           if (i == keysyms_per_keycode) {
-               /* all but (possibly) first two were NoSymbol. */
-               if (keysyms_per_keycode == 4) {
-                       keycodemap[keycode][2] = keycodemap[keycode][0];
-                       keycodemap[keycode][3] =  keycodemap[keycode][1];
-               }
-
-               continue;
-           }
+            if (keycode >= 256) {
+                  proto_tree_add_text(tt, tvb, *offsetp, 4 * keysyms_per_keycode,
+                                      "keycode value %d is out of range", keycode);
+                  *offsetp += 4 * keysyms_per_keycode;
+                  continue;
+            }
+            tti = proto_tree_add_none_format(tt, hf_item, tvb, *offsetp,
+                                             4 * keysyms_per_keycode, "keysyms (keycode %d):", keycode);
+
+            ttt = proto_item_add_subtree(tti, ett_x11_keysym);
+
+            tvb_ensure_bytes_exist(tvb, *offsetp, 4 * keysyms_per_keycode);
+            keycodemap[keycode]
+                  = g_malloc(sizeof(*keycodemap[keycode]) * keysyms_per_keycode);
+
+            for(i = 0; i < keysyms_per_keycode; ++i) {
+                  /* keysymvalue = byte3 * 256 + byte4. */
+                  guint32 v = VALUE32(tvb, *offsetp);
+
+                  proto_item_append_text(tti, " %s", keysymString(v));
+                  proto_tree_add_uint_format(ttt, hf_x11_keysyms_item_keysym,
+                                             tvb, *offsetp, 4, v,
+                                             "keysym (keycode %d): 0x%08x (%s)",
+                                             keycode, v, keysymString(v));
+
+                  keycodemap[keycode][i] = v;
+                  *offsetp += 4;
+            }
+
+            for (i = 1; i < keysyms_per_keycode; ++i)
+                  if (keycodemap[keycode][i] != NoSymbol)
+                        break;
+
+            if (i == keysyms_per_keycode) {
+                  /* all but (possibly) first were NoSymbol. */
+                  if (keysyms_per_keycode == 4) {
+                        keycodemap[keycode][1] = NoSymbol;
+                        keycodemap[keycode][2] = keycodemap[keycode][0];
+                        keycodemap[keycode][3] = NoSymbol;
+                  }
+
+                  continue;
+            }
+
+            for (i = 2; i < keysyms_per_keycode; ++i)
+                  if (keycodemap[keycode][i] != NoSymbol)
+                        break;
+            if (i == keysyms_per_keycode) {
+                  /* all but (possibly) first two were NoSymbol. */
+                  if (keysyms_per_keycode == 4) {
+                        keycodemap[keycode][2] = keycodemap[keycode][0];
+                        keycodemap[keycode][3] =  keycodemap[keycode][1];
+                  }
+
+                  continue;
+            }
       }
 }
 
 static void listOfPoint(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                       int length, gboolean little_endian)
+                        int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 4, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_point);
       while(length--) {
-           gint16 x, y;
-           proto_item *tti;
-           proto_tree *ttt;
-
-           x = VALUE16(tvb, *offsetp);
-           y = VALUE16(tvb, *offsetp + 2);
-
-           tti = proto_tree_add_none_format(tt, hf_x11_point, tvb, *offsetp, 4, "point: (%d,%d)", x, y);
-           ttt = proto_item_add_subtree(tti, ett_x11_point);
-           proto_tree_add_int(ttt, hf_x11_point_x, tvb, *offsetp, 2, x);
-           *offsetp += 2;
-           proto_tree_add_int(ttt, hf_x11_point_y, tvb, *offsetp, 2, y);
-           *offsetp += 2;
+            gint16 x, y;
+            proto_item *tti;
+            proto_tree *ttt;
+
+            x = VALUE16(tvb, *offsetp);
+            y = VALUE16(tvb, *offsetp + 2);
+
+            tti = proto_tree_add_none_format(tt, hf_x11_point, tvb, *offsetp, 4, "point: (%d,%d)", x, y);
+            ttt = proto_item_add_subtree(tti, ett_x11_point);
+            proto_tree_add_int(ttt, hf_x11_point_x, tvb, *offsetp, 2, x);
+            *offsetp += 2;
+            proto_tree_add_int(ttt, hf_x11_point_y, tvb, *offsetp, 2, y);
+            *offsetp += 2;
       }
 }
 
 static void listOfRectangle(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                           int length, gboolean little_endian)
+                            int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 8, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_rectangle);
       while(length--) {
-           gint16 x, y;
-           unsigned width, height;
-           proto_item *tti;
-           proto_tree *ttt;
-
-           x = VALUE16(tvb, *offsetp);
-           y = VALUE16(tvb, *offsetp + 2);
-           width = VALUE16(tvb, *offsetp + 4);
-           height = VALUE16(tvb, *offsetp + 6);
-
-           tti = proto_tree_add_none_format(tt, hf_x11_rectangle, tvb, *offsetp, 8,
-                                                "rectangle: %dx%d+%d+%d", width, height, x, y);
-           ttt = proto_item_add_subtree(tti, ett_x11_rectangle);
-           proto_tree_add_int(ttt, hf_x11_rectangle_x, tvb, *offsetp, 2, x);
-           *offsetp += 2;
-           proto_tree_add_int(ttt, hf_x11_rectangle_y, tvb, *offsetp, 2, y);
-           *offsetp += 2;
-           proto_tree_add_uint(ttt, hf_x11_rectangle_width, tvb, *offsetp, 2, width);
-           *offsetp += 2;
-           proto_tree_add_uint(ttt, hf_x11_rectangle_height, tvb, *offsetp, 2, height);
-           *offsetp += 2;
+            gint16 x, y;
+            unsigned width, height;
+            proto_item *tti;
+            proto_tree *ttt;
+
+            x = VALUE16(tvb, *offsetp);
+            y = VALUE16(tvb, *offsetp + 2);
+            width = VALUE16(tvb, *offsetp + 4);
+            height = VALUE16(tvb, *offsetp + 6);
+
+            tti = proto_tree_add_none_format(tt, hf_x11_rectangle, tvb, *offsetp, 8,
+                                                 "rectangle: %dx%d+%d+%d", width, height, x, y);
+            ttt = proto_item_add_subtree(tti, ett_x11_rectangle);
+            proto_tree_add_int(ttt, hf_x11_rectangle_x, tvb, *offsetp, 2, x);
+            *offsetp += 2;
+            proto_tree_add_int(ttt, hf_x11_rectangle_y, tvb, *offsetp, 2, y);
+            *offsetp += 2;
+            proto_tree_add_uint(ttt, hf_x11_rectangle_width, tvb, *offsetp, 2, width);
+            *offsetp += 2;
+            proto_tree_add_uint(ttt, hf_x11_rectangle_height, tvb, *offsetp, 2, height);
+            *offsetp += 2;
       }
 }
 
 static void listOfSegment(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                         int length, gboolean little_endian)
+                          int length, gboolean little_endian)
 {
       proto_item *ti = proto_tree_add_item(t, hf, tvb, *offsetp, length * 8, little_endian);
       proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_segment);
       while(length--) {
-           gint16 x1, y1, x2, y2;
-           proto_item *tti;
-           proto_tree *ttt;
-
-           x1 = VALUE16(tvb, *offsetp);
-           y1 = VALUE16(tvb, *offsetp + 2);
-           x2 = VALUE16(tvb, *offsetp + 4);
-           y2 = VALUE16(tvb, *offsetp + 6);
-
-           tti = proto_tree_add_none_format(tt, hf_x11_segment, tvb, *offsetp, 8,
-                                                "segment: (%d,%d)-(%d,%d)", x1, y1, x2, y2);
-           ttt = proto_item_add_subtree(tti, ett_x11_segment);
-           proto_tree_add_item(ttt, hf_x11_segment_x1, tvb, *offsetp, 2, little_endian);
-           *offsetp += 2;
-           proto_tree_add_item(ttt, hf_x11_segment_y1, tvb, *offsetp, 2, little_endian);
-           *offsetp += 2;
-           proto_tree_add_item(ttt, hf_x11_segment_x2, tvb, *offsetp, 2, little_endian);
-           *offsetp += 2;
-           proto_tree_add_item(ttt, hf_x11_segment_y2, tvb, *offsetp, 2, little_endian);
-           *offsetp += 2;
+            gint16 x1, y1, x2, y2;
+            proto_item *tti;
+            proto_tree *ttt;
+
+            x1 = VALUE16(tvb, *offsetp);
+            y1 = VALUE16(tvb, *offsetp + 2);
+            x2 = VALUE16(tvb, *offsetp + 4);
+            y2 = VALUE16(tvb, *offsetp + 6);
+
+            tti = proto_tree_add_none_format(tt, hf_x11_segment, tvb, *offsetp, 8,
+                                                 "segment: (%d,%d)-(%d,%d)", x1, y1, x2, y2);
+            ttt = proto_item_add_subtree(tti, ett_x11_segment);
+            proto_tree_add_item(ttt, hf_x11_segment_x1, tvb, *offsetp, 2, little_endian);
+            *offsetp += 2;
+            proto_tree_add_item(ttt, hf_x11_segment_y1, tvb, *offsetp, 2, little_endian);
+            *offsetp += 2;
+            proto_tree_add_item(ttt, hf_x11_segment_x2, tvb, *offsetp, 2, little_endian);
+            *offsetp += 2;
+            proto_tree_add_item(ttt, hf_x11_segment_y2, tvb, *offsetp, 2, little_endian);
+            *offsetp += 2;
       }
 }
 
@@ -2080,15 +2080,15 @@ static void stringCopy(char *dest, const char *source, int length)
 {
       guchar c;
       while(length--) {
-           c = *source++;
-           if (!isgraph(c) && c != ' ') c = '.';
-           *dest++ = c;
+            c = *source++;
+            if (!isgraph(c) && c != ' ') c = '.';
+            *dest++ = c;
       }
       *dest++ = '\0';
 }
 
 static void listOfString8(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                         int hf_item, int length, gboolean little_endian)
+                          int hf_item, int length, gboolean little_endian)
 {
       char *s = NULL;
       guint allocated = 0;
@@ -2100,23 +2100,23 @@ static void listOfString8(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
 
       int scanning_offset = *offsetp; /* Scanning pointer */
       for(i = length; i; i--) {
-           int l;
-           l = tvb_get_guint8(tvb, scanning_offset);
-           scanning_offset += 1 + l;
+            int l;
+            l = tvb_get_guint8(tvb, scanning_offset);
+            scanning_offset += 1 + l;
       }
 
       ti = proto_tree_add_item(t, hf, tvb, *offsetp, scanning_offset - *offsetp, little_endian);
       tt = proto_item_add_subtree(ti, ett_x11_list_of_string8);
 
       while(length--) {
-           unsigned l = VALUE8(tvb, *offsetp);
-           if (allocated < (l + 1)) {
-                 s = ep_alloc(l + 1);
-                 allocated = l + 1;
-           }
-           stringCopy(s, (gchar *)tvb_get_ptr(tvb, *offsetp + 1, l), l); /* Nothing better for now. We need a better string handling API. */
-           proto_tree_add_string_format(tt, hf_item, tvb, *offsetp, l + 1, s, "\"%s\"", s);
-           *offsetp += l + 1;
+            unsigned l = VALUE8(tvb, *offsetp);
+            if (allocated < (l + 1)) {
+                  s = ep_alloc(l + 1);
+                  allocated = l + 1;
+            }
+            stringCopy(s, (gchar *)tvb_get_ptr(tvb, *offsetp + 1, l), l); /* Nothing better for now. We need a better string handling API. */
+            proto_tree_add_string_format(tt, hf_item, tvb, *offsetp, l + 1, s, "\"%s\"", s);
+            *offsetp += l + 1;
       }
 }
 
@@ -2126,8 +2126,8 @@ static int stringIsActuallyAn8BitString(tvbuff_t *tvb, int offset, unsigned leng
 {
       if (length > STRING16_MAX_DISPLAYED_LENGTH) length = STRING16_MAX_DISPLAYED_LENGTH;
       for(; length > 0; offset += 2, length--) {
-           if (tvb_get_guint8(tvb, offset))
-               return FALSE;
+            if (tvb_get_guint8(tvb, offset))
+                  return FALSE;
       }
       return TRUE;
 }
@@ -2135,45 +2135,45 @@ static int stringIsActuallyAn8BitString(tvbuff_t *tvb, int offset, unsigned leng
 /* length is the length of the _byte_zone_ (that is, twice the length of the string) */
 
 static void string16_with_buffer_preallocated(tvbuff_t *tvb, proto_tree *t,
-                                             int hf, int hf_bytes,
-                                             int offset, unsigned length,
-                                             char **s, int *sLength,
-                                             gboolean little_endian)
+                                              int hf, int hf_bytes,
+                                              int offset, unsigned length,
+                                              char **s, int *sLength,
+                                              gboolean little_endian)
 {
       int truncated = FALSE;
       unsigned l = length / 2;
 
       if (stringIsActuallyAn8BitString(tvb, offset, l)) {
-           char *dp;
-           int soffset = offset;
-
-           if (l > STRING16_MAX_DISPLAYED_LENGTH) {
-                 truncated = TRUE;
-                 l = STRING16_MAX_DISPLAYED_LENGTH;
-           }
-           if (*sLength < (int) l + 3) {
-                 *s = ep_alloc(l + 3);
-                 *sLength = l + 3;
-           }
-           dp = *s;
-           *dp++ = '"';
-           if (truncated) l -= 3;
-
-           while(l--) {
-                 soffset++;
-                 *dp++ = tvb_get_guint8(tvb, soffset);
-                 soffset++;
-           }
-           *dp++ = '"';
-
-           /* If truncated, add an ellipsis */
-           if (truncated) { *dp++ = '.'; *dp++ = '.'; *dp++ = '.'; }
-
-           *dp++ = '\0';
-           proto_tree_add_string_format(t, hf, tvb, offset, length, (gchar *)tvb_get_ptr(tvb, offset, length), "%s: %s",
-                                       proto_registrar_get_nth(hf) -> name, *s);
+            char *dp;
+            int soffset = offset;
+
+            if (l > STRING16_MAX_DISPLAYED_LENGTH) {
+                  truncated = TRUE;
+                  l = STRING16_MAX_DISPLAYED_LENGTH;
+            }
+            if (*sLength < (int) l + 3) {
+                  *s = ep_alloc(l + 3);
+                  *sLength = l + 3;
+            }
+            dp = *s;
+            *dp++ = '"';
+            if (truncated) l -= 3;
+
+            while(l--) {
+                  soffset++;
+                  *dp++ = tvb_get_guint8(tvb, soffset);
+                  soffset++;
+            }
+            *dp++ = '"';
+
+            /* If truncated, add an ellipsis */
+            if (truncated) { *dp++ = '.'; *dp++ = '.'; *dp++ = '.'; }
+
+            *dp++ = '\0';
+            proto_tree_add_string_format(t, hf, tvb, offset, length, (gchar *)tvb_get_ptr(tvb, offset, length), "%s: %s",
+                                        proto_registrar_get_nth(hf) -> name, *s);
       } else
-           proto_tree_add_item(t, hf_bytes, tvb, offset, length, little_endian);
+            proto_tree_add_item(t, hf_bytes, tvb, offset, length, little_endian);
 
 }
 
@@ -2192,92 +2192,92 @@ static void listOfTextItem(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
       int n = 0;                        /* Number of items */
 
       while(scanning_offset < next_offset) {
-           int l;                            /* Length of an individual item */
-           l = tvb_get_guint8(tvb, scanning_offset);
-           scanning_offset++;
-           if (!l) break;
-           n++;
-           scanning_offset += l == 255 ? 4 : l + (sizeIs16 ? l : 0) + 1;
+            int l;                            /* Length of an individual item */
+            l = tvb_get_guint8(tvb, scanning_offset);
+            scanning_offset++;
+            if (!l) break;
+            n++;
+            scanning_offset += l == 255 ? 4 : l + (sizeIs16 ? l : 0) + 1;
       }
 
       ti = proto_tree_add_item(t, hf, tvb, *offsetp, scanning_offset - *offsetp, little_endian);
       tt = proto_item_add_subtree(ti, ett_x11_list_of_text_item);
 
       while(n--) {
-           unsigned l = VALUE8(tvb, *offsetp);
-           if (l == 255) { /* Item is a font */
-                 fid = tvb_get_ntohl(tvb, *offsetp + 1);
-                 proto_tree_add_uint(tt, hf_x11_textitem_font, tvb, *offsetp, 5, fid);
-                 *offsetp += 5;
-           } else { /* Item is a string */
-                 proto_item *tti;
-                 proto_tree *ttt;
-                 gint8 delta = VALUE8(tvb, *offsetp + 1);
-                 if (sizeIs16) l += l;
-                 if ((unsigned) allocated < l + 1) {
-                       s = ep_alloc(l + 1);
-                       allocated = l + 1;
-                 }
-                 stringCopy(s, (gchar *)tvb_get_ptr(tvb, *offsetp + 2, l), l);
-                 tti = proto_tree_add_none_format(tt, hf_x11_textitem_string, tvb, *offsetp, l + 2,
-                                                      "textitem (string): delta = %d, \"%s\"",
-                                                      delta, s);
-                 ttt = proto_item_add_subtree(tti, ett_x11_text_item);
-                 proto_tree_add_item(ttt, hf_x11_textitem_string_delta, tvb, *offsetp + 1, 1, little_endian);
-                 if (sizeIs16)
-                       string16_with_buffer_preallocated(tvb, ttt, hf_x11_textitem_string_string16,
-                                                         hf_x11_textitem_string_string16_bytes,
-                                                         *offsetp + 2, l,
-                                                         &s, &allocated,
-                                                         little_endian);
-                 else
-                       proto_tree_add_string_format(ttt, hf_x11_textitem_string_string8, tvb,
-                                                    *offsetp + 2, l, s, "\"%s\"", s);
-                 *offsetp += l + 2;
-           }
+            unsigned l = VALUE8(tvb, *offsetp);
+            if (l == 255) { /* Item is a font */
+                  fid = tvb_get_ntohl(tvb, *offsetp + 1);
+                  proto_tree_add_uint(tt, hf_x11_textitem_font, tvb, *offsetp, 5, fid);
+                  *offsetp += 5;
+            } else { /* Item is a string */
+                  proto_item *tti;
+                  proto_tree *ttt;
+                  gint8 delta = VALUE8(tvb, *offsetp + 1);
+                  if (sizeIs16) l += l;
+                  if ((unsigned) allocated < l + 1) {
+                        s = ep_alloc(l + 1);
+                        allocated = l + 1;
+                  }
+                  stringCopy(s, (gchar *)tvb_get_ptr(tvb, *offsetp + 2, l), l);
+                  tti = proto_tree_add_none_format(tt, hf_x11_textitem_string, tvb, *offsetp, l + 2,
+                                                       "textitem (string): delta = %d, \"%s\"",
+                                                       delta, s);
+                  ttt = proto_item_add_subtree(tti, ett_x11_text_item);
+                  proto_tree_add_item(ttt, hf_x11_textitem_string_delta, tvb, *offsetp + 1, 1, little_endian);
+                  if (sizeIs16)
+                        string16_with_buffer_preallocated(tvb, ttt, hf_x11_textitem_string_string16,
+                                                          hf_x11_textitem_string_string16_bytes,
+                                                          *offsetp + 2, l,
+                                                          &s, &allocated,
+                                                          little_endian);
+                  else
+                        proto_tree_add_string_format(ttt, hf_x11_textitem_string_string8, tvb,
+                                                     *offsetp + 2, l, s, "\"%s\"", s);
+                  *offsetp += l + 2;
+            }
       }
 }
 
 static guint32 field8(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                     gboolean little_endian)
+                      gboolean little_endian)
 {
       guint32 v = VALUE8(tvb, *offsetp);
       header_field_info *hfi = proto_registrar_get_nth(hf);
       const gchar *enumValue = NULL;
 
       if (hfi -> strings)
-           enumValue = match_strval(v, cVALS(hfi -> strings));
+            enumValue = match_strval(v, cVALS(hfi -> strings));
       if (enumValue)
-           proto_tree_add_uint_format(t, hf, tvb, *offsetp, 1, v,
+            proto_tree_add_uint_format(t, hf, tvb, *offsetp, 1, v,
             hfi -> display == BASE_DEC ? "%s: %u (%s)" : "%s: 0x%02x (%s)",
-           hfi -> name, v, enumValue);
+            hfi -> name, v, enumValue);
       else
-           proto_tree_add_item(t, hf, tvb, *offsetp, 1, little_endian);
+            proto_tree_add_item(t, hf, tvb, *offsetp, 1, little_endian);
       *offsetp += 1;
       return v;
 }
 
 static guint32 field16(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                      gboolean little_endian)
+                       gboolean little_endian)
 {
       guint32 v = VALUE16(tvb, *offsetp);
       header_field_info *hfi = proto_registrar_get_nth(hf);
       const gchar *enumValue = NULL;
 
       if (hfi -> strings)
-           enumValue = match_strval(v, cVALS(hfi -> strings));
+            enumValue = match_strval(v, cVALS(hfi -> strings));
       if (enumValue)
-           proto_tree_add_uint_format(t, hf, tvb, *offsetp, 2, v,
-                   hfi -> display == BASE_DEC ? "%s: %u (%s)" : "%s: 0x%02x (%s)",
-           hfi -> name, v, enumValue);
+            proto_tree_add_uint_format(t, hf, tvb, *offsetp, 2, v,
+            hfi -> display == BASE_DEC ? "%s: %u (%s)" : "%s: 0x%02x (%s)",
+            hfi -> name, v, enumValue);
       else
-           proto_tree_add_item(t, hf, tvb, *offsetp, 2, little_endian);
+            proto_tree_add_item(t, hf, tvb, *offsetp, 2, little_endian);
       *offsetp += 2;
       return v;
 }
 
 static guint32 field32(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                      gboolean little_endian)
+                       gboolean little_endian)
 {
       guint32 v = VALUE32(tvb, *offsetp);
       header_field_info *hfi = proto_registrar_get_nth(hf);
@@ -2285,21 +2285,21 @@ static guint32 field32(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
       const gchar *nameAsChar = hfi -> name;
 
       if (hfi -> strings)
-           enumValue = match_strval(v, cVALS(hfi -> strings));
+            enumValue = match_strval(v, cVALS(hfi -> strings));
       if (enumValue)
-           proto_tree_add_uint_format(t, hf, tvb, *offsetp, 4, v,
-                                      hfi -> display == BASE_DEC ? "%s: %u (%s)" : "%s: 0x%08x (%s)",
-                                      nameAsChar, v, enumValue);
+            proto_tree_add_uint_format(t, hf, tvb, *offsetp, 4, v,
+                                       hfi -> display == BASE_DEC ? "%s: %u (%s)" : "%s: 0x%08x (%s)",
+                                       nameAsChar, v, enumValue);
       else
-           proto_tree_add_uint_format(t, hf, tvb, *offsetp, 4, v,
-                                      hfi -> display == BASE_DEC ? "%s: %u" : "%s: 0x%08x",
-                                      nameAsChar, v);
+            proto_tree_add_uint_format(t, hf, tvb, *offsetp, 4, v,
+                                       hfi -> display == BASE_DEC ? "%s: %u" : "%s: 0x%08x",
+                                       nameAsChar, v);
       *offsetp += 4;
       return v;
 }
 
 static void gcAttributes(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-                        gboolean little_endian)
+                         gboolean little_endian)
 {
       BITMASK32(gc_value);
       BITFIELD(ENUM8,  gc_value_mask, function);
@@ -2329,7 +2329,7 @@ static void gcAttributes(tvbuff_t *tvb, int *offsetp, proto_tree *t,
 }
 
 static void gcMask(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-                  gboolean little_endian)
+                   gboolean little_endian)
 {
       BITMASK32(gc_value);
       FLAG(gc_value, function);
@@ -2359,7 +2359,7 @@ static void gcMask(tvbuff_t *tvb, int *offsetp, proto_tree *t,
 }
 
 static guint32 requestLength(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-                            gboolean little_endian)
+                             gboolean little_endian)
 {
       guint32 res = VALUE16(tvb, *offsetp);
       proto_tree_add_uint(t, hf_x11_request_length, tvb, *offsetp, 2, res);
@@ -2368,7 +2368,7 @@ static guint32 requestLength(tvbuff_t *tvb, int *offsetp, proto_tree *t,
 }
 
 static void setOfEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-                      gboolean little_endian)
+                       gboolean little_endian)
 {
       BITMASK32(event);
       FLAG(event, KeyPress);
@@ -2401,7 +2401,7 @@ static void setOfEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t,
 }
 
 static void setOfDeviceEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-                            gboolean little_endian)
+                             gboolean little_endian)
 {
       BITMASK32(do_not_propagate);
       FLAG(do_not_propagate, KeyPress);
@@ -2421,7 +2421,7 @@ static void setOfDeviceEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t,
 
 
 static void setOfKeyButMask(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-                        gboolean little_endian, gboolean butmask)
+                            gboolean little_endian, gboolean butmask)
 {
       proto_item *ti;
       guint32 bitmask_value;
@@ -2434,39 +2434,39 @@ static void setOfKeyButMask(tvbuff_t *tvb, int *offsetp, proto_tree *t,
       bitmask_size = 2;
 
       if (!butmask && bitmask_value == 0x8000)
-           proto_tree_add_uint_format(t, hf_x11_modifiers_mask_AnyModifier, tvb, *offsetp, 2, 0x8000,
-                                      "modifiers-masks: 0x8000 (AnyModifier)");
+            proto_tree_add_uint_format(t, hf_x11_modifiers_mask_AnyModifier, tvb, *offsetp, 2, 0x8000,
+                                       "modifiers-masks: 0x8000 (AnyModifier)");
       else {
-           ti = proto_tree_add_uint(t, hf_x11_modifiers_mask, tvb, *offsetp, 2,
-                                                bitmask_value);
-           bitmask_tree = proto_item_add_subtree(ti, ett_x11_set_of_key_mask);
-           FLAG(modifiers, Shift);
-           FLAG(modifiers, Lock);
-           FLAG(modifiers, Control);
-           FLAG(modifiers, Mod1);
-           FLAG(modifiers, Mod2);
-           FLAG(modifiers, Mod3);
-           FLAG(modifiers, Mod4);
-           FLAG(modifiers, Mod5);
-
-           if (butmask) {
-                   FLAG(modifiers, Button1);
-                   FLAG(modifiers, Button2);
-                   FLAG(modifiers, Button3);
-                   FLAG(modifiers, Button4);
-                   FLAG(modifiers, Button5);
-           }
-
-           if (butmask)
-                   FLAG_IF_NONZERO(keybut, erroneous_bits);
-           else
-                   FLAG_IF_NONZERO(modifiers, erroneous_bits);
+            ti = proto_tree_add_uint(t, hf_x11_modifiers_mask, tvb, *offsetp, 2,
+                                                 bitmask_value);
+            bitmask_tree = proto_item_add_subtree(ti, ett_x11_set_of_key_mask);
+            FLAG(modifiers, Shift);
+            FLAG(modifiers, Lock);
+            FLAG(modifiers, Control);
+            FLAG(modifiers, Mod1);
+            FLAG(modifiers, Mod2);
+            FLAG(modifiers, Mod3);
+            FLAG(modifiers, Mod4);
+            FLAG(modifiers, Mod5);
+
+            if (butmask) {
+                  FLAG(modifiers, Button1);
+                  FLAG(modifiers, Button2);
+                  FLAG(modifiers, Button3);
+                  FLAG(modifiers, Button4);
+                  FLAG(modifiers, Button5);
+            }
+
+            if (butmask)
+                  FLAG_IF_NONZERO(keybut, erroneous_bits);
+            else
+                  FLAG_IF_NONZERO(modifiers, erroneous_bits);
       }
       *offsetp += 2;
 }
 
 static void setOfPointerEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-                             gboolean little_endian)
+                              gboolean little_endian)
 {
       BITMASK16(pointer_event);
       FLAG(pointer_event, ButtonPress);
@@ -2509,26 +2509,26 @@ static void string16(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
 
       length += length;
       string16_with_buffer_preallocated(tvb, t, hf, hf_bytes, *offsetp, length,
-                                       &s, &l, little_endian);
+                                        &s, &l, little_endian);
 
       *offsetp += length;
 }
 
 static void timestamp(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf,
-                     gboolean little_endian)
+                      gboolean little_endian)
 {
       guint32 v = VALUE32(tvb, *offsetp);
 
       if (!v)
-           proto_tree_add_uint_format(t, hf, tvb, *offsetp, 4, 0, "%s: 0 (CurrentTime)",
-               proto_registrar_get_nth(hf) -> name);
+            proto_tree_add_uint_format(t, hf, tvb, *offsetp, 4, 0, "%s: 0 (CurrentTime)",
+                                       proto_registrar_get_nth(hf) -> name);
       else
-           proto_tree_add_uint(t, hf, tvb, *offsetp, 4, v);
+            proto_tree_add_uint(t, hf, tvb, *offsetp, 4, v);
       *offsetp += 4;
 }
 
 static void windowAttributes(tvbuff_t *tvb, int *offsetp, proto_tree *t,
-                            gboolean little_endian)
+                             gboolean little_endian)
 {
       BITMASK32(window_value);
       BITFIELD(PIXMAP, window_value_mask, background_pixmap);
@@ -2554,14 +2554,14 @@ static void x11_init_protocol(void)
       x11_conv_data_t *state;
 
       for (state = x11_conv_data_list; state != NULL; ) {
-           x11_conv_data_t *last;
+            x11_conv_data_t *last;
 
-           g_hash_table_destroy(state->seqtable);
-           g_hash_table_destroy(state->valtable);
+            g_hash_table_destroy(state->seqtable);
+            g_hash_table_destroy(state->valtable);
 
-           last = state;
-           state = state->next;
-           g_free(last);
+            last = state;
+            state = state->next;
+            g_free(last);
       }
       x11_conv_data_list = NULL;
 }
@@ -2575,7 +2575,7 @@ static void x11_init_protocol(void)
 /* If we can't guess, we return TRUE (that is little_endian), cause
    I'm developing on a Linux box :-). The (non-)guess isn't cached
    however, so we may have more luck next time. I'm quite conservative
-   in my assertions, cause once it's cached, it's stay in cache, and
+   in my assertions, cause once it's cached, it stays in cache, and
    we may be fooled up by a packet starting with the end of a request
    started in a previous packet...
 */
@@ -2586,9 +2586,9 @@ static int numberOfBitSet(tvbuff_t *tvb, int offset, int maskLength)
 {
       int res = 0;
       while(maskLength--) {
-           int c = tvb_get_guint8(tvb, offset);
-           offset++;
-           res += numberOfBitSetTable[c & 0xf] + numberOfBitSetTable[c >> 4];
+            int c = tvb_get_guint8(tvb, offset);
+            offset++;
+            res += numberOfBitSetTable[c & 0xf] + numberOfBitSetTable[c >> 4];
       }
       return res;
 }
@@ -2597,15 +2597,15 @@ static int listOfStringLengthConsistent(tvbuff_t *tvb, int offset, int length, i
 {
       if (listLength > length) return FALSE;
       while(listLength--) {
-           int l;
-           if (!tvb_bytes_exist(tvb, offset, 1)) return TRUE;
-           l = tvb_get_guint8(tvb, offset);
-           if (!l) break;
-           l++;
-           if (l > length) return FALSE;
-           if (!tvb_bytes_exist(tvb, offset, l)) return TRUE;
-           offset += l;
-           length -= l;
+            int l;
+            if (!tvb_bytes_exist(tvb, offset, 1)) return TRUE;
+            l = tvb_get_guint8(tvb, offset);
+            if (!l) break;
+            l++;
+            if (l > length) return FALSE;
+            if (!tvb_bytes_exist(tvb, offset, l)) return TRUE;
+            offset += l;
+            length -= l;
       }
       if (length > 3) return FALSE;
       return TRUE;
@@ -2624,214 +2624,214 @@ static int rounded4(int n)
 static gboolean consistentWithOrder(int length, tvbuff_t *tvb, int offset, guint16 (*v16)(tvbuff_t *, const gint))
 {
       switch(tvb_get_guint8(tvb, offset)) {
-         case X_CreateWindow:
-           return !tvb_bytes_exist(tvb, offset, 32) || length == 8 + numberOfBitSet(tvb, offset + 7 * 4, 4);
-
-         case X_ChangeWindowAttributes:
-         case X_ChangeGC:
-           return !tvb_bytes_exist(tvb, offset, 12) || length == 3 + numberOfBitSet(tvb, offset + 8, 4);
-
-         case X_GetWindowAttributes:
-         case X_DestroyWindow:
-         case X_DestroySubwindows:
-         case X_ChangeSaveSet:
-         case X_MapWindow:
-         case X_MapSubwindows:
-         case X_UnmapWindow:
-         case X_UnmapSubwindows:
-         case X_CirculateWindow:
-         case X_GetGeometry:
-         case X_QueryTree:
-         case X_GetAtomName:
-         case X_ListProperties:
-         case X_GetSelectionOwner:
-         case X_UngrabPointer:
-         case X_UngrabKeyboard:
-         case X_AllowEvents:
-         case X_QueryPointer:
-         case X_CloseFont:
-         case X_QueryFont:
-         case X_FreePixmap:
-         case X_FreeGC:
-         case X_FreeColormap:
-         case X_InstallColormap:
-         case X_UninstallColormap:
-         case X_ListInstalledColormaps:
-         case X_FreeCursor:
-         case X_GetKeyboardMapping:
-         case X_KillClient:
-           return length == 2;
-
-         case X_ReparentWindow:
-         case X_SetSelectionOwner:
-         case X_ChangeActivePointerGrab:
-         case X_GrabKeyboard:
-         case X_GrabKey:
-         case X_GetMotionEvents:
-         case X_TranslateCoords:
-         case X_CreatePixmap:
-         case X_CopyGC:
-         case X_ClearArea:
-         case X_CreateColormap:
-         case X_AllocColor:
-         case X_AllocColorPlanes:
-           return length == 4;
-
-         case X_ConfigureWindow:
-           return !tvb_bytes_exist(tvb, offset, 10) || length == 3 + numberOfBitSet(tvb, offset + 8, 2);
-
-         case X_InternAtom:
-         case X_QueryExtension:
-           return !tvb_bytes_exist(tvb, offset, 6) || length == 2 + rounded4(v16(tvb, offset + 4));
-
-         case X_ChangeProperty:
-           {
-                 int multiplier, type;
-                 if (!tvb_bytes_exist(tvb, offset, 17)) return TRUE;
-                 type = tvb_get_guint8(tvb, 16);
-                 if (type != 8 && type != 16 && type != 32) return FALSE;
-                 multiplier = type == 8 ? 1 : type == 16 ? 2 : 4;
-                 if (!tvb_bytes_exist(tvb, offset, 24)) return TRUE;
-                 return length == 6 + rounded4((v16 == tvb_get_letohs ? tvb_get_letohl : tvb_get_ntohl)(tvb, offset + 20) * multiplier);
-           }
-
-         case X_DeleteProperty:
-         case X_UngrabButton:
-         case X_UngrabKey:
-         case X_SetInputFocus:
-         case X_CopyColormapAndFree:
-         case X_AllocColorCells:
-         case X_QueryBestSize:
-         case X_ChangePointerControl:
-         case X_SetScreenSaver:
-           return length == 3;
-
-         case X_GetProperty:
-         case X_ConvertSelection:
-         case X_GrabPointer:
-         case X_GrabButton:
-         case X_WarpPointer:
-           return length == 6;
-
-         case X_SendEvent:
-           return length == 11;
-
-         case X_GrabServer:
-         case X_UngrabServer:
-         case X_GetInputFocus:
-         case X_QueryKeymap:
-         case X_GetFontPath:
-         case X_ListExtensions:
-         case X_GetKeyboardControl:
-         case X_Bell:
-         case X_GetPointerControl:
-         case X_GetScreenSaver:
-         case X_ListHosts:
-         case X_SetAccessControl:
-         case X_SetCloseDownMode:
-         case X_ForceScreenSaver:
-         case X_GetPointerMapping:
-         case X_GetModifierMapping:
-           return length == 1;
-
-         case X_OpenFont:
-         case X_AllocNamedColor:
-         case X_LookupColor:
-           return !tvb_bytes_exist(tvb, offset, 10) || length == 3 + rounded4(v16(tvb, offset + 8));
-
-         case X_QueryTextExtents:
-           return length >= 2;
-
-         case X_ListFonts:
-         case X_ListFontsWithInfo:
-         case X_ChangeHosts:
-           return !tvb_bytes_exist(tvb, offset, 8) || length == 2 + rounded4(v16(tvb, offset + 6));
-
-         case X_SetFontPath:
-           if (length < 2) return FALSE;
-           if (!tvb_bytes_exist(tvb, offset, 8)) return TRUE;
-           return listOfStringLengthConsistent(tvb, offset + 8, (length - 2) * 4, v16(tvb, offset + 4));
-
-         case X_CreateGC:
-           return !tvb_bytes_exist(tvb, offset, 16) || length == 4 + numberOfBitSet(tvb, offset + 12, 4);
-
-         case X_SetDashes:
-           return !tvb_bytes_exist(tvb, offset, 12) || length == 3 + rounded4(v16(tvb, offset + 10));
-
-         case X_SetClipRectangles:
-         case X_PolySegment:
-         case X_PolyRectangle:
-         case X_PolyFillRectangle:
-           return length >= 3 && (length - 3) % 2 == 0;
-
-         case X_CopyArea:
-           return length == 7;
-
-         case X_CopyPlane:
-         case X_CreateCursor:
-         case X_CreateGlyphCursor:
-           return length == 8;
-
-         case X_PolyPoint:
-         case X_PolyLine:
-         case X_FreeColors:
-           return length >= 3;
-
-         case X_PolyArc:
-         case X_PolyFillArc:
-           return length >= 3 && (length - 3) % 3 == 0;
-
-         case X_FillPoly:
-         case X_ImageText8:
-           return length >= 4;
-
-         case X_PutImage:
-           return length >= 6;
-
-         case X_GetImage:
-         case X_RecolorCursor:
-           return length == 5;
-
-         case X_PolyText8:
-           if (length < 4) return FALSE;
-           return TRUE; /* We don't perform many controls on this one */
-
-         case X_PolyText16:
-           if (length < 4) return FALSE;
-           return TRUE; /* We don't perform many controls on this one */
-
-         case X_ImageText16:
-           return length >= 4;
-
-         case X_StoreColors:
-           return length > 2 && (length - 2) % 3 == 0;
-
-         case X_StoreNamedColor:
-           return !tvb_bytes_exist(tvb, offset, 14) || length == 4 + rounded4(v16(tvb, offset + 12));
-
-         case X_QueryColors:
-           return length >= 2;
-
-         case X_ChangeKeyboardMapping:
-           return !tvb_bytes_exist(tvb, offset, 6) || length == 2 + tvb_get_guint8(tvb, 1) * tvb_get_guint8(tvb, 5);
-
-         case X_ChangeKeyboardControl:
-           return !tvb_bytes_exist(tvb, offset, 6) || length == 2 + numberOfBitSet(tvb, offset + 4, 2);
-
-         case X_RotateProperties:
-           return !tvb_bytes_exist(tvb, offset, 10) || length == 3 + v16(tvb, offset + 8);
-
-         case X_SetPointerMapping:
-           return length == 1 + rounded4(tvb_get_guint8(tvb, 1));
+            case X_CreateWindow:
+                  return !tvb_bytes_exist(tvb, offset, 32) || length == 8 + numberOfBitSet(tvb, offset + 7 * 4, 4);
+
+            case X_ChangeWindowAttributes:
+            case X_ChangeGC:
+                  return !tvb_bytes_exist(tvb, offset, 12) || length == 3 + numberOfBitSet(tvb, offset + 8, 4);
+
+            case X_GetWindowAttributes:
+            case X_DestroyWindow:
+            case X_DestroySubwindows:
+            case X_ChangeSaveSet:
+            case X_MapWindow:
+            case X_MapSubwindows:
+            case X_UnmapWindow:
+            case X_UnmapSubwindows:
+            case X_CirculateWindow:
+            case X_GetGeometry:
+            case X_QueryTree:
+            case X_GetAtomName:
+            case X_ListProperties:
+            case X_GetSelectionOwner:
+            case X_UngrabPointer:
+            case X_UngrabKeyboard:
+            case X_AllowEvents:
+            case X_QueryPointer:
+            case X_CloseFont:
+            case X_QueryFont:
+            case X_FreePixmap:
+            case X_FreeGC:
+            case X_FreeColormap:
+            case X_InstallColormap:
+            case X_UninstallColormap:
+            case X_ListInstalledColormaps:
+            case X_FreeCursor:
+            case X_GetKeyboardMapping:
+            case X_KillClient:
+                  return length == 2;
+
+            case X_ReparentWindow:
+            case X_SetSelectionOwner:
+            case X_ChangeActivePointerGrab:
+            case X_GrabKeyboard:
+            case X_GrabKey:
+            case X_GetMotionEvents:
+            case X_TranslateCoords:
+            case X_CreatePixmap:
+            case X_CopyGC:
+            case X_ClearArea:
+            case X_CreateColormap:
+            case X_AllocColor:
+            case X_AllocColorPlanes:
+                  return length == 4;
+
+            case X_ConfigureWindow:
+                  return !tvb_bytes_exist(tvb, offset, 10) || length == 3 + numberOfBitSet(tvb, offset + 8, 2);
+
+            case X_InternAtom:
+            case X_QueryExtension:
+                  return !tvb_bytes_exist(tvb, offset, 6) || length == 2 + rounded4(v16(tvb, offset + 4));
+
+            case X_ChangeProperty:
+            {
+                  int multiplier, type;
+                  if (!tvb_bytes_exist(tvb, offset, 17)) return TRUE;
+                  type = tvb_get_guint8(tvb, 16);
+                  if (type != 8 && type != 16 && type != 32) return FALSE;
+                  multiplier = type == 8 ? 1 : type == 16 ? 2 : 4;
+                  if (!tvb_bytes_exist(tvb, offset, 24)) return TRUE;
+                  return length == 6 + rounded4((v16 == tvb_get_letohs ? tvb_get_letohl : tvb_get_ntohl)(tvb, offset + 20) * multiplier);
+            }
+
+            case X_DeleteProperty:
+            case X_UngrabButton:
+            case X_UngrabKey:
+            case X_SetInputFocus:
+            case X_CopyColormapAndFree:
+            case X_AllocColorCells:
+            case X_QueryBestSize:
+            case X_ChangePointerControl:
+            case X_SetScreenSaver:
+                  return length == 3;
+
+            case X_GetProperty:
+            case X_ConvertSelection:
+            case X_GrabPointer:
+            case X_GrabButton:
+            case X_WarpPointer:
+                  return length == 6;
+
+            case X_SendEvent:
+                  return length == 11;
+
+            case X_GrabServer:
+            case X_UngrabServer:
+            case X_GetInputFocus:
+            case X_QueryKeymap:
+            case X_GetFontPath:
+            case X_ListExtensions:
+            case X_GetKeyboardControl:
+            case X_Bell:
+            case X_GetPointerControl:
+            case X_GetScreenSaver:
+            case X_ListHosts:
+            case X_SetAccessControl:
+            case X_SetCloseDownMode:
+            case X_ForceScreenSaver:
+            case X_GetPointerMapping:
+            case X_GetModifierMapping:
+                  return length == 1;
+
+            case X_OpenFont:
+            case X_AllocNamedColor:
+            case X_LookupColor:
+                  return !tvb_bytes_exist(tvb, offset, 10) || length == 3 + rounded4(v16(tvb, offset + 8));
+
+            case X_QueryTextExtents:
+                  return length >= 2;
+
+            case X_ListFonts:
+            case X_ListFontsWithInfo:
+            case X_ChangeHosts:
+                  return !tvb_bytes_exist(tvb, offset, 8) || length == 2 + rounded4(v16(tvb, offset + 6));
+
+            case X_SetFontPath:
+                  if (length < 2) return FALSE;
+                  if (!tvb_bytes_exist(tvb, offset, 8)) return TRUE;
+                  return listOfStringLengthConsistent(tvb, offset + 8, (length - 2) * 4, v16(tvb, offset + 4));
+
+            case X_CreateGC:
+                  return !tvb_bytes_exist(tvb, offset, 16) || length == 4 + numberOfBitSet(tvb, offset + 12, 4);
+
+            case X_SetDashes:
+                  return !tvb_bytes_exist(tvb, offset, 12) || length == 3 + rounded4(v16(tvb, offset + 10));
+
+            case X_SetClipRectangles:
+            case X_PolySegment:
+            case X_PolyRectangle:
+            case X_PolyFillRectangle:
+                  return length >= 3 && (length - 3) % 2 == 0;
+
+            case X_CopyArea:
+                  return length == 7;
+
+            case X_CopyPlane:
+            case X_CreateCursor:
+            case X_CreateGlyphCursor:
+                  return length == 8;
+
+            case X_PolyPoint:
+            case X_PolyLine:
+            case X_FreeColors:
+                  return length >= 3;
+
+            case X_PolyArc:
+            case X_PolyFillArc:
+                  return length >= 3 && (length - 3) % 3 == 0;
+
+            case X_FillPoly:
+            case X_ImageText8:
+                  return length >= 4;
+
+            case X_PutImage:
+                  return length >= 6;
+
+            case X_GetImage:
+            case X_RecolorCursor:
+                  return length == 5;
+
+            case X_PolyText8:
+                  if (length < 4) return FALSE;
+                  return TRUE; /* We don't perform many controls on this one */
+
+            case X_PolyText16:
+                  if (length < 4) return FALSE;
+                  return TRUE; /* We don't perform many controls on this one */
+
+            case X_ImageText16:
+                  return length >= 4;
+
+            case X_StoreColors:
+                  return length > 2 && (length - 2) % 3 == 0;
+
+            case X_StoreNamedColor:
+                  return !tvb_bytes_exist(tvb, offset, 14) || length == 4 + rounded4(v16(tvb, offset + 12));
+
+            case X_QueryColors:
+                  return length >= 2;
+
+            case X_ChangeKeyboardMapping:
+                  return !tvb_bytes_exist(tvb, offset, 6) || length == 2 + tvb_get_guint8(tvb, 1) * tvb_get_guint8(tvb, 5);
+
+            case X_ChangeKeyboardControl:
+                  return !tvb_bytes_exist(tvb, offset, 6) || length == 2 + numberOfBitSet(tvb, offset + 4, 2);
+
+            case X_RotateProperties:
+                  return !tvb_bytes_exist(tvb, offset, 10) || length == 3 + v16(tvb, offset + 8);
+
+            case X_SetPointerMapping:
+                  return length == 1 + rounded4(tvb_get_guint8(tvb, 1));
 
-         case X_SetModifierMapping:
-           return length == 1 + tvb_get_guint8(tvb, 1) * 2;
+            case X_SetModifierMapping:
+                  return length == 1 + tvb_get_guint8(tvb, 1) * 2;
 
-         case X_NoOperation:
-           return length >= 1;
+            case X_NoOperation:
+                  return length >= 1;
 
-         default:
-           return TRUE;
+            default:
+                  return TRUE;
       }
 }
 
@@ -2843,36 +2843,36 @@ static int x_endian_match(tvbuff_t *tvb, guint16 (*v16)(tvbuff_t *, const gint))
       int atLeastOne = 0;
 
       for(offset = 0; tvb_bytes_exist(tvb, offset, 4); offset = nextoffset) {
-           int length;
-           length = v16(tvb, offset + 2);
-           if (!length) return -1;
-           nextoffset = offset + length * 4;
-           if (!consistentWithOrder(length, tvb, offset, v16)) return -1;
-           atLeastOne = 1;
+            int length;
+            length = v16(tvb, offset + 2);
+            if (!length) return -1;
+            nextoffset = offset + length * 4;
+            if (!consistentWithOrder(length, tvb, offset, v16)) return -1;
+            atLeastOne = 1;
       }
       return atLeastOne;
 }
 
 static gboolean
 guess_byte_ordering(tvbuff_t *tvb, packet_info *pinfo,
-                   x11_conv_data_t *state)
+                    x11_conv_data_t *state)
 {
       /* With X the client gives the byte ordering for the protocol,
-        and the port on the server tells us we're speaking X. */
+         and the port on the server tells us we're speaking X. */
 
       int le, be, decision, decisionToCache;
 
       if (state->byte_order == BYTE_ORDER_BE)
-           return FALSE;       /* known to be big-endian */
+            return FALSE;       /* known to be big-endian */
       else if (state->byte_order == BYTE_ORDER_LE)
-           return TRUE;        /* known to be little-endian */
+            return TRUE;        /* known to be little-endian */
 
       if (pinfo->srcport == pinfo->match_port) {
-           /*
-            * This is a reply or event; we don't try to guess the
-            * byte order on it for now.
-            */
-           return TRUE;
+            /*
+             * This is a reply or event; we don't try to guess the
+             * byte order on it for now.
+             */
+            return TRUE;
       }
 
       le = x_endian_match(tvb, tvb_get_letohs);
@@ -2880,33 +2880,33 @@ guess_byte_ordering(tvbuff_t *tvb, packet_info *pinfo,
 
       /* remember that "decision" really means "little_endian". */
       if (le == be) {
-           /* We have no reason to believe it's little- rather than
-              big-endian, so we guess the shortest length is the
-              right one.
-           */
-           if (!tvb_bytes_exist(tvb, 0, 4))
-                 /* Not even a way to get the length. We're biased
-                    toward little endianness here (essentially the
-                    x86 world right now). Decoding won't go very far
-                    anyway.
-                 */
-                 decision = TRUE;
-           else
-                 decision = tvb_get_letohs(tvb, 2) <= tvb_get_ntohs(tvb, 2);
+            /* We have no reason to believe it's little- rather than
+               big-endian, so we guess the shortest length is the
+               right one.
+            */
+            if (!tvb_bytes_exist(tvb, 0, 4))
+                  /* Not even a way to get the length. We're biased
+                     toward little endianness here (essentially the
+                     x86 world right now). Decoding won't go very far
+                     anyway.
+                  */
+                  decision = TRUE;
+            else
+                  decision = tvb_get_letohs(tvb, 2) <= tvb_get_ntohs(tvb, 2);
       } else
-         decision = le >= be;
+          decision = le >= be;
 
       decisionToCache = (le < 0 && be > 0) || (le > 0 && be < 0);
       if (decisionToCache) {
-           /*
-            * Remember the decision.
-            */
-           state->byte_order = decision ? BYTE_ORDER_LE : BYTE_ORDER_BE;
+            /*
+             * Remember the decision.
+             */
+            state->byte_order = decision ? BYTE_ORDER_LE : BYTE_ORDER_BE;
       }
 
       /*
       fprintf(stderr, "packet %d\tle %d\tbe %d\tlittle_endian %d\tcache %d\n",
-             pinfo->fd -> num, le, be, decision, decisionToCache);
+              pinfo->fd -> num, le, be, decision, decisionToCache);
       */
       return decision;
 }
@@ -2943,18 +2943,18 @@ static void dissect_x11_initial_conn(tvbuff_t *tvb, packet_info *pinfo,
       UNUSED(2);
 
       if (auth_proto_name_length != 0) {
-           STRING8(authorization_protocol_name, auth_proto_name_length);
-           offset = ROUND_LENGTH(offset);
+            STRING8(authorization_protocol_name, auth_proto_name_length);
+            offset = ROUND_LENGTH(offset);
       }
 
       if (auth_proto_data_length != 0) {
-           STRING8(authorization_protocol_data, auth_proto_data_length);
-           offset = ROUND_LENGTH(offset);
+            STRING8(authorization_protocol_data, auth_proto_data_length);
+            offset = ROUND_LENGTH(offset);
       }
 
       if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
-               proto_tree_add_item(t, hf_x11_undecoded, tvb, offset, left,
-               little_endian);
+            proto_tree_add_item(t, hf_x11_undecoded, tvb, offset, left,
+                                little_endian);
 
       /*
        * This is the initial connection request...
@@ -2966,96 +2966,96 @@ static void dissect_x11_initial_conn(tvbuff_t *tvb, packet_info *pinfo,
        */
       state->sequencenumber = 0;
       g_hash_table_insert(state->seqtable, GINT_TO_POINTER(state->sequencenumber),
-                         (int *)INITIAL_CONN);
+                          (int *)INITIAL_CONN);
 }
 
 static void dissect_x11_initial_reply(tvbuff_t *tvb, packet_info *pinfo,
     proto_tree *tree, const char _U_ *sep, x11_conv_data_t *volatile state,
     gboolean little_endian)
 {
-       int offset = 0, *offsetp = &offset, left;
-       unsigned char success;
-       int length_of_vendor;
-       int length_of_reason;
-       proto_item *ti;
-       proto_tree *t;
-
-       ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
-       proto_item_append_text(ti, ", Reply, Initial connection reply");
-       t = proto_item_add_subtree(ti, ett_x11);
-
-       state->iconn_reply = pinfo->fd->num;
-       success = INT8(success);
-       if (success) {
-               UNUSED(1);
-               length_of_reason = 0;
-       }
-       else {
-               length_of_reason = INT8(length_of_reason);
-       }
-
-       INT16(protocol_major_version);
-       INT16(protocol_minor_version);
-       INT16(replylength);
-       if (success) {
-               INT32(release_number);
-               INT32(resource_id_base);
-               INT32(resource_id_mask);
-               INT32(motion_buffer_size);
-               length_of_vendor = INT16(length_of_vendor);
-               INT16(maximum_request_length);
-               INT8(number_of_screens_in_roots);
-               INT8(number_of_formats_in_pixmap_formats);
-               INT8(image_byte_order);
-               INT8(bitmap_format_bit_order);
-               INT8(bitmap_format_scanline_unit);
-               INT8(bitmap_format_scanline_pad);
-               INT8(min_keycode);
-               INT8(max_keycode);
-               UNUSED(4);
-               STRING8(vendor, length_of_vendor);
-       } else {
-               STRING8(reason, length_of_reason);
-       }
-
-       if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
-           UNDECODED(left);
+      int offset = 0, *offsetp = &offset, left;
+      unsigned char success;
+      int length_of_vendor;
+      int length_of_reason;
+      proto_item *ti;
+      proto_tree *t;
+
+      ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
+      proto_item_append_text(ti, ", Reply, Initial connection reply");
+      t = proto_item_add_subtree(ti, ett_x11);
+
+      state->iconn_reply = pinfo->fd->num;
+      success = INT8(success);
+      if (success) {
+            UNUSED(1);
+            length_of_reason = 0;
+      }
+      else {
+            length_of_reason = INT8(length_of_reason);
+      }
+
+      INT16(protocol_major_version);
+      INT16(protocol_minor_version);
+      INT16(replylength);
+      if (success) {
+            INT32(release_number);
+            INT32(resource_id_base);
+            INT32(resource_id_mask);
+            INT32(motion_buffer_size);
+            length_of_vendor = INT16(length_of_vendor);
+            INT16(maximum_request_length);
+            INT8(number_of_screens_in_roots);
+            INT8(number_of_formats_in_pixmap_formats);
+            INT8(image_byte_order);
+            INT8(bitmap_format_bit_order);
+            INT8(bitmap_format_scanline_unit);
+            INT8(bitmap_format_scanline_pad);
+            INT8(min_keycode);
+            INT8(max_keycode);
+            UNUSED(4);
+            STRING8(vendor, length_of_vendor);
+      } else {
+            STRING8(reason, length_of_reason);
+      }
+
+      if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
+            UNDECODED(left);
 
 }
 
 typedef struct x11_reply_info {
-    const guint8 minor;
-    void (*dissect)(tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t, int little_endian);
+      const guint8 minor;
+      void (*dissect)(tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t, int little_endian);
 } x11_reply_info;
 
 typedef struct event_info {
-    const gchar *name;
-    void (*dissect)(tvbuff_t *tvb, int *offsetp, proto_tree *t, int little_endian);
+      const gchar *name;
+      void (*dissect)(tvbuff_t *tvb, int *offsetp, proto_tree *t, int little_endian);
 } x11_event_info;
 
 static void set_handler(const char *name, void (*func)(tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t, int little_endian),
-                       const char **errors,
-                       const x11_event_info *event_info,
-                       const x11_reply_info *reply_info)
+                        const char **errors,
+                        const x11_event_info *event_info,
+                        const x11_reply_info *reply_info)
 {
-    g_hash_table_insert(extension_table, (gpointer)name, (gpointer)func);
-    g_hash_table_insert(error_table, (gpointer)name, (gpointer)errors);
-    g_hash_table_insert(event_table, (gpointer)name, (gpointer)event_info);
-    g_hash_table_insert(reply_table, (gpointer)name, (gpointer)reply_info);
+      g_hash_table_insert(extension_table, (gpointer)name, (gpointer)func);
+      g_hash_table_insert(error_table, (gpointer)name, (gpointer)errors);
+      g_hash_table_insert(event_table, (gpointer)name, (gpointer)event_info);
+      g_hash_table_insert(reply_table, (gpointer)name, (gpointer)reply_info);
 }
 
 static int popcount(unsigned int mask)
 {
 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-    /* GCC 3.4 or newer */
-    return __builtin_popcount(mask);
+      /* GCC 3.4 or newer */
+      return __builtin_popcount(mask);
 #else
-    /* HACKMEM 169 */
-    unsigned long y;
+      /* HACKMEM 169 */
+      unsigned long y;
 
-    y = (mask >> 1) &033333333333;
-    y = mask - y - ((y >>1) & 033333333333);
-    return (((y + (y >> 3)) & 030707070707) % 077);
+      y = (mask >> 1) &033333333333;
+      y = mask - y - ((y >>1) & 033333333333);
+      return (((y + (y >> 3)) & 030707070707) % 077);
 #endif
 }
 
@@ -3063,98 +3063,98 @@ static int popcount(unsigned int mask)
 #include "x11-extension-implementation.h"
 
 static void tryExtension(int opcode, tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t,
-    x11_conv_data_t *state, gboolean little_endian)
+                         x11_conv_data_t *state, gboolean little_endian)
 {
-    const gchar *extension;
-    void (*func)(tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t, int little_endian);
+      const gchar *extension;
+      void (*func)(tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t, int little_endian);
 
-    extension = match_strval(opcode, state->opcode_vals);
-    if (!extension)
-       return;
+      extension = match_strval(opcode, state->opcode_vals);
+      if (!extension)
+            return;
 
-    func = g_hash_table_lookup(extension_table, extension);
-    if (func)
-       func(tvb, pinfo, offsetp, t, little_endian);
+      func = g_hash_table_lookup(extension_table, extension);
+      if (func)
+            func(tvb, pinfo, offsetp, t, little_endian);
 }
 
 static void tryExtensionReply(int opcode, tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t,
-    x11_conv_data_t *state, gboolean little_endian)
+                              x11_conv_data_t *state, gboolean little_endian)
 {
-    void (*func)(tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t, int little_endian);
+      void (*func)(tvbuff_t *tvb, packet_info *pinfo, int *offsetp, proto_tree *t, int little_endian);
 
-    func = g_hash_table_lookup(state->reply_funcs, GINT_TO_POINTER(opcode));
-    if (func)
-       func(tvb, pinfo, offsetp, t, little_endian);
-    else
-       REPLYCONTENTS_COMMON();
+      func = g_hash_table_lookup(state->reply_funcs, GINT_TO_POINTER(opcode));
+      if (func)
+            func(tvb, pinfo, offsetp, t, little_endian);
+      else
+            REPLYCONTENTS_COMMON();
 }
 
 static void tryExtensionEvent(int event, tvbuff_t *tvb, int *offsetp, proto_tree *t,
-    x11_conv_data_t *state, gboolean little_endian)
+                              x11_conv_data_t *state, gboolean little_endian)
 {
-    void (*func)(tvbuff_t *tvb, int *offsetp, proto_tree *t, int little_endian);
+      void (*func)(tvbuff_t *tvb, int *offsetp, proto_tree *t, int little_endian);
 
-    func = g_hash_table_lookup(state->eventcode_funcs, GINT_TO_POINTER(event));
-    if (func)
-       func(tvb, offsetp, t, little_endian);
+      func = g_hash_table_lookup(state->eventcode_funcs, GINT_TO_POINTER(event));
+      if (func)
+            func(tvb, offsetp, t, little_endian);
 }
 
 static void register_extension(x11_conv_data_t *state, value_string *vals_p,
     int major_opcode, unsigned int first_event, unsigned int first_error)
 {
-    const char **error_string;
-    x11_event_info *event_info;
-    x11_reply_info *reply_info;
-    int i;
-
-    vals_p->value = major_opcode;
-
-    error_string = g_hash_table_lookup(error_table, vals_p->strptr);
-    while (error_string && *error_string && first_error <= LastExtensionError) {
-       /* store string of extension error */
-       for (i = 0; i <= LastExtensionError; i++) {
-           if (state->errorcode_vals[i].strptr == NULL) {
-               state->errorcode_vals[i].value = first_error;
-               state->errorcode_vals[i].strptr = *error_string;
-               break;
-           } else if (state->errorcode_vals[i].value == first_error) {
-               /* TODO: Warn about extensions stepping on each other */
-               state->errorcode_vals[i].strptr = *error_string;
-               break;
-           }
-       }
-       first_error++;
-       error_string++;
-    }
+      const char **error_string;
+      x11_event_info *event_info;
+      x11_reply_info *reply_info;
+      int i;
 
-    event_info = g_hash_table_lookup(event_table, vals_p->strptr);
-    while (event_info && event_info->name && first_event <= LastExtensionEvent) {
-       /* store string of extension event */
-       for (i = 0; i <= LastExtensionEvent; i++) {
-           if (state->eventcode_vals[i].strptr == NULL) {
-               state->eventcode_vals[i].value = first_event;
-               state->eventcode_vals[i].strptr = event_info->name;
-               break;
-           } else if (state->eventcode_vals[i].value == first_event) {
-               /* TODO: Warn about extensions stepping on each other */
-               state->eventcode_vals[i].strptr = event_info->name;
-               break;
-           }
-       }
-
-       /* store event decode function */
-       g_hash_table_insert(state->eventcode_funcs, GINT_TO_POINTER(first_event), (gpointer)event_info->dissect);
-
-       first_event++;
-       event_info++;
-    }
+      vals_p->value = major_opcode;
+
+      error_string = g_hash_table_lookup(error_table, vals_p->strptr);
+      while (error_string && *error_string && first_error <= LastExtensionError) {
+            /* store string of extension error */
+            for (i = 0; i <= LastExtensionError; i++) {
+                  if (state->errorcode_vals[i].strptr == NULL) {
+                        state->errorcode_vals[i].value = first_error;
+                        state->errorcode_vals[i].strptr = *error_string;
+                        break;
+                  } else if (state->errorcode_vals[i].value == first_error) {
+                        /* TODO: Warn about extensions stepping on each other */
+                        state->errorcode_vals[i].strptr = *error_string;
+                        break;
+                  }
+            }
+            first_error++;
+            error_string++;
+      }
+
+      event_info = g_hash_table_lookup(event_table, vals_p->strptr);
+      while (event_info && event_info->name && first_event <= LastExtensionEvent) {
+            /* store string of extension event */
+            for (i = 0; i <= LastExtensionEvent; i++) {
+                  if (state->eventcode_vals[i].strptr == NULL) {
+                        state->eventcode_vals[i].value = first_event;
+                        state->eventcode_vals[i].strptr = event_info->name;
+                        break;
+                  } else if (state->eventcode_vals[i].value == first_event) {
+                        /* TODO: Warn about extensions stepping on each other */
+                        state->eventcode_vals[i].strptr = event_info->name;
+                        break;
+                  }
+            }
+
+            /* store event decode function */
+            g_hash_table_insert(state->eventcode_funcs, GINT_TO_POINTER(first_event), (gpointer)event_info->dissect);
+
+            first_event++;
+            event_info++;
+      }
 
-    reply_info = g_hash_table_lookup(reply_table, vals_p->strptr);
-    if (reply_info)
-       for (i = 0; reply_info[i].dissect; i++)
-           g_hash_table_insert(state->reply_funcs,
-                       GINT_TO_POINTER(major_opcode | (reply_info[i].minor << 8)),
-                       (gpointer)reply_info[i].dissect);
+      reply_info = g_hash_table_lookup(reply_table, vals_p->strptr);
+      if (reply_info)
+            for (i = 0; reply_info[i].dissect; i++)
+                  g_hash_table_insert(state->reply_funcs,
+                                      GINT_TO_POINTER(major_opcode | (reply_info[i].minor << 8)),
+                                      (gpointer)reply_info[i].dissect);
 }
 
 
@@ -3177,8 +3177,8 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo,
       length = VALUE16(tvb, 2) * 4;
 
       if (length < 4) {
-           /* Bogus message length? */
-           return;
+            /* Bogus message length? */
+            return;
       }
 
       next_offset = offset + length;
@@ -3192,48 +3192,48 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo,
       OPCODE();
 
       if (check_col(pinfo->cinfo, COL_INFO))
-         col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s", sep,
-                         val_to_str(opcode, state->opcode_vals,
-                                    "<Unknown opcode %d>"));
+            col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s", sep,
+                            val_to_str(opcode, state->opcode_vals,
+                                       "<Unknown opcode %d>"));
 
       proto_item_append_text(ti, ", Request, opcode: %d (%s)",
-                            opcode, val_to_str(opcode, state->opcode_vals,
-                                               "<Unknown opcode %d>"));
+                             opcode, val_to_str(opcode, state->opcode_vals,
+                                                "<Unknown opcode %d>"));
 
       /*
        * Does this request expect a reply?
        */
       switch(opcode) {
 
-      case X_QueryExtension:
-
-               /* necessary processing even if tree == NULL */
-
-               v16 = VALUE16(tvb, 4);
-               name = se_alloc(v16 + 1);
-               stringCopy(name, (gchar*)tvb_get_ptr(tvb, 8, v16), v16);
-
-               /* store string of extension, opcode will be set at reply */
-               i = 0;
-               while(i < MAX_OPCODES) {
-                       if (state->opcode_vals[i].strptr == NULL) {
-                               state->opcode_vals[i].strptr = name;
-                               state->opcode_vals[i].value = -1;
-                               g_hash_table_insert(state->valtable,
-                                                   GINT_TO_POINTER(state->sequencenumber),
-                                                   (int *)&state->opcode_vals[i]);
-                               break;
-                       } else if (strcmp(state->opcode_vals[i].strptr,
-                                         name) == 0) {
-                               g_hash_table_insert(state->valtable,
-                                                   GINT_TO_POINTER(state->sequencenumber),
-                                                   (int *)&state->opcode_vals[i]);
-                               break;
-                       }
-                       i++;
-               }
-
-               /* QueryExtension expects a reply, fall through */
+            case X_QueryExtension:
+
+                  /* necessary processing even if tree == NULL */
+
+                  v16 = VALUE16(tvb, 4);
+                  name = se_alloc(v16 + 1);
+                  stringCopy(name, (gchar*)tvb_get_ptr(tvb, 8, v16), v16);
+
+                  /* store string of extension, opcode will be set at reply */
+                  i = 0;
+                  while(i < MAX_OPCODES) {
+                        if (state->opcode_vals[i].strptr == NULL) {
+                              state->opcode_vals[i].strptr = name;
+                              state->opcode_vals[i].value = -1;
+                              g_hash_table_insert(state->valtable,
+                                                  GINT_TO_POINTER(state->sequencenumber),
+                                                  (int *)&state->opcode_vals[i]);
+                              break;
+                        } else if (strcmp(state->opcode_vals[i].strptr,
+                                          name) == 0) {
+                              g_hash_table_insert(state->valtable,
+                                                  GINT_TO_POINTER(state->sequencenumber),
+                                                  (int *)&state->opcode_vals[i]);
+                              break;
+                        }
+                        i++;
+                  }
+
+                  /* QueryExtension expects a reply, fall through */
 
       case X_AllocColor:
       case X_AllocColorCells:
@@ -3274,1028 +3274,1028 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo,
       case X_SetModifierMapping:
       case X_SetPointerMapping:
       case X_TranslateCoords:
-               /*
-                * Those requests expect a reply.
-                */
-               g_hash_table_insert(state->seqtable,
-                                   GINT_TO_POINTER(state->sequencenumber),
-                                   GINT_TO_POINTER(opcode));
+            /*
+             * Those requests expect a reply.
+             */
+            g_hash_table_insert(state->seqtable,
+                                GINT_TO_POINTER(state->sequencenumber),
+                                GINT_TO_POINTER(opcode));
 
-               break;
+            break;
 
       default:
-               /*
-                * With Extension, we don't know, so assume there could be one
-                */
-               if (opcode >= X_FirstExtension && opcode <= X_LastExtension) {
-                       guint32 minor;
-                       minor = tvb_get_guint8(tvb, 1);
-
-                       g_hash_table_insert(state->seqtable,
-                                           GINT_TO_POINTER(state->sequencenumber),
-                                           GINT_TO_POINTER(opcode | (minor << 8)));
-               }
-
-               /*
-                * No reply is expected from any other request.
-                */
-               break;
+            /*
+             * With Extension, we don't know, so assume there could be one
+             */
+            if (opcode >= X_FirstExtension && opcode <= X_LastExtension) {
+                  guint32 minor;
+                  minor = tvb_get_guint8(tvb, 1);
+
+                  g_hash_table_insert(state->seqtable,
+                                      GINT_TO_POINTER(state->sequencenumber),
+                                      GINT_TO_POINTER(opcode | (minor << 8)));
+            }
+
+            /*
+             * No reply is expected from any other request.
+             */
+            break;
       }
 
       if (tree == NULL)
-        return;
+            return;
 
       switch(opcode) {
 
       case X_CreateWindow:
-           CARD8(depth);
-           REQUEST_LENGTH();
-           WINDOW(wid);
-           WINDOW(parent);
-           INT16(x);
-           INT16(y);
-           CARD16(width);
-           CARD16(height);
-           CARD16(border_width);
-           ENUM16(window_class);
-           VISUALID(visual);
-           windowAttributes(tvb, offsetp, t, little_endian);
-           break;
+            CARD8(depth);
+            REQUEST_LENGTH();
+            WINDOW(wid);
+            WINDOW(parent);
+            INT16(x);
+            INT16(y);
+            CARD16(width);
+            CARD16(height);
+            CARD16(border_width);
+            ENUM16(window_class);
+            VISUALID(visual);
+            windowAttributes(tvb, offsetp, t, little_endian);
+            break;
 
       case X_ChangeWindowAttributes:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           windowAttributes(tvb, offsetp, t, little_endian);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            windowAttributes(tvb, offsetp, t, little_endian);
+            break;
 
       case X_GetWindowAttributes:
       case X_DestroyWindow:
       case X_DestroySubwindows:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            break;
 
       case X_ChangeSaveSet:
-           ENUM8(save_set_mode);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           break;
+            ENUM8(save_set_mode);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            break;
 
       case X_ReparentWindow:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           WINDOW(parent);
-           INT16(x);
-           INT16(y);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            WINDOW(parent);
+            INT16(x);
+            INT16(y);
+            break;
 
       case X_MapWindow:
       case X_MapSubwindows:
       case X_UnmapWindow:
       case X_UnmapSubwindows:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            break;
 
       case X_ConfigureWindow:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           BITMASK16(configure_window);
-           UNUSED(2);
-           BITFIELD(INT16,  configure_window_mask, x);
-           BITFIELD(INT16,  configure_window_mask, y);
-           BITFIELD(CARD16, configure_window_mask, width);
-           BITFIELD(CARD16, configure_window_mask, height);
-           BITFIELD(CARD16, configure_window_mask, border_width);
-           BITFIELD(WINDOW, configure_window_mask, sibling);
-           BITFIELD(ENUM8,  configure_window_mask, stack_mode);
-           ENDBITMASK;
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            BITMASK16(configure_window);
+            UNUSED(2);
+            BITFIELD(INT16,  configure_window_mask, x);
+            BITFIELD(INT16,  configure_window_mask, y);
+            BITFIELD(CARD16, configure_window_mask, width);
+            BITFIELD(CARD16, configure_window_mask, height);
+            BITFIELD(CARD16, configure_window_mask, border_width);
+            BITFIELD(WINDOW, configure_window_mask, sibling);
+            BITFIELD(ENUM8,  configure_window_mask, stack_mode);
+            ENDBITMASK;
+            PAD();
+            break;
 
       case X_CirculateWindow:
-           ENUM8(direction);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           break;
+            ENUM8(direction);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            break;
 
       case X_GetGeometry:
       case X_QueryTree:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            break;
 
       case X_InternAtom:
-           BOOL(only_if_exists);
-           REQUEST_LENGTH();
-           v16 = FIELD16(name_length);
-           UNUSED(2);
-           STRING8(name, v16);
-           PAD();
-           break;
+            BOOL(only_if_exists);
+            REQUEST_LENGTH();
+            v16 = FIELD16(name_length);
+            UNUSED(2);
+            STRING8(name, v16);
+            PAD();
+            break;
 
       case X_GetAtomName:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           ATOM(atom);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            ATOM(atom);
+            break;
 
       case X_ChangeProperty:
-           ENUM8(mode);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           ATOM(property);
-           ATOM(type);
-           v8 = CARD8(format);
-           UNUSED(3);
-           v32 = CARD32(data_length);
-           switch (v8) {
-           case 8:
-               if (v32)
-                   LISTofBYTE(data, v32);
-               break;
-           case 16:
-               if (v32)
-                   LISTofCARD16(data16, v32 * 2);
-               break;
-           case 32:
-               if (v32)
-                   LISTofCARD32(data32, v32 * 4);
-               break;
-           default:
-               expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "Invalid Format");
-               break;
-           }
-           PAD();
-           break;
+            ENUM8(mode);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            ATOM(property);
+            ATOM(type);
+            v8 = CARD8(format);
+            UNUSED(3);
+            v32 = CARD32(data_length);
+            switch (v8) {
+            case 8:
+                if (v32)
+                    LISTofBYTE(data, v32);
+                break;
+            case 16:
+                if (v32)
+                    LISTofCARD16(data16, v32 * 2);
+                break;
+            case 32:
+                if (v32)
+                    LISTofCARD32(data32, v32 * 4);
+                break;
+            default:
+                expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "Invalid Format");
+                break;
+            }
+            PAD();
+            break;
 
       case X_DeleteProperty:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           ATOM(property);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            ATOM(property);
+            break;
 
       case X_GetProperty:
-           BOOL(delete);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           ATOM(property);
-           ATOM(get_property_type);
-           CARD32(long_offset);
-           CARD32(long_length);
-           break;
+            BOOL(delete);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            ATOM(property);
+            ATOM(get_property_type);
+            CARD32(long_offset);
+            CARD32(long_length);
+            break;
 
       case X_ListProperties:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            break;
 
       case X_SetSelectionOwner:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(owner);
-           ATOM(selection);
-           TIMESTAMP(time);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(owner);
+            ATOM(selection);
+            TIMESTAMP(time);
+            break;
 
       case X_GetSelectionOwner:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           ATOM(selection);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            ATOM(selection);
+            break;
 
       case X_ConvertSelection:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(requestor);
-           ATOM(selection);
-           ATOM(target);
-           ATOM(property);
-           TIMESTAMP(time);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(requestor);
+            ATOM(selection);
+            ATOM(target);
+            ATOM(property);
+            TIMESTAMP(time);
+            break;
 
       case X_SendEvent:
-           BOOL(propagate);
-           REQUEST_LENGTH();
-           WINDOW(destination);
-           SETofEVENT(event_mask);
-           EVENT();
-           break;
+            BOOL(propagate);
+            REQUEST_LENGTH();
+            WINDOW(destination);
+            SETofEVENT(event_mask);
+            EVENT();
+            break;
 
       case X_GrabPointer:
-           BOOL(owner_events);
-           REQUEST_LENGTH();
-           WINDOW(grab_window);
-           SETofPOINTEREVENT(pointer_event_mask);
-           ENUM8(pointer_mode);
-           ENUM8(keyboard_mode);
-           WINDOW(confine_to);
-           CURSOR(cursor);
-           TIMESTAMP(time);
-           break;
+            BOOL(owner_events);
+            REQUEST_LENGTH();
+            WINDOW(grab_window);
+            SETofPOINTEREVENT(pointer_event_mask);
+            ENUM8(pointer_mode);
+            ENUM8(keyboard_mode);
+            WINDOW(confine_to);
+            CURSOR(cursor);
+            TIMESTAMP(time);
+            break;
 
       case X_UngrabPointer:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           TIMESTAMP(time);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            TIMESTAMP(time);
+            break;
 
       case X_GrabButton:
-           BOOL(owner_events);
-           REQUEST_LENGTH();
-           WINDOW(grab_window);
-           SETofPOINTEREVENT(event_mask);
-           ENUM8(pointer_mode);
-           ENUM8(keyboard_mode);
-           WINDOW(confine_to);
-           CURSOR(cursor);
-           BUTTON(button);
-           UNUSED(1);
-           SETofKEYMASK(modifiers);
-           break;
+            BOOL(owner_events);
+            REQUEST_LENGTH();
+            WINDOW(grab_window);
+            SETofPOINTEREVENT(event_mask);
+            ENUM8(pointer_mode);
+            ENUM8(keyboard_mode);
+            WINDOW(confine_to);
+            CURSOR(cursor);
+            BUTTON(button);
+            UNUSED(1);
+            SETofKEYMASK(modifiers);
+            break;
 
       case X_UngrabButton:
-           BUTTON(button);
-           REQUEST_LENGTH();
-           WINDOW(grab_window);
-           SETofKEYMASK(modifiers);
-           UNUSED(2);
-           break;
+            BUTTON(button);
+            REQUEST_LENGTH();
+            WINDOW(grab_window);
+            SETofKEYMASK(modifiers);
+            UNUSED(2);
+            break;
 
       case X_ChangeActivePointerGrab:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           CURSOR(cursor);
-           TIMESTAMP(time);
-           SETofPOINTEREVENT(event_mask);
-           UNUSED(2);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            CURSOR(cursor);
+            TIMESTAMP(time);
+            SETofPOINTEREVENT(event_mask);
+            UNUSED(2);
+            break;
 
       case X_GrabKeyboard:
-           BOOL(owner_events);
-           REQUEST_LENGTH();
-           WINDOW(grab_window);
-           TIMESTAMP(time);
-           ENUM8(pointer_mode);
-           ENUM8(keyboard_mode);
-           UNUSED(2);
-           break;
+            BOOL(owner_events);
+            REQUEST_LENGTH();
+            WINDOW(grab_window);
+            TIMESTAMP(time);
+            ENUM8(pointer_mode);
+            ENUM8(keyboard_mode);
+            UNUSED(2);
+            break;
 
       case X_UngrabKeyboard:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           TIMESTAMP(time);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            TIMESTAMP(time);
+            break;
 
       case X_GrabKey:
-           BOOL(owner_events);
-           REQUEST_LENGTH();
-           WINDOW(grab_window);
-           SETofKEYMASK(modifiers);
-           KEYCODE(key);
-           ENUM8(pointer_mode);
-           ENUM8(keyboard_mode);
-           UNUSED(3);
-           break;
+            BOOL(owner_events);
+            REQUEST_LENGTH();
+            WINDOW(grab_window);
+            SETofKEYMASK(modifiers);
+            KEYCODE(key);
+            ENUM8(pointer_mode);
+            ENUM8(keyboard_mode);
+            UNUSED(3);
+            break;
 
       case X_UngrabKey:
-           KEYCODE(key);
-           REQUEST_LENGTH();
-           WINDOW(grab_window);
-           SETofKEYMASK(modifiers);
-           UNUSED(2);
-           break;
+            KEYCODE(key);
+            REQUEST_LENGTH();
+            WINDOW(grab_window);
+            SETofKEYMASK(modifiers);
+            UNUSED(2);
+            break;
 
       case X_AllowEvents:
-           ENUM8(allow_events_mode);
-           REQUEST_LENGTH();
-           TIMESTAMP(time);
-           break;
+            ENUM8(allow_events_mode);
+            REQUEST_LENGTH();
+            TIMESTAMP(time);
+            break;
 
       case X_GrabServer:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_UngrabServer:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_QueryPointer:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            break;
 
       case X_GetMotionEvents:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           TIMESTAMP(start);
-           TIMESTAMP(stop);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            TIMESTAMP(start);
+            TIMESTAMP(stop);
+            break;
 
       case X_TranslateCoords:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(src_window);
-           WINDOW(dst_window);
-           INT16(src_x);
-           INT16(src_y);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(src_window);
+            WINDOW(dst_window);
+            INT16(src_x);
+            INT16(src_y);
+            break;
 
       case X_WarpPointer:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(warp_pointer_src_window);
-           WINDOW(warp_pointer_dst_window);
-           INT16(src_x);
-           INT16(src_y);
-           CARD16(src_width);
-           CARD16(src_height);
-           INT16(dst_x);
-           INT16(dst_y);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(warp_pointer_src_window);
+            WINDOW(warp_pointer_dst_window);
+            INT16(src_x);
+            INT16(src_y);
+            CARD16(src_width);
+            CARD16(src_height);
+            INT16(dst_x);
+            INT16(dst_y);
+            break;
 
       case X_SetInputFocus:
-           ENUM8(revert_to);
-           REQUEST_LENGTH();
-           WINDOW(focus);
-           TIMESTAMP(time);
-           break;
+            ENUM8(revert_to);
+            REQUEST_LENGTH();
+            WINDOW(focus);
+            TIMESTAMP(time);
+            break;
 
       case X_GetInputFocus:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_QueryKeymap:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_OpenFont:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           FONT(fid);
-           v16 = FIELD16(name_length);
-           UNUSED(2);
-           STRING8(name, v16);
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            FONT(fid);
+            v16 = FIELD16(name_length);
+            UNUSED(2);
+            STRING8(name, v16);
+            PAD();
+            break;
 
       case X_CloseFont:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           FONT(font);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            FONT(font);
+            break;
 
       case X_QueryFont:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           FONTABLE(font);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            FONTABLE(font);
+            break;
 
       case X_QueryTextExtents:
-           v8 = BOOL(odd_length);
-           REQUEST_LENGTH();
-           FONTABLE(font);
-           STRING16(string16, (next_offset - offset - (v8 ? 2 : 0)) / 2);
-           PAD();
-           break;
+            v8 = BOOL(odd_length);
+            REQUEST_LENGTH();
+            FONTABLE(font);
+            STRING16(string16, (next_offset - offset - (v8 ? 2 : 0)) / 2);
+            PAD();
+            break;
 
       case X_ListFonts:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           CARD16(max_names);
-           v16 = FIELD16(pattern_length);
-           STRING8(pattern, v16);
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            CARD16(max_names);
+            v16 = FIELD16(pattern_length);
+            STRING8(pattern, v16);
+            PAD();
+            break;
 
       case X_ListFontsWithInfo:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           CARD16(max_names);
-           v16 = FIELD16(pattern_length);
-           STRING8(pattern, v16);
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            CARD16(max_names);
+            v16 = FIELD16(pattern_length);
+            STRING8(pattern, v16);
+            PAD();
+            break;
 
       case X_SetFontPath:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           v16 = CARD16(str_number_in_path);
-           UNUSED(2);
-           LISTofSTRING8(path, v16);
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            v16 = CARD16(str_number_in_path);
+            UNUSED(2);
+            LISTofSTRING8(path, v16);
+            PAD();
+            break;
 
       case X_GetFontPath:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_CreatePixmap:
-           CARD8(depth);
-           REQUEST_LENGTH();
-           PIXMAP(pid);
-           DRAWABLE(drawable);
-           CARD16(width);
-           CARD16(height);
-           break;
+            CARD8(depth);
+            REQUEST_LENGTH();
+            PIXMAP(pid);
+            DRAWABLE(drawable);
+            CARD16(width);
+            CARD16(height);
+            break;
 
       case X_FreePixmap:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           PIXMAP(pixmap);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            PIXMAP(pixmap);
+            break;
 
       case X_CreateGC:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           GCONTEXT(cid);
-           DRAWABLE(drawable);
-           gcAttributes(tvb, offsetp, t, little_endian);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            GCONTEXT(cid);
+            DRAWABLE(drawable);
+            gcAttributes(tvb, offsetp, t, little_endian);
+            break;
 
       case X_ChangeGC:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           GCONTEXT(gc);
-           gcAttributes(tvb, offsetp, t, little_endian);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            GCONTEXT(gc);
+            gcAttributes(tvb, offsetp, t, little_endian);
+            break;
 
       case X_CopyGC:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           GCONTEXT(src_gc);
-           GCONTEXT(dst_gc);
-           gcMask(tvb, offsetp, t, little_endian);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            GCONTEXT(src_gc);
+            GCONTEXT(dst_gc);
+            gcMask(tvb, offsetp, t, little_endian);
+            break;
 
       case X_SetDashes:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           GCONTEXT(gc);
-           CARD16(dash_offset);
-           v16 = FIELD16(dashes_length);
-           LISTofCARD8(dashes, v16);
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            GCONTEXT(gc);
+            CARD16(dash_offset);
+            v16 = FIELD16(dashes_length);
+            LISTofCARD8(dashes, v16);
+            PAD();
+            break;
 
       case X_SetClipRectangles:
-           ENUM8(ordering);
-           REQUEST_LENGTH();
-           GCONTEXT(gc);
-           INT16(clip_x_origin);
-           INT16(clip_y_origin);
-           LISTofRECTANGLE(rectangles);
-           break;
+            ENUM8(ordering);
+            REQUEST_LENGTH();
+            GCONTEXT(gc);
+            INT16(clip_x_origin);
+            INT16(clip_y_origin);
+            LISTofRECTANGLE(rectangles);
+            break;
 
       case X_FreeGC:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           GCONTEXT(gc);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            GCONTEXT(gc);
+            break;
 
       case X_ClearArea:
-           BOOL(exposures);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           INT16(x);
-           INT16(y);
-           CARD16(width);
-           CARD16(height);
-           break;
+            BOOL(exposures);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            INT16(x);
+            INT16(y);
+            CARD16(width);
+            CARD16(height);
+            break;
 
       case X_CopyArea:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           DRAWABLE(src_drawable);
-           DRAWABLE(dst_drawable);
-           GCONTEXT(gc);
-           INT16(src_x);
-           INT16(src_y);
-           INT16(dst_x);
-           INT16(dst_y);
-           CARD16(width);
-           CARD16(height);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            DRAWABLE(src_drawable);
+            DRAWABLE(dst_drawable);
+            GCONTEXT(gc);
+            INT16(src_x);
+            INT16(src_y);
+            INT16(dst_x);
+            INT16(dst_y);
+            CARD16(width);
+            CARD16(height);
+            break;
 
       case X_CopyPlane:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           DRAWABLE(src_drawable);
-           DRAWABLE(dst_drawable);
-           GCONTEXT(gc);
-           INT16(src_x);
-           INT16(src_y);
-           INT16(dst_x);
-           INT16(dst_y);
-           CARD16(width);
-           CARD16(height);
-           CARD32(bit_plane);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            DRAWABLE(src_drawable);
+            DRAWABLE(dst_drawable);
+            GCONTEXT(gc);
+            INT16(src_x);
+            INT16(src_y);
+            INT16(dst_x);
+            INT16(dst_y);
+            CARD16(width);
+            CARD16(height);
+            CARD32(bit_plane);
+            break;
 
       case X_PolyPoint:
-           ENUM8(coordinate_mode);
-           v16 = REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           LISTofPOINT(points, v16 - 12);
-           break;
+            ENUM8(coordinate_mode);
+            v16 = REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            LISTofPOINT(points, v16 - 12);
+            break;
 
       case X_PolyLine:
-           ENUM8(coordinate_mode);
-           v16 = REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           LISTofPOINT(points, v16 - 12);
-           break;
+            ENUM8(coordinate_mode);
+            v16 = REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            LISTofPOINT(points, v16 - 12);
+            break;
 
       case X_PolySegment:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           LISTofSEGMENT(segments);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            LISTofSEGMENT(segments);
+            break;
 
       case X_PolyRectangle:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           LISTofRECTANGLE(rectangles);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            LISTofRECTANGLE(rectangles);
+            break;
 
       case X_PolyArc:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           LISTofARC(arcs);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            LISTofARC(arcs);
+            break;
 
       case X_FillPoly:
-           UNUSED(1);
-           v16 = REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           ENUM8(shape);
-           ENUM8(coordinate_mode);
-           UNUSED(2);
-           LISTofPOINT(points, v16 - 16);
-           break;
+            UNUSED(1);
+            v16 = REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            ENUM8(shape);
+            ENUM8(coordinate_mode);
+            UNUSED(2);
+            LISTofPOINT(points, v16 - 16);
+            break;
 
       case X_PolyFillRectangle:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           LISTofRECTANGLE(rectangles);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            LISTofRECTANGLE(rectangles);
+            break;
 
       case X_PolyFillArc:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           LISTofARC(arcs);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            LISTofARC(arcs);
+            break;
 
       case X_PutImage:
-           ENUM8(image_format);
-           v16 = REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           CARD16(width);
-           CARD16(height);
-           INT16(dst_x);
-           INT16(dst_y);
-           CARD8(left_pad);
-           CARD8(depth);
-           UNUSED(2);
-           LISTofBYTE(data, v16 - 24);
-           PAD();
-           break;
+            ENUM8(image_format);
+            v16 = REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            CARD16(width);
+            CARD16(height);
+            INT16(dst_x);
+            INT16(dst_y);
+            CARD8(left_pad);
+            CARD8(depth);
+            UNUSED(2);
+            LISTofBYTE(data, v16 - 24);
+            PAD();
+            break;
 
       case X_GetImage:
-           ENUM8(image_pixmap_format);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           INT16(x);
-           INT16(y);
-           CARD16(width);
-           CARD16(height);
-           CARD32(plane_mask);
-           break;
+            ENUM8(image_pixmap_format);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            INT16(x);
+            INT16(y);
+            CARD16(width);
+            CARD16(height);
+            CARD32(plane_mask);
+            break;
 
       case X_PolyText8:
-           UNUSED(1);
-           v16 = REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           INT16(x);
-           INT16(y);
-           LISTofTEXTITEM8(items);
-           PAD();
-           break;
+            UNUSED(1);
+            v16 = REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            INT16(x);
+            INT16(y);
+            LISTofTEXTITEM8(items);
+            PAD();
+            break;
 
       case X_PolyText16:
-           UNUSED(1);
-           v16 = REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           INT16(x);
-           INT16(y);
-           LISTofTEXTITEM16(items);
-           PAD();
-           break;
+            UNUSED(1);
+            v16 = REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            INT16(x);
+            INT16(y);
+            LISTofTEXTITEM16(items);
+            PAD();
+            break;
 
       case X_ImageText8:
-           v8 = FIELD8(string_length);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           INT16(x);
-           INT16(y);
-           STRING8(string, v8);
-           PAD();
-           break;
+            v8 = FIELD8(string_length);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            INT16(x);
+            INT16(y);
+            STRING8(string, v8);
+            PAD();
+            break;
 
       case X_ImageText16:
-           v8 = FIELD8(string_length);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           GCONTEXT(gc);
-           INT16(x);
-           INT16(y);
-           STRING16(string16, v8);
-           PAD();
-           break;
+            v8 = FIELD8(string_length);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            GCONTEXT(gc);
+            INT16(x);
+            INT16(y);
+            STRING16(string16, v8);
+            PAD();
+            break;
 
       case X_CreateColormap:
-           ENUM8(alloc);
-           REQUEST_LENGTH();
-           COLORMAP(mid);
-           WINDOW(window);
-           VISUALID(visual);
-           break;
+            ENUM8(alloc);
+            REQUEST_LENGTH();
+            COLORMAP(mid);
+            WINDOW(window);
+            VISUALID(visual);
+            break;
 
       case X_FreeColormap:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            break;
 
       case X_CopyColormapAndFree:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           COLORMAP(mid);
-           COLORMAP(src_cmap);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            COLORMAP(mid);
+            COLORMAP(src_cmap);
+            break;
 
       case X_InstallColormap:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            break;
 
       case X_UninstallColormap:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            break;
 
       case X_ListInstalledColormaps:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           WINDOW(window);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            WINDOW(window);
+            break;
 
       case X_AllocColor:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           CARD16(red);
-           CARD16(green);
-           CARD16(blue);
-           UNUSED(2);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            CARD16(red);
+            CARD16(green);
+            CARD16(blue);
+            UNUSED(2);
+            break;
 
       case X_AllocNamedColor:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           v16 = FIELD16(name_length);
-           UNUSED(2);
-           STRING8(name, v16);
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            v16 = FIELD16(name_length);
+            UNUSED(2);
+            STRING8(name, v16);
+            PAD();
+            break;
 
       case X_AllocColorCells:
-           BOOL(contiguous);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           CARD16(colors);
-           CARD16(planes);
-           break;
+            BOOL(contiguous);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            CARD16(colors);
+            CARD16(planes);
+            break;
 
       case X_AllocColorPlanes:
-           BOOL(contiguous);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           CARD16(colors);
-           CARD16(reds);
-           CARD16(greens);
-           CARD16(blues);
-           break;
+            BOOL(contiguous);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            CARD16(colors);
+            CARD16(reds);
+            CARD16(greens);
+            CARD16(blues);
+            break;
 
       case X_FreeColors:
-           UNUSED(1);
-           v16 = REQUEST_LENGTH();
-           COLORMAP(cmap);
-           CARD32(plane_mask);
-           LISTofCARD32(pixels, v16 - 12);
-           break;
+            UNUSED(1);
+            v16 = REQUEST_LENGTH();
+            COLORMAP(cmap);
+            CARD32(plane_mask);
+            LISTofCARD32(pixels, v16 - 12);
+            break;
 
       case X_StoreColors:
-           UNUSED(1);
-           v16 = REQUEST_LENGTH();
-           COLORMAP(cmap);
-           LISTofCOLORITEM(color_items, v16 - 8);
-           break;
+            UNUSED(1);
+            v16 = REQUEST_LENGTH();
+            COLORMAP(cmap);
+            LISTofCOLORITEM(color_items, v16 - 8);
+            break;
 
       case X_StoreNamedColor:
-           COLOR_FLAGS(color);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           CARD32(pixel);
-           v16 = FIELD16(name_length);
-           UNUSED(2);
-           STRING8(name, v16);
-           PAD();
-           break;
+            COLOR_FLAGS(color);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            CARD32(pixel);
+            v16 = FIELD16(name_length);
+            UNUSED(2);
+            STRING8(name, v16);
+            PAD();
+            break;
 
       case X_QueryColors:
-           UNUSED(1);
-           v16 = REQUEST_LENGTH();
-           COLORMAP(cmap);
-           LISTofCARD32(pixels, v16 - 8);
-           break;
+            UNUSED(1);
+            v16 = REQUEST_LENGTH();
+            COLORMAP(cmap);
+            LISTofCARD32(pixels, v16 - 8);
+            break;
 
       case X_LookupColor:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           COLORMAP(cmap);
-           v16 = FIELD16(name_length);
-           UNUSED(2);
-           STRING8(name, v16);
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            COLORMAP(cmap);
+            v16 = FIELD16(name_length);
+            UNUSED(2);
+            STRING8(name, v16);
+            PAD();
+            break;
 
       case X_CreateCursor:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           CURSOR(cid);
-           PIXMAP(source_pixmap);
-           PIXMAP(mask);
-           CARD16(fore_red);
-           CARD16(fore_green);
-           CARD16(fore_blue);
-           CARD16(back_red);
-           CARD16(back_green);
-           CARD16(back_blue);
-           CARD16(x);
-           CARD16(y);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            CURSOR(cid);
+            PIXMAP(source_pixmap);
+            PIXMAP(mask);
+            CARD16(fore_red);
+            CARD16(fore_green);
+            CARD16(fore_blue);
+            CARD16(back_red);
+            CARD16(back_green);
+            CARD16(back_blue);
+            CARD16(x);
+            CARD16(y);
+            break;
 
       case X_CreateGlyphCursor:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           CURSOR(cid);
-           FONT(source_font);
-           FONT(mask_font);
-           CARD16(source_char);
-           CARD16(mask_char);
-           CARD16(fore_red);
-           CARD16(fore_green);
-           CARD16(fore_blue);
-           CARD16(back_red);
-           CARD16(back_green);
-           CARD16(back_blue);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            CURSOR(cid);
+            FONT(source_font);
+            FONT(mask_font);
+            CARD16(source_char);
+            CARD16(mask_char);
+            CARD16(fore_red);
+            CARD16(fore_green);
+            CARD16(fore_blue);
+            CARD16(back_red);
+            CARD16(back_green);
+            CARD16(back_blue);
+            break;
 
       case X_FreeCursor:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           CURSOR(cursor);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            CURSOR(cursor);
+            break;
 
       case X_RecolorCursor:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           CURSOR(cursor);
-           CARD16(fore_red);
-           CARD16(fore_green);
-           CARD16(fore_blue);
-           CARD16(back_red);
-           CARD16(back_green);
-           CARD16(back_blue);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            CURSOR(cursor);
+            CARD16(fore_red);
+            CARD16(fore_green);
+            CARD16(fore_blue);
+            CARD16(back_red);
+            CARD16(back_green);
+            CARD16(back_blue);
+            break;
 
       case X_QueryBestSize:
-           ENUM8(class);
-           REQUEST_LENGTH();
-           DRAWABLE(drawable);
-           CARD16(width);
-           CARD16(height);
-           break;
+            ENUM8(class);
+            REQUEST_LENGTH();
+            DRAWABLE(drawable);
+            CARD16(width);
+            CARD16(height);
+            break;
 
       case X_QueryExtension:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           v16 = FIELD16(name_length);
-           UNUSED(2);
-           STRING8(name, v16);
-           PAD();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            v16 = FIELD16(name_length);
+            UNUSED(2);
+            STRING8(name, v16);
+            PAD();
+            break;
 
       case X_ListExtensions:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_ChangeKeyboardMapping:
-           v8 = FIELD8(keycode_count);
-           REQUEST_LENGTH();
-           v8_2 = KEYCODE(first_keycode);
-           v8_3 = FIELD8(keysyms_per_keycode);
-           UNUSED(2);
-           LISTofKEYSYM(keysyms, state->keycodemap, v8_2, v8, v8_3);
-           break;
+            v8 = FIELD8(keycode_count);
+            REQUEST_LENGTH();
+            v8_2 = KEYCODE(first_keycode);
+            v8_3 = FIELD8(keysyms_per_keycode);
+            UNUSED(2);
+            LISTofKEYSYM(keysyms, state->keycodemap, v8_2, v8, v8_3);
+            break;
 
       case X_GetKeyboardMapping:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           state->request.GetKeyboardMapping.first_keycode
-           = KEYCODE(first_keycode);
-           FIELD8(count);
-           UNUSED(2);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            state->request.GetKeyboardMapping.first_keycode
+            = KEYCODE(first_keycode);
+            FIELD8(count);
+            UNUSED(2);
+            break;
 
       case X_ChangeKeyboardControl:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           BITMASK32(keyboard_value);
-           BITFIELD(INT8, keyboard_value_mask, key_click_percent);
-           BITFIELD(INT8, keyboard_value_mask, bell_percent);
-           BITFIELD(INT16, keyboard_value_mask, bell_pitch);
-           BITFIELD(INT16, keyboard_value_mask, bell_duration);
-           BITFIELD(INT16, keyboard_value_mask, led);
-           BITFIELD(ENUM8, keyboard_value_mask, led_mode);
-           BITFIELD(KEYCODE, keyboard_value_mask, keyboard_key);
-           BITFIELD(ENUM8, keyboard_value_mask, auto_repeat_mode);
-           ENDBITMASK;
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            BITMASK32(keyboard_value);
+            BITFIELD(INT8, keyboard_value_mask, key_click_percent);
+            BITFIELD(INT8, keyboard_value_mask, bell_percent);
+            BITFIELD(INT16, keyboard_value_mask, bell_pitch);
+            BITFIELD(INT16, keyboard_value_mask, bell_duration);
+            BITFIELD(INT16, keyboard_value_mask, led);
+            BITFIELD(ENUM8, keyboard_value_mask, led_mode);
+            BITFIELD(KEYCODE, keyboard_value_mask, keyboard_key);
+            BITFIELD(ENUM8, keyboard_value_mask, auto_repeat_mode);
+            ENDBITMASK;
+            break;
 
       case X_GetKeyboardControl:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_Bell:
-           INT8(percent);
-           REQUEST_LENGTH();
-           break;
+            INT8(percent);
+            REQUEST_LENGTH();
+            break;
 
       case X_ChangePointerControl:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           INT16(acceleration_numerator);
-           INT16(acceleration_denominator);
-           INT16(threshold);
-           BOOL(do_acceleration);
-           BOOL(do_threshold);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            INT16(acceleration_numerator);
+            INT16(acceleration_denominator);
+            INT16(threshold);
+            BOOL(do_acceleration);
+            BOOL(do_threshold);
+            break;
 
       case X_GetPointerControl:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_SetScreenSaver:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           INT16(timeout);
-           INT16(interval);
-           ENUM8(prefer_blanking);
-           ENUM8(allow_exposures);
-           UNUSED(2);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            INT16(timeout);
+            INT16(interval);
+            ENUM8(prefer_blanking);
+            ENUM8(allow_exposures);
+            UNUSED(2);
+            break;
 
       case X_GetScreenSaver:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_ChangeHosts:
-           ENUM8(change_host_mode);
-           REQUEST_LENGTH();
-           v8 = ENUM8(family);
-           UNUSED(1);
-           v16 = CARD16(address_length);
-           if (v8 == FAMILY_INTERNET && v16 == 4) {
-                 /*
-                  * IPv4 addresses.
-                  * XXX - what about IPv6?  Is that a family of
-                  * FAMILY_INTERNET (0) with a length of 16?
-                  */
-                 LISTofIPADDRESS(ip_address, v16);
-           } else
-                 LISTofCARD8(address, v16);
-           break;
+            ENUM8(change_host_mode);
+            REQUEST_LENGTH();
+            v8 = ENUM8(family);
+            UNUSED(1);
+            v16 = CARD16(address_length);
+            if (v8 == FAMILY_INTERNET && v16 == 4) {
+                  /*
+                   * IPv4 addresses.
+                   * XXX - what about IPv6?  Is that a family of
+                   * FAMILY_INTERNET (0) with a length of 16?
+                   */
+                  LISTofIPADDRESS(ip_address, v16);
+            } else
+                  LISTofCARD8(address, v16);
+            break;
 
       case X_ListHosts:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_SetAccessControl:
-           ENUM8(access_mode);
-           REQUEST_LENGTH();
-           break;
+            ENUM8(access_mode);
+            REQUEST_LENGTH();
+            break;
 
       case X_SetCloseDownMode:
-           ENUM8(close_down_mode);
-           REQUEST_LENGTH();
-           break;
+            ENUM8(close_down_mode);
+            REQUEST_LENGTH();
+            break;
 
       case X_KillClient:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           CARD32(resource);
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            CARD32(resource);
+            break;
 
       case X_RotateProperties:
-           UNUSED(1);
-           v16 = REQUEST_LENGTH();
-           WINDOW(window);
-           CARD16(property_number);
-           INT16(delta);
-           LISTofATOM(properties, (v16 - 12));
-           break;
+            UNUSED(1);
+            v16 = REQUEST_LENGTH();
+            WINDOW(window);
+            CARD16(property_number);
+            INT16(delta);
+            LISTofATOM(properties, (v16 - 12));
+            break;
 
       case X_ForceScreenSaver:
-           ENUM8(screen_saver_mode);
-           REQUEST_LENGTH();
-           break;
+            ENUM8(screen_saver_mode);
+            REQUEST_LENGTH();
+            break;
 
       case X_SetPointerMapping:
-           v8 = FIELD8(map_length);
-           REQUEST_LENGTH();
-           LISTofCARD8(map, v8);
-           PAD();
-           break;
+            v8 = FIELD8(map_length);
+            REQUEST_LENGTH();
+            LISTofCARD8(map, v8);
+            PAD();
+            break;
 
       case X_GetPointerMapping:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_SetModifierMapping:
-           v8 = FIELD8(keycodes_per_modifier);
-           REQUEST_LENGTH();
-           LISTofKEYCODE(state->modifiermap, keycodes, v8);
-           break;
+            v8 = FIELD8(keycodes_per_modifier);
+            REQUEST_LENGTH();
+            LISTofKEYCODE(state->modifiermap, keycodes, v8);
+            break;
 
       case X_GetModifierMapping:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
 
       case X_NoOperation:
-           UNUSED(1);
-           REQUEST_LENGTH();
-           break;
+            UNUSED(1);
+            REQUEST_LENGTH();
+            break;
       default:
-           tryExtension(opcode, tvb, pinfo, offsetp, t, state, little_endian);
-           break;
+            tryExtension(opcode, tvb, pinfo, offsetp, t, state, little_endian);
+            break;
       }
 
       if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
-           UNDECODED(left);
+            UNDECODED(left);
 }
 
 static void dissect_x11_requests(tvbuff_t *tvb, packet_info *pinfo,
@@ -4317,326 +4317,326 @@ static void dissect_x11_requests(tvbuff_t *tvb, packet_info *pinfo,
       tvbuff_t *volatile next_tvb;
 
       while (tvb_reported_length_remaining(tvb, offset) != 0) {
-           /*
-            * We use "tvb_ensure_length_remaining()" to make sure there
-            * actually *is* data remaining.
-            *
-            * This means we're guaranteed that "length_remaining" is
-            * positive.
-            */
-           length_remaining = tvb_ensure_length_remaining(tvb, offset);
-
-           /*
-            * Can we do reassembly?
-            */
-           if (x11_desegment && pinfo->can_desegment) {
-                 /*
-                  * Yes - is the X11 request header split across
-                  * segment boundaries?
-                  */
-                 if (length_remaining < 4) {
-                       /*
-                        * Yes.  Tell the TCP dissector where the data
-                        * for this message starts in the data it handed
-                        * us, and how many more bytes we need, and return.
-                        */
-                       pinfo->desegment_offset = offset;
-                       pinfo->desegment_len = 4 - length_remaining;
-                       return;
-                 }
-           }
-
-           /*
-            * Get the state for this conversation; create the conversation
-            * if we don't have one, and create the state if we don't have
-            * any.
-            */
-           conversation = find_or_create_conversation(pinfo);
-
-           /*
-            * Is there state attached to this conversation?
-            */
-           if ((state = conversation_get_proto_data(conversation, proto_x11))
-           == NULL)
-               state = x11_stateinit(conversation);
-
-           /*
-            * Guess the byte order if we don't already know it.
-            */
-           little_endian = guess_byte_ordering(tvb, pinfo, state);
-
-           /*
-            * Get the opcode and length of the putative X11 request.
-            */
-           opcode = VALUE8(tvb, 0);
-           plen = VALUE16(tvb, offset + 2);
-
-           if (plen == 0) {
-                 /*
-                  * This can't be 0, as it includes the header length.
-                  * A different choice of byte order wouldn't have
-                  * helped.
-                  * Give up.
-                  */
-                 ti = proto_tree_add_item(tree, proto_x11, tvb, offset, -1,
-                 FALSE);
-                 t = proto_item_add_subtree(ti, ett_x11);
-                 proto_tree_add_text(t, tvb, offset, -1,
-                 "Bogus request length (0)");
-                 return;
-           }
-
-           if (state->iconn_frame == pinfo->fd->num ||
-               (g_hash_table_lookup(state->seqtable,
-               GINT_TO_POINTER(state->sequencenumber)) == (int *)NOTHING_SEEN &&
-                (opcode == 'B' || opcode == 'l') &&
-                (plen == 11 || plen == 2816))) {
-                 /*
-                  * Either
-                  *
-                  *    we saw this on the first pass and this is
-                  *    it again
-                  *
-                  * or
-                  *    we haven't already seen any requests, the first
-                  *    byte of the message is 'B' or 'l', and the 16-bit
-                  *    integer 2 bytes into the data stream is either 11
-                  *    or a byte-swapped 11.
-                  *
-                  * This means it's probably an initial connection
-                  * request, not a message.
-                  *
-                  * 'B' is decimal 66, which is the opcode for a
-                  * PolySegment request; unfortunately, 11 is a valid
-                  * length for a PolySegment request request, so we
-                  * might mis-identify that request.  (Are there any
-                  * other checks we can do?)
-                  *
-                  * 'l' is decimal 108, which is the opcode for a
-                  * GetScreenSaver request; the only valid length
-                  * for that request is 1.
-                  */
-                 is_initial_creq = TRUE;
-
-                 /*
-                  * We now know the byte order.  Override the guess.
-                  */
-                 if (state->byte_order == BYTE_ORDER_UNKNOWN) {
-                       if (opcode == 'B') {
-                             /*
-                              * Big-endian.
-                              */
-                             state->byte_order = BYTE_ORDER_BE;
-                             little_endian = FALSE;
-                       } else {
-                             /*
-                              * Little-endian.
-                              */
-                             state->byte_order = BYTE_ORDER_LE;
-                             little_endian = TRUE;
-                       }
-                 }
-
-                 /*
-                  * Can we do reassembly?
-                  */
-                 if (x11_desegment && pinfo->can_desegment) {
-                       /*
-                        * Yes - is the fixed-length portion of the
-                        * initial connection header split across
-                        * segment boundaries?
-                        */
-                       if (length_remaining < 10) {
-                             /*
-                              * Yes.  Tell the TCP dissector where the
-                              * data for this message starts in the data
-                              * it handed us, and how many more bytes we
-                              * need, and return.
-                              */
-                             pinfo->desegment_offset = offset;
-                             pinfo->desegment_len = 10 - length_remaining;
-                             return;
-                       }
-                 }
-
-                 /*
-                  * Get the lengths of the authorization protocol and
-                  * the authorization data.
-                  */
-                 auth_proto_len = VALUE16(tvb, offset + 6);
-                 auth_data_len = VALUE16(tvb, offset + 8);
-                 plen = 12 + ROUND_LENGTH(auth_proto_len) +
-                       ROUND_LENGTH(auth_data_len);
-           } else {
-                 /*
-                  * This is probably an ordinary request.
-                  */
-                 is_initial_creq = FALSE;
-
-                 /*
-                  * The length of a request is in 4-byte words.
-                  */
-                 plen *= 4;
-           }
-
-           /*
-            * Can we do reassembly?
-            */
-           if (x11_desegment && pinfo->can_desegment) {
-                 /*
-                  * Yes - is the X11 request split across segment
-                  * boundaries?
-                  */
-                 if (length_remaining < plen) {
-                       /*
-                        * Yes.  Tell the TCP dissector where the data
-                        * for this message starts in the data it handed
-                        * us, and how many more bytes we need, and return.
-                        */
-                       pinfo->desegment_offset = offset;
-                       pinfo->desegment_len = plen - length_remaining;
-                       return;
-                 }
-           }
-
-           /*
-            * Construct a tvbuff containing the amount of the payload
-            * we have available.  Make its reported length the
-            * amount of data in the X11 request.
-            *
-            * XXX - if reassembly isn't enabled. the subdissector
-            * will throw a BoundsError exception, rather than a
-            * ReportedBoundsError exception.  We really want a tvbuff
-            * where the length is "length", the reported length is "plen",
-            * and the "if the snapshot length were infinite" length is the
-            * minimum of the reported length of the tvbuff handed to us
-            * and "plen", with a new type of exception thrown if the offset
-            * is within the reported length but beyond that third length,
-            * with that exception getting the "Unreassembled Packet" error.
-            */
-           length = length_remaining;
-           if (length > plen)
-                 length = plen;
-           next_tvb = tvb_new_subset(tvb, offset, length, plen);
-
-           /*
-            * Set the column appropriately.
-            */
-           if (is_initial_creq) {
-                 col_set_str(pinfo->cinfo, COL_INFO, "Initial connection request");
-           } else {
-                 if (sep == NULL) {
-                       /*
-                        * We haven't set the column yet; set it.
-                        */
-                       col_set_str(pinfo->cinfo, COL_INFO, "Requests");
-
-                       /*
-                        * Initialize the separator.
-                        */
-                       sep = ":";
-                 }
-           }
-
-           /*
-            * Dissect the X11 request.
-            *
-            * Catch the ReportedBoundsError exception; if this
-            * particular message happens to get a ReportedBoundsError
-            * exception, that doesn't mean that we should stop
-            * dissecting X11 requests within this frame or chunk of
-            * reassembled data.
-            *
-            * If it gets a BoundsError, we can stop, as there's nothing
-            * more to see, so we just re-throw it.
-            */
-           TRY {
-                 if (is_initial_creq) {
-                       dissect_x11_initial_conn(next_tvb, pinfo, tree,
-                           state, little_endian);
-                 } else {
-                       dissect_x11_request(next_tvb, pinfo, tree, sep,
-                           state, little_endian);
-                 }
-           }
-           CATCH(BoundsError) {
-                 RETHROW;
-           }
-           CATCH(ReportedBoundsError) {
-                 show_reported_bounds_error(tvb, pinfo, tree);
-           }
-           ENDTRY;
-
-           /*
-            * Skip the X11 message.
-            */
-           offset += plen;
-
-           sep = ",";
+            /*
+             * We use "tvb_ensure_length_remaining()" to make sure there
+             * actually *is* data remaining.
+             *
+             * This means we're guaranteed that "length_remaining" is
+             * positive.
+             */
+            length_remaining = tvb_ensure_length_remaining(tvb, offset);
+
+            /*
+             * Can we do reassembly?
+             */
+            if (x11_desegment && pinfo->can_desegment) {
+                  /*
+                   * Yes - is the X11 request header split across
+                   * segment boundaries?
+                   */
+                  if (length_remaining < 4) {
+                        /*
+                         * Yes.  Tell the TCP dissector where the data
+                         * for this message starts in the data it handed
+                         * us, and how many more bytes we need, and return.
+                         */
+                        pinfo->desegment_offset = offset;
+                        pinfo->desegment_len = 4 - length_remaining;
+                        return;
+                  }
+            }
+
+            /*
+             * Get the state for this conversation; create the conversation
+             * if we don't have one, and create the state if we don't have
+             * any.
+             */
+            conversation = find_or_create_conversation(pinfo);
+
+            /*
+             * Is there state attached to this conversation?
+             */
+            if ((state = conversation_get_proto_data(conversation, proto_x11))
+            == NULL)
+                state = x11_stateinit(conversation);
+
+            /*
+             * Guess the byte order if we don't already know it.
+             */
+            little_endian = guess_byte_ordering(tvb, pinfo, state);
+
+            /*
+             * Get the opcode and length of the putative X11 request.
+             */
+            opcode = VALUE8(tvb, 0);
+            plen = VALUE16(tvb, offset + 2);
+
+            if (plen == 0) {
+                  /*
+                   * This can't be 0, as it includes the header length.
+                   * A different choice of byte order wouldn't have
+                   * helped.
+                   * Give up.
+                   */
+                  ti = proto_tree_add_item(tree, proto_x11, tvb, offset, -1,
+                  FALSE);
+                  t = proto_item_add_subtree(ti, ett_x11);
+                  proto_tree_add_text(t, tvb, offset, -1,
+                  "Bogus request length (0)");
+                  return;
+            }
+
+            if (state->iconn_frame == pinfo->fd->num ||
+                (g_hash_table_lookup(state->seqtable,
+                GINT_TO_POINTER(state->sequencenumber)) == (int *)NOTHING_SEEN &&
+                 (opcode == 'B' || opcode == 'l') &&
+                 (plen == 11 || plen == 2816))) {
+                  /*
+                   * Either
+                   *
+                   *    we saw this on the first pass and this is
+                   *    it again
+                   *
+                   * or
+                   *    we haven't already seen any requests, the first
+                   *    byte of the message is 'B' or 'l', and the 16-bit
+                   *    integer 2 bytes into the data stream is either 11
+                   *    or a byte-swapped 11.
+                   *
+                   * This means it's probably an initial connection
+                   * request, not a message.
+                   *
+                   * 'B' is decimal 66, which is the opcode for a
+                   * PolySegment request; unfortunately, 11 is a valid
+                   * length for a PolySegment request request, so we
+                   * might mis-identify that request.  (Are there any
+                   * other checks we can do?)
+                   *
+                   * 'l' is decimal 108, which is the opcode for a
+                   * GetScreenSaver request; the only valid length
+                   * for that request is 1.
+                   */
+                  is_initial_creq = TRUE;
+
+                  /*
+                   * We now know the byte order.  Override the guess.
+                   */
+                  if (state->byte_order == BYTE_ORDER_UNKNOWN) {
+                        if (opcode == 'B') {
+                              /*
+                               * Big-endian.
+                               */
+                              state->byte_order = BYTE_ORDER_BE;
+                              little_endian = FALSE;
+                        } else {
+                              /*
+                               * Little-endian.
+                               */
+                              state->byte_order = BYTE_ORDER_LE;
+                              little_endian = TRUE;
+                        }
+                  }
+
+                  /*
+                   * Can we do reassembly?
+                   */
+                  if (x11_desegment && pinfo->can_desegment) {
+                        /*
+                         * Yes - is the fixed-length portion of the
+                         * initial connection header split across
+                         * segment boundaries?
+                         */
+                        if (length_remaining < 10) {
+                              /*
+                               * Yes.  Tell the TCP dissector where the
+                               * data for this message starts in the data
+                               * it handed us, and how many more bytes we
+                               * need, and return.
+                               */
+                              pinfo->desegment_offset = offset;
+                              pinfo->desegment_len = 10 - length_remaining;
+                              return;
+                        }
+                  }
+
+                  /*
+                   * Get the lengths of the authorization protocol and
+                   * the authorization data.
+                   */
+                  auth_proto_len = VALUE16(tvb, offset + 6);
+                  auth_data_len = VALUE16(tvb, offset + 8);
+                  plen = 12 + ROUND_LENGTH(auth_proto_len) +
+                        ROUND_LENGTH(auth_data_len);
+            } else {
+                  /*
+                   * This is probably an ordinary request.
+                   */
+                  is_initial_creq = FALSE;
+
+                  /*
+                   * The length of a request is in 4-byte words.
+                   */
+                  plen *= 4;
+            }
+
+            /*
+             * Can we do reassembly?
+             */
+            if (x11_desegment && pinfo->can_desegment) {
+                  /*
+                   * Yes - is the X11 request split across segment
+                   * boundaries?
+                   */
+                  if (length_remaining < plen) {
+                        /*
+                         * Yes.  Tell the TCP dissector where the data
+                         * for this message starts in the data it handed
+                         * us, and how many more bytes we need, and return.
+                         */
+                        pinfo->desegment_offset = offset;
+                        pinfo->desegment_len = plen - length_remaining;
+                        return;
+                  }
+            }
+
+            /*
+             * Construct a tvbuff containing the amount of the payload
+             * we have available.  Make its reported length the
+             * amount of data in the X11 request.
+             *
+             * XXX - if reassembly isn't enabled. the subdissector
+             * will throw a BoundsError exception, rather than a
+             * ReportedBoundsError exception.  We really want a tvbuff
+             * where the length is "length", the reported length is "plen",
+             * and the "if the snapshot length were infinite" length is the
+             * minimum of the reported length of the tvbuff handed to us
+             * and "plen", with a new type of exception thrown if the offset
+             * is within the reported length but beyond that third length,
+             * with that exception getting the "Unreassembled Packet" error.
+             */
+            length = length_remaining;
+            if (length > plen)
+                  length = plen;
+            next_tvb = tvb_new_subset(tvb, offset, length, plen);
+
+            /*
+             * Set the column appropriately.
+             */
+            if (is_initial_creq) {
+                  col_set_str(pinfo->cinfo, COL_INFO, "Initial connection request");
+            } else {
+                  if (sep == NULL) {
+                        /*
+                         * We haven't set the column yet; set it.
+                         */
+                        col_set_str(pinfo->cinfo, COL_INFO, "Requests");
+
+                        /*
+                         * Initialize the separator.
+                         */
+                        sep = ":";
+                  }
+            }
+
+            /*
+             * Dissect the X11 request.
+             *
+             * Catch the ReportedBoundsError exception; if this
+             * particular message happens to get a ReportedBoundsError
+             * exception, that doesn't mean that we should stop
+             * dissecting X11 requests within this frame or chunk of
+             * reassembled data.
+             *
+             * If it gets a BoundsError, we can stop, as there's nothing
+             * more to see, so we just re-throw it.
+             */
+            TRY {
+                  if (is_initial_creq) {
+                        dissect_x11_initial_conn(next_tvb, pinfo, tree,
+                            state, little_endian);
+                  } else {
+                        dissect_x11_request(next_tvb, pinfo, tree, sep,
+                            state, little_endian);
+                  }
+            }
+            CATCH(BoundsError) {
+                  RETHROW;
+            }
+            CATCH(ReportedBoundsError) {
+                  show_reported_bounds_error(tvb, pinfo, tree);
+            }
+            ENDTRY;
+
+            /*
+             * Skip the X11 message.
+             */
+            offset += plen;
+
+            sep = ",";
       }
 }
 
 static x11_conv_data_t *
 x11_stateinit(conversation_t *conversation)
 {
-       x11_conv_data_t *state;
-       static x11_conv_data_t stateinit;
-       int i = 0;
-
-       state = g_malloc(sizeof (x11_conv_data_t));
-       *state = stateinit;
-       state->next = x11_conv_data_list;
-       x11_conv_data_list = state;
-
-       /* initialise opcodes */
-       while (1) {
-         if (opcode_vals[i].strptr == NULL) break;
-         state->opcode_vals[i].value = opcode_vals[i].value;
-         state->opcode_vals[i].strptr = opcode_vals[i].strptr;
-         i++;
-       }
-       while (i <= MAX_OPCODES) {
-         state->opcode_vals[i].value = 0;
-         state->opcode_vals[i].strptr = NULL;
-         i++;
-       }
-
-       /* initialise errorcodes */
-       i = 0;
-       while (1) {
-         if (errorcode_vals[i].strptr == NULL) break;
-         state->errorcode_vals[i].value = errorcode_vals[i].value;
-         state->errorcode_vals[i].strptr = errorcode_vals[i].strptr;
-         i++;
-       }
-       while (i <= LastExtensionError + 1) {
-         state->errorcode_vals[i].value = 0;
-         state->errorcode_vals[i].strptr = NULL;
-         i++;
-       }
-
-       /* initialise eventcodes */
-       i = 0;
-       while (1) {
-         if (eventcode_vals[i].strptr == NULL) break;
-         state->eventcode_vals[i].value = eventcode_vals[i].value;
-         state->eventcode_vals[i].strptr = eventcode_vals[i].strptr;
-         i++;
-       }
-       while (i <= LastExtensionEvent + 1) {
-         state->eventcode_vals[i].value = 0;
-         state->eventcode_vals[i].strptr = NULL;
-         i++;
-       }
-       state->eventcode_funcs = g_hash_table_new(g_direct_hash, g_direct_equal);
-       state->reply_funcs = g_hash_table_new(g_direct_hash, g_direct_equal);
-
-       state->seqtable = g_hash_table_new(g_direct_hash, g_direct_equal);
-       state->valtable = g_hash_table_new(g_direct_hash, g_direct_equal);
-       g_hash_table_insert(state->seqtable, (int *)0, (int *)NOTHING_SEEN);
-       state->byte_order = BYTE_ORDER_UNKNOWN; /* don't know yet*/
-       conversation_add_proto_data(conversation, proto_x11, state);
-       return state;
+      x11_conv_data_t *state;
+      static x11_conv_data_t stateinit;
+      int i = 0;
+
+      state = g_malloc(sizeof (x11_conv_data_t));
+      *state = stateinit;
+      state->next = x11_conv_data_list;
+      x11_conv_data_list = state;
+
+      /* initialise opcodes */
+      while (1) {
+            if (opcode_vals[i].strptr == NULL) break;
+            state->opcode_vals[i].value = opcode_vals[i].value;
+            state->opcode_vals[i].strptr = opcode_vals[i].strptr;
+            i++;
+      }
+      while (i <= MAX_OPCODES) {
+            state->opcode_vals[i].value = 0;
+            state->opcode_vals[i].strptr = NULL;
+            i++;
+      }
+
+      /* initialise errorcodes */
+      i = 0;
+      while (1) {
+            if (errorcode_vals[i].strptr == NULL) break;
+            state->errorcode_vals[i].value = errorcode_vals[i].value;
+            state->errorcode_vals[i].strptr = errorcode_vals[i].strptr;
+            i++;
+      }
+      while (i <= LastExtensionError + 1) {
+            state->errorcode_vals[i].value = 0;
+            state->errorcode_vals[i].strptr = NULL;
+            i++;
+      }
+
+      /* initialise eventcodes */
+      i = 0;
+      while (1) {
+            if (eventcode_vals[i].strptr == NULL) break;
+            state->eventcode_vals[i].value = eventcode_vals[i].value;
+            state->eventcode_vals[i].strptr = eventcode_vals[i].strptr;
+            i++;
+      }
+      while (i <= LastExtensionEvent + 1) {
+            state->eventcode_vals[i].value = 0;
+            state->eventcode_vals[i].strptr = NULL;
+            i++;
+      }
+      state->eventcode_funcs = g_hash_table_new(g_direct_hash, g_direct_equal);
+      state->reply_funcs = g_hash_table_new(g_direct_hash, g_direct_equal);
+
+      state->seqtable = g_hash_table_new(g_direct_hash, g_direct_equal);
+      state->valtable = g_hash_table_new(g_direct_hash, g_direct_equal);
+      g_hash_table_insert(state->seqtable, (int *)0, (int *)NOTHING_SEEN);
+      state->byte_order = BYTE_ORDER_UNKNOWN; /* don't know yet*/
+      conversation_add_proto_data(conversation, proto_x11, state);
+      return state;
 }
 
 
@@ -4644,509 +4644,509 @@ static void
 dissect_x11_replies(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
 /* Set up structures we will need to add the protocol subtree and manage it */
-       volatile int offset, plen;
-       tvbuff_t * volatile next_tvb;
-       conversation_t *conversation;
-       x11_conv_data_t *volatile state;
-       gboolean little_endian;
-       int length_remaining;
-       const char *volatile sep = NULL;
-
-
-       /*
-       * Get the state for this conversation; create the conversation
-       * if we don't have one, and create the state if we don't have
-       * any.
-       */
-       conversation = find_or_create_conversation(pinfo);
-
-       /*
-        * Is there state attached to this conversation?
-       */
-       if ((state = conversation_get_proto_data(conversation, proto_x11))
-       == NULL) {
-               /*
-                * No - create a state structure and attach it.
-                */
-               state = x11_stateinit(conversation);
-       }
-
-       /*
-        * Guess the byte order if we don't already know it.
-        */
-       little_endian = guess_byte_ordering(tvb, pinfo, state);
-
-       offset = 0;
-       while (tvb_reported_length_remaining(tvb, offset) != 0) {
-               /*
-                * We use "tvb_ensure_length_remaining()" to make sure there
-                * actually *is* data remaining.
-                *
-                * This means we're guaranteed that "length_remaining" is
-                * positive.
-                */
-               length_remaining = tvb_ensure_length_remaining(tvb, offset);
-
-               /*
-               * Can we do reassembly?
-               */
-               if (x11_desegment && pinfo->can_desegment) {
-                         /*
-                          * Yes - is the X11 reply header split across
-                          * segment boundaries?
-                          */
-                         if (length_remaining < 8) {
-                               /*
-                                * Yes.  Tell the TCP dissector where the data
-                                * for this message starts in the data it handed
-                                * us, and how many more bytes we need, and
-                                * return.
-                                */
-                               pinfo->desegment_offset = offset;
-                               pinfo->desegment_len = 8 - length_remaining;
-                               return;
-                       }
-               }
-
-               /*
-                * Find out what kind of a reply it is.
-                * There are four possible:
-                *      - reply to initial connection
-                *      - errorreply (a request generated an error)
-                *      - requestreply (reply to a request)
-                *      - event (some event occured)
-                */
-               if (g_hash_table_lookup(state->seqtable,
-                   GINT_TO_POINTER(state->sequencenumber)) == (int *)INITIAL_CONN
-                   || (state->iconn_reply == pinfo->fd->num)) {
-                       /*
-                        * Either the connection is in the "initial
-                        * connection" state, or this frame is known
-                        * to have the initial connection reply.
-                        * That means this is the initial connection
-                        * reply.
-                        */
-                       plen = 8 + VALUE16(tvb, offset + 6) * 4;
-
-                       HANDLE_REPLY(plen, length_remaining,
-                           "Initial connection reply",
-                           dissect_x11_initial_reply);
-               } else {
-                       /*
-                        * This isn't an initial connection reply
-                        * (XXX - unless we missed the initial
-                        * connection request).  Look at the first
-                        * byte to determine what it is; errors
-                        * start with a byte of 0, replies start
-                        * with a byte of 1, events start with
-                        * a byte with of 2 or greater.
-                        */
-                       switch (tvb_get_guint8(tvb, offset)) {
-
-                       case 0:
-                               plen = 32;
-                               HANDLE_REPLY(plen, length_remaining,
-                                   "Error", dissect_x11_error);
-                               break;
-
-                       case 1:
-                               /* replylength is in units of four. */
-                               plen = 32 + VALUE32(tvb, offset + 4) * 4;
-                               DISSECTOR_ASSERT(plen >= 32);
-                               HANDLE_REPLY(plen, length_remaining,
-                                   "Reply", dissect_x11_reply);
-                               break;
-
-                       default:
-                               /* Event */
-                               plen = 32;
-                               HANDLE_REPLY(plen, length_remaining,
-                                   "Event", dissect_x11_event);
-                               break;
-                       }
-               }
-
-               offset += plen;
-       }
-
-       return;
+      volatile int offset, plen;
+      tvbuff_t * volatile next_tvb;
+      conversation_t *conversation;
+      x11_conv_data_t *volatile state;
+      gboolean little_endian;
+      int length_remaining;
+      const char *volatile sep = NULL;
+
+
+      /*
+       * Get the state for this conversation; create the conversation
+       * if we don't have one, and create the state if we don't have
+       * any.
+       */
+      conversation = find_or_create_conversation(pinfo);
+
+      /*
+       * Is there state attached to this conversation?
+       */
+      if ((state = conversation_get_proto_data(conversation, proto_x11))
+          == NULL) {
+            /*
+             * No - create a state structure and attach it.
+             */
+            state = x11_stateinit(conversation);
+      }
+
+      /*
+       * Guess the byte order if we don't already know it.
+       */
+      little_endian = guess_byte_ordering(tvb, pinfo, state);
+
+      offset = 0;
+      while (tvb_reported_length_remaining(tvb, offset) != 0) {
+            /*
+             * We use "tvb_ensure_length_remaining()" to make sure there
+             * actually *is* data remaining.
+             *
+             * This means we're guaranteed that "length_remaining" is
+             * positive.
+             */
+            length_remaining = tvb_ensure_length_remaining(tvb, offset);
+
+            /*
+             * Can we do reassembly?
+             */
+            if (x11_desegment && pinfo->can_desegment) {
+                  /*
+                   * Yes - is the X11 reply header split across
+                   * segment boundaries?
+                   */
+                  if (length_remaining < 8) {
+                        /*
+                         * Yes.  Tell the TCP dissector where the data
+                         * for this message starts in the data it handed
+                         * us, and how many more bytes we need, and
+                         * return.
+                         */
+                        pinfo->desegment_offset = offset;
+                        pinfo->desegment_len = 8 - length_remaining;
+                        return;
+                  }
+            }
+
+            /*
+             * Find out what kind of a reply it is.
+             * There are four possible:
+             *  - reply to initial connection
+             *  - errorreply (a request generated an error)
+             *  - requestreply (reply to a request)
+             *  - event (some event occured)
+             */
+            if (g_hash_table_lookup(state->seqtable,
+                                    GINT_TO_POINTER(state->sequencenumber)) == (int *)INITIAL_CONN
+                || (state->iconn_reply == pinfo->fd->num)) {
+                  /*
+                   * Either the connection is in the "initial
+                   * connection" state, or this frame is known
+                   * to have the initial connection reply.
+                   * That means this is the initial connection
+                   * reply.
+                   */
+                  plen = 8 + VALUE16(tvb, offset + 6) * 4;
+
+                  HANDLE_REPLY(plen, length_remaining,
+                               "Initial connection reply",
+                               dissect_x11_initial_reply);
+            } else {
+                  /*
+                   * This isn't an initial connection reply
+                   * (XXX - unless we missed the initial
+                   * connection request).  Look at the first
+                   * byte to determine what it is; errors
+                   * start with a byte of 0, replies start
+                   * with a byte of 1, events start with
+                   * a byte with of 2 or greater.
+                   */
+                  switch (tvb_get_guint8(tvb, offset)) {
+
+                        case 0:
+                              plen = 32;
+                              HANDLE_REPLY(plen, length_remaining,
+                                           "Error", dissect_x11_error);
+                              break;
+
+                        case 1:
+                              /* replylength is in units of four. */
+                              plen = 32 + VALUE32(tvb, offset + 4) * 4;
+                              DISSECTOR_ASSERT(plen >= 32);
+                              HANDLE_REPLY(plen, length_remaining,
+                                           "Reply", dissect_x11_reply);
+                              break;
+
+                        default:
+                              /* Event */
+                              plen = 32;
+                              HANDLE_REPLY(plen, length_remaining,
+                                           "Event", dissect_x11_event);
+                              break;
+                  }
+            }
+
+            offset += plen;
+      }
+
+      return;
 }
 
 static void
 dissect_x11_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                 const char *volatile sep, x11_conv_data_t *volatile state,
-                 gboolean little_endian)
+                  const char *volatile sep, x11_conv_data_t *volatile state,
+                  gboolean little_endian)
 {
-       int offset = 0, *offsetp = &offset, length, left, opcode;
-       int major_opcode, sequence_number, first_error, first_event;
-       value_string *vals_p;
-       proto_item *ti;
-       proto_tree *t;
-
-       ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
-       t = proto_item_add_subtree(ti, ett_x11);
-
-
-       /*
-        * XXX - this doesn't work correctly if either
-        *
-        *      1) the request sequence number wraps in the lower 16
-        *         bits;
-        *
-        *      2) we don't see the initial connection request and the
-        *         resynchronization of sequence number fails and thus
-        *         don't have the right sequence numbers
-        *
-        *      3) we don't have all the packets in the capture and
-        *         get out of sequence.
-        *
-        * We might, instead, want to assume that a reply is a reply to
-        * the most recent not-already-replied-to request in the same
-        * connection.  That also might mismatch replies to requests if
-        * packets are lost, but there's nothing you can do to fix that.
-        */
-
-       sequence_number = VALUE16(tvb, offset + 2);
-       opcode = GPOINTER_TO_INT(g_hash_table_lookup(state->seqtable,
-                                         GINT_TO_POINTER(sequence_number)));
-
-       if (state->iconn_frame == 0 &&  state->resync == FALSE) {
-
-               /*
-                * We don't see the initial connection request and no
-                * resynchronization has been performed yet (first reply),
-                * set the current sequence number to the one of the
-                * current reply (this is only performed once).
-                */
-               state->sequencenumber = sequence_number;
-               state->resync = TRUE;
-       }
-
-       if (opcode == UNKNOWN_OPCODE) {
-               if (check_col(pinfo->cinfo, COL_INFO))
-                       col_append_fstr(pinfo->cinfo, COL_INFO,
-                                       "%s to unknown request", sep);
-               proto_item_append_text(ti, ", Reply to unknown request");
-       } else {
-               if (check_col(pinfo->cinfo, COL_INFO))
-                       col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
-                                       sep,
-                                       val_to_str(opcode & 0xFF, state->opcode_vals,
-                                                  "<Unknown opcode %d>"));
-
-               if (opcode > 0xFF)
-                   proto_item_append_text(ti, ", Reply, opcode: %d.%d (%s)",
-                                          opcode & 0xFF, opcode >> 8, val_to_str(opcode & 0xFF,
-                                                         state->opcode_vals,
-                                                         "<Unknown opcode %d>"));
-               else
-                   proto_item_append_text(ti, ", Reply, opcode: %d (%s)",
-                                          opcode, val_to_str(opcode,
-                                                         state->opcode_vals,
-                                                         "<Unknown opcode %d>"));
-       }
-
-       switch (opcode) {
-
-               /*
-                        * Replies that need special processing outside tree
-                */
-
-               case X_QueryExtension:
-
-                       /*
-                        * if extension is present and request is known:
-                        * store opcode of extension in value_string of
-                        * opcodes
-                        */
-                       if (!VALUE8(tvb, offset + 8)) {
-                               /* not present */
-                               break;
-                       }
-
-                       vals_p = g_hash_table_lookup(state->valtable,
-                                                    GINT_TO_POINTER(sequence_number));
-                       if (vals_p != NULL) {
-                               major_opcode = VALUE8(tvb, offset + 9);
-                               first_event = VALUE8(tvb, offset + 10);
-                               first_error = VALUE8(tvb, offset + 11);
-
-                               register_extension(state, vals_p, major_opcode, first_event, first_error);
-                               g_hash_table_remove(state->valtable,
-                                                   GINT_TO_POINTER(sequence_number));
-                       }
-                       break;
-
-               default:
-                       break;
-       }
-
-       if (tree == NULL)
-               return;
-
-       switch (opcode) {
-               /*
-                        * Requests that expect a reply.
-                */
-
-               case X_GetWindowAttributes:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_GetGeometry:
-                       REPLY(reply);
-                       CARD8(depth);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       WINDOW(rootwindow);
-                       INT16(x);
-                       INT16(y);
-                       CARD16(width);
-                       CARD16(height);
-                       CARD16(border_width);
-                       UNUSED(10);
-                       break;
-
-               case X_QueryTree:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_InternAtom:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       ATOM(atom);
-                       UNUSED(20);
-                       break;
-
-               case X_GetAtomName:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_GetProperty:
-                       REPLY(reply);
-                       CARD8(format);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       length = REPLYLENGTH(replylength);
-                       ATOM(get_property_type);
-                       CARD32(bytes_after);
-                       CARD32(valuelength);
-                       UNUSED(12);
-                       break;
-
-               case X_ListProperties:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       length = CARD16(property_number);
-                       UNUSED(22);
-                       LISTofATOM(properties, length*4);
-                       break;
-
-               case X_GetSelectionOwner:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       WINDOW(owner);
-                       UNUSED(20);
-                       break;
-
-               case X_GrabPointer:
-               case X_GrabKeyboard:
-                       REPLY(reply);
-                       ENUM8(grab_status);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       UNUSED(24);
-                       break;
-
-               case X_QueryPointer:
-                       REPLY(reply);
-                       BOOL(same_screen);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       WINDOW(rootwindow);
-                       WINDOW(childwindow);
-                       INT16(root_x);
-                       INT16(root_y);
-                       INT16(win_x);
-                       INT16(win_y);
-                       SETofKEYBUTMASK(mask);
-                       UNUSED(6);
-                       break;
-
-               case X_GetMotionEvents:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_TranslateCoords:
-                       REPLY(reply);
-                       BOOL(same_screen);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       WINDOW(childwindow);
-                       INT16(dst_x);
-                       INT16(dst_y);
-                       UNUSED(16);
-                       break;
-
-               case X_GetInputFocus:
-                       REPLY(reply);
-                       ENUM8(revert_to);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       WINDOW(focus);
-                       UNUSED(20);
-                       break;
-
-               case X_QueryKeymap:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       LISTofCARD8(keys, 32);
-                       break;
-
-               case X_QueryFont:
-               case X_QueryTextExtents:
-               case X_ListFonts:
-               case X_GetImage:
-               case X_ListInstalledColormaps:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_AllocColor:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       CARD16(red);
-                       CARD16(green);
-                       CARD16(blue);
-                       UNUSED(2);
-                       CARD32(pixel);
-                       UNUSED(12);
-                       break;
-
-               case X_QueryColors:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_LookupColor:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       CARD16(exact_red);
-                       CARD16(exact_green);
-                       CARD16(exact_blue);
-                       CARD16(visual_red);
-                       CARD16(visual_green);
-                       CARD16(visual_blue);
-                       UNUSED(12);
-                       break;
-
-               case X_QueryBestSize:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       CARD16(width);
-                       CARD16(height);
-                       UNUSED(20);
-                       break;
-
-               case X_QueryExtension:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       BOOL(present);
-                       CARD8(major_opcode);
-                       CARD8(first_event);
-                       CARD8(first_error);
-                       UNUSED(20);
-                       break;
-
-               case X_ListExtensions:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_GetKeyboardMapping:
-                       state->first_keycode =
-                               state->request.GetKeyboardMapping.first_keycode;
-                       REPLY(reply);
-                       state->keysyms_per_keycode =
-                               FIELD8(keysyms_per_keycode);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       length = REPLYLENGTH(replylength);
-                       UNUSED(24);
-                       LISTofKEYSYM(keysyms, state->keycodemap,
-                                    state->request.GetKeyboardMapping.first_keycode,
-                                        /* XXX - length / state->keysyms_per_keycode can raise a division by zero,
-                                         * don't know if this is the *right* way to fix it ... */
-                                        state->keysyms_per_keycode ? length / state->keysyms_per_keycode : 0,
-                                    state->keysyms_per_keycode);
-                       break;
-
-               case X_GetKeyboardControl:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_GetPointerControl:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       CARD16(acceleration_numerator);
-                       CARD16(acceleration_denominator);
-                       CARD16(threshold);
-                       UNUSED(18);
-                       break;
-
-               case X_GetScreenSaver:
-                       REPLY(reply);
-                       UNUSED(1);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       CARD16(timeout);
-                       CARD16(interval);
-                       ENUM8(prefer_blanking);
-                       ENUM8(allow_exposures);
-                       UNUSED(18);
-                       break;
-
-               case X_ListHosts:
-               case X_SetPointerMapping:
-               case X_GetPointerMapping:
-               case X_SetModifierMapping:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               case X_GetModifierMapping:
-                       REPLY(reply);
-                       state->keycodes_per_modifier =
-                               FIELD8(keycodes_per_modifier);
-                       SEQUENCENUMBER_REPLY(sequencenumber);
-                       REPLYLENGTH(replylength);
-                       UNUSED(24);
-                       LISTofKEYCODE(state->modifiermap, keycodes,
-                                     state->keycodes_per_modifier);
-                       break;
-
-               case UNKNOWN_OPCODE:
-                       REPLYCONTENTS_COMMON();
-                       break;
-
-               default:
-                       tryExtensionReply(opcode, tvb, pinfo, offsetp, t, state, little_endian);
-       }
-
-       if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
-           UNDECODED(left);
+      int offset = 0, *offsetp = &offset, length, left, opcode;
+      int major_opcode, sequence_number, first_error, first_event;
+      value_string *vals_p;
+      proto_item *ti;
+      proto_tree *t;
+
+      ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
+      t = proto_item_add_subtree(ti, ett_x11);
+
+
+      /*
+       * XXX - this doesn't work correctly if either
+       *
+       *        1) the request sequence number wraps in the lower 16
+       *           bits;
+       *
+       *        2) we don't see the initial connection request and the
+       *         resynchronization of sequence number fails and thus
+       *           don't have the right sequence numbers
+       *
+       *        3) we don't have all the packets in the capture and
+       *           get out of sequence.
+       *
+       * We might, instead, want to assume that a reply is a reply to
+       * the most recent not-already-replied-to request in the same
+       * connection.  That also might mismatch replies to requests if
+       * packets are lost, but there's nothing you can do to fix that.
+       */
+
+      sequence_number = VALUE16(tvb, offset + 2);
+      opcode = GPOINTER_TO_INT(g_hash_table_lookup(state->seqtable,
+                                                   GINT_TO_POINTER(sequence_number)));
+
+      if (state->iconn_frame == 0 &&  state->resync == FALSE) {
+
+            /*
+             * We don't see the initial connection request and no
+             * resynchronization has been performed yet (first reply),
+             * set the current sequence number to the one of the
+             * current reply (this is only performed once).
+             */
+            state->sequencenumber = sequence_number;
+            state->resync = TRUE;
+      }
+
+      if (opcode == UNKNOWN_OPCODE) {
+            if (check_col(pinfo->cinfo, COL_INFO))
+                  col_append_fstr(pinfo->cinfo, COL_INFO,
+                                  "%s to unknown request", sep);
+            proto_item_append_text(ti, ", Reply to unknown request");
+      } else {
+            if (check_col(pinfo->cinfo, COL_INFO))
+                  col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+                                  sep,
+                                  val_to_str(opcode & 0xFF, state->opcode_vals,
+                                             "<Unknown opcode %d>"));
+
+            if (opcode > 0xFF)
+                  proto_item_append_text(ti, ", Reply, opcode: %d.%d (%s)",
+                                         opcode & 0xFF, opcode >> 8, val_to_str(opcode & 0xFF,
+                                                                                state->opcode_vals,
+                                                                                "<Unknown opcode %d>"));
+            else
+                  proto_item_append_text(ti, ", Reply, opcode: %d (%s)",
+                                         opcode, val_to_str(opcode,
+                                                            state->opcode_vals,
+                                                            "<Unknown opcode %d>"));
+      }
+
+      switch (opcode) {
+
+            /*
+             * Replies that need special processing outside tree
+             */
+
+            case X_QueryExtension:
+
+                  /*
+                   * if extension is present and request is known:
+                   * store opcode of extension in value_string of
+                   * opcodes
+                   */
+                  if (!VALUE8(tvb, offset + 8)) {
+                        /* not present */
+                        break;
+                  }
+
+                  vals_p = g_hash_table_lookup(state->valtable,
+                                               GINT_TO_POINTER(sequence_number));
+                  if (vals_p != NULL) {
+                        major_opcode = VALUE8(tvb, offset + 9);
+                        first_event = VALUE8(tvb, offset + 10);
+                        first_error = VALUE8(tvb, offset + 11);
+
+                        register_extension(state, vals_p, major_opcode, first_event, first_error);
+                        g_hash_table_remove(state->valtable,
+                                            GINT_TO_POINTER(sequence_number));
+                  }
+                  break;
+
+            default:
+                  break;
+      }
+
+      if (tree == NULL)
+            return;
+
+      switch (opcode) {
+            /*
+             * Requests that expect a reply.
+             */
+
+            case X_GetWindowAttributes:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_GetGeometry:
+                  REPLY(reply);
+                  CARD8(depth);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  WINDOW(rootwindow);
+                  INT16(x);
+                  INT16(y);
+                  CARD16(width);
+                  CARD16(height);
+                  CARD16(border_width);
+                  UNUSED(10);
+                  break;
+
+            case X_QueryTree:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_InternAtom:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  ATOM(atom);
+                  UNUSED(20);
+                  break;
+
+            case X_GetAtomName:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_GetProperty:
+                  REPLY(reply);
+                  CARD8(format);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  length = REPLYLENGTH(replylength);
+                  ATOM(get_property_type);
+                  CARD32(bytes_after);
+                  CARD32(valuelength);
+                  UNUSED(12);
+                  break;
+
+            case X_ListProperties:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  length = CARD16(property_number);
+                  UNUSED(22);
+                  LISTofATOM(properties, length*4);
+                  break;
+
+            case X_GetSelectionOwner:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  WINDOW(owner);
+                  UNUSED(20);
+                  break;
+
+            case X_GrabPointer:
+            case X_GrabKeyboard:
+                  REPLY(reply);
+                  ENUM8(grab_status);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  UNUSED(24);
+                  break;
+
+            case X_QueryPointer:
+                  REPLY(reply);
+                  BOOL(same_screen);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  WINDOW(rootwindow);
+                  WINDOW(childwindow);
+                  INT16(root_x);
+                  INT16(root_y);
+                  INT16(win_x);
+                  INT16(win_y);
+                  SETofKEYBUTMASK(mask);
+                  UNUSED(6);
+                  break;
+
+            case X_GetMotionEvents:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_TranslateCoords:
+                  REPLY(reply);
+                  BOOL(same_screen);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  WINDOW(childwindow);
+                  INT16(dst_x);
+                  INT16(dst_y);
+                  UNUSED(16);
+                  break;
+
+            case X_GetInputFocus:
+                  REPLY(reply);
+                  ENUM8(revert_to);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  WINDOW(focus);
+                  UNUSED(20);
+                  break;
+
+            case X_QueryKeymap:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  LISTofCARD8(keys, 32);
+                  break;
+
+            case X_QueryFont:
+            case X_QueryTextExtents:
+            case X_ListFonts:
+            case X_GetImage:
+            case X_ListInstalledColormaps:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_AllocColor:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  CARD16(red);
+                  CARD16(green);
+                  CARD16(blue);
+                  UNUSED(2);
+                  CARD32(pixel);
+                  UNUSED(12);
+                  break;
+
+            case X_QueryColors:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_LookupColor:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  CARD16(exact_red);
+                  CARD16(exact_green);
+                  CARD16(exact_blue);
+                  CARD16(visual_red);
+                  CARD16(visual_green);
+                  CARD16(visual_blue);
+                  UNUSED(12);
+                  break;
+
+            case X_QueryBestSize:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  CARD16(width);
+                  CARD16(height);
+                  UNUSED(20);
+                  break;
+
+            case X_QueryExtension:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  BOOL(present);
+                  CARD8(major_opcode);
+                  CARD8(first_event);
+                  CARD8(first_error);
+                  UNUSED(20);
+                  break;
+
+            case X_ListExtensions:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_GetKeyboardMapping:
+                  state->first_keycode =
+                        state->request.GetKeyboardMapping.first_keycode;
+                  REPLY(reply);
+                  state->keysyms_per_keycode =
+                        FIELD8(keysyms_per_keycode);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  length = REPLYLENGTH(replylength);
+                  UNUSED(24);
+                  LISTofKEYSYM(keysyms, state->keycodemap,
+                               state->request.GetKeyboardMapping.first_keycode,
+                               /* XXX - length / state->keysyms_per_keycode can raise a division by zero,
+                                * don't know if this is the *right* way to fix it ... */
+                               state->keysyms_per_keycode ? length / state->keysyms_per_keycode : 0,
+                               state->keysyms_per_keycode);
+                  break;
+
+            case X_GetKeyboardControl:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_GetPointerControl:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  CARD16(acceleration_numerator);
+                  CARD16(acceleration_denominator);
+                  CARD16(threshold);
+                  UNUSED(18);
+                  break;
+
+            case X_GetScreenSaver:
+                  REPLY(reply);
+                  UNUSED(1);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  CARD16(timeout);
+                  CARD16(interval);
+                  ENUM8(prefer_blanking);
+                  ENUM8(allow_exposures);
+                  UNUSED(18);
+                  break;
+
+            case X_ListHosts:
+            case X_SetPointerMapping:
+            case X_GetPointerMapping:
+            case X_SetModifierMapping:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            case X_GetModifierMapping:
+                  REPLY(reply);
+                  state->keycodes_per_modifier =
+                        FIELD8(keycodes_per_modifier);
+                  SEQUENCENUMBER_REPLY(sequencenumber);
+                  REPLYLENGTH(replylength);
+                  UNUSED(24);
+                  LISTofKEYCODE(state->modifiermap, keycodes,
+                                state->keycodes_per_modifier);
+                  break;
+
+            case UNKNOWN_OPCODE:
+                  REPLYCONTENTS_COMMON();
+                  break;
+
+            default:
+                  tryExtensionReply(opcode, tvb, pinfo, offsetp, t, state, little_endian);
+      }
+
+      if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
+            UNDECODED(left);
 }
 
 static void
@@ -5163,7 +5163,7 @@ same_screen_focus(tvbuff_t *tvb, int *offsetp, proto_tree *t)
       bitmask_size = 1;
 
       ti = proto_tree_add_uint(t, hf_x11_same_screen_focus_mask, tvb, *offsetp, 1,
-                                                bitmask_value);
+                               bitmask_value);
       bitmask_tree = proto_item_add_subtree(ti, ett_x11_same_screen_focus);
       FLAG(same_screen_focus, focus);
       FLAG(same_screen_focus, same_screen);
@@ -5173,401 +5173,401 @@ same_screen_focus(tvbuff_t *tvb, int *offsetp, proto_tree *t)
 
 static void
 dissect_x11_event(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                 const char *volatile sep, x11_conv_data_t *volatile state,
-                 gboolean little_endian)
+                  const char *volatile sep, x11_conv_data_t *volatile state,
+                  gboolean little_endian)
 {
-       unsigned char eventcode;
-       const char *sent;
-       proto_item *ti;
-       proto_tree *t;
+      unsigned char eventcode;
+      const char *sent;
+      proto_item *ti;
+      proto_tree *t;
 
-       ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
-       t = proto_item_add_subtree(ti, ett_x11);
+      ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
+      t = proto_item_add_subtree(ti, ett_x11);
 
-       eventcode = tvb_get_guint8(tvb, 0);
-       sent = (eventcode & 0x80) ? "Sent-" : "";
+      eventcode = tvb_get_guint8(tvb, 0);
+      sent = (eventcode & 0x80) ? "Sent-" : "";
 
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s%s",
-                               sep, sent,
-                               val_to_str(eventcode & 0x7F, state->eventcode_vals,
-                               "<Unknown eventcode %u>"));
+      if (check_col(pinfo->cinfo, COL_INFO))
+            col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s%s",
+                            sep, sent,
+                            val_to_str(eventcode & 0x7F, state->eventcode_vals,
+                                       "<Unknown eventcode %u>"));
 
-       proto_item_append_text(ti, ", Event, eventcode: %d (%s%s)",
-                             eventcode, sent,
-                             val_to_str(eventcode & 0x7F, state->eventcode_vals,
-                             "<Unknown eventcode %u>"));
+      proto_item_append_text(ti, ", Event, eventcode: %d (%s%s)",
+                             eventcode, sent,
+                             val_to_str(eventcode & 0x7F, state->eventcode_vals,
+                                        "<Unknown eventcode %u>"));
 
-       if (tree == NULL)
-               return;
+      if (tree == NULL)
+            return;
 
-       decode_x11_event(tvb, eventcode, sent, t, state, little_endian);
+      decode_x11_event(tvb, eventcode, sent, t, state, little_endian);
 
-       return;
+      return;
 }
 
 static void
 decode_x11_event(tvbuff_t *tvb, unsigned char eventcode, const char *sent,
-                proto_tree *t, x11_conv_data_t *volatile state,
-                gboolean little_endian)
+                 proto_tree *t, x11_conv_data_t *volatile state,
+                 gboolean little_endian)
 {
-       int offset = 0, *offsetp = &offset, left;
-
-       proto_tree_add_uint_format(t, hf_x11_eventcode, tvb, offset, 1,
-                                  eventcode,
-                                  "eventcode: %d (%s%s)",
-                                  eventcode, sent,
-                                  val_to_str(eventcode & 0x7F, state->eventcode_vals,
-                                  "<Unknown eventcode %u>"));
-       ++offset;
-
-       switch (eventcode & 0x7F) {
-               case KeyPress:
-               case KeyRelease: {
-                       int code, mask;
-
-                       /* need to do some prefetching here ... */
-                       code = VALUE8(tvb, offset);
-                       mask = VALUE16(tvb, 28);
-
-                       KEYCODE_DECODED(keycode, code, mask);
-                       CARD16(event_sequencenumber);
-                       EVENTCONTENTS_COMMON();
-                       BOOL(same_screen);
-                       UNUSED(1);
-                       break;
-               }
-
-               case ButtonPress:
-               case ButtonRelease:
-                       BUTTON(eventbutton);
-                       CARD16(event_sequencenumber);
-                       EVENTCONTENTS_COMMON();
-                       BOOL(same_screen);
-                       UNUSED(1);
-                       break;
-
-               case MotionNotify:
-                       CARD8(detail);
-                       CARD16(event_sequencenumber);
-                       EVENTCONTENTS_COMMON();
-                       BOOL(same_screen);
-                       UNUSED(1);
-                       break;
-
-               case EnterNotify:
-               case LeaveNotify:
-                       ENUM8(event_detail);
-                       CARD16(event_sequencenumber);
-                       EVENTCONTENTS_COMMON();
-                       ENUM8(grab_mode);
-                       same_screen_focus(tvb, offsetp, t);
-                       break;
-
-               case FocusIn:
-               case FocusOut:
-                       ENUM8(focus_detail);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       ENUM8(focus_mode);
-                       UNUSED(23);
-                       break;
-
-               case KeymapNotify:
-                       break;
-
-               case Expose:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       INT16(x);
-                       INT16(y);
-                       CARD16(width);
-                       CARD16(height);
-                       CARD16(count);
-                       UNUSED(14);
-                       break;
-
-               case GraphicsExpose:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       DRAWABLE(drawable);
-                       CARD16(x);
-                       CARD16(y);
-                       CARD16(width);
-                       CARD16(height);
-                       CARD16(minor_opcode);
-                       CARD16(count);
-                       CARD8(major_opcode);
-                       UNUSED(11);
-                       break;
-
-               case NoExpose:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       DRAWABLE(drawable);
-                       CARD16(minor_opcode);
-                       CARD8(major_opcode);
-                       UNUSED(21);
-                       break;
-
-               case VisibilityNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       ENUM8(visibility_state);
-                       UNUSED(23);
-                       break;
-
-               case CreateNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(parent);
-                       WINDOW(eventwindow);
-                       INT16(x);
-                       INT16(y);
-                       CARD16(width);
-                       CARD16(height);
-                       CARD16(border_width);
-                       BOOL(override_redirect);
-                       UNUSED(9);
-                       break;
-
-               case DestroyNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       WINDOW(window);
-                       UNUSED(20);
-                       break;
-
-               case UnmapNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       WINDOW(window);
-                       BOOL(from_configure);
-                       UNUSED(19);
-                       break;
-
-               case MapNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       WINDOW(window);
-                       BOOL(override_redirect);
-                       UNUSED(19);
-                       break;
-
-               case MapRequest:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(parent);
-                       WINDOW(eventwindow);
-                       UNUSED(20);
-                       break;
-
-               case ReparentNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       WINDOW(window);
-                       WINDOW(parent);
-                       INT16(x);
-                       INT16(y);
-                       BOOL(override_redirect);
-                       UNUSED(11);
-                       break;
-
-               case ConfigureNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       WINDOW(window);
-                       WINDOW(above_sibling);
-                       INT16(x);
-                       INT16(y);
-                       CARD16(width);
-                       CARD16(height);
-                       CARD16(border_width);
-                       BOOL(override_redirect);
-                       UNUSED(5);
-                       break;
-
-               case ConfigureRequest:
-                       break;
-
-               case GravityNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       WINDOW(window);
-                       INT16(x);
-                       INT16(y);
-                       UNUSED(16);
-                       break;
-
-               case ResizeRequest:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       CARD16(width);
-                       CARD16(height);
-                       UNUSED(20);
-                       break;
-
-               case CirculateNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       WINDOW(window);
-                       UNUSED(4);
-                       ENUM8(place);
-                       UNUSED(15);
-                       break;
-
-               case CirculateRequest:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(parent);
-                       WINDOW(eventwindow);
-                       UNUSED(4);
-                       ENUM8(place);
-                       UNUSED(15);
-                       break;
-
-               case PropertyNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       ATOM(atom);
-                       TIMESTAMP(time);
-                       ENUM8(property_state);
-                       UNUSED(15);
-                       break;
-
-               case SelectionClear:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       TIMESTAMP(time);
-                       WINDOW(owner);
-                       ATOM(selection);
-                       UNUSED(16);
-                       break;
-
-               case SelectionRequest:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       TIMESTAMP(time);
-                       WINDOW(owner);
-                       WINDOW(requestor);
-                       ATOM(selection);
-                       ATOM(target);
-                       ATOM(property);
-                       UNUSED(4);
-                       break;
-
-               case SelectionNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       TIMESTAMP(time);
-                       WINDOW(requestor);
-                       ATOM(selection);
-                       ATOM(target);
-                       ATOM(property);
-                       UNUSED(8);
-                       break;
-
-               case ColormapNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       COLORMAP(cmap);
-                       BOOL(new);
-                       ENUM8(colormap_state);
-                       UNUSED(18);
-                       break;
-
-               case ClientMessage:
-                       CARD8(format);
-                       CARD16(event_sequencenumber);
-                       WINDOW(eventwindow);
-                       ATOM(type);
-                       LISTofBYTE(data, 20);
-                       break;
-
-               case MappingNotify:
-                       UNUSED(1);
-                       CARD16(event_sequencenumber);
-                       ENUM8(mapping_request);
-                       CARD8(first_keycode);
-                       CARD8(count);
-                       UNUSED(25);
-                       break;
-
-               default:
-                       tryExtensionEvent(eventcode & 0x7F, tvb, offsetp, t, state, little_endian);
-                       break;
-       }
-
-       if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
-               UNDECODED(left);
-
-       return;
+      int offset = 0, *offsetp = &offset, left;
+
+      proto_tree_add_uint_format(t, hf_x11_eventcode, tvb, offset, 1,
+                                 eventcode,
+                                 "eventcode: %d (%s%s)",
+                                 eventcode, sent,
+                                 val_to_str(eventcode & 0x7F, state->eventcode_vals,
+                                            "<Unknown eventcode %u>"));
+      ++offset;
+
+      switch (eventcode & 0x7F) {
+            case KeyPress:
+            case KeyRelease: {
+                  int code, mask;
+
+                  /* need to do some prefetching here ... */
+                  code = VALUE8(tvb, offset);
+                  mask = VALUE16(tvb, 28);
+
+                  KEYCODE_DECODED(keycode, code, mask);
+                  CARD16(event_sequencenumber);
+                  EVENTCONTENTS_COMMON();
+                  BOOL(same_screen);
+                  UNUSED(1);
+                  break;
+            }
+
+            case ButtonPress:
+            case ButtonRelease:
+                  BUTTON(eventbutton);
+                  CARD16(event_sequencenumber);
+                  EVENTCONTENTS_COMMON();
+                  BOOL(same_screen);
+                  UNUSED(1);
+                  break;
+
+            case MotionNotify:
+                  CARD8(detail);
+                  CARD16(event_sequencenumber);
+                  EVENTCONTENTS_COMMON();
+                  BOOL(same_screen);
+                  UNUSED(1);
+                  break;
+
+            case EnterNotify:
+            case LeaveNotify:
+                  ENUM8(event_detail);
+                  CARD16(event_sequencenumber);
+                  EVENTCONTENTS_COMMON();
+                  ENUM8(grab_mode);
+                  same_screen_focus(tvb, offsetp, t);
+                  break;
+
+            case FocusIn:
+            case FocusOut:
+                  ENUM8(focus_detail);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  ENUM8(focus_mode);
+                  UNUSED(23);
+                  break;
+
+            case KeymapNotify:
+                  break;
+
+            case Expose:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  INT16(x);
+                  INT16(y);
+                  CARD16(width);
+                  CARD16(height);
+                  CARD16(count);
+                  UNUSED(14);
+                  break;
+
+            case GraphicsExpose:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  DRAWABLE(drawable);
+                  CARD16(x);
+                  CARD16(y);
+                  CARD16(width);
+                  CARD16(height);
+                  CARD16(minor_opcode);
+                  CARD16(count);
+                  CARD8(major_opcode);
+                  UNUSED(11);
+                  break;
+
+            case NoExpose:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  DRAWABLE(drawable);
+                  CARD16(minor_opcode);
+                  CARD8(major_opcode);
+                  UNUSED(21);
+                  break;
+
+            case VisibilityNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  ENUM8(visibility_state);
+                  UNUSED(23);
+                  break;
+
+            case CreateNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(parent);
+                  WINDOW(eventwindow);
+                  INT16(x);
+                  INT16(y);
+                  CARD16(width);
+                  CARD16(height);
+                  CARD16(border_width);
+                  BOOL(override_redirect);
+                  UNUSED(9);
+                  break;
+
+            case DestroyNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  WINDOW(window);
+                  UNUSED(20);
+                  break;
+
+            case UnmapNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  WINDOW(window);
+                  BOOL(from_configure);
+                  UNUSED(19);
+                  break;
+
+            case MapNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  WINDOW(window);
+                  BOOL(override_redirect);
+                  UNUSED(19);
+                  break;
+
+            case MapRequest:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(parent);
+                  WINDOW(eventwindow);
+                  UNUSED(20);
+                  break;
+
+            case ReparentNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  WINDOW(window);
+                  WINDOW(parent);
+                  INT16(x);
+                  INT16(y);
+                  BOOL(override_redirect);
+                  UNUSED(11);
+                  break;
+
+            case ConfigureNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  WINDOW(window);
+                  WINDOW(above_sibling);
+                  INT16(x);
+                  INT16(y);
+                  CARD16(width);
+                  CARD16(height);
+                  CARD16(border_width);
+                  BOOL(override_redirect);
+                  UNUSED(5);
+                  break;
+
+            case ConfigureRequest:
+                  break;
+
+            case GravityNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  WINDOW(window);
+                  INT16(x);
+                  INT16(y);
+                  UNUSED(16);
+                  break;
+
+            case ResizeRequest:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  CARD16(width);
+                  CARD16(height);
+                  UNUSED(20);
+                  break;
+
+            case CirculateNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  WINDOW(window);
+                  UNUSED(4);
+                  ENUM8(place);
+                  UNUSED(15);
+                  break;
+
+            case CirculateRequest:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(parent);
+                  WINDOW(eventwindow);
+                  UNUSED(4);
+                  ENUM8(place);
+                  UNUSED(15);
+                  break;
+
+            case PropertyNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  ATOM(atom);
+                  TIMESTAMP(time);
+                  ENUM8(property_state);
+                  UNUSED(15);
+                  break;
+
+            case SelectionClear:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  TIMESTAMP(time);
+                  WINDOW(owner);
+                  ATOM(selection);
+                  UNUSED(16);
+                  break;
+
+            case SelectionRequest:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  TIMESTAMP(time);
+                  WINDOW(owner);
+                  WINDOW(requestor);
+                  ATOM(selection);
+                  ATOM(target);
+                  ATOM(property);
+                  UNUSED(4);
+                  break;
+
+            case SelectionNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  TIMESTAMP(time);
+                  WINDOW(requestor);
+                  ATOM(selection);
+                  ATOM(target);
+                  ATOM(property);
+                  UNUSED(8);
+                  break;
+
+            case ColormapNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  COLORMAP(cmap);
+                  BOOL(new);
+                  ENUM8(colormap_state);
+                  UNUSED(18);
+                  break;
+
+            case ClientMessage:
+                  CARD8(format);
+                  CARD16(event_sequencenumber);
+                  WINDOW(eventwindow);
+                  ATOM(type);
+                  LISTofBYTE(data, 20);
+                  break;
+
+            case MappingNotify:
+                  UNUSED(1);
+                  CARD16(event_sequencenumber);
+                  ENUM8(mapping_request);
+                  CARD8(first_keycode);
+                  CARD8(count);
+                  UNUSED(25);
+                  break;
+
+            default:
+                  tryExtensionEvent(eventcode & 0x7F, tvb, offsetp, t, state, little_endian);
+                  break;
+      }
+
+      if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
+            UNDECODED(left);
+
+      return;
 }
 
 static void
 dissect_x11_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                 const char *volatile sep, x11_conv_data_t *volatile state _U_,
-                 gboolean little_endian)
+                  const char *volatile sep, x11_conv_data_t *volatile state _U_,
+                  gboolean little_endian)
 {
-       int offset = 0, *offsetp = &offset, left;
-       unsigned char errorcode, error;
-       proto_item *ti;
-       proto_tree *t;
+      int offset = 0, *offsetp = &offset, left;
+      unsigned char errorcode, error;
+      proto_item *ti;
+      proto_tree *t;
 
-       ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
-       t = proto_item_add_subtree(ti, ett_x11);
+      ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
+      t = proto_item_add_subtree(ti, ett_x11);
 
-       error = tvb_get_guint8(tvb, offset);
-       CARD8(error);
+      error = tvb_get_guint8(tvb, offset);
+      CARD8(error);
 
-       errorcode = tvb_get_guint8(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
-               sep, val_to_str(errorcode, state->errorcode_vals, "<Unknown errorcode %u>"));
+      errorcode = tvb_get_guint8(tvb, offset);
+      if (check_col(pinfo->cinfo, COL_INFO))
+            col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+                            sep, val_to_str(errorcode, state->errorcode_vals, "<Unknown errorcode %u>"));
 
-       proto_tree_add_uint_format(t, hf_x11_errorcode, tvb, offset, 1,
-                                  errorcode,
-                                  "errorcode: %d (%s)",
-                                  errorcode,
-                                  val_to_str(errorcode, state->errorcode_vals,
-                                  "<Unknown errorcode %u>"));
-       ++offset;
+      proto_tree_add_uint_format(t, hf_x11_errorcode, tvb, offset, 1,
+                                 errorcode,
+                                 "errorcode: %d (%s)",
+                                 errorcode,
+                                 val_to_str(errorcode, state->errorcode_vals,
+                                            "<Unknown errorcode %u>"));
+      ++offset;
 
-        proto_item_append_text(ti, ", Error, errorcode: %d (%s)",
-                              errorcode, val_to_str(errorcode, state->errorcode_vals,
-                              "<Unknown errorcode %u>"));
+      proto_item_append_text(ti, ", Error, errorcode: %d (%s)",
+                             errorcode, val_to_str(errorcode, state->errorcode_vals,
+                                                   "<Unknown errorcode %u>"));
 
-       if (tree == NULL)
-               return;
+      if (tree == NULL)
+            return;
 
-       CARD16(error_sequencenumber);
+      CARD16(error_sequencenumber);
 
-       switch (errorcode) {
-               case BadValue:
-                       CARD32(error_badvalue);
-                       break;
+      switch (errorcode) {
+            case BadValue:
+                  CARD32(error_badvalue);
+                  break;
 
-               default:
-                       UNDECODED(4);
-       }
+            default:
+                  UNDECODED(4);
+      }
 
-       CARD16(minor_opcode);
-       CARD8(major_opcode);
+      CARD16(minor_opcode);
+      CARD8(major_opcode);
 
-       if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
-           UNDECODED(left);
+      if ((left = tvb_reported_length_remaining(tvb, offset)) > 0)
+            UNDECODED(left);
 }
 
 
@@ -5581,12 +5581,12 @@ dissect_x11_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 static void
 dissect_x11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
-       col_set_str(pinfo->cinfo, COL_PROTOCOL, "X11");
+      col_set_str(pinfo->cinfo, COL_PROTOCOL, "X11");
 
-       if (pinfo->match_port == pinfo->srcport)
-               dissect_x11_replies(tvb, pinfo, tree);
-       else
-               dissect_x11_requests(tvb, pinfo, tree);
+      if (pinfo->match_port == pinfo->srcport)
+            dissect_x11_replies(tvb, pinfo, tree);
+      else
+            dissect_x11_requests(tvb, pinfo, tree);
 }
 
 /* Register the protocol with Wireshark */
@@ -5600,38 +5600,38 @@ void proto_register_x11(void)
 
 /* Setup protocol subtree array */
       static gint *ett[] = {
-           &ett_x11,
-           &ett_x11_color_flags,
-           &ett_x11_list_of_arc,
-           &ett_x11_arc,
-           &ett_x11_list_of_atom,
-           &ett_x11_list_of_card32,
-           &ett_x11_list_of_float,
-           &ett_x11_list_of_double,
-           &ett_x11_list_of_color_item,
-           &ett_x11_color_item,
-           &ett_x11_list_of_keycode,
-           &ett_x11_list_of_keysyms,
-           &ett_x11_keysym,
-           &ett_x11_list_of_point,
-           &ett_x11_point,
-           &ett_x11_list_of_rectangle,
-           &ett_x11_rectangle,
-           &ett_x11_list_of_segment,
-           &ett_x11_segment,
-           &ett_x11_list_of_string8,
-           &ett_x11_list_of_text_item,
-           &ett_x11_text_item,
-           &ett_x11_gc_value_mask,
-           &ett_x11_event_mask,
-           &ett_x11_do_not_propagate_mask,
-           &ett_x11_set_of_key_mask,
-           &ett_x11_pointer_event_mask,
-           &ett_x11_window_value_mask,
-           &ett_x11_configure_window_mask,
-           &ett_x11_keyboard_value_mask,
-           &ett_x11_same_screen_focus,
-           &ett_x11_event,
+            &ett_x11,
+            &ett_x11_color_flags,
+            &ett_x11_list_of_arc,
+            &ett_x11_arc,
+            &ett_x11_list_of_atom,
+            &ett_x11_list_of_card32,
+            &ett_x11_list_of_float,
+            &ett_x11_list_of_double,
+            &ett_x11_list_of_color_item,
+            &ett_x11_color_item,
+            &ett_x11_list_of_keycode,
+            &ett_x11_list_of_keysyms,
+            &ett_x11_keysym,
+            &ett_x11_list_of_point,
+            &ett_x11_point,
+            &ett_x11_list_of_rectangle,
+            &ett_x11_rectangle,
+            &ett_x11_list_of_segment,
+            &ett_x11_segment,
+            &ett_x11_list_of_string8,
+            &ett_x11_list_of_text_item,
+            &ett_x11_text_item,
+            &ett_x11_gc_value_mask,
+            &ett_x11_event_mask,
+            &ett_x11_do_not_propagate_mask,
+            &ett_x11_set_of_key_mask,
+            &ett_x11_pointer_event_mask,
+            &ett_x11_window_value_mask,
+            &ett_x11_configure_window_mask,
+            &ett_x11_keyboard_value_mask,
+            &ett_x11_same_screen_focus,
+            &ett_x11_event,
       };
       module_t *x11_module;
 
@@ -5652,20 +5652,20 @@ void proto_register_x11(void)
 
       x11_module = prefs_register_protocol(proto_x11, NULL);
       prefs_register_bool_preference(x11_module, "desegment",
-           "Reassemble X11 messages spanning multiple TCP segments",
-           "Whether the X11 dissector should reassemble messages spanning multiple TCP segments. "
-           "To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
-           &x11_desegment);
+            "Reassemble X11 messages spanning multiple TCP segments",
+            "Whether the X11 dissector should reassemble messages spanning multiple TCP segments. "
+            "To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
+            &x11_desegment);
 }
 
 void
 proto_reg_handoff_x11(void)
 {
-  dissector_handle_t x11_handle;
+      dissector_handle_t x11_handle;
 
-  x11_handle = create_dissector_handle(dissect_x11, proto_x11);
-  dissector_add("tcp.port", TCP_PORT_X11, x11_handle);
-  dissector_add("tcp.port", TCP_PORT_X11_2, x11_handle);
-  dissector_add("tcp.port", TCP_PORT_X11_3, x11_handle);
+      x11_handle = create_dissector_handle(dissect_x11, proto_x11);
+      dissector_add("tcp.port", TCP_PORT_X11, x11_handle);
+      dissector_add("tcp.port", TCP_PORT_X11_2, x11_handle);
+      dissector_add("tcp.port", TCP_PORT_X11_3, x11_handle);
 }
 
index 0c6daab5b14b450aebb87b4f5ace5c177286e287..33c70df919e561b9378ea3d5908f99b873adf71b 100644 (file)
@@ -598,13 +598,13 @@ dissect_zbee_aps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     /*  Get the FCF */
     fcf = tvb_get_guint8(tvb, offset);
-    packet.type         = zbee_get_bit_field(fcf, ZBEE_APS_FCF_FRAME_TYPE);
-    packet.delivery     = zbee_get_bit_field(fcf, ZBEE_APS_FCF_DELIVERY_MODE);
+    packet.type          = zbee_get_bit_field(fcf, ZBEE_APS_FCF_FRAME_TYPE);
+    packet.delivery      = zbee_get_bit_field(fcf, ZBEE_APS_FCF_DELIVERY_MODE);
     packet.indirect_mode = zbee_get_bit_field(fcf, ZBEE_APS_FCF_INDIRECT_MODE);
-    packet.ack_format   = zbee_get_bit_field(fcf, ZBEE_APS_FCF_ACK_FORMAT);
-    packet.security     = zbee_get_bit_field(fcf, ZBEE_APS_FCF_SECURITY);
-    packet.ack_req      = zbee_get_bit_field(fcf, ZBEE_APS_FCF_ACK_REQ);
-    packet.ext_header   = zbee_get_bit_field(fcf, ZBEE_APS_FCF_EXT_HEADER);
+    packet.ack_format    = zbee_get_bit_field(fcf, ZBEE_APS_FCF_ACK_FORMAT);
+    packet.security      = zbee_get_bit_field(fcf, ZBEE_APS_FCF_SECURITY);
+    packet.ack_req       = zbee_get_bit_field(fcf, ZBEE_APS_FCF_ACK_REQ);
+    packet.ext_header    = zbee_get_bit_field(fcf, ZBEE_APS_FCF_EXT_HEADER);
 
     /* Display the frame type to the proto root and info column. */
     if (tree) {
@@ -1169,7 +1169,7 @@ dissect_zbee_aps_transport_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
 {
     guint8              key_type;
     guint8              key[ZBEE_APS_CMD_KEY_LENGTH];
-    GSList            **nwk_keyring; 
+    GSList            **nwk_keyring;
     key_record_t        key_record;
     zbee_nwk_hints_t   *nwk_hints;
     guint               i;
@@ -1191,16 +1191,16 @@ dissect_zbee_aps_transport_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
         proto_tree_add_item(tree, hf_zbee_aps_cmd_key, tvb, offset, ZBEE_APS_CMD_KEY_LENGTH, ENC_BIG_ENDIAN);
     }
     offset += ZBEE_APS_CMD_KEY_LENGTH;
-    
+
     /* Update the key ring for this pan */
     if ( !pinfo->fd->flags.visited && (nwk_hints = (zbee_nwk_hints_t *)p_get_proto_data(pinfo->fd,
                                                 proto_get_id_by_filter_name(ZBEE_PROTOABBREV_NWK)))) {
 
         nwk_keyring = (GSList **)g_hash_table_lookup(zbee_table_nwk_keyring, &nwk_hints->src_pan);
         if ( !nwk_keyring ) {
-            /* Create an empty key ring for this pan. Use g_alloc() because we must free
-             * GSLists after a capture is closed and wireshark freed seasonal memory
-             * with se_free_all()
+            /* Create an empty key ring for this pan. Use g_malloc0() because we must free
+             * GSLists after a capture is closed and wireshark frees seasonal memory
+             * with se_free_all() before calling the registered init routine.
              */
             nwk_keyring = (GSList **)g_malloc0(sizeof(GSList**));
             g_hash_table_insert(zbee_table_nwk_keyring,